Skip to content

Commit

Permalink
Add similar SBE demo workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Beamanator committed Aug 21, 2023
1 parent 453ff52 commit 1f97101
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ EXPENSIFY_ACCOUNT_ID_QA_TRAVIS=-1
EXPENSIFY_ACCOUNT_ID_RECEIPTS=-1
EXPENSIFY_ACCOUNT_ID_REWARDS=-1
EXPENSIFY_ACCOUNT_ID_SAASTR=-1
EXPENSIFY_ACCOUNT_ID_SBE=-1
EXPENSIFY_ACCOUNT_ID_STUDENT_AMBASSADOR=-1
EXPENSIFY_ACCOUNT_ID_SVFG=-1
7 changes: 7 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ const CONST = {
QA_TRAVIS: '[email protected]',
RECEIPTS: '[email protected]',
SAASTR: '[email protected]',
SBE: '[email protected]',
STUDENT_AMBASSADOR: '[email protected]',
SVFG: '[email protected]',
},
Expand All @@ -880,6 +881,7 @@ const CONST = {
RECEIPTS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_RECEIPTS', -1)),
REWARDS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_REWARDS', 11023767)), // rewards@expensify.com
SAASTR: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_SAASTR', 15252830)),
SBE: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_SBE', -1)), // TODO: replace with prod account ID
STUDENT_AMBASSADOR: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_STUDENT_AMBASSADOR', 10476956)),
SVFG: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_SVFG', 2012843)),
},
Expand Down Expand Up @@ -1211,6 +1213,8 @@ const CONST = {
this.EMAIL.QA,
this.EMAIL.QA_TRAVIS,
this.EMAIL.RECEIPTS,
this.EMAIL.SAASTR,
this.EMAIL.SBE,
this.EMAIL.STUDENT_AMBASSADOR,
this.EMAIL.SVFG,
];
Expand All @@ -1231,6 +1235,8 @@ const CONST = {
this.ACCOUNT_ID.QA_TRAVIS,
this.ACCOUNT_ID.RECEIPTS,
this.ACCOUNT_ID.REWARDS,
this.ACCOUNT_ID.SAASTR,
this.ACCOUNT_ID.SBE,
this.ACCOUNT_ID.STUDENT_AMBASSADOR,
this.ACCOUNT_ID.SVFG,
];
Expand Down Expand Up @@ -2568,6 +2574,7 @@ const CONST = {
},
DEMO_PAGES: {
SAASTR: 'SaaStrDemoSetup',
SBE: 'SbeDemoSetup',
},
};

Expand Down
1 change: 1 addition & 0 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export default {

// These are some on-off routes that will be removed once they're no longer needed (see GH issues for details)
SAASTR: 'saastr',
SBE: 'sbe',

/**
* @param {String} route
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1626,5 +1626,8 @@ export default {
saastr: {
signInWelcome: 'Welcome to SaaStr! Hop in to start networking now.',
},
sbe: {
signInWelcome: 'Welcome to Small Business Expo! Get paid back for your ride.',
},
},
};
3 changes: 3 additions & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -2113,5 +2113,8 @@ export default {
saastr: {
signInWelcome: '¡Bienvenido a SaaStr! Entra y empieza a establecer contactos.',
},
sbe: {
signInWelcome: '¡Bienvenido a Small Business Expo! Recupera el dinero de tu viaje.',
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ function CentralPaneNavigator() {
}}
component={DemoSetupPage}
/>
<Stack.Screen
name={CONST.DEMO_PAGES.SBE}
options={{
headerShown: false,
title: 'New Expensify',
}}
component={DemoSetupPage}
/>
</Stack.Navigator>
</FreezeWrapper>
);
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
screens: {
[SCREENS.REPORT]: ROUTES.REPORT_WITH_ID,
[CONST.DEMO_PAGES.SAASTR]: ROUTES.SAASTR,
[CONST.DEMO_PAGES.SBE]: ROUTES.SBE,
},
},
[NAVIGATORS.FULL_SCREEN_NAVIGATOR]: {
Expand Down
11 changes: 11 additions & 0 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,23 @@ function beginDeepLinkRedirectAfterTransition(shouldAuthenticateWithCurrentAccou
* @param {String} url - URL user is navigating to via deep link (or regular link in web)
*/
function runDemoByURL(url = '') {
if (!url) {
url = '';
}
url = url.toLowerCase();

if (url.endsWith(ROUTES.SAASTR)) {
Onyx.merge(ONYXKEYS.DEMO_INFO, {
saastr: {
isBeginningDemo: true,
},
});
} else if (url.endsWith(ROUTES.SBE)) {
Onyx.merge(ONYXKEYS.DEMO_INFO, {
sbe: {
isBeginningDemo: true,
},
});
} else {
// No demo is being run, so clear out demo info
Onyx.set(ONYXKEYS.DEMO_INFO, null);
Expand Down
9 changes: 8 additions & 1 deletion src/libs/actions/DemoActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Onyx.connect({
},
});

function createSbeDemoWorkspaceAndNavigate() {
// TODO: reuse lots of code
}

function createSaastrDemoWorkspaceAndNavigate() {
// Try to navigate to existing SaaStr expense chat if it exists in Onyx
const saastrWorkspaceChatReportID = ReportUtils.getPolicyExpenseChatReportIDByOwner(CONST.EMAIL.SAASTR);
Expand Down Expand Up @@ -243,4 +247,7 @@ function createSaastrDemoWorkspaceAndNavigate() {
Navigation.navigate(ROUTES.getReportRoute(expenseChatReportID));
}

export {createSaastrDemoWorkspaceAndNavigate};
export {
createSaastrDemoWorkspaceAndNavigate,
createSbeDemoWorkspaceAndNavigate,
};
2 changes: 2 additions & 0 deletions src/pages/DemoSetupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function DemoSetupPage(props) {
// 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.createSaastrDemoWorkspaceAndNavigate();
} else if (props.route.name === CONST.DEMO_PAGES.SBE) {
DemoActions.createSbeDemoWorkspaceAndNavigate();
}
});

Expand Down

0 comments on commit 1f97101

Please sign in to comment.