Skip to content

Commit

Permalink
Merge pull request #27124 from Expensify/beaman-removeDemoPages
Browse files Browse the repository at this point in the history
Kill SaaStr & SBE demo flows
  • Loading branch information
cristipaval authored Sep 11, 2023
2 parents 144fca5 + 5f6e614 commit fd3a753
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 210 deletions.
2 changes: 0 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,6 @@ const CONST = {
QA: 'qa@expensify.com',
QA_TRAVIS: 'qa+travisreceipts@expensify.com',
RECEIPTS: 'receipts@expensify.com',
SAASTR: 'saastr@expensify.com',
SBE: 'sbe@expensify.com',
STUDENT_AMBASSADOR: 'studentambassadors@expensify.com',
SVFG: 'svfg@expensify.com',
},
Expand Down
3 changes: 0 additions & 3 deletions src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import KeyboardShortcutsModal from './components/KeyboardShortcutsModal';
import AppleAuthWrapper from './components/SignInButtons/AppleAuthWrapper';
import EmojiPicker from './components/EmojiPicker/EmojiPicker';
import * as EmojiPickerAction from './libs/actions/EmojiPickerAction';
import * as DemoActions from './libs/actions/DemoActions';
import DownloadAppModal from './components/DownloadAppModal';
import DeeplinkWrapper from './components/DeeplinkWrapper';

Expand Down Expand Up @@ -168,13 +167,11 @@ function Expensify(props) {

// If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report
Linking.getInitialURL().then((url) => {
DemoActions.runDemoByURL(url);
Report.openReportFromDeepLink(url, isAuthenticated);
});

// Open chat report from a deep link (only mobile native)
Linking.addEventListener('url', (state) => {
DemoActions.runDemoByURL(state.url);
Report.openReportFromDeepLink(state.url, isAuthenticated);
});

Expand Down
10 changes: 0 additions & 10 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1755,14 +1755,4 @@ export default {
selectSuggestedAddress: 'Please select a suggested address',
},
},
demos: {
saastr: {
signInWelcome: 'Welcome to SaaStr! Hop in to start networking now.',
heroBody: 'Use New Expensify for event updates, networking, social chatter, and to get paid back for lunch!',
},
sbe: {
signInWelcome: 'Welcome to Small Business Expo! Get paid back for your ride.',
heroBody: 'Use New Expensify for event updates, networking, social chatter, and to get paid back for your ride to or from the show!',
},
},
} as const;
11 changes: 0 additions & 11 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2247,15 +2247,4 @@ export default {
selectSuggestedAddress: 'Por favor, selecciona una dirección sugerida',
},
},
demos: {
saastr: {
signInWelcome: '¡Bienvenido a SaaStr! Entra y empieza a establecer contactos.',
heroBody: 'Utiliza New Expensify para estar al día de los eventos, establecer contactos, charlar en las redes sociales, ¡y para que te devuelvan el dinero de la comida!',
},
sbe: {
signInWelcome: '¡Bienvenido a Small Business Expo! Recupera el dinero de tu viaje.',
heroBody:
'Utiliza New Expensify para estar al día de los eventos, establecer contactos, charlar en las redes sociales y para que te paguen el viaje de ida y vuelta a la conferencia.',
},
},
};
20 changes: 0 additions & 20 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ const propTypes = {
/** The last Onyx update ID was applied to the client */
lastUpdateIDAppliedToClient: PropTypes.number,

/** Information about any currently running demos */
demoInfo: PropTypes.shape({
saastr: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
sbe: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
}),

...windowDimensionsPropTypes,
};

Expand All @@ -126,7 +116,6 @@ const defaultProps = {
},
lastOpenedPublicRoomID: null,
lastUpdateIDAppliedToClient: null,
demoInfo: {},
};

class AuthScreens extends React.Component {
Expand Down Expand Up @@ -163,12 +152,6 @@ class AuthScreens extends React.Component {
App.setUpPoliciesAndNavigate(this.props.session, !this.props.isSmallScreenWidth);
App.redirectThirdPartyDesktopSignIn();

// Check if we should be running any demos immediately after signing in.
if (lodashGet(this.props.demoInfo, 'saastr.isBeginningDemo', false)) {
Navigation.navigate(ROUTES.SAASTR, CONST.NAVIGATION.TYPE.FORCED_UP);
} else if (lodashGet(this.props.demoInfo, 'sbe.isBeginningDemo', false)) {
Navigation.navigate(ROUTES.SBE, CONST.NAVIGATION.TYPE.FORCED_UP);
}
if (this.props.lastOpenedPublicRoomID) {
// Re-open the last opened public room if the user logged in from a public room link
Report.openLastOpenedPublicRoom(this.props.lastOpenedPublicRoomID);
Expand Down Expand Up @@ -344,8 +327,5 @@ export default compose(
lastUpdateIDAppliedToClient: {
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
},
demoInfo: {
key: ONYXKEYS.DEMO_INFO,
},
}),
)(AuthScreens);
6 changes: 0 additions & 6 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ function getPolicyName(report, returnEmptyIfNotFound = false, policy = undefined
// since they can also be accessed by people who aren't in the workspace
const policyName = lodashGet(finalPolicy, 'name') || report.policyName || report.oldPolicyName || noPolicyFound;

// The SBE and SAASTR policies have the user name in its name, however, we do not want to show that
if (lodashGet(finalPolicy, 'owner') === CONST.EMAIL.SBE || lodashGet(finalPolicy, 'owner') === CONST.EMAIL.SAASTR) {
const policyNameParts = policyName.split(' ');
if (!Str.isValidEmail(policyNameParts[0])) return policyName;
return policyNameParts.length > 1 ? policyNameParts.slice(1).join(' ') : policyName;
}
return policyName;
}

Expand Down
108 changes: 0 additions & 108 deletions src/libs/actions/DemoActions.js

This file was deleted.

21 changes: 6 additions & 15 deletions src/pages/DemoSetupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import {useFocusEffect} from '@react-navigation/native';
import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator';
import CONST from '../CONST';
import * as DemoActions from '../libs/actions/DemoActions';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';

const propTypes = {
/** Navigation route context info provided by react navigation */
Expand All @@ -15,22 +14,14 @@ const propTypes = {
};

/*
* This is a "utility page", that does this:
* - Looks at the current route
* - Determines if there's a demo command we need to call
* - If not, routes back to home
* This is a "utility page", that used to call specific actions depending on the
* route that led the user here. Now, it's just used to route the user home so we
* don't show them a "Hmm... It's not here" message (which looks broken).
*/
function DemoSetupPage(props) {
function DemoSetupPage() {
useFocusEffect(() => {
Navigation.isNavigationReady().then(() => {
// Depending on the route that the user hit to get here, run a specific demo flow
if (props.route.name === CONST.DEMO_PAGES.SAASTR) {
DemoActions.runSaastrDemo();
} else if (props.route.name === CONST.DEMO_PAGES.SBE) {
DemoActions.runSbeDemo();
} else {
Navigation.goBack();
}
Navigation.goBack(ROUTES.HOME);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ const propTypes = {

/** Forwarded ref to FloatingActionButtonAndPopover */
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),

/** Information about any currently running demos */
demoInfo: PropTypes.shape({
saastr: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
sbe: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
}),
};
const defaultProps = {
onHideCreateMenu: () => {},
Expand All @@ -86,7 +76,6 @@ const defaultProps = {
isLoading: false,
innerRef: null,
shouldShowDownloadAppBanner: true,
demoInfo: {},
};

/**
Expand Down Expand Up @@ -173,9 +162,6 @@ function FloatingActionButtonAndPopover(props) {
if (props.shouldShowDownloadAppBanner && Browser.isMobile()) {
return;
}
if (lodashGet(props.demoInfo, 'saastr.isBeginningDemo', false) || lodashGet(props.demoInfo, 'sbe.isBeginningDemo', false)) {
return;
}
Welcome.show({routes, showCreateMenu});
}, [props.shouldShowDownloadAppBanner, props.navigation, showCreateMenu, props.demoInfo]);

Expand Down Expand Up @@ -308,9 +294,6 @@ export default compose(
shouldShowDownloadAppBanner: {
key: ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER,
},
demoInfo: {
key: ONYXKEYS.DEMO_INFO,
},
}),
)(
forwardRef((props, ref) => (
Expand Down
20 changes: 2 additions & 18 deletions src/pages/signin/SignInPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import * as StyleUtils from '../../styles/StyleUtils';
import useLocalize from '../../hooks/useLocalize';
import useWindowDimensions from '../../hooks/useWindowDimensions';
import Log from '../../libs/Log';
import * as DemoActions from '../../libs/actions/DemoActions';

const propTypes = {
/** The details about the account that the user is signing in with */
Expand Down Expand Up @@ -49,23 +48,12 @@ const propTypes = {

/** Whether or not the sign in page is being rendered in the RHP modal */
isInModal: PropTypes.bool,

/** Information about any currently running demos */
demoInfo: PropTypes.shape({
saastr: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
sbe: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
}),
};

const defaultProps = {
account: {},
credentials: {},
isInModal: false,
demoInfo: {},
};

/**
Expand Down Expand Up @@ -93,7 +81,7 @@ function getRenderOptions({hasLogin, hasValidateCode, hasAccount, isPrimaryLogin
};
}

function SignInPage({credentials, account, isInModal, demoInfo}) {
function SignInPage({credentials, account, isInModal}) {
const {translate, formatPhoneNumber} = useLocalize();
const {isSmallScreenWidth} = useWindowDimensions();
const shouldShowSmallScreen = isSmallScreenWidth || isInModal;
Expand All @@ -118,8 +106,7 @@ function SignInPage({credentials, account, isInModal, demoInfo}) {

let welcomeHeader = '';
let welcomeText = '';
const {customHeadline, customHeroBody} = DemoActions.getCustomTextForDemo(demoInfo);
const headerText = customHeadline || translate('login.hero.header');
const headerText = translate('login.hero.header');
if (shouldShowLoginForm) {
welcomeHeader = isSmallScreenWidth ? headerText : translate('welcomeText.getStarted');
welcomeText = isSmallScreenWidth ? translate('welcomeText.getStarted') : '';
Expand Down Expand Up @@ -167,8 +154,6 @@ function SignInPage({credentials, account, isInModal, demoInfo}) {
shouldShowWelcomeText={shouldShowWelcomeText}
ref={signInPageLayoutRef}
isInModal={isInModal}
customHeadline={customHeadline}
customHeroBody={customHeroBody}
>
{/* LoginForm must use the isVisible prop. This keeps it mounted, but visually hidden
so that password managers can access the values. Conditionally rendering this component will break this feature. */}
Expand All @@ -192,5 +177,4 @@ SignInPage.displayName = 'SignInPage';
export default withOnyx({
account: {key: ONYXKEYS.ACCOUNT},
credentials: {key: ONYXKEYS.CREDENTIALS},
demoInfo: {key: ONYXKEYS.DEMO_INFO},
})(SignInPage);

0 comments on commit fd3a753

Please sign in to comment.