Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
35e55e9
fix: update CSV upload options for Members
nkdengineer Jul 3, 2025
09029b8
Add import button inworkflow
nkdengineer Jul 3, 2025
b71ce6e
Merge branch 'main' into fix/65056
nkdengineer Jul 8, 2025
6de9c44
remove import in workflow page
nkdengineer Jul 8, 2025
58a9d66
fix import
nkdengineer Jul 8, 2025
744b983
fix ts
nkdengineer Jul 8, 2025
b390331
Merge branch 'main' into fix/65056
nkdengineer Jul 16, 2025
1702d23
Merge branch 'main' into fix/65056
nkdengineer Jul 29, 2025
18d4c1f
add submitsTo and forwardsTo to member
nkdengineer Jul 29, 2025
75a0f41
fix lint
nkdengineer Jul 29, 2025
0f5fcba
Merge branch 'main' into fix/65056
nkdengineer Jul 30, 2025
0c53269
add confirmation step
nkdengineer Jul 30, 2025
092299e
fix typecheck
nkdengineer Jul 30, 2025
f0d1563
correct role logic
nkdengineer Jul 30, 2025
0d12087
update translation
nkdengineer Jul 30, 2025
937a7ec
add other translations
nkdengineer Jul 30, 2025
c78dcc5
Merge branch 'main' into fix/65056
nkdengineer Jul 31, 2025
49403ba
resolve conflict
nkdengineer Aug 3, 2025
6de1386
update flow
nkdengineer Aug 3, 2025
870d3f1
Merge branch 'main' into fix/65056
nkdengineer Aug 5, 2025
ec9f983
update role missing case
nkdengineer Aug 5, 2025
33c0992
fix error after merge main
nkdengineer Aug 5, 2025
bf59c6b
Update src/pages/workspace/members/ImportedMembersConfirmationPage.tsx
nkdengineer Aug 5, 2025
afc48ac
Update src/types/onyx/ImportedSpreadsheetMemberData.ts
nkdengineer Aug 5, 2025
60ac1b2
fix lint
nkdengineer Aug 5, 2025
ff35bce
create new method to check the pending delete member
nkdengineer Aug 5, 2025
2907358
clear imported data when unmounting
nkdengineer Aug 5, 2025
bac635f
run prettier
nkdengineer Aug 5, 2025
18716b9
resolve conflict
nkdengineer Aug 8, 2025
d7cd26d
resolve remaining conflict
nkdengineer Aug 8, 2025
690bb02
update onyx type file
nkdengineer Aug 8, 2025
4455b8d
resolve conflict
nkdengineer Aug 13, 2025
ab685cf
resolve conflict
nkdengineer Aug 14, 2025
86f2903
Merge branch 'main' into fix/65056
nkdengineer Aug 18, 2025
7dfa289
add comment
nkdengineer Aug 18, 2025
cbdb568
remove unnecessary change
nkdengineer Aug 18, 2025
66721bc
Merge branch 'main' into fix/65056
nkdengineer Aug 19, 2025
84c0cd7
improve translation and refactor code
nkdengineer Aug 19, 2025
9146ca3
Update src/pages/workspace/members/ImportedMembersPage.tsx
nkdengineer Aug 19, 2025
d921f13
Merge branch 'main' into fix/65056
nkdengineer Aug 19, 2025
1e61261
update comment
nkdengineer Aug 19, 2025
32921ce
edit the comment
nkdengineer Aug 19, 2025
a1d88ad
Merge branch 'main' into fix/65056
nkdengineer Aug 19, 2025
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: 5 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,13 @@ const ONYXKEYS = {

/** Stores the user search value for persistence across the screens */
ROOM_MEMBERS_USER_SEARCH_PHRASE: 'roomMembersUserSearchPhrase',

/** Stores information about recently uploaded spreadsheet file */
IMPORTED_SPREADSHEET: 'importedSpreadsheet',

/** Stores the information about the members imported from the spreadsheet */
IMPORTED_SPREADSHEET_MEMBER_DATA: 'importedSpreadsheetMemberData',

/** Stores the route to open after changing app permission from settings */
LAST_ROUTE: 'lastRoute',

Expand Down Expand Up @@ -1200,6 +1204,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.ROOM_MEMBERS_USER_SEARCH_PHRASE]: string;
[ONYXKEYS.APPROVAL_WORKFLOW]: OnyxTypes.ApprovalWorkflowOnyx;
[ONYXKEYS.IMPORTED_SPREADSHEET]: OnyxTypes.ImportedSpreadsheet;
[ONYXKEYS.IMPORTED_SPREADSHEET_MEMBER_DATA]: OnyxTypes.ImportedSpreadsheetMemberData[];
[ONYXKEYS.LAST_ROUTE]: string;
[ONYXKEYS.IS_USING_IMPORTED_STATE]: boolean;
[ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES]: Record<string, string>;
Expand Down
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,10 @@ const ROUTES = {
route: 'workspaces/:policyID/members/imported',
getRoute: (policyID: string) => `workspaces/${policyID}/members/imported` as const,
},
WORKSPACE_MEMBERS_IMPORTED_CONFIRMATION: {
route: 'workspaces/:policyID/members/imported/confirmation',
getRoute: (policyID: string) => `workspaces/${policyID}/members/imported/confirmation` as const,
},
POLICY_ACCOUNTING: {
route: 'workspaces/:policyID/accounting',
getRoute: (policyID: string | undefined, newConnectionName?: ConnectionName, integrationToDisconnect?: ConnectionName, shouldDisconnectIntegrationBeforeConnecting?: boolean) => {
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ const SCREENS = {
MEMBERS: 'Workspace_Members',
MEMBERS_IMPORT: 'Members_Import',
MEMBERS_IMPORTED: 'Members_Imported',
MEMBERS_IMPORTED_CONFIRMATION: 'Members_Imported_Confirmation',
INVITE: 'Workspace_Invite',
INVITE_MESSAGE: 'Workspace_Invite_Message',
INVITE_MESSAGE_ROLE: 'Workspace_Invite_Message_Role',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ const translations = {
getTheApp: 'Hole dir die App',
scanReceiptsOnTheGo: 'Scannen Sie Belege von Ihrem Telefon aus',
headsUp: 'Achtung!',
submitTo: 'Einreichen an',
forwardTo: 'Weiterleiten an',
merge: 'Zusammenführen',
unstableInternetConnection: 'Instabile Internetverbindung. Bitte überprüfe dein Netzwerk und versuche es erneut.',
},
Expand Down Expand Up @@ -990,6 +992,11 @@ const translations = {
'Die Datei, die Sie hochgeladen haben, ist entweder leer oder enthält ungültige Daten. Bitte stellen Sie sicher, dass die Datei korrekt formatiert ist und die notwendigen Informationen enthält, bevor Sie sie erneut hochladen.',
importSpreadsheet: 'Tabellenkalkulation importieren',
downloadCSV: 'CSV herunterladen',
importMemberConfirmation: () => ({
one: `Bitte bestätige die folgenden Angaben für ein neues Workspace-Mitglied, das mit diesem Upload hinzugefügt wird. Bestehende Mitglieder erhalten keine Rollenaktualisierungen oder Einladungshinweise.`,
other: (count: number) =>
`Bitte bestätige die folgenden Angaben für die ${count} neuen Workspace-Mitglieder, die mit diesem Upload hinzugefügt werden. Bestehende Mitglieder erhalten keine Rollenaktualisierungen oder Einladungshinweise.`,
}),
},
receipt: {
upload: 'Beleg hochladen',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ const translations = {
getTheApp: 'Get the app',
scanReceiptsOnTheGo: 'Scan receipts from your phone',
headsUp: 'Heads up!',
submitTo: 'Submit to',
forwardTo: 'Forward to',
merge: 'Merge',
unstableInternetConnection: 'Unstable internet connection. Please check your network and try again.',
},
Expand Down Expand Up @@ -981,6 +983,11 @@ const translations = {
'The file you uploaded is either empty or contains invalid data. Please ensure that the file is correctly formatted and contains the necessary information before uploading it again.',
importSpreadsheet: 'Import spreadsheet',
downloadCSV: 'Download CSV',
importMemberConfirmation: () => ({
one: `Please confirm the details below for a new workspace member that will be added as part of this upload. Existing members won’t receive any role updates or invite messages.`,
other: (count: number) =>
`Please confirm the details below for the ${count} new workspace members that will be added as part of this upload. Existing members won’t receive any role updates or invite messages.`,
}),
},
receipt: {
upload: 'Upload receipt',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ const translations = {
getTheApp: 'Descarga la app',
scanReceiptsOnTheGo: 'Escanea recibos desde tu teléfono',
headsUp: '¡Atención!',
submitTo: 'Enviar a',
forwardTo: 'Reenviar a',
merge: 'Fusionar',
unstableInternetConnection: 'Conexión a internet inestable. Por favor, revisa tu red e inténtalo de nuevo.',
},
Expand Down Expand Up @@ -974,6 +976,11 @@ const translations = {
'El archivo que subiste está vacío o contiene datos no válidos. Asegúrate de que el archivo esté correctamente formateado y contenga la información necesaria antes de volver a subirlo.',
importSpreadsheet: 'Importar hoja de cálculo',
downloadCSV: 'Descargar CSV',
importMemberConfirmation: () => ({
one: `Por favor confirma los detalles a continuación para un nuevo miembro del espacio de trabajo que se agregará como parte de esta carga. Los miembros existentes no recibirán actualizaciones de rol ni mensajes de invitación.`,
other: (count: number) =>
`Por favor confirma los detalles a continuación para los ${count} nuevos miembros del espacio de trabajo que se agregarán como parte de esta carga. Los miembros existentes no recibirán actualizaciones de rol ni mensajes de invitación.`,
}),
},
receipt: {
upload: 'Subir recibo',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ const translations = {
getTheApp: "Obtenez l'application",
scanReceiptsOnTheGo: 'Numérisez les reçus depuis votre téléphone',
headsUp: 'Attention !',
submitTo: 'Envoyer à',
forwardTo: 'Transférer à',
merge: 'Fusionner',
unstableInternetConnection: 'Connexion Internet instable. Veuillez vérifier votre réseau et réessayer.',
},
Expand Down Expand Up @@ -992,6 +994,11 @@ const translations = {
'Le fichier que vous avez téléchargé est soit vide, soit contient des données invalides. Veuillez vous assurer que le fichier est correctement formaté et contient les informations nécessaires avant de le télécharger à nouveau.',
importSpreadsheet: 'Importer une feuille de calcul',
downloadCSV: 'Télécharger CSV',
importMemberConfirmation: () => ({
one: `Veuillez confirmer les informations ci-dessous pour un nouveau membre de l’espace de travail qui sera ajouté dans le cadre de cet import. Les membres existants ne recevront aucune mise à jour de rôle ni de message d’invitation.`,
other: (count: number) =>
`Veuillez confirmer les informations ci-dessous pour les ${count} nouveaux membres de l’espace de travail qui seront ajoutés dans le cadre de cet import. Les membres existants ne recevront aucune mise à jour de rôle ni de message d’invitation.`,
}),
},
receipt: {
upload: 'Télécharger le reçu',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ const translations = {
getTheApp: "Scarica l'app",
scanReceiptsOnTheGo: 'Scansiona le ricevute dal tuo telefono',
headsUp: 'Attenzione!',
submitTo: 'Invia a',
forwardTo: 'Inoltra a',
merge: 'Unisci',
unstableInternetConnection: 'Connessione Internet instabile. Controlla la tua rete e riprova.',
},
Expand Down Expand Up @@ -987,6 +989,11 @@ const translations = {
'Il file che hai caricato è vuoto o contiene dati non validi. Assicurati che il file sia formattato correttamente e contenga le informazioni necessarie prima di caricarlo di nuovo.',
importSpreadsheet: 'Importa foglio di calcolo',
downloadCSV: 'Scarica CSV',
importMemberConfirmation: () => ({
one: `Conferma i dettagli di seguito per un nuovo membro del workspace che verrà aggiunto come parte di questo caricamento. I membri esistenti non riceveranno aggiornamenti di ruolo né messaggi di invito.`,
other: (count: number) =>
`Conferma i dettagli di seguito per i ${count} nuovi membri del workspace che verranno aggiunti come parte di questo caricamento. I membri esistenti non riceveranno aggiornamenti di ruolo né messaggi di invito.`,
}),
},
receipt: {
upload: 'Carica ricevuta',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ const translations = {
getTheApp: 'アプリを入手',
scanReceiptsOnTheGo: '携帯電話から領収書をスキャンする',
headsUp: 'ご注意ください!',
submitTo: '送信先',
forwardTo: '転送先',
merge: 'マージ',
unstableInternetConnection: 'インターネット接続が不安定です。ネットワークを確認してもう一度お試しください。',
},
Expand Down Expand Up @@ -989,6 +991,11 @@ const translations = {
'アップロードしたファイルは空であるか、無効なデータが含まれています。ファイルが正しくフォーマットされ、必要な情報が含まれていることを確認してから、再度アップロードしてください。',
importSpreadsheet: 'スプレッドシートをインポート',
downloadCSV: 'CSVをダウンロード',
importMemberConfirmation: () => ({
one: `このアップロードで追加される新しいワークスペースメンバーの詳細を以下で確認してください。既存のメンバーにはロールの更新や招待メッセージは送信されません。`,
other: (count: number) =>
`このアップロードで追加される${count}人の新しいワークスペースメンバーの詳細を以下で確認してください。既存のメンバーにはロールの更新や招待メッセージは送信されません。`,
}),
},
receipt: {
upload: '領収書をアップロード',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ const translations = {
getTheApp: 'Download de app',
scanReceiptsOnTheGo: 'Scan bonnetjes vanaf je telefoon',
headsUp: 'Let op!',
submitTo: 'Sturen naar',
forwardTo: 'Doorsturen naar',
merge: 'Samenvoegen',
unstableInternetConnection: 'Onstabiele internetverbinding. Controleer je netwerk en probeer het opnieuw.',
},
Expand Down Expand Up @@ -988,6 +990,11 @@ const translations = {
'Het bestand dat u heeft geüpload is ofwel leeg of bevat ongeldige gegevens. Zorg ervoor dat het bestand correct is opgemaakt en de benodigde informatie bevat voordat u het opnieuw uploadt.',
importSpreadsheet: 'Spreadsheet importeren',
downloadCSV: 'CSV downloaden',
importMemberConfirmation: () => ({
one: `Bevestig hieronder de gegevens voor een nieuw werkruimte-lid dat via deze upload wordt toegevoegd. Bestaande leden ontvangen geen rolupdates of uitnodigingsberichten.`,
other: (count: number) =>
`Bevestig hieronder de gegevens voor de ${count} nieuwe werkruimte-leden die via deze upload worden toegevoegd. Bestaande leden ontvangen geen rolupdates of uitnodigingsberichten.`,
}),
},
receipt: {
upload: 'Bonnetje uploaden',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ const translations = {
getTheApp: 'Pobierz aplikację',
scanReceiptsOnTheGo: 'Skanuj paragony za pomocą telefonu',
headsUp: 'Uwaga!',
submitTo: 'Wyślij do',
forwardTo: 'Przekaż do',
merge: 'Scal',
unstableInternetConnection: 'Niestabilne połączenie internetowe. Sprawdź swoją sieć i spróbuj ponownie.',
},
Expand Down Expand Up @@ -986,6 +988,11 @@ const translations = {
'Plik, który przesłałeś, jest pusty lub zawiera nieprawidłowe dane. Upewnij się, że plik jest poprawnie sformatowany i zawiera niezbędne informacje przed ponownym przesłaniem.',
importSpreadsheet: 'Importuj arkusz kalkulacyjny',
downloadCSV: 'Pobierz CSV',
importMemberConfirmation: () => ({
one: `Potwierdź poniższe szczegóły dotyczące nowego członka przestrzeni roboczej, który zostanie dodany w ramach tego przesyłania. Istniejący członkowie nie otrzymają aktualizacji ról ani wiadomości z zaproszeniem.`,
other: (count: number) =>
`Potwierdź poniższe szczegóły dotyczące ${count} nowych członków przestrzeni roboczej, którzy zostaną dodani w ramach tego przesyłania. Istniejący członkowie nie otrzymają aktualizacji ról ani wiadomości z zaproszeniem.`,
}),
},
receipt: {
upload: 'Prześlij paragon',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ const translations = {
getTheApp: 'Obtenha o aplicativo',
scanReceiptsOnTheGo: 'Digitalize recibos com seu celular',
headsUp: 'Atenção!',
submitTo: 'Enviar para',
forwardTo: 'Encaminhar para',
merge: 'Mesclar',
unstableInternetConnection: 'Conexão de internet instável. Verifique sua rede e tente novamente.',
},
Expand Down Expand Up @@ -989,6 +991,11 @@ const translations = {
'O arquivo que você enviou está vazio ou contém dados inválidos. Por favor, certifique-se de que o arquivo está formatado corretamente e contém as informações necessárias antes de enviá-lo novamente.',
importSpreadsheet: 'Importar planilha',
downloadCSV: 'Baixar CSV',
importMemberConfirmation: () => ({
one: `Confirme os detalhes abaixo para um novo membro do workspace que será adicionado como parte deste envio. Os membros existentes não receberão atualizações de função nem mensagens de convite.`,
other: (count: number) =>
`Confirme os detalhes abaixo para os ${count} novos membros do workspace que serão adicionados como parte deste envio. Os membros existentes não receberão atualizações de função nem mensagens de convite.`,
}),
},
receipt: {
upload: 'Fazer upload de recibo',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ const translations = {
getTheApp: '获取应用程序',
scanReceiptsOnTheGo: '用手机扫描收据',
headsUp: '\u6CE8\u610F\uFF01',
submitTo: '提交到',
forwardTo: '转发到',
merge: '合并',
unstableInternetConnection: '互联网连接不稳定。请检查你的网络,然后重试。',
},
Expand Down Expand Up @@ -981,6 +983,10 @@ const translations = {
invalidFileMessage: '您上传的文件要么是空的,要么包含无效数据。请确保文件格式正确并包含必要的信息,然后再重新上传。',
importSpreadsheet: '导入电子表格',
downloadCSV: '下载 CSV',
importMemberConfirmation: () => ({
one: `请确认以下信息,以添加此次上传中的一位新工作区成员。现有成员不会收到角色更新或邀请消息。`,
other: (count: number) => `请确认以下信息,以添加此次上传中的 ${count} 位新工作区成员。现有成员不会收到角色更新或邀请消息。`,
}),
},
receipt: {
upload: '上传收据',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.WORKSPACE.INVITE]: () => require<ReactComponentModule>('../../../../pages/workspace/WorkspaceInvitePage').default,
[SCREENS.WORKSPACE.MEMBERS_IMPORT]: () => require<ReactComponentModule>('../../../../pages/workspace/members/ImportMembersPage').default,
[SCREENS.WORKSPACE.MEMBERS_IMPORTED]: () => require<ReactComponentModule>('../../../../pages/workspace/members/ImportedMembersPage').default,
[SCREENS.WORKSPACE.MEMBERS_IMPORTED_CONFIRMATION]: () => require<ReactComponentModule>('../../../../pages/workspace/members/ImportedMembersConfirmationPage').default,
[SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_NEW]: () => require<ReactComponentModule>('../../../../pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsCreatePage').default,
[SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_EDIT]: () => require<ReactComponentModule>('../../../../pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage').default,
[SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_EXPENSES_FROM]: () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const WORKSPACE_TO_RHP: Partial<Record<keyof WorkspaceSplitNavigatorParamList, s
SCREENS.WORKSPACE.OWNER_CHANGE_ERROR,
SCREENS.WORKSPACE.MEMBERS_IMPORT,
SCREENS.WORKSPACE.MEMBERS_IMPORTED,
SCREENS.WORKSPACE.MEMBERS_IMPORTED_CONFIRMATION,
],
[SCREENS.WORKSPACE.WORKFLOWS]: [
SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_NEW,
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.WORKSPACE.MEMBERS_IMPORTED]: {
path: ROUTES.WORKSPACE_MEMBERS_IMPORTED.route,
},
[SCREENS.WORKSPACE.MEMBERS_IMPORTED_CONFIRMATION]: {
path: ROUTES.WORKSPACE_MEMBERS_IMPORTED_CONFIRMATION.route,
},
[SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_NEW]: {
path: ROUTES.WORKSPACE_WORKFLOWS_APPROVALS_NEW.route,
},
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ type SettingsNavigatorParamList = {
[SCREENS.WORKSPACE.MEMBERS_IMPORTED]: {
policyID: string;
};
[SCREENS.WORKSPACE.MEMBERS_IMPORTED_CONFIRMATION]: {
policyID: string;
};
[SCREENS.WORKSPACE.INVITE_MESSAGE]: {
policyID: string;
backTo?: Routes;
Expand Down
10 changes: 10 additions & 0 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@
let activePolicyId: OnyxEntry<string>;
let isLoadingReportData = true;

Onyx.connect({

Check warning on line 62 in src/libs/PolicyUtils.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
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
});

Onyx.connect({

Check warning on line 68 in src/libs/PolicyUtils.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
key: ONYXKEYS.NVP_ACTIVE_POLICY_ID,
callback: (value) => (activePolicyId = value),
});

Onyx.connect({

Check warning on line 73 in src/libs/PolicyUtils.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
key: ONYXKEYS.IS_LOADING_REPORT_DATA,
initWithStoredValues: false,
callback: (value) => (isLoadingReportData = value ?? false),
Expand Down Expand Up @@ -284,6 +284,15 @@
return !!currentUserLogin && !!policyID && !!allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]?.employeeList?.[currentUserLogin];
}

function isPolicyMemberWithoutPendingDelete(currentUserLogin: string | undefined, policy: OnyxEntry<Policy>): boolean {
if (!currentUserLogin || !policy?.id) {
return false;
}

const policyEmployee = policy?.employeeList?.[currentUserLogin];
return !!policyEmployee && policyEmployee.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
}

function isPolicyPayer(policy: OnyxEntry<Policy>, currentUserLogin: string | undefined): boolean {
if (!policy) {
return false;
Expand Down Expand Up @@ -1664,6 +1673,7 @@
getPolicyRole,
hasIndependentTags,
getLengthOfTag,
isPolicyMemberWithoutPendingDelete,
getPolicyEmployeeAccountIDs,
};

Expand Down
Loading
Loading