-
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
🎨 Redesign référentiels page #3514
Changes from all commits
5bee024
8e7c205
c57a8d5
2ce22be
bacb585
f621af4
c91fe6e
b043de0
bbf4344
55db36f
d2bfe6f
f26eea1
fca80ed
6a0bed1
49cbae0
b36ba14
371ee11
188159d
06dfa74
bf00b83
d284bc9
6299650
d996e5d
cf93867
c942468
4fe0ce2
d441466
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,22 +9,84 @@ import { | |
useReferentielId, | ||
useReferentielVue, | ||
} from '@/app/core-logic/hooks/params'; | ||
import { ReferentielOfIndicateur } from '@/app/types/litterals'; | ||
import { Tab, Tabs } from '@/app/ui/shared/Tabs'; | ||
import { Referentiel, ReferentielOfIndicateur } from '@/app/types/litterals'; | ||
import { Tab, Tabs } from '@/ui'; | ||
import { useRouter } from 'next/navigation'; | ||
import { useReferentielDownToAction } from '../../../../core-logic/hooks/referentiel'; | ||
import ActionProgressBar from '../../../../ui/referentiels/ActionProgressBar'; | ||
import { Counter } from '../../../../ui/referentiels/Counter'; | ||
import AidePriorisation from '../AidePriorisation'; | ||
import DetailTacheTable from '../DetailTaches'; | ||
import Progression from './Referentiels'; | ||
import ActionsReferentiels from './Referentiels'; | ||
|
||
const TABS_INDEX: Record<ReferentielVueParamOption, number> = { | ||
progression: 0, | ||
priorisation: 1, | ||
detail: 2, | ||
}; | ||
|
||
/** | ||
* Affiche les onglets des vues tabulaires sur le référentiel | ||
*/ | ||
const ReferentielHeader = ({ | ||
referentielId, | ||
className, | ||
}: { | ||
referentielId: ReferentielParamOption; | ||
className?: string; | ||
}) => { | ||
const current = referentielId ?? 'eci'; | ||
const actions = useReferentielDownToAction(current as Referentiel); | ||
const referentiel = actions.find((a) => a.type === 'referentiel')!; | ||
|
||
return ( | ||
<div className={className}> | ||
<h2 className="mb-4"> | ||
Référentiel{' '} | ||
{referentielToName[referentielId as ReferentielOfIndicateur]} | ||
</h2> | ||
{/*****************************************/} | ||
{/* */} | ||
{/* For future use: start */} | ||
{/* (Figer une version du référentiel) */} | ||
{/* */} | ||
{/*****************************************/} | ||
Comment on lines
+45
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Magnifique panneau There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha merci, j'y ai mis toute mon âme artistique |
||
|
||
{/* <div className="flex gap-x-4"> */} | ||
{/* <Select | ||
options={[]} | ||
onChange={() => {}} | ||
values={[]} | ||
customItem={(v) => <span className="text-grey-8">{v.label}</span>} | ||
small | ||
/> | ||
<Button | ||
icon="save-3-line" | ||
size="sm" | ||
className="whitespace-nowrap min-w-fit" | ||
> | ||
Figer le référentiel | ||
</Button> */} | ||
{/* </div> */} | ||
|
||
{/**********************************/} | ||
{/* */} | ||
{/* For future use: end */} | ||
{/* */} | ||
{/**********************************/} | ||
|
||
{referentiel && ( | ||
<div className="flex items-center gap-4 pb-4 mb-4 border-b border-primary-3"> | ||
<div className="grow"> | ||
<ActionProgressBar | ||
action={referentiel} | ||
progressBarStyleOptions={{ fullWidth: true }} | ||
/> | ||
</div> | ||
<Counter actionId={referentiel.id} className="ml-auto" /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
const ReferentielTabs = () => { | ||
const collectiviteId = useCollectiviteId(); | ||
const referentielId = useReferentielId() as ReferentielParamOption; | ||
|
@@ -60,31 +122,40 @@ const ReferentielTabs = () => { | |
}; | ||
|
||
return ( | ||
<main className="fr-container fr-mt-4w flex flex-col items-center"> | ||
<h1 className="fr-mb-4w"> | ||
Référentiel{' '} | ||
{referentielToName[referentielId as ReferentielOfIndicateur]} | ||
</h1> | ||
<Tabs | ||
className="w-full" | ||
defaultActiveTab={activeTab} | ||
onChange={handleChange} | ||
> | ||
<Tab label="Progression"> | ||
<Progression /> | ||
</Tab> | ||
<Tab label="Aide à la priorisation"> | ||
{activeTab === TABS_INDEX['priorisation'] ? ( | ||
<AidePriorisation /> | ||
) : ( | ||
'...' | ||
)} | ||
</Tab> | ||
<Tab label="Détail des statuts"> | ||
{activeTab === TABS_INDEX['detail'] ? <DetailTacheTable /> : '...'} | ||
</Tab> | ||
</Tabs> | ||
</main> | ||
<div className="grow bg-grey-2 -mb-8 py-12 px-4 lg:px-6 2xl:px-0"> | ||
<div className="m-auto xl:max-w-[90rem] 2xl:px-6"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ici pour cette div tu pourras utiliser le nouveau compo PageContainer quand il sera merge sur main There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Je me note de faire une PR corrective si jamais cette branche est merge avant celle qui contient PageContainer, merci |
||
<ReferentielHeader referentielId={referentielId} /> | ||
<Tabs | ||
defaultActiveTab={activeTab} | ||
onChange={handleChange} | ||
tabsListClassName="!justify-start pl-0 flex-nowrap bg-transparent" | ||
> | ||
<Tab label="Actions"> | ||
<div className="p-7 border border-primary-2 bg-white rounded-lg"> | ||
<ActionsReferentiels /> | ||
</div> | ||
</Tab> | ||
<Tab label="Aide à la priorisation" className="!text-primary-500"> | ||
{activeTab === TABS_INDEX['priorisation'] ? ( | ||
<div className="p-7 border border-primary-2 bg-white rounded-lg"> | ||
<AidePriorisation /> | ||
</div> | ||
) : ( | ||
'...' | ||
)} | ||
</Tab> | ||
<Tab label="Détail des statuts"> | ||
{activeTab === TABS_INDEX['detail'] ? ( | ||
<div className="p-7 border border-primary-2 bg-white rounded-lg"> | ||
<DetailTacheTable /> | ||
</div> | ||
) : ( | ||
'...' | ||
)} | ||
</Tab> | ||
</Tabs> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
|
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.
Si on met la page de progression dans un dossier à part, on pourrait séparer
ReferentielTabs
etReferentielHeader