[Domain Control] [Release 4] [FE] Create MoveUsersBetweenGroupsPage#81973
[Domain Control] [Release 4] [FE] Create MoveUsersBetweenGroupsPage#81973jmusial wants to merge 27 commits intoExpensify:mainfrom
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`, | ||
| value: { | ||
| memberErrors: { | ||
| [employeeEmail]: {errors: getMicroSecondOnyxErrorWithTranslationKey('domain.members.error.moveMember')}, | ||
| }, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Let's update this to use the following structure: domainErrors_<domainAccountID>.memberErrors.<employeeEmail>.changeDomainSecurityGroupErrors
Please update the other occurrences as well.
| { | |
| onyxMethod: Onyx.METHOD.MERGE, | |
| key: `${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`, | |
| value: { | |
| memberErrors: { | |
| [employeeEmail]: {errors: getMicroSecondOnyxErrorWithTranslationKey('domain.members.error.moveMember')}, | |
| }, | |
| }, | |
| }, | |
| { | |
| onyxMethod: Onyx.METHOD.MERGE, | |
| key: `${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`, | |
| value: { | |
| memberErrors: { | |
| [employeeEmail]: {changeDomainSecurityGroupErrors: getMicroSecondOnyxErrorWithTranslationKey('domain.members.error.moveMember')}, | |
| }, | |
| }, | |
| }, |
|
Back on this should no longer be blocked |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 56eef0b6..3b0d0424 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -8643,12 +8643,16 @@ Hier ist ein *Testbeleg*, um dir zu zeigen, wie es funktioniert:`,
removeMember: 'Dieser Benutzer kann nicht entfernt werden. Bitte versuche es erneut.',
addMember: 'Dieses Mitglied kann nicht hinzugefügt werden. Bitte versuche es erneut.',
vacationDelegate: 'Dieser Benutzer kann nicht als Urlaubsvertretung festgelegt werden. Bitte versuche es erneut.',
+ moveMember: 'Dieses Mitglied kann nicht verschoben werden. Bitte versuchen Sie es erneut.',
},
reportSuspiciousActivityPrompt: (email: string) =>
`Bist du sicher? Dadurch wird das Konto von <strong>${email}</strong> gesperrt. <br /><br /> Unser Team wird das Konto anschließend überprüfen und unbefugten Zugriff entfernen. Um den Zugriff wiederherzustellen, muss die Person mit Concierge zusammenarbeiten.`,
reportSuspiciousActivityConfirmationPrompt: 'Wir überprüfen das Konto, um sicherzustellen, dass es sicher entsperrt werden kann, und melden uns bei Fragen über Concierge.',
cannotSetVacationDelegateForMember: (email: string) => `Du kannst keine Urlaubsvertretung für ${email} festlegen, weil sie derzeit die Vertretung für folgende Mitglieder sind:`,
emptyMembers: {title: 'Keine Mitglieder in dieser Gruppe', subtitle: 'Fügen Sie ein Mitglied hinzu oder versuchen Sie, den Filter oben zu ändern.'},
+ moveToGroup: 'In Gruppe verschieben',
+ chooseWhereToMove: ({count}: {count: number}) => `Wählen Sie aus, wohin Sie ${count} ${count === 1 ? 'Mitglied' : 'Mitglieder'} verschieben möchten.`,
+ move: 'Verschieben',
},
common: {
settings: 'Einstellungen',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index e3141cb9..45a95304 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -8665,6 +8665,7 @@ Voici un *reçu test* pour vous montrer comment ça fonctionne :`,
removeMember: 'Impossible de supprimer cet utilisateur. Veuillez réessayer.',
addMember: 'Impossible d’ajouter ce membre. Veuillez réessayer.',
vacationDelegate: 'Impossible de définir cet utilisateur comme délégué de vacances. Veuillez réessayer.',
+ moveMember: 'Impossible de déplacer ce membre. Veuillez réessayer.',
},
cannotSetVacationDelegateForMember: (email: string) =>
`Vous ne pouvez pas définir un délégué de vacances pour ${email}, car cette personne est actuellement le délégué des membres suivants :`,
@@ -8673,6 +8674,9 @@ Voici un *reçu test* pour vous montrer comment ça fonctionne :`,
reportSuspiciousActivityConfirmationPrompt:
'Nous examinerons le compte pour vérifier qu’il est sûr de le déverrouiller et nous vous contacterons via Concierge si nous avons des questions.',
emptyMembers: {title: 'Aucun membre dans ce groupe', subtitle: 'Ajoutez un membre ou essayez de modifier le filtre ci-dessus.'},
+ moveToGroup: 'Déplacer vers le groupe',
+ chooseWhereToMove: ({count}: {count: number}) => `Choisissez où déplacer ${count} ${count === 1 ? 'membre' : 'membres'}.`,
+ move: 'Déplacer',
},
common: {
settings: 'Paramètres',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 2814a3f5..f7292d65 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -8631,12 +8631,16 @@ Ecco una *ricevuta di prova* per mostrarti come funziona:`,
removeMember: 'Impossibile rimuovere questo utente. Riprova.',
addMember: 'Impossibile aggiungere questo membro. Riprova.',
vacationDelegate: 'Impossibile impostare questo utente come delegato per le ferie. Riprova.',
+ moveMember: 'Impossibile spostare questo membro. Riprova.',
},
cannotSetVacationDelegateForMember: (email: string) => `Non puoi impostare un delegato per le vacanze per ${email} perché al momento è il delegato per i seguenti membri:`,
reportSuspiciousActivityPrompt: (email: string) =>
`Sei sicuro? Questo bloccherà l’account di <strong>${email}</strong>. <br /><br /> Il nostro team esaminerà quindi l’account e rimuoverà qualsiasi accesso non autorizzato. Per riottenere l’accesso, dovranno collaborare con Concierge.`,
reportSuspiciousActivityConfirmationPrompt: 'Esamineremo l’account per verificare che sia sicuro sbloccarlo e ti contatteremo tramite Concierge per qualsiasi domanda.',
emptyMembers: {title: 'Nessun membro in questo gruppo', subtitle: 'Aggiungi un membro o prova a cambiare il filtro qui sopra.'},
+ moveToGroup: 'Sposta nel gruppo',
+ chooseWhereToMove: ({count}: {count: number}) => `Scegli dove spostare ${count} ${count === 1 ? 'membro' : 'membri'}.`,
+ move: 'Sposta',
},
common: {
settings: 'Impostazioni',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 1fb0fb53..18b3ecc1 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -8535,12 +8535,16 @@ ${reportName}
removeMember: 'このユーザーを削除できません。もう一度お試しください。',
addMember: 'このメンバーを追加できませんでした。もう一度お試しください。',
vacationDelegate: 'このユーザーを休暇代理人として設定できませんでした。もう一度お試しください。',
+ moveMember: 'このメンバーを移動できませんでした。もう一度お試しください。',
},
cannotSetVacationDelegateForMember: (email: string) => `${email} に休暇代理人を設定できません。現在、このユーザーは次のメンバーの代理人になっています。`,
reportSuspiciousActivityPrompt: (email: string) =>
`本当によろしいですか?これにより、<strong>${email}</strong> さんのアカウントがロックされます。<br /><br />その後、当社のチームがアカウントを確認し、不正アクセスを削除します。アクセスを回復するには、Concierge と連携して対応してもらう必要があります。`,
reportSuspiciousActivityConfirmationPrompt: 'アカウントが安全にロック解除できることを確認するために審査し、質問がある場合はConciergeを通じてご連絡します。',
emptyMembers: {title: 'このグループにはメンバーがいません', subtitle: 'メンバーを追加するか、上のフィルターを変更してみてください。'},
+ moveToGroup: 'グループへ移動',
+ chooseWhereToMove: ({count}: {count: number}) => `${count} ${count === 1 ? 'メンバー' : 'メンバー'} を移動する先を選択してください。`,
+ move: '移動',
},
common: {
settings: '設定',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 5bee400f..ba5167d5 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -8605,6 +8605,7 @@ Hier is een *proefbon* om je te laten zien hoe het werkt:`,
removeMember: 'Kan deze gebruiker niet verwijderen. Probeer het opnieuw.',
addMember: 'Kan dit lid niet toevoegen. Probeer het opnieuw.',
vacationDelegate: 'Kan deze gebruiker niet als vakantiemandataris instellen. Probeer het opnieuw.',
+ moveMember: 'Kan dit lid niet verplaatsen. Probeer het opnieuw.',
},
cannotSetVacationDelegateForMember: (email: string) =>
`Je kunt geen vakantiemandataris instellen voor ${email} omdat die persoon momenteel gedelegeerde is voor de volgende leden:`,
@@ -8613,6 +8614,9 @@ Hier is een *proefbon* om je te laten zien hoe het werkt:`,
reportSuspiciousActivityConfirmationPrompt:
'We beoordelen de account om te verifiëren dat het veilig is om deze te ontgrendelen en nemen via Concierge contact op als we vragen hebben.',
emptyMembers: {title: 'Geen leden in deze groep', subtitle: 'Voeg een lid toe of probeer het filter hierboven te wijzigen.'},
+ moveToGroup: 'Verplaatsen naar groep',
+ chooseWhereToMove: ({count}: {count: number}) => `Kies waar je ${count} ${count === 1 ? 'lid' : 'leden'} naartoe wilt verplaatsen.`,
+ move: 'Verplaatsen',
},
common: {
settings: 'Instellingen',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 3bea0ab6..4668136c 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -8591,12 +8591,16 @@ Oto *paragon testowy*, żeby pokazać Ci, jak to działa:`,
removeMember: 'Nie można usunąć tego użytkownika. Spróbuj ponownie.',
addMember: 'Nie można dodać tego członka. Spróbuj ponownie.',
vacationDelegate: 'Nie można ustawić tego użytkownika jako zastępującego na czas nieobecności. Spróbuj ponownie.',
+ moveMember: 'Nie można przenieść tego członka. Spróbuj ponownie.',
},
cannotSetVacationDelegateForMember: (email: string) => `Nie możesz ustawić zastępstwa urlopowego dla ${email}, ponieważ jest on/ona obecnie zastępcą dla następujących członków:`,
reportSuspiciousActivityPrompt: (email: string) =>
`Czy na pewno? To zablokuje konto użytkownika <strong>${email}</strong>. <br /><br /> Nasz zespół następnie przejrzy konto i usunie wszelki nieautoryzowany dostęp. Aby odzyskać dostęp, będą musieli współpracować z Concierge.`,
reportSuspiciousActivityConfirmationPrompt: 'Przejrzymy konto, aby potwierdzić, że bezpiecznie je odblokować, i skontaktujemy się przez Concierge w razie pytań.',
emptyMembers: {title: 'Brak członków w tej grupie', subtitle: 'Dodaj członka lub spróbuj zmienić filtr powyżej.'},
+ moveToGroup: 'Przenieś do grupy',
+ chooseWhereToMove: ({count}: {count: number}) => `Wybierz, dokąd przenieść ${count} ${count === 1 ? 'członek' : 'członkowie'}.`,
+ move: 'Przenieś',
},
common: {
settings: 'Ustawienia',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index e2c3fb53..8b1a2607 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -8596,12 +8596,16 @@ Aqui está um *comprovante de teste* para mostrar como funciona:`,
removeMember: 'Não foi possível remover este usuário. Tente novamente.',
addMember: 'Não foi possível adicionar este membro. Tente novamente.',
vacationDelegate: 'Não foi possível definir este usuário como delegado de férias. Tente novamente.',
+ moveMember: 'Não foi possível mover este membro. Tente novamente.',
},
cannotSetVacationDelegateForMember: (email: string) => `Você não pode definir um procurador de férias para ${email} porque esta pessoa já é procuradora dos seguintes membros:`,
reportSuspiciousActivityPrompt: (email: string) =>
`Tem certeza? Isso irá bloquear a conta de <strong>${email}</strong>. <br /><br /> Nossa equipe irá então analisar a conta e remover qualquer acesso não autorizado. Para recuperar o acesso, será necessário que trabalhem com a Concierge.`,
reportSuspiciousActivityConfirmationPrompt: 'Vamos revisar a conta para verificar se é seguro desbloqueá-la e entraremos em contato via Concierge caso haja dúvidas.',
emptyMembers: {title: 'Nenhum membro neste grupo', subtitle: 'Adicione um membro ou tente mudar o filtro acima.'},
+ moveToGroup: 'Mover para grupo',
+ chooseWhereToMove: ({count}: {count: number}) => `Escolha para onde mover ${count} ${count === 1 ? 'membro' : 'membros'}.`,
+ move: 'Mover',
},
common: {
settings: 'Configurações',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 96415f4f..ce743100 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -8386,12 +8386,16 @@ ${reportName}
removeMember: '无法移除此用户。请重试。',
addMember: '无法添加此成员。请重试。',
vacationDelegate: '无法将此用户设置为休假代理人。请重试。',
+ moveMember: '无法移动此成员。请重试。',
},
cannotSetVacationDelegateForMember: (email: string) => `您无法为 ${email} 设置休假代理人,因为 TA 当前是以下成员的代理人:`,
reportSuspiciousActivityPrompt: (email: string) =>
`你确定要这样做吗?这将锁定 <strong>${email}</strong> 的账户。<br /><br />我们的团队随后会审核该账户并移除任何未经授权的访问。若要重新获得访问权限,他们需要与 Concierge 配合处理。`,
reportSuspiciousActivityConfirmationPrompt: '我们会审核账户以确认解锁是否安全,如有任何问题将通过 Concierge 与您联系。',
emptyMembers: {title: '此群组中没有成员', subtitle: '添加成员或尝试更改上方的筛选条件。'},
+ moveToGroup: '移至群组',
+ chooseWhereToMove: ({count}: {count: number}) => `选择将 ${count} 个 ${count === 1 ? '成员' : '成员'} 移动到哪里。`,
+ move: '移动',
},
common: {
settings: '设置',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4ec86a443
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/libs/actions/Domain.ts
Outdated
| [currentSecurityGroupKey]: currentSecurityGroup, | ||
| [targetSecurityGroupKey]: { | ||
| shared: { |
There was a problem hiding this comment.
Roll back only the failed account's source-group membership
When the bulk move flow iterates selected members in MoveUsersBetweenGroupsPage, every call for users from the same source group passes the same pre-move currentGroup.details snapshot. Merging that whole snapshot back here means a single failed ChangeDomainSecurityGroup request will restore all of that group's original shared members, including users whose moves already succeeded. In practice, selecting two users from one group and having only one request fail leaves the successful user back in the source group (and potentially in both groups) until the next server refresh.
Useful? React with 👍 / 👎.
|
hey @situchan when will you have time to take a look @ this ? |
|
Please merge main. Reviewing today |
🤖 Code ReviewOverall this is a clean, well-structured PR that follows existing patterns in the codebase. The optimistic/success/failure data in 1. No loading/disabled state on Save button during bulk moveIn const [isLoading, setIsLoading] = useState(false);
const handleSave = () => {
if (!selectedGroupId || !selectedMemberAccountIDs?.length || !domainName) {
return;
}
setIsLoading(true);
// ... loop and fire API calls ...
clearDomainMembersSelectedForMove();
Navigation.goBack(ROUTES.DOMAIN_MEMBERS.getRoute(domainAccountID));
};
// In JSX:
<Button
success
pressOnEnter
text={translate('common.save')}
onPress={handleSave}
isDisabled={!selectedGroupId}
isLoading={isLoading}
/>This follows the pattern used in other domain pages to prevent double-submission. 2.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ab351b8a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| > | ||
| <HeaderWithBackButton | ||
| title={translate('domain.members.moveToGroup')} | ||
| onBackButtonPress={() => Navigation.goBack(ROUTES.DOMAIN_MEMBERS.getRoute(domainAccountID))} |
There was a problem hiding this comment.
Clear pending move selection on back navigation
onBackButtonPress only navigates away and never clears DOMAIN_MEMBERS_SELECTED_FOR_MOVE. Since that selection is stored in a global Onyx key and is only reset in handleSave, canceling this page leaves stale account IDs behind; when domain/:domainAccountID/members/move is opened later (especially via deeplink or after switching domains), those old IDs can be reused and trigger moves for users not selected in the current flow. Clear the selection on cancel/unmount (or scope it by domain) to prevent cross-flow state leakage.
Useful? React with 👍 / 👎.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Part of an existing product initiative
...
Given how the code works,
This is intentional. @rayane-d do you think we'll ever get
Translations from parrot
Intentional |
No, I don't think we'll get changeDomainSecurityGroup errors keyed by accountID instead of email. We always send them using the email. |

Explanation of Change
This PR implements a page that allows admins to bulk move selected domain members between security groups.
How it works can be previewed on desktop video at the end.
Fixed Issues
$ #80136
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2026-02-10.at.15.25.59.mov
Android: Native
android.mov
iOS: Native
Screen.Recording.2026-03-18.at.14.44.25.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-18.at.13.55.12.mov