-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#273 more config on home #274
base: #265-add-tab-for-referencedPublications
Are you sure you want to change the base?
#273 more config on home #274
Conversation
@@ -43,7 +44,25 @@ export default function Home(props: Props) { | |||
const statsCases = config.home.statistics.catgegories as Array<availableStat>; | |||
|
|||
type availableUseCase = "declareReferent" | "editSoftware" | "addSoftwareOrService"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
majuscule pour les types , c'est les useCase de quoi ? ça mériterait peut-être d'apparaitre dans le nom :
type availableUseCase = "declareReferent" | "editSoftware" | "addSoftwareOrService"; | |
type AvailableUseCase = "declareReferent" | "editSoftware" | "addSoftwareOrService"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui, j'ai vu qu'on avait laisser passé ça d'une ancienne PR 😅
const keys: Array<availableUseCase> = Object.keys( | ||
configUseCases | ||
) as Array<availableUseCase>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const keys: Array<availableUseCase> = Object.keys( | |
configUseCases | |
) as Array<availableUseCase>; | |
const keys = Object.keys( | |
configUseCases | |
) as AvailableUseCase[]; |
const useCases: Array<availableUseCase> = keys.reduce( | ||
(accumulator: Array<availableUseCase>, key: availableUseCase) => { | ||
return configUseCases[key].enabled ? accumulator.concat([key]) : accumulator; | ||
}, | ||
[] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En fait c'est juste un filtre ça :
const useCases: Array<availableUseCase> = keys.reduce( | |
(accumulator: Array<availableUseCase>, key: availableUseCase) => { | |
return configUseCases[key].enabled ? accumulator.concat([key]) : accumulator; | |
}, | |
[] | |
); | |
const useCases = keys.filter(useCaseName => configUseCases[useCaseName].enabled) |
closes #273