[Domain Control] [No QA] Create DomainAdminsSettings RHP with Primary contact - #77515
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 |
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.
|
…admins-settings-page # Conflicts: # src/ONYXKEYS.ts # src/pages/domain/Admins/DomainAdminsPage.tsx
…admins-settings-page # Conflicts: # src/pages/domain/Admins/DomainAdminsPage.tsx
|
Please merge main to reduce diff. |
|
@situchan main merged! |
| const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); | ||
| const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE, {canBeMissing: false}); | ||
| const [domainSettings] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${domainAccountID}`, { | ||
| canBeMissing: false, |
There was a problem hiding this comment.
Can you add context? I'd like to know when canBeMissing should be false.
As I understand from doc, it's not standard practice.
/**
* If the component calling this is the one loading the data by calling an action, then you should set this to `true`.
*
* If the component calling this does not load the data then you should set it to `false`, which means that if the data
* is not there, it will log an alert, as it means we are using data that no one loaded and that's most probably a bug.
*/
canBeMissing?: boolean;
There was a problem hiding this comment.
I think, based on the comment you sent, that if we don't load the data, we should set it to false
but maybe I misunderstood something 🤔
|
I'm not sure it's a bug 2025-12-15.14.02.01.mov |
|
@war-in |
|
I suppose we still need to fix these issues here or we can fix it separately |
|
But overall changes look good |
# Conflicts: # src/pages/domain/Admins/DomainAdminsPage.tsx
|
@ZhenjaHorbach both comments addressed! we still need to wait for translations |
🦜 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 30f483b7..5d64ccef 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7991,7 +7991,7 @@ Hier ist ein *Testbeleg*, um dir zu zeigen, wie es funktioniert:`,
subtitle: 'Erzwingen Sie für Mitglieder Ihrer Domain die Anmeldung per Single Sign-On, schränken Sie die Erstellung von Workspaces ein und vieles mehr.',
enable: 'Aktivieren',
},
- admins: {title: 'Admins', findAdmin: 'Admin finden'},
+ admins: {title: 'Admins', findAdmin: 'Admin finden', primaryContact: 'Hauptansprechpartner', addPrimaryContact: 'Primären Kontakt hinzufügen', settings: 'Einstellungen'},
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index ae752206..3ae6f9c1 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -7995,7 +7995,7 @@ Voici un *reçu test* pour vous montrer comment cela fonctionne :`,
subtitle: "Exiger que les membres de votre domaine se connectent via l'authentification unique, restreindre la création d'espaces de travail, et plus encore.",
enable: 'Activer',
},
- admins: {title: 'Admins', findAdmin: 'Trouver un admin'},
+ admins: {title: 'Admins', findAdmin: 'Trouver un admin', primaryContact: 'Contact principal', addPrimaryContact: 'Ajouter un contact principal', settings: 'Paramètres'},
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/it.ts b/src/languages/it.ts
index f60d9a6e..e9b2d1cf 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7971,7 +7971,13 @@ Ecco una *ricevuta di prova* per mostrarti come funziona:`,
subtitle: 'Richiedi ai membri del tuo dominio di accedere tramite Single Sign-On, limita la creazione di spazi di lavoro e altro ancora.',
enable: 'Abilita',
},
- admins: {title: 'Amministratori', findAdmin: 'Trova amministratore'},
+ admins: {
+ title: 'Amministratori',
+ findAdmin: 'Trova amministratore',
+ primaryContact: 'Contatto principale',
+ addPrimaryContact: 'Aggiungi contatto principale',
+ settings: 'Impostazioni',
+ },
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 6bcbcba2..63de94c8 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7914,7 +7914,7 @@ Expensify の使い方をお見せするための*テストレシート*がこ
subtitle: 'ドメインのメンバーにシングルサインオンでのログインを必須化し、ワークスペースの作成を制限するなど、さらに多くのことができます。',
enable: '有効にする',
},
- admins: {title: '管理者', findAdmin: '管理者を検索'},
+ admins: {title: '管理者', findAdmin: '管理者を検索', primaryContact: '主要連絡先', addPrimaryContact: '主要連絡先を追加', settings: '設定'},
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 396f75b9..e1e7f45e 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7956,7 +7956,13 @@ Hier is een *testbon* om je te laten zien hoe het werkt:`,
subtitle: 'Verplicht leden van je domein om in te loggen via single sign-on, beperk het aanmaken van werkruimten en meer.',
enable: 'Inschakelen',
},
- admins: {title: 'Beheerders', findAdmin: 'Beheerder zoeken'},
+ admins: {
+ title: 'Beheerders',
+ findAdmin: 'Beheerder zoeken',
+ primaryContact: 'Primair contactpersoon',
+ addPrimaryContact: 'Primair contactpersoon toevoegen',
+ settings: 'Instellingen',
+ },
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 9646789e..e42e818a 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7942,7 +7942,7 @@ Oto *paragon testowy*, który pokazuje, jak to działa:`,
subtitle: 'Wymagaj, aby członkowie Twojej domeny logowali się przez Single Sign-On (SSO), ograniczaj tworzenie obszarów roboczych i nie tylko.',
enable: 'Włącz',
},
- admins: {title: 'Administratorzy', findAdmin: 'Znajdź administratora'},
+ admins: {title: 'Administratorzy', findAdmin: 'Znajdź administratora', primaryContact: 'Główny kontakt', addPrimaryContact: 'Dodaj główny kontakt', settings: 'Ustawienia'},
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index ea50d4c1..e649b4fc 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7949,7 +7949,13 @@ Aqui está um *recibo de teste* para mostrar como funciona:`,
subtitle: 'Exija que os membros do seu domínio façam login por meio de logon único (SSO), restrinja a criação de espaços de trabalho e muito mais.',
enable: 'Ativar',
},
- admins: {title: 'Administradores', findAdmin: 'Encontrar administrador'},
+ admins: {
+ title: 'Administradores',
+ findAdmin: 'Encontrar administrador',
+ primaryContact: 'Contato principal',
+ addPrimaryContact: 'Adicionar contato principal',
+ settings: 'Configurações',
+ },
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 28c1c108..53f214fb 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7779,7 +7779,7 @@ ${reportName}
addDomain: {title: '添加域', subtitle: '请输入您想访问的私有域名(例如:expensify.com)。', domainName: '域名', newDomain: '新域名'},
domainAdded: {title: '已添加域名', description: '接下来,您需要验证域名的所有权并调整您的安全设置。', configure: '配置'},
enhancedSecurity: {title: '增强的安全性', subtitle: '要求您域内的成员使用单点登录登录、限制工作区创建等。', enable: '启用'},
- admins: {title: '管理员', findAdmin: '查找管理员'},
+ admins: {title: '管理员', findAdmin: '查找管理员', primaryContact: '主要联系人', addPrimaryContact: '添加主要联系人', settings: '设置'},
},
};
// IMPORTANT: This line is manually replaced in generate translation files by scripts/generateTranslations.ts,
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
| const data: AdminOption[] = []; | ||
| for (const accountID of adminAccountIDs ?? []) { |
There was a problem hiding this comment.
NAB: for is run every time component is rendered. Can we memoize?
There was a problem hiding this comment.
As I remember, we decided not to add useMemo to prevent React Compiler issue
But in my opinion, I would put this logic into a separate function
There was a problem hiding this comment.
I am not sure but react compiler will memoize this as well? Or only after putting this into separate function?
There was a problem hiding this comment.
Currently, I think this code is executed after each render
And by the way,
I just realized this now
This logic is used in two places (DomainAddPrimaryContactPage and DomainAdminsPage)
So, I would create a custom hook for this logic
But I think we can do this in the next PR
|
Okay |
| type SetTechnicalContactEmailParams = { | ||
| authToken?: string | null; | ||
| domainAccountID: number; | ||
| technicalContactAccountID: number; |
There was a problem hiding this comment.
We will update this to email, but since its not used yet, we can do that later
# Conflicts: # src/ROUTES.ts # src/SCREENS.ts # src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx # src/libs/Navigation/linkingConfig/RELATIONS/DOMAIN_TO_RHP.ts # src/libs/Navigation/linkingConfig/config.ts # src/libs/Navigation/types.ts # src/pages/domain/Admins/DomainAdminsPage.tsx
| } | ||
|
|
||
| export {domainMemberSamlSettingsSelector, domainSamlSettingsStateSelector, domainNameSelector, metaIdentitySelector, adminAccountIDsSelector}; | ||
| const technicalContactEmailSelector = (domainMemberSharedNVP: OnyxEntry<CardFeeds>) => domainMemberSharedNVP?.settings?.technicalContactEmail; |
There was a problem hiding this comment.
I know it is trivial but I think we should still add a simple unit tests for such simple selectors to have coverage on these
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.82-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.82-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.82-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.84-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.84-8 🚀
|



Explanation of Change
Second part of the Release 1 of the domain-control-in-new-dot project. It adds settings button to the Admins page under
domain/<domainAccountID>/admins/settingsI didn't create the API command yet, as it's not ready on the backend side. I'll update the code once the command is ready
Fixed Issues
$ #77585
PROPOSAL:
Tests
Primary contactrowOffline tests
QA Steps
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-12-12.at.17.50.46.mov