Skip to content

Commit

Permalink
feat(admin-react): "Administrateur du compte" menu in aap agencies se…
Browse files Browse the repository at this point in the history
…ttings is no longer available when AAP_INTERVENTION_ZONE_UPDATE feature is enabled
  • Loading branch information
agarbe committed Jul 16, 2024
1 parent d206cde commit 544567c
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const AgenciesSettingsLayout = ({ children }: { children: ReactNode }) => {
queryFn: () => graphqlClient.request(agenciesInfoForConnectedUserQuery),
});

const aapInterventionZoneUpdateFeatureActive = isFeatureActive(
"AAP_INTERVENTION_ZONE_UPDATE",
);

const getNavItem = ({
text,
href,
Expand All @@ -69,7 +73,7 @@ const AgenciesSettingsLayout = ({ children }: { children: ReactNode }) => {
organismId: string;
organismType: "REMOTE" | "ONSITE";
}) => [
...(isFeatureActive("AAP_INTERVENTION_ZONE_UPDATE")
...(aapInterventionZoneUpdateFeatureActive
? [
getNavItem({
text: "Informations générales",
Expand All @@ -94,10 +98,14 @@ const AgenciesSettingsLayout = ({ children }: { children: ReactNode }) => {
text: "Absences et fermetures",
href: `/agencies-settings/${organismId}/absence`,
}),
getNavItem({
text: "Administrateur du compte",
href: `/agencies-settings/${organismId}/manager`,
}),
...(aapInterventionZoneUpdateFeatureActive
? []
: [
getNavItem({
text: "Administrateur du compte",
href: `/agencies-settings/${organismId}/manager`,
}),
]),
];

const getNavItems = () => {
Expand Down Expand Up @@ -166,7 +174,7 @@ const AgenciesSettingsLayout = ({ children }: { children: ReactNode }) => {
{
isActive: false,
linkProps: {
href: isFeatureActive("AAP_INTERVENTION_ZONE_UPDATE")
href: aapInterventionZoneUpdateFeatureActive
? "/agencies-settings/add-agency/"
: "/agencies-settings/add-agence/",
target: "_self",
Expand Down Expand Up @@ -225,9 +233,7 @@ const AgenciesSettingsLayout = ({ children }: { children: ReactNode }) => {

items = [
agenciesMenu,
...(isFeatureActive("AAP_INTERVENTION_ZONE_UPDATE")
? [userAccountsMenu]
: []),
...(aapInterventionZoneUpdateFeatureActive ? [userAccountsMenu] : []),
];
} else if (isOrganism) {
items = getOrganismNavItems({
Expand Down

0 comments on commit 544567c

Please sign in to comment.