From cb499a1f889db6321c468d64eb1c6c0c96ff92e7 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Wed, 20 Nov 2024 10:58:51 +0700 Subject: [PATCH 01/11] Add Chat with setup specialist to the accounting page. --- src/libs/actions/Report.ts | 4 +++ .../accounting/PolicyAccountingPage.tsx | 34 ++++++++++++++++++- src/types/onyx/Account.ts | 9 +++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 81f7116b3da7..78d7e1bad376 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -4347,6 +4347,9 @@ function exportReportToCSV({reportID, transactionIDList}: ExportReportCSVParams, fileDownload(ApiUtils.getCommandURL({command: WRITE_COMMANDS.EXPORT_REPORT_TO_CSV}), 'Expensify.csv', '', false, formData, CONST.NETWORK.METHOD.POST, onDownloadFailed); } +function getConciergeReportID() { + return conciergeChatReportID; +} export type {Video}; @@ -4437,4 +4440,5 @@ export { updateReportName, updateRoomVisibility, updateWriteCapability, + getConciergeReportID, }; diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 878a2dcd6b22..55a91e25eeec 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -7,6 +7,7 @@ import CollapsibleSection from '@components/CollapsibleSection'; import ConfirmModal from '@components/ConfirmModal'; import FormHelpMessage from '@components/FormHelpMessage'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import MenuItem from '@components/MenuItem'; @@ -28,6 +29,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import {isAuthenticationError, isConnectionInProgress, isConnectionUnverified, removePolicyConnection, syncConnection} from '@libs/actions/connections'; +import {getConciergeReportID} from '@libs/actions/Report'; import * as PolicyUtils from '@libs/PolicyUtils'; import { areSettingsInErrorFields, @@ -74,7 +76,9 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { const [datetimeToRelative, setDateTimeToRelative] = useState(''); const threeDotsMenuContainerRef = useRef(null); const {startIntegrationFlow, popoverAnchorRefs} = useAccountingContext(); - + const [account] = useOnyx(ONYXKEYS.ACCOUNT); + // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth + const {isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout(); const route = useRoute(); const params = route.params as RouteParams | undefined; const newConnectionName = params?.newConnectionName; @@ -456,6 +460,21 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { popoverAnchorRefs, ]); + const [chatTextLink, chatReportID] = useMemo(() => { + // If they have an onboarding specialist assigned display the following and link to the #admins room with the setup specialist. + if (account?.adminsRoomReportID) { + return ['Talk to your onboarding specialist', account?.adminsRoomReportID]; + } + + // If not, if they have an account manager assigned display the following and link to the DM with their account manager. + if (account?.accountManagerAccountID) { + return ['Talk to your account manager', account?.accountManagerReportID]; + } + + // Else, display the following and link to their Concierge DM. + return ['Talk to concierge', getConciergeReportID()]; + }, [account]); + return ( )} + + + + Need another accounting package? + {chatTextLink} + + diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 3902d67882c4..f605862a154b 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -92,6 +92,15 @@ type Account = { /** The primaryLogin associated with the account */ primaryLogin?: string; + /** The primaryLogin associated with the account */ + adminsRoomReportID?: string; + + /** The primaryLogin associated with the account */ + accountManagerAccountID?: string; + + /** The primaryLogin associated with the account */ + accountManagerReportID?: string; + /** The message to be displayed when code requested */ message?: string; From e61abc0bffb8cce31e3b4aa1a325874c9a5d3d62 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Wed, 20 Nov 2024 16:30:53 +0700 Subject: [PATCH 02/11] fix: add translation key and style --- src/languages/en.ts | 4 ++++ src/languages/es.ts | 4 ++++ .../workspace/accounting/PolicyAccountingPage.tsx | 13 ++++++------- src/types/onyx/Account.ts | 6 +++--- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 591f7eb0ed42..3f8e2b166975 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3769,6 +3769,10 @@ const translations = { xero: 'Xero', netsuite: 'NetSuite', intacct: 'Sage Intacct', + talkYourOnboardingSpecialist: 'Talk to your onboarding specialist', + talkYourAccountManager: 'Talk to your account manager', + talkToConcierge: 'Talk to concierge', + needAnotherAccounting: 'Need another accounting package? ', connectionName: ({connectionName}: ConnectionNameParams) => { switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: diff --git a/src/languages/es.ts b/src/languages/es.ts index 91557c9defbf..5473dfd4b39e 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3777,6 +3777,10 @@ const translations = { xero: 'Xero', netsuite: 'NetSuite', intacct: 'Sage Intacct', + talkYourOnboardingSpecialist: 'Talk to your onboarding specialist', + talkYourAccountManager: 'Talk to your account manager', + talkToConcierge: 'Talk to concierge', + needAnotherAccounting: 'Need another accounting package? ', connectionName: ({connectionName}: ConnectionNameParams) => { switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 55a91e25eeec..489d39cb9f07 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -463,17 +463,16 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { const [chatTextLink, chatReportID] = useMemo(() => { // If they have an onboarding specialist assigned display the following and link to the #admins room with the setup specialist. if (account?.adminsRoomReportID) { - return ['Talk to your onboarding specialist', account?.adminsRoomReportID]; + return [translate('workspace.accounting.talkYourOnboardingSpecialist'), account?.adminsRoomReportID]; } // If not, if they have an account manager assigned display the following and link to the DM with their account manager. if (account?.accountManagerAccountID) { - return ['Talk to your account manager', account?.accountManagerReportID]; + return [translate('workspace.accounting.talkYourAccountManager'), account?.accountManagerReportID]; } - // Else, display the following and link to their Concierge DM. - return ['Talk to concierge', getConciergeReportID()]; - }, [account]); + return [translate('workspace.accounting.talkToConcierge'), getConciergeReportID()]; + }, [account, translate]); return ( - Need another accounting package? - {chatTextLink} + {translate('workspace.accounting.needAnotherAccounting')} + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID ?? ''))}>{chatTextLink} diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index f605862a154b..55ae713468b5 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -92,13 +92,13 @@ type Account = { /** The primaryLogin associated with the account */ primaryLogin?: string; - /** The primaryLogin associated with the account */ + /** The Report ID of the admins room */ adminsRoomReportID?: string; - /** The primaryLogin associated with the account */ + /** The Account ID of the account manager */ accountManagerAccountID?: string; - /** The primaryLogin associated with the account */ + /** The Report ID of the account manager */ accountManagerReportID?: string; /** The message to be displayed when code requested */ From c29f6ebd37294462dfb86972c7931bafec2a35e3 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 22 Nov 2024 15:08:50 +0700 Subject: [PATCH 03/11] fix: update accounting translate --- src/languages/en.ts | 8 ++++---- src/languages/es.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 3f8e2b166975..e1853b3cb0b7 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3769,10 +3769,10 @@ const translations = { xero: 'Xero', netsuite: 'NetSuite', intacct: 'Sage Intacct', - talkYourOnboardingSpecialist: 'Talk to your onboarding specialist', - talkYourAccountManager: 'Talk to your account manager', - talkToConcierge: 'Talk to concierge', - needAnotherAccounting: 'Need another accounting package? ', + talkYourOnboardingSpecialist: 'Chat with your setup specialist.', + talkYourAccountManager: 'Chat with your account manager.', + talkToConcierge: 'Chat with Concierge.', + needAnotherAccounting: 'Need another software? ', connectionName: ({connectionName}: ConnectionNameParams) => { switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: diff --git a/src/languages/es.ts b/src/languages/es.ts index 5473dfd4b39e..26448dd4186c 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3777,10 +3777,10 @@ const translations = { xero: 'Xero', netsuite: 'NetSuite', intacct: 'Sage Intacct', - talkYourOnboardingSpecialist: 'Talk to your onboarding specialist', - talkYourAccountManager: 'Talk to your account manager', - talkToConcierge: 'Talk to concierge', - needAnotherAccounting: 'Need another accounting package? ', + talkYourOnboardingSpecialist: 'Chatea con tu especialista asignado.', + talkYourAccountManager: 'Chatea con tu gestor de cuenta.', + talkToConcierge: 'Chatear con Concierge.', + needAnotherAccounting: '¿Necesitas otro software? ', connectionName: ({connectionName}: ConnectionNameParams) => { switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: From 2efa89fd87414be2398753f4403423cfa89b9f9c Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 25 Nov 2024 12:35:29 +0700 Subject: [PATCH 04/11] change translation --- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 850bae590677..665240987609 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3793,7 +3793,7 @@ const translations = { talkYourOnboardingSpecialist: 'Chat with your setup specialist.', talkYourAccountManager: 'Chat with your account manager.', talkToConcierge: 'Chat with Concierge.', - needAnotherAccounting: 'Need another software? ', + needAnotherAccounting: 'Need another accounting software? ', connectionName: ({connectionName}: ConnectionNameParams) => { switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: diff --git a/src/languages/es.ts b/src/languages/es.ts index ae558acb20e5..f2b08abdb5aa 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3800,7 +3800,7 @@ const translations = { talkYourOnboardingSpecialist: 'Chatea con tu especialista asignado.', talkYourAccountManager: 'Chatea con tu gestor de cuenta.', talkToConcierge: 'Chatear con Concierge.', - needAnotherAccounting: '¿Necesitas otro software? ', + needAnotherAccounting: '¿Necesitas otro software de contabilidad? ', connectionName: ({connectionName}: ConnectionNameParams) => { switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 489d39cb9f07..ccffcd8d4ab7 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -77,8 +77,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { const threeDotsMenuContainerRef = useRef(null); const {startIntegrationFlow, popoverAnchorRefs} = useAccountingContext(); const [account] = useOnyx(ONYXKEYS.ACCOUNT); - // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth - const {isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout(); + const {isLargeScreenWidth} = useResponsiveLayout(); const route = useRoute(); const params = route.params as RouteParams | undefined; const newConnectionName = params?.newConnectionName; @@ -569,7 +568,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { fill={theme.icon} additionalStyles={styles.mr3} /> - + {translate('workspace.accounting.needAnotherAccounting')} Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID ?? ''))}>{chatTextLink} From d3aa2f21cfb1cb326fbd781a87ee30fd418de52b Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 29 Nov 2024 15:20:21 +0700 Subject: [PATCH 05/11] fix: accounting page style --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 8fc350922ec4..926dbaab56f3 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -560,7 +560,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { /> )} - + - {translate('workspace.accounting.needAnotherAccounting')} + {translate('workspace.accounting.needAnotherAccounting')} Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID ?? ''))}>{chatTextLink} From b340aa37d7990747209e6fa7bebaab5666fbcaf9 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Dec 2024 16:08:19 +0700 Subject: [PATCH 06/11] add get assigned support data api --- src/libs/API/types.ts | 1 + src/libs/actions/Policy/Policy.ts | 5 +++++ src/pages/workspace/accounting/PolicyAccountingPage.tsx | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index d31da53304f6..f0e624b420c1 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -949,6 +949,7 @@ const READ_COMMANDS = { OPEN_DRAFT_DISTANCE_EXPENSE: 'OpenDraftDistanceExpense', START_ISSUE_NEW_CARD_FLOW: 'StartIssueNewCardFlow', OPEN_CARD_DETAILS_PAGE: 'OpenCardDetailsPage', + GET_ASSIGNED_SUPPORT_DATA: 'GetAssignedSupportData', } as const; type ReadCommand = ValueOf; diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 0b72d2de3f98..7ad71f963cd4 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -4559,6 +4559,10 @@ function updateInvoiceCompanyWebsite(policyID: string, companyWebsite: string) { API.write(WRITE_COMMANDS.UPDATE_INVOICE_COMPANY_WEBSITE, parameters, {optimisticData, successData, failureData}); } +function getAssignedSupportData(policyID: string) { + API.read(READ_COMMANDS.GET_ASSIGNED_SUPPORT_DATA, {policyID}); +} + export { leaveWorkspace, addBillingCardAndRequestPolicyOwnerChange, @@ -4654,6 +4658,7 @@ export { verifySetupIntentAndRequestPolicyOwnerChange, updateInvoiceCompanyName, updateInvoiceCompanyWebsite, + getAssignedSupportData, }; export type {NewCustomUnit}; diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 288d1c55c2ef..74af6931e889 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -29,6 +29,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import {isAuthenticationError, isConnectionInProgress, isConnectionUnverified, removePolicyConnection, syncConnection} from '@libs/actions/connections'; +import {getAssignedSupportData} from '@libs/actions/Policy/Policy'; import {getConciergeReportID} from '@libs/actions/Report'; import * as PolicyUtils from '@libs/PolicyUtils'; import { @@ -175,6 +176,12 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { setDateTimeToRelative(''); }, [getDatetimeToRelative, successfulDate]); + useEffect(() => { + if (policyID) { + getAssignedSupportData(policyID); + } + }, [policyID]); + const integrationSpecificMenuItems = useMemo(() => { const sageIntacctEntityList = policy?.connections?.intacct?.data?.entities ?? []; const netSuiteSubsidiaryList = policy?.connections?.netsuite?.options?.data?.subsidiaryList ?? []; From 268c25c881e48127368e12528968465ca1f92f1a Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Dec 2024 16:18:24 +0700 Subject: [PATCH 07/11] fix lint --- src/libs/API/parameters/index.ts | 1 + src/libs/API/types.ts | 1 + src/libs/actions/Policy/Policy.ts | 6 +++++- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 5 +++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts index 6a510d074f98..be5612022711 100644 --- a/src/libs/API/parameters/index.ts +++ b/src/libs/API/parameters/index.ts @@ -282,6 +282,7 @@ export type {default as ExportReportCSVParams} from './ExportReportCSVParams'; export type {default as UpdateExpensifyCardLimitParams} from './UpdateExpensifyCardLimitParams'; export type {CreateWorkspaceApprovalParams, UpdateWorkspaceApprovalParams, RemoveWorkspaceApprovalParams} from './WorkspaceApprovalParams'; export type {default as StartIssueNewCardFlowParams} from './StartIssueNewCardFlowParams'; +export type {default as GetAssignedSupportDataParams} from './GetAssignedSupportDataParams'; export type {default as ConnectAsDelegateParams} from './ConnectAsDelegateParams'; export type {default as SetPolicyRulesEnabledParams} from './SetPolicyRulesEnabledParams'; export type {default as SetPolicyDefaultReportTitleParams} from './SetPolicyDefaultReportTitle'; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index f0e624b420c1..54039a4d0f12 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -1012,6 +1012,7 @@ type ReadCommandParameters = { [READ_COMMANDS.OPEN_DRAFT_DISTANCE_EXPENSE]: null; [READ_COMMANDS.START_ISSUE_NEW_CARD_FLOW]: Parameters.StartIssueNewCardFlowParams; [READ_COMMANDS.OPEN_CARD_DETAILS_PAGE]: Parameters.OpenCardDetailsPageParams; + [READ_COMMANDS.GET_ASSIGNED_SUPPORT_DATA]: Parameters.GetAssignedSupportDataParams; }; const SIDE_EFFECT_REQUEST_COMMANDS = { diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 7ad71f963cd4..e6343ae8e5f5 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -24,6 +24,7 @@ import type { EnablePolicyReportFieldsParams, EnablePolicyTaxesParams, EnablePolicyWorkflowsParams, + GetAssignedSupportDataParams, LeavePolicyParams, OpenDraftWorkspaceRequestParams, OpenPolicyEditCardLimitTypePageParams, @@ -4560,7 +4561,10 @@ function updateInvoiceCompanyWebsite(policyID: string, companyWebsite: string) { } function getAssignedSupportData(policyID: string) { - API.read(READ_COMMANDS.GET_ASSIGNED_SUPPORT_DATA, {policyID}); + const parameters: GetAssignedSupportDataParams = { + policyID, + }; + API.read(READ_COMMANDS.GET_ASSIGNED_SUPPORT_DATA, parameters); } export { diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 74af6931e889..b7af2a8aea69 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -177,9 +177,10 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { }, [getDatetimeToRelative, successfulDate]); useEffect(() => { - if (policyID) { - getAssignedSupportData(policyID); + if (!policyID) { + return; } + getAssignedSupportData(policyID); }, [policyID]); const integrationSpecificMenuItems = useMemo(() => { From ab7690d778f181cf1f35794b419725c5a2b2c95c Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Dec 2024 16:19:38 +0700 Subject: [PATCH 08/11] fix lint --- src/libs/API/parameters/GetAssignedSupportDataParams.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/libs/API/parameters/GetAssignedSupportDataParams.ts diff --git a/src/libs/API/parameters/GetAssignedSupportDataParams.ts b/src/libs/API/parameters/GetAssignedSupportDataParams.ts new file mode 100644 index 000000000000..dcdc4bf99b0c --- /dev/null +++ b/src/libs/API/parameters/GetAssignedSupportDataParams.ts @@ -0,0 +1,5 @@ +type GetAssignedSupportDataParams = { + policyID: string; +}; + +export default GetAssignedSupportDataParams; From 0239ae7c97f8e62350bb8040a4e39a57e856fd99 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 9 Dec 2024 16:12:29 +0700 Subject: [PATCH 09/11] fix only show accouting link when have guide details --- .../accounting/PolicyAccountingPage.tsx | 26 ++++++++++--------- src/types/onyx/Account.ts | 8 ++++++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index b7af2a8aea69..00bb56ed4c5c 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -571,19 +571,21 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { /> )} - - - - {translate('workspace.accounting.needAnotherAccounting')} - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID ?? ''))}>{chatTextLink} + {account?.guideDetails?.email && ( + + + + {translate('workspace.accounting.needAnotherAccounting')} + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID ?? ''))}>{chatTextLink} + - + )} diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 03ff920015b2..72ca8a4d4a73 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -166,6 +166,14 @@ type Account = { /** Indicates SMS delivery failure status and associated information */ smsDeliveryFailureStatus?: SMSDeliveryFailureStatus; + + /** The guide details of the account */ + guideDetails?: { + /** The email of the guide details */ + email: string; + /** Datetime stamp if the user is already onboard */ + wonTimestamp: string; + }; }; export default Account; From 89d9f580d5e29283f7ef44216fecb8f24bbbfd32 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 9 Dec 2024 16:15:00 +0700 Subject: [PATCH 10/11] fix lint --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 00bb56ed4c5c..f10d200b24d1 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -571,7 +571,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { /> )} - {account?.guideDetails?.email && ( + {!!account?.guideDetails?.email && ( Date: Tue, 10 Dec 2024 10:31:14 +0700 Subject: [PATCH 11/11] change type guide details --- src/types/onyx/Account.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 72ca8a4d4a73..33a593ca2b10 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -171,8 +171,8 @@ type Account = { guideDetails?: { /** The email of the guide details */ email: string; - /** Datetime stamp if the user is already onboard */ - wonTimestamp: string; + /** The calendar link of the guide details */ + calendarLink: string; }; };