Skip to content
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8577,6 +8577,7 @@ const CONST = {
},
WORKSPACE: {
TOGGLE_SETTINGS_ROW: 'Workspace-ToggleSettingsRow',
DUPLICATE_SELECT_FEATURES_SELECT_ALL: 'WorkspaceDuplicate-SelectFeaturesSelectAll',
WORKSPACE_MENU_ITEM: 'Workspace-WorkspaceMenuItem',
COMPANY_CARDS: {
TABLE_ITEM: 'Workspace-CompanyCards-TableItem',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5540,6 +5540,11 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
reimbursementAccount: 'Erstattungskonto',
welcomeNote: 'Bitte verwende meinen neuen Arbeitsbereich',
delayedSubmission: 'verspätete Einreichung',
merchantRules: 'Händlerregeln',
merchantRulesCount: () => ({
one: '1 Händlerregel',
other: (count: number) => `${count} Händlerregeln`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Sie sind dabei, ${newWorkspaceName ?? ''} mit ${totalMembers ?? 0} Mitgliedern aus dem ursprünglichen Workspace zu erstellen und zu teilen.`,
error: 'Beim Duplizieren deines neuen Workspace ist ein Fehler aufgetreten. Bitte versuche es erneut.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5497,6 +5497,11 @@ const translations = {
reimbursementAccount: 'reimbursement account',
welcomeNote: 'Please start using my new workspace',
delayedSubmission: 'delayed submission',
merchantRules: 'Merchant rules',
merchantRulesCount: () => ({
one: '1 merchant rule',
other: (count: number) => `${count} merchant rules`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`You’re about to create and share ${newWorkspaceName ?? ''} with ${totalMembers ?? 0} members from the original workspace.`,
error: 'An error occurred while duplicating your new workspace. Please try again.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5308,6 +5308,11 @@ ${amount} para ${merchant} - ${date}`,
reimbursementAccount: 'cuenta de reembolso',
delayedSubmission: 'presentación retrasada',
welcomeNote: 'Por favor, comience a utilizar mi nuevo espacio de trabajo.',
merchantRules: 'Reglas de comerciante',
merchantRulesCount: () => ({
one: '1 regla de comerciante',
other: (count: number) => `${count} reglas de comerciante`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}) =>
`Estás a punto de crear y compartir ${newWorkspaceName ?? ''} con ${totalMembers ?? 0} miembros del espacio de trabajo original.`,
error: 'Se produjo un error al duplicar tu nuevo espacio de trabajo. Inténtalo de nuevo.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5561,6 +5561,11 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
reimbursementAccount: 'compte de remboursement',
welcomeNote: 'Veuillez commencer à utiliser mon nouvel espace de travail',
delayedSubmission: 'soumission retardée',
merchantRules: 'Règles de commerçant',
merchantRulesCount: () => ({
one: '1 règle de commerçant',
other: (count: number) => `${count} règles de commerçant`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Vous êtes sur le point de créer et de partager ${newWorkspaceName ?? ''} avec ${totalMembers ?? 0} membres de l’espace de travail d’origine.`,
error: 'Une erreur s’est produite lors de la duplication de votre nouvel espace de travail. Veuillez réessayer.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5528,6 +5528,11 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
reimbursementAccount: 'conto di rimborso',
welcomeNote: 'Inizia a usare il mio nuovo workspace',
delayedSubmission: 'invio posticipato',
merchantRules: 'Regole del commerciante',
merchantRulesCount: () => ({
one: '1 regola del commerciante',
other: (count: number) => `${count} regole del commerciante`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Stai per creare e condividere ${newWorkspaceName ?? ''} con ${totalMembers ?? 0} membri dello spazio di lavoro originale.`,
error: 'Si è verificato un errore durante la duplicazione del tuo nuovo workspace. Riprova.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5481,6 +5481,11 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
reimbursementAccount: '精算口座',
welcomeNote: '私の新しいワークスペースを使い始めてください',
delayedSubmission: '遅延提出',
merchantRules: '販売者ルール',
merchantRulesCount: () => ({
one: '1 販売者ルール',
other: (count: number) => `${count} 販売者ルール`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`元のワークスペースから ${totalMembers ?? 0} 人のメンバーと一緒に、${newWorkspaceName ?? ''} を作成して共有しようとしています。`,
error: '新しいワークスペースの複製中にエラーが発生しました。もう一度お試しください。',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5516,6 +5516,11 @@ _Voor meer gedetailleerde instructies, [bezoek onze help-site](${CONST.NETSUITE_
reimbursementAccount: 'vergoedingsrekening',
welcomeNote: 'Begin alsjeblieft mijn nieuwe werkruimte te gebruiken',
delayedSubmission: 'vertraagde indiening',
merchantRules: 'Handelaarsregels',
merchantRulesCount: () => ({
one: '1 handelaarsregel',
other: (count: number) => `${count} handelaarsregels`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Je staat op het punt ${newWorkspaceName ?? ''} te maken en te delen met ${totalMembers ?? 0} leden van de oorspronkelijke werkruimte.`,
error: 'Er is een fout opgetreden bij het dupliceren van je nieuwe werkruimte. Probeer het opnieuw.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5506,6 +5506,11 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
reimbursementAccount: 'konto zwrotów',
welcomeNote: 'Proszę, zacznij używać mojego nowego obszaru roboczego',
delayedSubmission: 'opóźnione przesłanie',
merchantRules: 'Zasady sprzedawcy',
merchantRulesCount: () => ({
one: '1 zasada sprzedawcy',
other: (count: number) => `${count} zasady sprzedawcy`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Za chwilę utworzysz i udostępnisz ${newWorkspaceName ?? ''} ${totalMembers ?? 0} członkom oryginalnego obszaru roboczego.`,
error: 'Wystąpił błąd podczas duplikowania Twojego nowego obszaru roboczego. Spróbuj ponownie.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5511,6 +5511,11 @@ _Para instruções mais detalhadas, [visite nossa central de ajuda](${CONST.NETS
reimbursementAccount: 'conta de reembolso',
welcomeNote: 'Comece a usar meu novo espaço de trabalho',
delayedSubmission: 'envio atrasado',
merchantRules: 'Regras do comerciante',
merchantRulesCount: () => ({
one: '1 regra do comerciante',
other: (count: number) => `${count} regras do comerciante`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Você está prestes to criar e compartilhar ${newWorkspaceName ?? ''} com ${totalMembers ?? 0} membros do workspace original.`,
error: 'Ocorreu um erro ao duplicar seu novo espaço de trabalho. Tente novamente.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5408,6 +5408,11 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
reimbursementAccount: '报销账户',
welcomeNote: '请开始使用我的新工作区',
delayedSubmission: '延迟提交',
merchantRules: '商家规则',
merchantRulesCount: () => ({
one: '1 商家规则',
other: (count: number) => `${count} 商家规则`,
}),
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`您即将创建并共享 ${newWorkspaceName ?? ''},其中包含来自原始工作区的 ${totalMembers ?? 0} 位成员。`,
error: '复制您的新工作区时发生错误。请重试。',
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
};

const deprecatedAllPolicies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 229 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
key: ONYXKEYS.COLLECTION.POLICY,
callback: (val, key) => {
if (!key) {
Expand All @@ -242,7 +242,7 @@
});

let deprecatedAllReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 245 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
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand All @@ -252,7 +252,7 @@

let deprecatedSessionEmail = '';
let deprecatedSessionAccountID = 0;
Onyx.connect({

Check warning on line 255 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
key: ONYXKEYS.SESSION,
callback: (val) => {
deprecatedSessionEmail = val?.email ?? '';
Expand All @@ -261,7 +261,7 @@
});

let deprecatedAllPersonalDetails: OnyxEntry<PersonalDetailsList>;
Onyx.connect({

Check warning on line 264 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
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (val) => (deprecatedAllPersonalDetails = val),
});
Expand Down Expand Up @@ -2910,6 +2910,7 @@
const isPerDiemOptionSelected = parts?.perDiem;
const isOverviewOptionSelected = parts?.overview;
const isTravelOptionSelected = parts?.travel;
const isCodingRulesOptionSelected = parts?.codingRules;

const outputCurrency = isOverviewOptionSelected ? policy?.outputCurrency : localCurrency;

Expand Down Expand Up @@ -2963,6 +2964,7 @@
connections: isConnectionsOptionSelected ? policy?.connections : undefined,
customUnits: getCustomUnitsForDuplication(policy, isDistanceRatesOptionSelected, isPerDiemOptionSelected),
taxRates: isTaxesOptionSelected ? policy?.taxRates : undefined,
rules: isCodingRulesOptionSelected ? {codingRules: policy?.rules?.codingRules} : undefined,
Comment thread
JS00001 marked this conversation as resolved.
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
pendingFields: {
autoReporting: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
const taxesLength = Object.keys(policy?.taxRates?.taxes ?? {}).length ?? 0;
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, {canBeMissing: true});
const categoriesCount = Object.keys(policyCategories ?? {}).length;
const codingRulesCount = Object.keys(policy?.rules?.codingRules ?? {}).length;
const [selectedItems, setSelectedItems] = useState<string[]>([]);
const reportFields = Object.keys(getReportFieldsByPolicyID(policyID)).length ?? 0;
const customUnits = getPerDiemCustomUnit(policy);
Expand Down Expand Up @@ -142,6 +143,13 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
: undefined,
}
: undefined,
codingRulesCount > 0 && !isCollect
? {
translation: translate('workspace.duplicateWorkspace.merchantRules'),
value: 'codingRules',
alternateText: translate('workspace.duplicateWorkspace.merchantRulesCount', {count: codingRulesCount}),
}
: undefined,
ratesCount > 0 && policy?.areDistanceRatesEnabled
? {
translation: translate('workspace.common.distanceRates'),
Expand Down Expand Up @@ -188,6 +196,7 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
allRates,
bankAccountList,
invoiceCompany,
codingRulesCount,
]);

const featuresToCopy: ListItem[] = useMemo(() => {
Expand Down Expand Up @@ -235,6 +244,7 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
exportLayouts: selectedItems.includes('workflows'),
overview: selectedItems.includes('overview'),
travel: selectedItems.includes('travel'),
codingRules: selectedItems.includes('codingRules'),
Comment thread
JS00001 marked this conversation as resolved.
},
file: duplicatedWorkspaceAvatar,
localCurrency: currentUserPersonalDetails?.localCurrencyCode ?? '',
Expand Down Expand Up @@ -360,6 +370,7 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
accessibilityLabel={translate('workspace.common.selectAll')}
role="button"
accessibilityState={{checked: isSelectAllChecked}}
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.DUPLICATE_SELECT_FEATURES_SELECT_ALL}
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
>
<Text style={[styles.textLabelSupporting, styles.ph3]}>{translate('workspace.common.selectAll')}</Text>
Expand Down
Loading