From 17a8e27fed43ce88eeb15d457f745fedd9816619 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 10 Dec 2024 05:22:13 +0530 Subject: [PATCH 1/5] update: Add 'Workspace' to Profile and Name at the workspace level for clarity. Signed-off-by: krishna2323 --- src/components/Icon/Illustrations.ts | 2 ++ src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- src/pages/workspace/WorkspaceNamePage.tsx | 6 +++--- src/pages/workspace/WorkspaceProfilePage.tsx | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index 4379142619ff..ea1c6946bab2 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -74,6 +74,7 @@ import BankArrow from '@assets/images/simple-illustrations/simple-illustration__ import BigRocket from '@assets/images/simple-illustrations/simple-illustration__bigrocket.svg'; import PinkBill from '@assets/images/simple-illustrations/simple-illustration__bill.svg'; import Binoculars from '@assets/images/simple-illustrations/simple-illustration__binoculars.svg'; +import Building from '@assets/images/simple-illustrations/simple-illustration__building.svg'; import CarIce from '@assets/images/simple-illustrations/simple-illustration__car-ice.svg'; import Car from '@assets/images/simple-illustrations/simple-illustration__car.svg'; import ChatBubbles from '@assets/images/simple-illustrations/simple-illustration__chatbubbles.svg'; @@ -228,6 +229,7 @@ export { PendingBank, ThreeLeggedLaptopWoman, House, + Building, Alert, TeachersUnite, Abacus, diff --git a/src/languages/en.ts b/src/languages/en.ts index 5c2cb34dc251..1e454f33fff7 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2477,7 +2477,7 @@ const translations = { rules: 'Rules', displayedAs: 'Displayed as', plan: 'Plan', - profile: 'Profile', + profile: 'Workspace profile', perDiem: 'Per diem', bankAccount: 'Bank account', connectBankAccount: 'Connect bank account', diff --git a/src/languages/es.ts b/src/languages/es.ts index 2370fd0a1a9d..a4f4dc0e4192 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2499,7 +2499,7 @@ const translations = { accounting: 'Contabilidad', rules: 'Reglas', plan: 'Plan', - profile: 'Perfil', + profile: 'Perfil del espacio de trabajo', perDiem: 'Per diem', bankAccount: 'Cuenta bancaria', displayedAs: 'Mostrado como', diff --git a/src/pages/workspace/WorkspaceNamePage.tsx b/src/pages/workspace/WorkspaceNamePage.tsx index d9632a1a2ae8..ab60c409e8de 100644 --- a/src/pages/workspace/WorkspaceNamePage.tsx +++ b/src/pages/workspace/WorkspaceNamePage.tsx @@ -67,7 +67,7 @@ function WorkspaceNamePage({policy}: Props) { testID={WorkspaceNamePage.displayName} > Navigation.goBack()} /> @@ -85,8 +85,8 @@ function WorkspaceNamePage({policy}: Props) { InputComponent={TextInput} role={CONST.ROLE.PRESENTATION} inputID={INPUT_IDS.NAME} - label={translate('workspace.editor.nameInputLabel')} - accessibilityLabel={translate('workspace.editor.nameInputLabel')} + label={translate('workspace.common.workspaceName')} + accessibilityLabel={translate('workspace.common.workspaceName')} defaultValue={policy?.name} spellCheck={false} autoFocus diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index 4a4862152d53..2a8c9f96bd8d 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -154,7 +154,7 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac shouldUseScrollView shouldShowOfflineIndicatorInWideScreen shouldShowNonAdmin - icon={Illustrations.House} + icon={Illustrations.Building} shouldShowNotFoundPage={policy === undefined} > {(hasVBA?: boolean) => ( @@ -203,7 +203,7 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac Date: Tue, 10 Dec 2024 05:22:39 +0530 Subject: [PATCH 2/5] add svg. Signed-off-by: krishna2323 --- .../simple-illustration__building.svg | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 assets/images/simple-illustrations/simple-illustration__building.svg diff --git a/assets/images/simple-illustrations/simple-illustration__building.svg b/assets/images/simple-illustrations/simple-illustration__building.svg new file mode 100644 index 000000000000..94a7320d8471 --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__building.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file From 175f1c9579abca806dc1a143eb80a4aa7d7a9b3d Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 10 Dec 2024 06:20:45 +0530 Subject: [PATCH 3/5] update LHN icon. Signed-off-by: krishna2323 --- src/pages/workspace/WorkspaceInitialPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index d279cba2ec65..11aa738cfbec 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -325,7 +325,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac const menuItems: WorkspaceMenuItem[] = [ { translationKey: 'workspace.common.profile', - icon: Expensicons.Home, + icon: Expensicons.Building, action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE.getRoute(policyID)))), brickRoadIndicator: hasGeneralSettingsError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, routeName: SCREENS.WORKSPACE.PROFILE, From 52d31d8f5ff51a52e883b7d72b0e8f1b6d1d1349 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Wed, 11 Dec 2024 08:44:48 +0530 Subject: [PATCH 4/5] update building icon to buildings icon on workspace list page. Signed-off-by: krishna2323 --- assets/images/buildings.svg | 12 ++++ .../simple-illustration__buildings.svg | 55 +++++++++++++++++++ src/components/Icon/Expensicons.ts | 2 + src/components/Icon/Illustrations.ts | 2 + src/pages/settings/InitialSettingsPage.tsx | 2 +- src/pages/workspace/WorkspacesListPage.tsx | 4 +- 6 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 assets/images/buildings.svg create mode 100644 assets/images/simple-illustrations/simple-illustration__buildings.svg diff --git a/assets/images/buildings.svg b/assets/images/buildings.svg new file mode 100644 index 000000000000..42171d499f26 --- /dev/null +++ b/assets/images/buildings.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/assets/images/simple-illustrations/simple-illustration__buildings.svg b/assets/images/simple-illustrations/simple-illustration__buildings.svg new file mode 100644 index 000000000000..cb22c3a29ce4 --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__buildings.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/Icon/Expensicons.ts b/src/components/Icon/Expensicons.ts index 51db1bc12c8e..cf0d07c2c5d9 100644 --- a/src/components/Icon/Expensicons.ts +++ b/src/components/Icon/Expensicons.ts @@ -32,6 +32,7 @@ import Box from '@assets/images/box.svg'; import Briefcase from '@assets/images/briefcase.svg'; import Bug from '@assets/images/bug.svg'; import Building from '@assets/images/building.svg'; +import Buildings from '@assets/images/buildings.svg'; import CalendarSolid from '@assets/images/calendar-solid.svg'; import Calendar from '@assets/images/calendar.svg'; import Camera from '@assets/images/camera.svg'; @@ -234,6 +235,7 @@ export { Briefcase, Bug, Building, + Buildings, Calendar, Camera, Car, diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index ea1c6946bab2..0debd4585e7b 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -75,6 +75,7 @@ import BigRocket from '@assets/images/simple-illustrations/simple-illustration__ import PinkBill from '@assets/images/simple-illustrations/simple-illustration__bill.svg'; import Binoculars from '@assets/images/simple-illustrations/simple-illustration__binoculars.svg'; import Building from '@assets/images/simple-illustrations/simple-illustration__building.svg'; +import Buildings from '@assets/images/simple-illustrations/simple-illustration__buildings.svg'; import CarIce from '@assets/images/simple-illustrations/simple-illustration__car-ice.svg'; import Car from '@assets/images/simple-illustrations/simple-illustration__car.svg'; import ChatBubbles from '@assets/images/simple-illustrations/simple-illustration__chatbubbles.svg'; @@ -230,6 +231,7 @@ export { ThreeLeggedLaptopWoman, House, Building, + Buildings, Alert, TeachersUnite, Abacus, diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index a40b14eae4c9..bc1d5b37c94e 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -181,7 +181,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr const items: MenuData[] = [ { translationKey: 'common.workspaces', - icon: Expensicons.Building, + icon: Expensicons.Buildings, routeName: ROUTES.SETTINGS_WORKSPACES, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, allConnectionSyncProgresses) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx index 7980616c08e3..3eece7ab7d3d 100755 --- a/src/pages/workspace/WorkspacesListPage.tsx +++ b/src/pages/workspace/WorkspacesListPage.tsx @@ -416,7 +416,7 @@ function WorkspacesListPage() { shouldShowBackButton={shouldUseNarrowLayout} shouldDisplaySearchRouter onBackButtonPress={() => Navigation.goBack()} - icon={Illustrations.BigRocket} + icon={Illustrations.Buildings} /> @@ -450,7 +450,7 @@ function WorkspacesListPage() { shouldShowBackButton={shouldUseNarrowLayout} shouldDisplaySearchRouter onBackButtonPress={() => Navigation.goBack()} - icon={Illustrations.BigRocket} + icon={Illustrations.Buildings} > {!shouldUseNarrowLayout && getHeaderButton()} From 659f15904dfe1d8d02c45370c02ff58a21c20a91 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sat, 21 Dec 2024 11:06:53 +0530 Subject: [PATCH 5/5] fix eslint. Signed-off-by: krishna2323 --- src/libs/PolicyUtils.ts | 2 +- src/libs/actions/Policy/Policy.ts | 5 ++++- src/pages/workspace/AccessOrNotFoundWrapper.tsx | 2 +- src/pages/workspace/WorkspaceNamePage.tsx | 2 +- src/pages/workspace/WorkspacesListPage.tsx | 6 +++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index 4982e8660dec..55928afd6941 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -1093,7 +1093,7 @@ function getCurrentTaxID(policy: OnyxEntry, taxID: string): string | und return Object.keys(policy?.taxRates?.taxes ?? {}).find((taxIDKey) => policy?.taxRates?.taxes?.[taxIDKey].previousTaxCode === taxID || taxIDKey === taxID); } -function getWorkspaceAccountID(policyID: string) { +function getWorkspaceAccountID(policyID?: string) { const policy = getPolicy(policyID); if (!policy) { diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index f855ea477856..eaf04135ad36 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -725,7 +725,10 @@ function clearWorkspaceReimbursementErrors(policyID: string) { Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {errorFields: {reimbursementChoice: null}}); } -function leaveWorkspace(policyID: string) { +function leaveWorkspace(policyID?: string) { + if (!policyID) { + return; + } const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]; const workspaceChats = ReportUtils.getAllWorkspaceReports(policyID); diff --git a/src/pages/workspace/AccessOrNotFoundWrapper.tsx b/src/pages/workspace/AccessOrNotFoundWrapper.tsx index 9bda7f3972f9..b9da0147b525 100644 --- a/src/pages/workspace/AccessOrNotFoundWrapper.tsx +++ b/src/pages/workspace/AccessOrNotFoundWrapper.tsx @@ -123,7 +123,7 @@ function AccessOrNotFoundWrapper({ ...props }: AccessOrNotFoundWrapperProps) { const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); - const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); + const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID ?? CONST.DEFAULT_NUMBER_ID}`); const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA, {initialValue: true}); const {login = ''} = useCurrentUserPersonalDetails(); const isPolicyIDInRoute = !!policyID?.length; diff --git a/src/pages/workspace/WorkspaceNamePage.tsx b/src/pages/workspace/WorkspaceNamePage.tsx index ab60c409e8de..42c97d5d85e6 100644 --- a/src/pages/workspace/WorkspaceNamePage.tsx +++ b/src/pages/workspace/WorkspaceNamePage.tsx @@ -58,7 +58,7 @@ function WorkspaceNamePage({policy}: Props) { return ( Policy.leaveWorkspace(item.policyID ?? '-1')), + onSelected: Session.checkIfActionIsAllowed(() => Policy.leaveWorkspace(item.policyID)), }); }