Skip to content

Commit

Permalink
Partage des libellés et supprime referent de liste des fonctions as…
Browse files Browse the repository at this point in the history
…signable à un utilisateur
  • Loading branch information
marc-rutkowski committed Dec 2, 2024
1 parent 5cc0ecc commit 0e0e924
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
16 changes: 14 additions & 2 deletions app.territoiresentransitions.react/src/app/labels.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {TActionAvancementExt} from 'types/alias';
import type {ReferentielOfIndicateur} from 'types/litterals';
import { TActionAvancementExt, TMembreFonction } from 'types/alias';
import type { ReferentielOfIndicateur } from 'types/litterals';

// Define all labels from app
export const referentielToName: Record<
Expand Down Expand Up @@ -27,3 +27,15 @@ export const actionIdToLabel: Record<string, string> = {
eci_3: "Autres piliers de l'ECI",
eci_4: 'Outils financiers',
};

export const membreFonctions: { value: TMembreFonction; label: string }[] = [
{ value: 'technique', label: 'Directions et services techniques' },
{ value: 'politique', label: 'Équipe politique' },
{ value: 'conseiller', label: "Bureau d'études" },
{ value: 'partenaire', label: 'Partenaire' },
];

export const membreFonctionToLabel = membreFonctions.reduce(
(acc, { value, label }) => ({ ...acc, [value]: label }),
{} as Record<TMembreFonction, string>
);
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {referentielToName} from 'app/labels';
import {TNiveauAcces, TMembreFonction} from 'types/alias';
import {SendInvitationArgs} from '../useSendInvitation';
import {ConfirmerChangementNiveau} from 'app/pages/collectivite/Users/components/ConfirmerChangementNiveau';
import { membreFonctions } from 'app/labels';

export type TMembreListTableRowProps = {
currentUserId: string;
Expand All @@ -24,14 +25,6 @@ export type TMembreListTableRowProps = {
sendInvitation: (args: SendInvitationArgs) => void;
};

const membreFonctions: {value: TMembreFonction; label: string}[] = [
{value: 'referent', label: 'Référent·e'},
{value: 'technique', label: 'Équipe technique'},
{value: 'politique', label: 'Équipe politique'},
{value: 'conseiller', label: "Bureau d'études"},
{value: 'partenaire', label: 'Partenaire'},
];

const niveauAcces: {value: TNiveauAcces; label: string}[] = [
{value: 'admin', label: 'Admin'},
{value: 'edition', label: 'Édition'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const fakeAdmin: Membre = {
prenom: 'Dodo',
email: '[email protected]',
telephone: '06 46 82 45 85',
fonction: 'referent',
fonction: 'conseiller',
champ_intervention: ['cae'],
details_fonction: 'Cheffe de projet PCAET',
niveau_acces: 'admin',
Expand Down
7 changes: 6 additions & 1 deletion app.territoiresentransitions.react/src/types/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ export type TNomCollectivite = NonNullableFields<Views<'named_collectivite'>>;

export type TNiveauAcces = Enums<'niveau_acces'>;

export type TMembreFonction = Enums<'membre_fonction'>;
export type TMembreFonction =
| 'conseiller'
| 'technique'
| 'politique'
| 'partenaire';

0 comments on commit 0e0e924

Please sign in to comment.