Skip to content
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/libs/API/parameters/GetAssignedSupportDataParams.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ 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';
Expand Down
2 changes: 0 additions & 2 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ const READ_COMMANDS = {
OPEN_DRAFT_DISTANCE_EXPENSE: 'OpenDraftDistanceExpense',
START_ISSUE_NEW_CARD_FLOW: 'StartIssueNewCardFlow',
OPEN_CARD_DETAILS_PAGE: 'OpenCardDetailsPage',
GET_ASSIGNED_SUPPORT_DATA: 'GetAssignedSupportData',
GET_CORPAY_ONBOARDING_FIELDS: 'GetCorpayOnboardingFields',
OPEN_WORKSPACE_PLAN_PAGE: 'OpenWorkspacePlanPage',
OPEN_SECURITY_SETTINGS_PAGE: 'OpenSecuritySettingsPage',
Expand Down Expand Up @@ -1138,7 +1137,6 @@ 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;
[READ_COMMANDS.GET_CORPAY_ONBOARDING_FIELDS]: Parameters.GetCorpayOnboardingFieldsParams;
[READ_COMMANDS.OPEN_WORKSPACE_PLAN_PAGE]: Parameters.OpenWorkspacePlanPageParams;
[READ_COMMANDS.OPEN_SECURITY_SETTINGS_PAGE]: null;
Expand Down
9 changes: 0 additions & 9 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
EnablePolicyReportFieldsParams,
EnablePolicyTaxesParams,
EnablePolicyWorkflowsParams,
GetAssignedSupportDataParams,
LeavePolicyParams,
OpenDraftWorkspaceRequestParams,
OpenPolicyEditCardLimitTypePageParams,
Expand Down Expand Up @@ -138,7 +137,7 @@
adminsChatReportID: string;
};

const allPolicies: OnyxCollection<Policy> = {};

Check warning on line 140 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY,
callback: (val, key) => {
Expand Down Expand Up @@ -171,13 +170,13 @@
},
});

let lastAccessedWorkspacePolicyID: OnyxEntry<string>;

Check warning on line 173 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID,
callback: (value) => (lastAccessedWorkspacePolicyID = value),
});

let allReports: OnyxCollection<Report>;

Check warning on line 179 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
Expand All @@ -186,7 +185,7 @@
},
});

let allReportActions: OnyxCollection<ReportActions>;

Check warning on line 188 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
Expand All @@ -196,7 +195,7 @@
});

let sessionEmail = '';
let sessionAccountID = 0;

Check warning on line 198 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.SESSION,
callback: (val) => {
Expand All @@ -205,31 +204,31 @@
},
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList>;

Check warning on line 207 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (val) => (allPersonalDetails = val),
});

let reimbursementAccount: OnyxEntry<ReimbursementAccount>;

Check warning on line 213 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
callback: (val) => (reimbursementAccount = val),
});

let allRecentlyUsedCurrencies: string[];

Check warning on line 219 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.RECENTLY_USED_CURRENCIES,
callback: (val) => (allRecentlyUsedCurrencies = val ?? []),
});

let activePolicyID: OnyxEntry<string>;

Check warning on line 225 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.NVP_ACTIVE_POLICY_ID,
callback: (value) => (activePolicyID = value),
});

let allTransactionViolations: OnyxCollection<TransactionViolations> = {};

Check warning on line 231 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
Expand Down Expand Up @@ -5279,13 +5278,6 @@
API.write(WRITE_COMMANDS.UPDATE_INVOICE_COMPANY_WEBSITE, parameters, {optimisticData, successData, failureData});
}

function getAssignedSupportData(policyID: string) {
const parameters: GetAssignedSupportDataParams = {
policyID,
};
API.read(READ_COMMANDS.GET_ASSIGNED_SUPPORT_DATA, parameters);
}

/**
* Validates user account and returns a list of accessible policies.
*/
Expand Down Expand Up @@ -5512,7 +5504,6 @@
updateInvoiceCompanyName,
updateInvoiceCompanyWebsite,
updateDefaultPolicy,
getAssignedSupportData,
downgradeToTeam,
getAccessiblePolicies,
clearGetAccessiblePoliciesErrors,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function ProfilePage({route}: ProfilePageProps) {
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false});
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
const isDebugModeEnabled = !!account?.isDebugModeEnabled;
const guideCalendarLink = account?.guideCalendarLink ?? '';
const guideCalendarLink = account?.guideDetails?.calendarLink ?? '';

const accountID = Number(route.params?.accountID ?? CONST.DEFAULT_NUMBER_ID);
const isCurrentUser = session?.accountID === accountID;
Expand Down
14 changes: 3 additions & 11 deletions src/pages/workspace/accounting/PolicyAccountingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useThreeDotsAnchorPosition from '@hooks/useThreeDotsAnchorPosition';
import {isAuthenticationError, isConnectionInProgress, isConnectionUnverified, removePolicyConnection, syncConnection} from '@libs/actions/connections';
import {shouldShowQBOReimbursableExportDestinationAccountError} from '@libs/actions/connections/QuickbooksOnline';
import {getAssignedSupportData} from '@libs/actions/Policy/Policy';
import {isExpensifyCardFullySetUp} from '@libs/CardUtils';
import {
areSettingsInErrorFields,
Expand Down Expand Up @@ -179,13 +178,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
setDateTimeToRelative('');
}, [getDatetimeToRelative, successfulDate]);

useEffect(() => {
if (!policyID) {
return;
}
getAssignedSupportData(policyID);
}, [policyID]);

const calculateAndSetThreeDotsMenuPosition = useCallback(() => {
if (shouldUseNarrowLayout) {
return Promise.resolve({horizontal: 0, vertical: 0});
Expand Down Expand Up @@ -512,8 +504,8 @@ 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 [translate('workspace.accounting.talkYourOnboardingSpecialist'), account?.adminsRoomReportID];
if (policy?.chatReportIDAdmins) {
return [translate('workspace.accounting.talkYourOnboardingSpecialist'), policy?.chatReportIDAdmins];
}

// If not, if they have an account manager assigned display the following and link to the DM with their account manager.
Expand Down Expand Up @@ -626,7 +618,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
/>
<View style={[!isLargeScreenWidth ? styles.flexColumn : styles.flexRow]}>
<Text style={styles.textSupporting}>{translate('workspace.accounting.needAnotherAccounting')}</Text>
<TextLink onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID))}>{chatTextLink}</TextLink>
<TextLink onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(String(chatReportID)))}>{chatTextLink}</TextLink>
</View>
</View>
)}
Expand Down
3 changes: 0 additions & 3 deletions src/types/onyx/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ type Account = {
/** Is this account having trouble receiving emails? */
hasEmailDeliveryFailure?: boolean;

/** URL to the assigned guide's appointment booking calendar */
guideCalendarLink?: string;

/** User recovery codes for setting up 2-FA */
recoveryCodes?: string;

Expand Down
Loading