-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin): display the list of all accounts on the head agency sett…
…ings page
- Loading branch information
Showing
6 changed files
with
128 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,26 @@ context("Head agency settings page", () => { | |
cy.get('[data-test="on-site-agencies"]').should("exist"); | ||
cy.get('[data-test="on-site-agency"]').should("not.exist"); | ||
}); | ||
|
||
context("on the account list section", () => { | ||
it("display all accounts with info details", function () { | ||
visitSettings({ informationsJuridiques: "A_JOUR" }); | ||
cy.wait("@getHeadAgencySettingsInfo"); | ||
cy.get('[data-test="account-list"] li').should("have.length", 4); | ||
cy.get( | ||
'[data-test="account-list"] [data-test="account-1"] [data-test="on-site-badge"]', | ||
).should("exist"); | ||
cy.get( | ||
'[data-test="account-list"] [data-test="account-2"] [data-test="remote-badge"]', | ||
).should("exist"); | ||
cy.get('[data-test="account-list"] [data-test="account-3"]').should( | ||
"contain", | ||
"Catherine Doe", | ||
); | ||
cy.get('[data-test="account-list"] [data-test="account-4"]').should( | ||
"contain", | ||
"[email protected]", | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,23 +10,11 @@ | |
"FRANCE_METROPOLITAINE" | ||
], | ||
"accounts": [ | ||
{ | ||
"id": "e45b3b63-6bf4-4181-801d-51b19c722580", | ||
"firstname": "John", | ||
"lastname": "Doe", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"id": "8f5fcf2d-ef76-4560-90d0-b151186b1c46", | ||
"firstname": "Alice", | ||
"lastname": "Doe", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"id": "6d1ffe00-a8b5-4f4f-a5ea-d1fe71282ec5", | ||
"firstname": "Bob", | ||
"lastname": "Joe", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"maisonMereAAP": { | ||
|
@@ -35,28 +23,63 @@ | |
{ | ||
"id": "2be04b85-ed75-41fb-9248-97fc178ba664", | ||
"isRemote": false, | ||
"isOnSite": true, | ||
"isVisibleInCandidateSearchResults": false, | ||
"remoteZones": [] | ||
"remoteZones": [], | ||
"accounts": [ | ||
{ | ||
"id": "account-1", | ||
"firstname": "John", | ||
"lastname": "Doe", | ||
"email": "[email protected]" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "29994a9a-f166-48b9-974f-f3b3dbccda19", | ||
"isRemote": true, | ||
"isOnSite": false, | ||
"isVisibleInCandidateSearchResults": false, | ||
"remoteZones": [ | ||
"FRANCE_METROPOLITAINE" | ||
], | ||
"accounts": [ | ||
{ | ||
"id": "account-2", | ||
"firstname": "Alice", | ||
"lastname": "Doe", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"id": "account-3", | ||
"firstname": "Catherine", | ||
"lastname": "Doe", | ||
"email": "[email protected]" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "fb10a5d2-c081-418b-ab92-5a11314ada84", | ||
"isRemote": false, | ||
"isOnSite": true, | ||
"isVisibleInCandidateSearchResults": false, | ||
"remoteZones": [] | ||
"remoteZones": [], | ||
"accounts": [ | ||
{ | ||
"id": "account-4", | ||
"firstname": "Bob", | ||
"lastname": "Doe", | ||
"email": "[email protected]" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "513be886-4f99-44d3-8edd-6ba2987dccd0", | ||
"isRemote": false, | ||
"isOnSite": true, | ||
"isVisibleInCandidateSearchResults": true, | ||
"remoteZones": [] | ||
"remoteZones": [], | ||
"accounts": [] | ||
} | ||
] | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
...ettings-v3/_components/agencies-settings-section/HeadAgencySettingsSectionAccountList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export const HeadAgencySettingsSectionAccountList = ({ | ||
organisms, | ||
}: { | ||
organisms: { | ||
accounts: { | ||
id: string; | ||
firstname?: string | null; | ||
lastname?: string | null; | ||
email: string; | ||
}[]; | ||
isRemote: boolean; | ||
isOnSite: boolean; | ||
}[]; | ||
}) => ( | ||
<ul data-test="account-list" className="ml-6 mb-8"> | ||
{organisms.map((organism) => | ||
organism.accounts.map((account) => ( | ||
<li | ||
data-test={account.id} | ||
key={account.id} | ||
className="flex gap-x-6 py-3 border-neutral-300 border-t last:border-b" | ||
> | ||
{organism.isRemote && ( | ||
<i | ||
data-test="remote-badge" | ||
className="fr-icon-headphone-fill fr-icon--sm" | ||
></i> | ||
)} | ||
{organism.isOnSite && ( | ||
<i | ||
data-test="on-site-badge" | ||
className="fr-icon-home-4-fill fr-icon--sm" | ||
></i> | ||
)} | ||
<div> | ||
<span className="font-bold"> | ||
{account.firstname} {account.lastname} | ||
</span> | ||
{" - "} | ||
{account.email} | ||
</div> | ||
</li> | ||
)), | ||
)} | ||
</ul> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters