@@ -6,6 +6,10 @@ import { IdentityState } from '~/constants/enums'
66export function getDefaultMenuEntries ( ) : MenuItem [ ] {
77 const { getStateBadge } = useIdentityStates ( )
88
9+ function normalizeNameFromLabel ( label : string ) : string {
10+ return label . toLowerCase ( ) . trim ( ) . replace ( / \s + / g, '_' )
11+ }
12+
913 return [
1014 {
1115 icon : 'mdi-account' ,
@@ -14,7 +18,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
1418 path : '/identities/table?sort[metadata.lastUpdatedAt]=desc&skip=0' ,
1519 color : 'primary' ,
1620 badge : { color : 'primary' } ,
17- part : MenuPart . DONNEES ,
21+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
1822 hideInMenuBar : false ,
1923 acl : [ '/management/identities' ] ,
2024 } ,
@@ -24,7 +28,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
2428 name : 'exporter' ,
2529 path : '/identities/export' ,
2630 color : 'accent' ,
27- part : MenuPart . DONNEES ,
31+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
2832 hideInMenuBar : true ,
2933 acl : [ '/management/identities' ] ,
3034 } ,
@@ -34,7 +38,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
3438 name : 'journal_des_jobs' ,
3539 path : '/jobs/table?filters[:state]=-1' ,
3640 color : 'info' ,
37- part : MenuPart . DONNEES ,
41+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
3842 hideInMenuBar : false ,
3943 acl : [ '/core/jobs' ] ,
4044 } ,
@@ -44,7 +48,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
4448 name : 'cycle_de_vie_des_identités' ,
4549 path : '/lifecycles/table' ,
4650 color : 'info' ,
47- part : MenuPart . DONNEES ,
51+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
4852 hideInMenuBar : false ,
4953 acl : [ '/management/lifecycle' ] ,
5054 } ,
@@ -55,7 +59,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
5559 path : '/audits/table' ,
5660 color : 'lime-8' ,
5761 hideInMenuBar : false ,
58- part : MenuPart . DONNEES ,
62+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
5963 acl : [ '/core/audits' ] ,
6064 } ,
6165 {
@@ -64,7 +68,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
6468 name : 'detection_des_doublons' ,
6569 path : '/identities/fusion' ,
6670 color : 'positive' ,
67- part : MenuPart . DONNEES ,
71+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
6872 hideInMenuBar : true ,
6973 acl : [ '/management/identities' ] ,
7074 } ,
@@ -75,7 +79,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
7579 path : '/identities/trash' ,
7680 color : 'grey-10' ,
7781 hideInMenuBar : true ,
78- part : MenuPart . DONNEES ,
82+ part : normalizeNameFromLabel ( MenuPart . DONNEES ) ,
7983 acl : [ '/management/identities' ] ,
8084 } ,
8185 {
@@ -86,7 +90,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
8690 color : 'warning' ,
8791 textColor : 'black' ,
8892 badge : getStateBadge ( IdentityState . TO_VALIDATE ) ,
89- part : MenuPart . ETATS ,
93+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
9094 hideInMenuBar : false ,
9195 acl : [ '/management/identities' ] ,
9296 } ,
@@ -98,7 +102,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
98102 color : 'secondary' ,
99103 textColor : 'black' ,
100104 badge : getStateBadge ( IdentityState . TO_COMPLETE ) ,
101- part : MenuPart . ETATS ,
105+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
102106 hideInMenuBar : false ,
103107 acl : [ '/management/identities' ] ,
104108 } ,
@@ -109,7 +113,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
109113 path : `/identities/table?readonly=1&sort[metadata.lastUpdatedAt]=desc&skip=0&filters[%23state]=${ IdentityState . TO_SYNC } ` ,
110114 color : 'orange-8' ,
111115 badge : getStateBadge ( IdentityState . TO_SYNC ) ,
112- part : MenuPart . ETATS ,
116+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
113117 hideInMenuBar : false ,
114118 acl : [ '/management/identities' ] ,
115119 } ,
@@ -120,7 +124,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
120124 path : `/identities/table?readonly=1&sort[metadata.lastUpdatedAt]=desc&skip=0&filters[%23state]=${ IdentityState . PROCESSING } ` ,
121125 color : 'grey-8' ,
122126 badge : getStateBadge ( IdentityState . PROCESSING ) ,
123- part : MenuPart . ETATS ,
127+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
124128 hideInMenuBar : false ,
125129 acl : [ '/management/identities' ] ,
126130 } ,
@@ -131,7 +135,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
131135 path : `/identities/table?sort[metadata.lastUpdatedAt]=desc&skip=0&filters[%23state]=${ IdentityState . SYNCED } ` ,
132136 badge : getStateBadge ( IdentityState . SYNCED ) ,
133137 color : 'positive' ,
134- part : MenuPart . ETATS ,
138+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
135139 hideInMenuBar : false ,
136140 acl : [ '/management/identities' ] ,
137141 } ,
@@ -146,7 +150,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
146150 color : 'linear-gradient(135deg, #7C3AED 0%, #EC4899 50%, #F97316 100%)' ,
147151 textColor : 'white' ,
148152 } ,
149- part : MenuPart . ETATS ,
153+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
150154 hideInMenuBar : false ,
151155 acl : [ '/management/identities' ] ,
152156 } ,
@@ -157,7 +161,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
157161 path : `/identities/table?sort[metadata.lastUpdatedAt]=desc&skip=0&filters[%23state]=${ IdentityState . ON_ERROR } ` ,
158162 color : 'negative' ,
159163 badge : getStateBadge ( IdentityState . ON_ERROR ) ,
160- part : MenuPart . ETATS ,
164+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
161165 hideInMenuBar : false ,
162166 acl : [ '/management/identities' ] ,
163167 } ,
@@ -168,7 +172,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
168172 path : `/identities/table?sort[metadata.lastUpdatedAt]=desc&skip=0&filters[%23state]=${ IdentityState . DONT_SYNC } ` ,
169173 color : 'black' ,
170174 badge : getStateBadge ( IdentityState . DONT_SYNC ) ,
171- part : MenuPart . ETATS ,
175+ part : normalizeNameFromLabel ( MenuPart . ETATS ) ,
172176 hideInMenuBar : false ,
173177 acl : [ '/management/identities' ] ,
174178 } ,
@@ -178,7 +182,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
178182 name : 'invitations_non_envoyées' ,
179183 path : '/identities/table?limit=10&skip=0&filters[%23initState]=0&sort[metadata.lastUpdatedAt]=desc' ,
180184 color : 'negative' ,
181- part : MenuPart . ACTIVATION ,
185+ part : normalizeNameFromLabel ( MenuPart . ACTIVATION ) ,
182186 badge : { color : 'negative' } ,
183187 hideInMenuBar : false ,
184188 acl : [ '/management/identities' ] ,
@@ -190,7 +194,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
190194 path : '/identities/table?limit=10&skip=0&filters[%23initState]=1&sort[metadata.lastUpdatedAt]=desc' ,
191195 color : 'warning' ,
192196 textColor : 'black' ,
193- part : MenuPart . ACTIVATION ,
197+ part : normalizeNameFromLabel ( MenuPart . ACTIVATION ) ,
194198 badge : { color : 'warning' , textColor : 'black' } ,
195199 hideInMenuBar : false ,
196200 acl : [ '/management/identities' ] ,
@@ -202,7 +206,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
202206 path : '/identities/table?limit=10&skip=0&filters[%23initState]=2&sort[metadata.lastUpdatedAt]=desc' ,
203207 color : 'positive' ,
204208 textColor : 'white' ,
205- part : MenuPart . ACTIVATION ,
209+ part : normalizeNameFromLabel ( MenuPart . ACTIVATION ) ,
206210 badge : { color : 'positive' } ,
207211 hideInMenuBar : false ,
208212 acl : [ '/management/identities' ] ,
@@ -213,7 +217,7 @@ export function getDefaultMenuEntries(): MenuItem[] {
213217 name : 'invitations_périmées' ,
214218 path : '/identities/outdated' ,
215219 color : 'accent' ,
216- part : MenuPart . ACTIVATION ,
220+ part : normalizeNameFromLabel ( MenuPart . ACTIVATION ) ,
217221 hideInMenuBar : false ,
218222 acl : [ '/management/identities' ] ,
219223 } ,
0 commit comments