Merge pull request #8918 from scratchfoundation/fix/display-guides-from-welcome-screen

fix: display guide from learn how to make project button
This commit is contained in:
Miroslav Dionisiev 2024-11-13 14:30:36 +02:00 committed by GitHub
commit 39e133f3da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 3 deletions

View file

@ -1,5 +1,6 @@
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
const React = require('react'); const React = require('react');
const {shouldDisplayOnboarding} = require('../../lib/onboarding.js');
const Box = require('../box/box.jsx'); const Box = require('../box/box.jsx');
@ -19,11 +20,23 @@ const Welcome = props => (
> >
<div className="welcome-col blue"> <div className="welcome-col blue">
<h4> <h4>
<a href="/projects/editor/?tutorial=getStarted"> <a
href={
shouldDisplayOnboarding(props.user, props.permissions) ?
'/projects/editor/' :
'/projects/editor/?tutorial=getStarted'
}
>
{props.messages['welcome.learn']} {props.messages['welcome.learn']}
</a> </a>
</h4> </h4>
<a href="/projects/editor/?tutorial=getStarted"> <a
href={
shouldDisplayOnboarding(props.user, props.permissions) ?
'/projects/editor/' :
'/projects/editor/?tutorial=getStarted'
}
>
<img <img
alt="Get Started" alt="Get Started"
src="/images/welcome-learn.png" src="/images/welcome-learn.png"
@ -66,7 +79,9 @@ Welcome.propTypes = {
'welcome.tryOut': PropTypes.string, 'welcome.tryOut': PropTypes.string,
'welcome.connect': PropTypes.string 'welcome.connect': PropTypes.string
}), }),
onDismiss: PropTypes.func onDismiss: PropTypes.func,
permissions: PropTypes.object,
user: PropTypes.object
}; };
Welcome.defaultProps = { Welcome.defaultProps = {

View file

@ -418,6 +418,8 @@ class SplashPresentation extends React.Component { // eslint-disable-line react/
onDismiss={() => { // eslint-disable-line react/jsx-no-bind onDismiss={() => { // eslint-disable-line react/jsx-no-bind
this.props.onDismiss('welcome'); this.props.onDismiss('welcome');
}} }}
permissions={this.props.permissions}
user={this.props.user}
/> />
] : [ ] : [
<WrappedActivityList <WrappedActivityList
@ -544,6 +546,7 @@ SplashPresentation.propTypes = {
onDismiss: PropTypes.func.isRequired, onDismiss: PropTypes.func.isRequired,
onOpenAdminPanel: PropTypes.func.isRequired, onOpenAdminPanel: PropTypes.func.isRequired,
onRefreshHomepageCache: PropTypes.func.isRequired, onRefreshHomepageCache: PropTypes.func.isRequired,
permissions: PropTypes.object,
refreshCacheStatus: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types refreshCacheStatus: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
sessionStatus: PropTypes.string.isRequired, sessionStatus: PropTypes.string.isRequired,
sharedByFollowing: PropTypes.arrayOf(PropTypes.object), sharedByFollowing: PropTypes.arrayOf(PropTypes.object),

View file

@ -218,6 +218,7 @@ class Splash extends React.Component {
isEducator={this.props.isEducator} isEducator={this.props.isEducator}
lovedByFollowing={this.props.loved} lovedByFollowing={this.props.loved}
news={this.state.news} news={this.state.news}
permissions={this.props.permissions}
refreshCacheStatus={homepageRefreshStatus} refreshCacheStatus={homepageRefreshStatus}
sessionStatus={this.props.sessionStatus} sessionStatus={this.props.sessionStatus}
sharedByFollowing={this.props.shared} sharedByFollowing={this.props.shared}
@ -267,6 +268,7 @@ Splash.propTypes = {
isAdmin: PropTypes.bool, isAdmin: PropTypes.bool,
isEducator: PropTypes.bool, isEducator: PropTypes.bool,
loved: PropTypes.arrayOf(PropTypes.object).isRequired, loved: PropTypes.arrayOf(PropTypes.object).isRequired,
permissions: PropTypes.object,
refreshSession: PropTypes.func.isRequired, refreshSession: PropTypes.func.isRequired,
reviewCommunityGuidelines: PropTypes.func.isRequired, reviewCommunityGuidelines: PropTypes.func.isRequired,
sessionStatus: PropTypes.string, sessionStatus: PropTypes.string,
@ -302,6 +304,7 @@ const mapStateToProps = state => ({
isAdmin: state.permissions.admin, isAdmin: state.permissions.admin,
isEducator: state.permissions.educator, isEducator: state.permissions.educator,
loved: state.splash.loved.rows, loved: state.splash.loved.rows,
permissions: state.permissions,
sessionStatus: state.session.status, sessionStatus: state.session.status,
shared: state.splash.shared.rows, shared: state.splash.shared.rows,
studios: state.splash.studios.rows, studios: state.splash.studios.rows,