Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoQA] Remove DemoSetupPage and related code #33213

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2915,11 +2915,6 @@ const CONST = {
PARENT_CHILD_SEPARATOR: ': ',
CATEGORY_LIST_THRESHOLD: 8,
TAG_LIST_THRESHOLD: 8,
DEMO_PAGES: {
SAASTR: 'SaaStrDemoSetup',
SBE: 'SbeDemoSetup',
MONEY2020: 'Money2020DemoSetup',
},
COLON: ':',
MAPBOX: {
PADDING: 50,
Expand Down
3 changes: 0 additions & 3 deletions src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import AppleAuthWrapper from './components/SignInButtons/AppleAuthWrapper';
import SplashScreenHider from './components/SplashScreenHider';
import UpdateAppModal from './components/UpdateAppModal';
import withLocalize, {withLocalizePropTypes} from './components/withLocalize';
import * as DemoActions from './libs/actions/DemoActions';
import * as EmojiPickerAction from './libs/actions/EmojiPickerAction';
import * as Report from './libs/actions/Report';
import * as User from './libs/actions/User';
Expand Down Expand Up @@ -183,13 +182,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
4 changes: 0 additions & 4 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ const ONYXKEYS = {
// The access token to be used with the Mapbox library
MAPBOX_ACCESS_TOKEN: 'mapboxAccessToken',

// Information on any active demos being run
DEMO_INFO: 'demoInfo',

// Max area supported for HTML <canvas> element
MAX_CANVAS_AREA: 'maxCanvasArea',

Expand Down Expand Up @@ -429,7 +426,6 @@ type OnyxValues = {
[ONYXKEYS.MAPBOX_ACCESS_TOKEN]: OnyxTypes.MapboxAccessToken;
[ONYXKEYS.ONYX_UPDATES_FROM_SERVER]: OnyxTypes.OnyxUpdatesFromServer;
[ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT]: number;
[ONYXKEYS.DEMO_INFO]: OnyxTypes.DemoInfo;
[ONYXKEYS.MAX_CANVAS_AREA]: number;
[ONYXKEYS.MAX_CANVAS_HEIGHT]: number;
[ONYXKEYS.MAX_CANVAS_WIDTH]: number;
Expand Down
5 changes: 0 additions & 5 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,6 @@ const ROUTES = {
route: 'referral/:contentType',
getRoute: (contentType: string) => `referral/${contentType}` as const,
},

// These are some one-off routes that will be removed once they're no longer needed (see GH issues for details)
SAASTR: 'saastr',
SBE: 'sbe',
MONEY2020: 'money2020',
} as const;

export {getUrlWithBackToParam};
Expand Down
28 changes: 1 addition & 27 deletions src/libs/Navigation/AppNavigator/AuthScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as Pusher from '@libs/Pusher/pusher';
import PusherConnectionManager from '@libs/PusherConnectionManager';
import * as SessionUtils from '@libs/SessionUtils';
import type {AuthScreensParamList} from '@navigation/types';
import DemoSetupPage from '@pages/DemoSetupPage';
import NotFoundPage from '@pages/ErrorPage/NotFoundPage';
import DesktopSignInRedirectPage from '@pages/signin/DesktopSignInRedirectPage';
import SearchInputManager from '@pages/workspace/SearchInputManager';
Expand Down Expand Up @@ -50,9 +49,6 @@ type AuthScreensProps = {

/** The last Onyx update ID was applied to the client */
lastUpdateIDAppliedToClient: OnyxEntry<number>;

/** Information about any currently running demos */
demoInfo: OnyxEntry<OnyxTypes.DemoInfo>;
};

const loadReportAttachments = () => require('../../../pages/home/report/ReportAttachments').default as React.ComponentType;
Expand Down Expand Up @@ -130,7 +126,7 @@ const modalScreenListeners = {
},
};

function AuthScreens({lastUpdateIDAppliedToClient, session, lastOpenedPublicRoomID, demoInfo, isUsingMemoryOnlyKeys = false}: AuthScreensProps) {
function AuthScreens({lastUpdateIDAppliedToClient, session, lastOpenedPublicRoomID, isUsingMemoryOnlyKeys = false}: AuthScreensProps) {
const styles = useThemeStyles();
const {isSmallScreenWidth} = useWindowDimensions();
const screenOptions = getRootNavigatorScreenOptions(isSmallScreenWidth, styles);
Expand Down Expand Up @@ -189,10 +185,6 @@ function AuthScreens({lastUpdateIDAppliedToClient, session, lastOpenedPublicRoom

App.redirectThirdPartyDesktopSignIn();

// Check if we should be running any demos immediately after signing in.
if (demoInfo?.money2020?.isBeginningDemo) {
Navigation.navigate(ROUTES.MONEY2020, CONST.NAVIGATION.TYPE.FORCED_UP);
}
if (lastOpenedPublicRoomID) {
// Re-open the last opened public room if the user logged in from a public room link
Report.openLastOpenedPublicRoom(lastOpenedPublicRoomID);
Expand Down Expand Up @@ -283,21 +275,6 @@ function AuthScreens({lastUpdateIDAppliedToClient, session, lastOpenedPublicRoom
options={defaultScreenOptions}
getComponent={loadConciergePage}
/>
<RootStack.Screen
name={CONST.DEMO_PAGES.SAASTR}
options={defaultScreenOptions}
component={DemoSetupPage}
/>
<RootStack.Screen
name={CONST.DEMO_PAGES.SBE}
options={defaultScreenOptions}
component={DemoSetupPage}
/>
<RootStack.Screen
name={CONST.DEMO_PAGES.MONEY2020}
options={defaultScreenOptions}
component={DemoSetupPage}
/>
<RootStack.Screen
name={SCREENS.REPORT_ATTACHMENTS}
options={{
Expand Down Expand Up @@ -345,7 +322,4 @@ export default withOnyx<AuthScreensProps, AuthScreensProps>({
lastUpdateIDAppliedToClient: {
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
},
demoInfo: {
key: ONYXKEYS.DEMO_INFO,
},
})(AuthScreensMemoized);
3 changes: 0 additions & 3 deletions src/libs/Navigation/linkingConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ const linkingConfig: LinkingOptions<RootStackParamList> = {
[SCREENS.DESKTOP_SIGN_IN_REDIRECT]: ROUTES.DESKTOP_SIGN_IN_REDIRECT,
[SCREENS.REPORT_ATTACHMENTS]: ROUTES.REPORT_ATTACHMENTS.route,

// Demo routes
[CONST.DEMO_PAGES.MONEY2020]: ROUTES.MONEY2020,

// Sidebar
[SCREENS.HOME]: {
path: ROUTES.HOME,
Expand Down
7 changes: 0 additions & 7 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,9 @@ type AuthScreensParamList = {
reportID: string;
source: string;
};
[CONST.DEMO_PAGES.SAASTR]: {
name: string;
};
[CONST.DEMO_PAGES.SBE]: {
name: string;
};
[SCREENS.NOT_FOUND]: undefined;
[NAVIGATORS.RIGHT_MODAL_NAVIGATOR]: NavigatorScreenParams<RightModalNavigatorParamList>;
[SCREENS.DESKTOP_SIGN_IN_REDIRECT]: undefined;
[CONST.DEMO_PAGES.MONEY2020]: undefined;
};

type RootStackParamList = PublicScreensParamList & AuthScreensParamList;
Expand Down
70 changes: 0 additions & 70 deletions src/libs/actions/DemoActions.js

This file was deleted.

40 changes: 0 additions & 40 deletions src/pages/DemoSetupPage.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,13 @@ const propTypes = {

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

/** Information about any currently running demos */
demoInfo: PropTypes.shape({
money2020: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
}),
};
const defaultProps = {
onHideCreateMenu: () => {},
onShowCreateMenu: () => {},
allPolicies: {},
isLoading: false,
innerRef: null,
demoInfo: {},
};

/**
Expand Down Expand Up @@ -157,9 +149,7 @@ function FloatingActionButtonAndPopover(props) {
if (currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) {
return;
}
if (lodashGet(props.demoInfo, 'money2020.isBeginningDemo', false)) {
return;
}

Welcome.show({routes, showCreateMenu});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.isLoading]);
Expand Down Expand Up @@ -282,8 +272,5 @@ export default compose(
isLoading: {
key: ONYXKEYS.IS_LOADING_APP,
},
demoInfo: {
key: ONYXKEYS.DEMO_INFO,
},
}),
)(FloatingActionButtonAndPopoverWithRef);
8 changes: 0 additions & 8 deletions src/types/onyx/DemoInfo.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/types/onyx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Card from './Card';
import Credentials from './Credentials';
import Currency from './Currency';
import CustomStatusDraft from './CustomStatusDraft';
import DemoInfo from './DemoInfo';
import Download from './Download';
import Form, {AddDebitCardForm, DateOfBirthForm} from './Form';
import FrequentlyUsedEmoji from './FrequentlyUsedEmoji';
Expand Down Expand Up @@ -69,7 +68,6 @@ export type {
Currency,
CustomStatusDraft,
DateOfBirthForm,
DemoInfo,
Download,
Form,
FrequentlyUsedEmoji,
Expand Down
Loading