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

Fix Workspace Switcher and Get Assistance Button issues #58000

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
15 changes: 1 addition & 14 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3340,20 +3340,7 @@ const CONST = {
PREFIX: '__predefined_',
SELF_SELECT: '__predefined_selfSelect',
},
GUIDES_CALL_TASK_IDS: {
CONCIERGE_DM: 'NewExpensifyConciergeDM',
WORKSPACE_INITIAL: 'WorkspaceHome',
WORKSPACE_OVERVIEW: 'WorkspaceOverview',
WORKSPACE_INVOICES: 'WorkspaceSendInvoices',
WORKSPACE_MEMBERS: 'WorkspaceManageMembers',
WORKSPACE_EXPENSIFY_CARD: 'WorkspaceExpensifyCard',
WORKSPACE_WORKFLOWS: 'WorkspaceWorkflows',
WORKSPACE_COMPANY_CARDS: 'WorkspaceCompanyCards',
WORKSPACE_BANK_ACCOUNT: 'WorkspaceBankAccount',
WORKSPACE_SETTINGS: 'WorkspaceSettings',
WORKSPACE_FEATURES: 'WorkspaceFeatures',
WORKSPACE_RULES: 'WorkspaceRules',
},

EXPENSIFY_EMAILS_OBJECT: Object.entries(EMAIL).reduce((prev, [, email]) => {
// eslint-disable-next-line no-param-reassign
prev[email] = true;
Expand Down
4 changes: 0 additions & 4 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ const ROUTES = {
getRoute: (accountID: number) => `a/${accountID}/avatar` as const,
},

GET_ASSISTANCE: {
route: 'get-assistance/:taskID',
getRoute: (taskID: string, backTo: string) => getUrlWithBackToParam(`get-assistance/${taskID}`, backTo),
},
DESKTOP_SIGN_IN_REDIRECT: 'desktop-signin-redirect',

// This is a special validation URL that will take the user to /workspace/new after validation. This is used
Expand Down
1 change: 0 additions & 1 deletion src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ const SCREENS = {
},
FLAG_COMMENT_ROOT: 'FlagComment_Root',
REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount',
GET_ASSISTANCE: 'GetAssistance',
REFERRAL_DETAILS: 'Referral_Details',
KEYBOARD_SHORTCUTS: 'KeyboardShortcuts',
TRANSACTION_RECEIPT: 'TransactionReceipt',
Expand Down
19 changes: 0 additions & 19 deletions src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function HeaderWithBackButton({
iconWidth,
iconHeight,
iconStyles,
guidesCallTaskID = '',
onBackButtonPress = () => Navigation.goBack(),
onCloseButtonPress = () => Navigation.dismissModal(),
onDownloadButtonPress = () => {},
Expand All @@ -43,8 +42,6 @@ function HeaderWithBackButton({
shouldShowCloseButton = false,
shouldShowDownloadButton = false,
isDownloading = false,
shouldShowGetAssistanceButton = false,
shouldDisableGetAssistanceButton = false,
shouldShowPinButton = false,
shouldSetModalVisibility = true,
shouldShowThreeDotsButton = false,
Expand Down Expand Up @@ -232,22 +229,6 @@ function HeaderWithBackButton({
color={theme.spinner}
/>
))}
{shouldShowGetAssistanceButton && (
<Tooltip text={translate('getAssistancePage.questionMarkButtonTooltip')}>
<PressableWithoutFeedback
disabled={shouldDisableGetAssistanceButton}
onPress={() => Navigation.navigate(ROUTES.GET_ASSISTANCE.getRoute(guidesCallTaskID, Navigation.getActiveRoute()))}
style={[styles.touchableButtonImage]}
role="button"
accessibilityLabel={translate('getAssistancePage.questionMarkButtonTooltip')}
>
<Icon
src={Expensicons.QuestionMark}
fill={iconFill ?? theme.icon}
/>
</PressableWithoutFeedback>
</Tooltip>
)}
{shouldShowPinButton && !!report && <PinButton report={report} />}
{shouldShowThreeDotsButton && (
<ThreeDotsMenu
Expand Down
9 changes: 0 additions & 9 deletions src/components/HeaderWithBackButton/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ type HeaderWithBackButtonProps = Partial<ChildrenProps> & {
/** Whether we should show a loading indicator replacing the download button */
isDownloading?: boolean;

/** Whether we should show a get assistance (question mark) button */
shouldShowGetAssistanceButton?: boolean;

/** Whether we should disable the get assistance button */
shouldDisableGetAssistanceButton?: boolean;

/** Whether we should show a pin button */
shouldShowPinButton?: boolean;

Expand Down Expand Up @@ -104,9 +98,6 @@ type HeaderWithBackButtonProps = Partial<ChildrenProps> & {
/** Whether we should show a back button */
shouldShowBackButton?: boolean;

/** The guides call taskID to associate with the get assistance button, if we show it */
guidesCallTaskID?: string;

/** Data to display a step counter in the header */
stepCounter?: StepCounterParams;

Expand Down
5 changes: 0 additions & 5 deletions src/components/InteractiveStepWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ type InteractiveStepWrapperProps = {
// Should enable picker avoiding
shouldEnablePickerAvoiding?: boolean;

// Call task ID for the guides
guidesCallTaskID?: string;

// Offline indicator style
offlineIndicatorStyle?: StyleProp<ViewStyle>;
};
Expand All @@ -57,7 +54,6 @@ function InteractiveStepWrapper(
shouldEnableMaxHeight,
shouldShowOfflineIndicator,
shouldEnablePickerAvoiding = false,
guidesCallTaskID,
offlineIndicatorStyle,
}: InteractiveStepWrapperProps,
ref: React.ForwardedRef<View>,
Expand All @@ -78,7 +74,6 @@ function InteractiveStepWrapper(
title={headerTitle}
subtitle={headerSubtitle}
onBackButtonPress={handleBackButtonPress}
guidesCallTaskID={guidesCallTaskID}
/>
{!!stepNames && (
<View style={[styles.ph5, styles.mb5, styles.mt3, {height: CONST.BANK_ACCOUNT.STEPS_HEADER_HEIGHT}]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
require<ReactComponentModule>('../../../../pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersDisplayedAsPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ITEMS]: () => require<ReactComponentModule>('../../../../pages/workspace/accounting/qbd/import/QuickbooksDesktopItemsPage').default,
[SCREENS.REIMBURSEMENT_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/ReimbursementAccount/ReimbursementAccountPage').default,
[SCREENS.GET_ASSISTANCE]: () => require<ReactComponentModule>('../../../../pages/GetAssistancePage').default,
[SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/ReportCardLostPage').default,
[SCREENS.KEYBOARD_SHORTCUTS]: () => require<ReactComponentModule>('../../../../pages/KeyboardShortcutsPage').default,
[SCREENS.SETTINGS.EXIT_SURVEY.REASON]: () => require<ReactComponentModule>('../../../../pages/settings/ExitSurvey/ExitSurveyReasonPage').default,
Expand Down
3 changes: 0 additions & 3 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,6 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
path: ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.route,
exact: true,
},
[SCREENS.GET_ASSISTANCE]: {
path: ROUTES.GET_ASSISTANCE.route,
},
[SCREENS.KEYBOARD_SHORTCUTS]: {
path: ROUTES.KEYBOARD_SHORTCUTS,
},
Expand Down
3 changes: 0 additions & 3 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,6 @@ type SettingsNavigatorParamList = {
policyID: string;
connection: ValueOf<typeof CONST.POLICY.CONNECTIONS.ROUTE>;
};
[SCREENS.GET_ASSISTANCE]: {
backTo: Routes;
};
[SCREENS.TWO_FACTOR_AUTH.DISABLED]: undefined;
[SCREENS.TWO_FACTOR_AUTH.DISABLE]: undefined;
[SCREENS.SETTINGS.DELEGATE.ADD_DELEGATE]: undefined;
Expand Down
100 changes: 0 additions & 100 deletions src/pages/GetAssistancePage.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import useThemeStyles from '@hooks/useThemeStyles';
import WorkspaceResetBankAccountModal from '@pages/workspace/WorkspaceResetBankAccountModal';
import {requestResetFreePlanBankAccount, resetReimbursementAccount} from '@userActions/ReimbursementAccount';
import CONST from '@src/CONST';

Check failure on line 17 in src/pages/ReimbursementAccount/ConnectedVerifiedBankAccount.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

'CONST' is defined but never used

Check failure on line 17 in src/pages/ReimbursementAccount/ConnectedVerifiedBankAccount.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'CONST' is defined but never used
import type {ReimbursementAccount} from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';

Expand Down Expand Up @@ -56,7 +56,6 @@
>
<HeaderWithBackButton
title={translate('workspace.common.connectBankAccount')}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Eslint is failing in this file

onBackButtonPress={onBackButtonPress}
/>
<ScrollView style={[styles.flex1]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import useSubStep from '@hooks/useSubStep';
import type {SubStepProps} from '@hooks/useSubStep/types';
import {parsePhoneNumber} from '@libs/PhoneNumber';
import * as ValidationUtils from '@libs/ValidationUtils';

Check failure on line 10 in src/pages/ReimbursementAccount/USD/BusinessInfo/BusinessInfo.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import getInitialSubStepForBusinessInfo from '@pages/ReimbursementAccount/USD/utils/getInitialSubStepForBusinessInfo';
import getSubStepValues from '@pages/ReimbursementAccount/utils/getSubStepValues';
import {updateCompanyInformationForBankAccount} from '@userActions/BankAccounts';
Expand Down Expand Up @@ -56,14 +56,14 @@
[reimbursementAccount, reimbursementAccountDraft],
);

const policyID = reimbursementAccount?.achData?.policyID ?? '-1';

Check failure on line 59 in src/pages/ReimbursementAccount/USD/BusinessInfo/BusinessInfo.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

const values = useMemo(() => getSubStepValues(BUSINESS_INFO_STEP_KEYS, reimbursementAccountDraft, reimbursementAccount), [reimbursementAccount, reimbursementAccountDraft]);

const submit = useCallback(
(isConfirmPage: boolean) => {
const companyWebsite = Str.sanitizeURL(values.website, CONST.COMPANY_WEBSITE_DEFAULT_SCHEME);
updateCompanyInformationForBankAccount(
Number(reimbursementAccount?.achData?.bankAccountID ?? '-1'),

Check failure on line 66 in src/pages/ReimbursementAccount/USD/BusinessInfo/BusinessInfo.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

{
...values,
...getBankAccountFields(['routingNumber', 'accountNumber', 'bankName', 'plaidAccountID', 'plaidAccessToken', 'isSavings']),
Expand Down Expand Up @@ -109,7 +109,6 @@
shouldEnablePickerAvoiding={false}
shouldEnableMaxHeight
headerTitle={translate('businessInfoStep.businessInfo')}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT}
handleBackButtonPress={handleBackButtonPress}
startStepIndex={3}
stepNames={CONST.BANK_ACCOUNT.STEP_NAMES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ function VerifiedBankAccountFlowEntryPoint({
<HeaderWithBackButton
title={translate('workspace.common.connectBankAccount')}
subtitle={policyName}
shouldShowGetAssistanceButton
onBackButtonPress={onBackButtonPress}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT}
/>

<ScrollView style={styles.flex1}>
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) {
Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID, backTo));
}
}}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_MEMBERS}
subtitle={StringUtils.lineBreaksToSpaces(getReportName(report))}
/>
<View style={[styles.pl5, styles.pr5]}>{headerButtons}</View>
Expand Down
1 change: 1 addition & 0 deletions src/pages/WorkspaceSwitcherPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function WorkspaceSwitcherPage() {
<HeaderWithBackButton
title={translate('workspace.switcher.headerTitle')}
onBackButtonPress={Navigation.goBack}
shouldDisplayHelpButton={false}
/>
{shouldShowLoadingIndicator ? (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
Expand Down
2 changes: 0 additions & 2 deletions src/pages/workspace/WorkspaceInviteMessagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ function WorkspaceInviteMessagePage({policy, route, currentUserPersonalDetails}:
<HeaderWithBackButton
title={translate('workspace.inviteMessage.confirmDetails')}
subtitle={policyName}
shouldShowGetAssistanceButton
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_MEMBERS}
shouldShowBackButton
onCloseButtonPress={() => Navigation.dismissModal()}
onBackButtonPress={() => Navigation.goBack(route.params.backTo)}
Expand Down
2 changes: 0 additions & 2 deletions src/pages/workspace/WorkspaceInvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useThemeStyles from '@hooks/useThemeStyles';
import * as ReportActions from '@libs/actions/Report';

Check failure on line 17 in src/pages/workspace/WorkspaceInvitePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import {READ_COMMANDS} from '@libs/API/types';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';

Check failure on line 19 in src/pages/workspace/WorkspaceInvitePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import HttpUtils from '@libs/HttpUtils';
import * as LoginUtils from '@libs/LoginUtils';

Check failure on line 21 in src/pages/workspace/WorkspaceInvitePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import * as OptionsListUtils from '@libs/OptionsListUtils';

Check failure on line 24 in src/pages/workspace/WorkspaceInvitePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import type {MemberForList} from '@libs/OptionsListUtils';
import * as PhoneNumber from '@libs/PhoneNumber';

Check failure on line 26 in src/pages/workspace/WorkspaceInvitePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import * as PolicyUtils from '@libs/PolicyUtils';

Check failure on line 27 in src/pages/workspace/WorkspaceInvitePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import type {OptionData} from '@libs/ReportUtils';
import type {SettingsNavigatorParamList} from '@navigation/types';
import * as Member from '@userActions/Policy/Member';
Expand Down Expand Up @@ -313,8 +313,6 @@
<HeaderWithBackButton
title={translate('workspace.invite.invitePeople')}
subtitle={policyName}
shouldShowGetAssistanceButton
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_MEMBERS}
onBackButtonPress={() => {
Policy.clearErrors(route.params.policyID);
Navigation.goBack();
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
<WorkspacePageWithSections
headerText={selectionModeHeader ? translate('common.selectMultiple') : translate('workspace.common.members')}
route={route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_MEMBERS}
icon={!selectionModeHeader ? ReceiptWrangler : undefined}
headerContent={!shouldUseNarrowLayout && getHeaderButtons()}
testID={WorkspaceMembersPage.displayName}
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspaceOverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ function WorkspaceOverviewPage({policyDraft, policy: policyProp, route}: Workspa
<WorkspacePageWithSections
headerText={translate('workspace.common.profile')}
route={route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_OVERVIEW}
// When we create a new workspaces, the policy prop will not be set on the first render. Therefore, we have to delay rendering until it has been set in Onyx.
shouldShowLoading={policy === undefined}
shouldUseScrollView
Expand Down
5 changes: 0 additions & 5 deletions src/pages/workspace/WorkspacePageWithSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ type WorkspacePageWithSectionsProps = WithPolicyAndFullscreenLoadingProps &
/** Content to be added as fixed footer */
footer?: ReactNode;

/** The guides call task ID to associate with the workspace page being shown */
guidesCallTaskID: string;

/** The route where we navigate when the user press the back button */
backButtonRoute?: Route;

Expand Down Expand Up @@ -101,7 +98,6 @@ function WorkspacePageWithSections({
children = () => null,
footer = null,
icon = undefined,
guidesCallTaskID = '',
headerText,
policy,
policyDraft,
Expand Down Expand Up @@ -183,7 +179,6 @@ function WorkspacePageWithSections({
>
<HeaderWithBackButton
title={headerText}
guidesCallTaskID={guidesCallTaskID}
onBackButtonPress={() => (onBackButtonPress ? onBackButtonPress() : Navigation.goBack(backButtonRoute))}
shouldShowBackButton={shouldUseNarrowLayout || shouldShowBackButton}
icon={icon ?? undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) {
icon={Illustrations.CompanyCard}
headerText={translate('workspace.common.companyCards')}
route={route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_COMPANY_CARDS}
shouldShowOfflineIndicatorInWideScreen
includeSafeAreaPaddingBottom
showLoadingAsFirstRender={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function WorkspaceExpensifyCardPageEmptyState({route, policy}: WorkspaceExpensif
icon={Illustrations.HandCard}
headerText={translate('workspace.common.expensifyCard')}
route={route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_EXPENSIFY_CARD}
showLoadingAsFirstRender={false}
shouldShowOfflineIndicatorInWideScreen
>
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function WorkspaceInvoicesPage({route}: WorkspaceInvoicesPageProps) {
<WorkspacePageWithSections
shouldUseScrollView
headerText={translate('workspace.common.invoices')}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_INVOICES}
shouldShowOfflineIndicatorInWideScreen
shouldSkipVBBACall={false}
route={route}
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/rules/PolicyRulesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function PolicyRulesPage({route}: PolicyRulesPageProps) {
testID={PolicyRulesPage.displayName}
shouldUseScrollView
headerText={translate('workspace.common.rules')}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_RULES}
shouldShowOfflineIndicatorInWideScreen
route={route}
icon={Illustrations.Rules}
Expand Down
Loading
Loading