Skip to content
Draft
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
8 changes: 7 additions & 1 deletion src/components/ValuePicker/ValueSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ function ValueSelectionList({
const initialSelectedValue = useInitialSelection(selectedItem?.value ? selectedItem.value : undefined, isVisible === undefined ? {resetOnFocus: true} : {isVisible});

const options = useMemo(() => {
const mappedOptions = items.map((item) => ({value: item.value ?? '', alternateText: item.description, text: item.label ?? '', keyForList: item.value ?? ''}));
const mappedOptions = items.map((item) => ({
value: item.value ?? '',
alternateText: item.description,
text: item.label ?? '',
keyForList: item.value ?? '',
isDisabled: item.isDisabled,
}));
const orderedOptions = moveInitialSelectionToTop(mappedOptions, initialSelectedValue ? [initialSelectedValue] : []);

return orderedOptions.map((item) => ({...item, isSelected: item.value === selectedItem?.value}));
Expand Down
1 change: 1 addition & 0 deletions src/components/ValuePicker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type ValuePickerItem = {
label?: string;
value?: string;
description?: string;
isDisabled?: boolean | null;
};

type ValueSelectorModalProps = {
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6619,6 +6619,7 @@ Der Control-Tarif beginnt bei 9 $ pro aktivem Mitglied und Monat.`,
chooseLimitType: 'Wähle einen Limittyp',
smartLimit: 'Intelligentes Limit',
smartLimitDescription: 'Bis zu einem bestimmten Betrag ausgeben, bevor eine Genehmigung erforderlich ist',
smartLimitDisabledDescription: 'Aktiviere einen Genehmigungsworkflow für diesen Workspace, um das intelligente Limit zu verwenden',
monthly: 'Monatlich',
monthlyDescription: 'Bis zu einem bestimmten Betrag pro Monat ausgeben',
fixedAmount: 'Fester Betrag',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6707,6 +6707,7 @@ const translations = {
chooseLimitType: 'Choose a limit type',
smartLimit: 'Smart Limit',
smartLimitDescription: 'Spend up to a certain amount before requiring approval',
smartLimitDisabledDescription: 'Enable an approval workflow for this workspace to use Smart Limit',
monthly: 'Monthly',
monthlyDescription: 'Limit renews monthly',
fixedAmount: 'Fixed amount',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6743,6 +6743,7 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
chooseLimitType: 'Elegir un tipo de límite',
smartLimit: 'Límite inteligente',
smartLimitDescription: 'Gasta hasta un determinado importe antes de requerir aprobación',
smartLimitDisabledDescription: 'Habilita un flujo de trabajo de aprobación para este espacio de trabajo para usar el Límite inteligente',
monthly: 'Mensual',
monthlyDescription: 'Gasta hasta un determinado importe al mes',
fixedAmount: 'Importe fijo',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6645,6 +6645,7 @@ Le forfait Control commence à 9 $ par Membre actif et par mois.`,
chooseLimitType: 'Choisissez un type de limite',
smartLimit: 'Limite intelligente',
smartLimitDescription: 'Dépenser jusqu’à un certain montant avant de nécessiter une approbation',
smartLimitDisabledDescription: 'Activez un flux d’approbation pour cet espace de travail afin d’utiliser la Limite intelligente',
monthly: 'Mensuel',
monthlyDescription: 'Dépenser jusqu’à un certain montant par mois',
fixedAmount: 'Montant fixe',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6604,6 +6604,7 @@ Il piano Control parte da 9 $ al mese per ogni membro attivo.`,
chooseLimitType: 'Scegli un tipo di limite',
smartLimit: 'Limite intelligente',
smartLimitDescription: 'Spendi fino a un certo importo prima di richiedere l’approvazione',
smartLimitDisabledDescription: 'Abilita un flusso di approvazione per questo spazio di lavoro per usare il Limite intelligente',
monthly: 'Mensile',
monthlyDescription: 'Spendi fino a un certo importo al mese',
fixedAmount: 'Importo fisso',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6523,6 +6523,7 @@ Control プランは、アクティブメンバー1人あたり月額 $9 から
chooseLimitType: '上限の種類を選択',
smartLimit: 'スマート制限',
smartLimitDescription: '承認が必要になる前に、一定額まで支出できる',
smartLimitDisabledDescription: 'スマート制限を使用するには、このワークスペースの承認ワークフローを有効にしてください',
monthly: '毎月',
monthlyDescription: '毎月、一定額まで利用する',
fixedAmount: '固定額',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6587,6 +6587,7 @@ Het Control-abonnement begint bij $9 per actieve deelnemer per maand.`,
chooseLimitType: 'Kies een limiettype',
smartLimit: 'Slimme limiet',
smartLimitDescription: 'Tot een bepaald bedrag uitgeven voordat goedkeuring vereist is',
smartLimitDisabledDescription: 'Schakel een goedkeuringsworkflow in voor deze werkruimte om de Slimme limiet te gebruiken',
monthly: 'Maandelijks',
monthlyDescription: 'Geef per maand tot een bepaald bedrag uit',
fixedAmount: 'Vast bedrag',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6569,6 +6569,7 @@ Plan Control zaczyna się od 9 USD za aktywnego członka miesięcznie.`,
chooseLimitType: 'Wybierz typ limitu',
smartLimit: 'Inteligentny limit',
smartLimitDescription: 'Wydawaj do określonej kwoty przed wymaganiem zatwierdzenia',
smartLimitDisabledDescription: 'Włącz proces zatwierdzania dla tej przestrzeni roboczej, aby korzystać z Inteligentnego limitu',
monthly: 'Miesięcznie',
monthlyDescription: 'Wydawaj do określonej kwoty miesięcznie',
fixedAmount: 'Stała kwota',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6580,6 +6580,7 @@ O plano Control começa em US$ 9 por membro ativo por mês.`,
chooseLimitType: 'Escolha um tipo de limite',
smartLimit: 'Limite Inteligente',
smartLimitDescription: 'Gaste até um determinado valor antes de exigir aprovação',
smartLimitDisabledDescription: 'Ative um fluxo de aprovação para este espaço de trabalho para usar o Limite Inteligente',
monthly: 'Mensal',
monthlyDescription: 'Gastar até um determinado valor por mês',
fixedAmount: 'Valor fixo',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6386,6 +6386,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
chooseLimitType: '选择限额类型',
smartLimit: '智能限额',
smartLimitDescription: '在需要审批前可支出至指定金额上限',
smartLimitDisabledDescription: '为此工作区启用审批工作流以使用智能限额',
monthly: '每月',
monthlyDescription: '每月消费上限为特定金额',
fixedAmount: '固定金额',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,14 @@ function DynamicExpensifyCardLimitTypePage({route}: WorkspaceEditCardLimitTypePa

const data = [];

if (areApprovalsConfigured) {
data.push({
value: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
label: translate('workspace.card.issueNewCard.smartLimit'),
description: translate('workspace.card.issueNewCard.smartLimitDescription'),
keyForList: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
isSelected: typeSelected === CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
});
}
data.push({
value: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
label: translate('workspace.card.issueNewCard.smartLimit'),
description: translate(areApprovalsConfigured ? 'workspace.card.issueNewCard.smartLimitDescription' : 'workspace.card.issueNewCard.smartLimitDisabledDescription'),
keyForList: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
isSelected: typeSelected === CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
isDisabled: !areApprovalsConfigured,
});

data.push({
value: CONST.EXPENSIFY_CARD.LIMIT_TYPES.MONTHLY,
Expand Down
17 changes: 8 additions & 9 deletions src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ function LimitTypeStep({policy, stepNames, startStepIndex}: LimitTypeStepProps)
const data = useMemo(() => {
const options = [];

if (areApprovalsConfigured) {
options.push({
value: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
label: translate('workspace.card.issueNewCard.smartLimit'),
description: translate('workspace.card.issueNewCard.smartLimitDescription'),
keyForList: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
isSelected: typeSelected === CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
});
}
options.push({
value: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
label: translate('workspace.card.issueNewCard.smartLimit'),
description: translate(areApprovalsConfigured ? 'workspace.card.issueNewCard.smartLimitDescription' : 'workspace.card.issueNewCard.smartLimitDisabledDescription'),
keyForList: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
isSelected: typeSelected === CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,
isDisabled: !areApprovalsConfigured,
});

options.push(
{
Expand Down
Loading