-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajoute les informations de création et modification dans le header pl…
…utôt que la colonne de la FA et renomme le dossier header
- Loading branch information
Showing
7 changed files
with
61 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
...c/app/pages/collectivite/PlansActions/FicheAction/FicheActionHeader/FicheActionHeader.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...entransitions.react/src/app/pages/collectivite/PlansActions/FicheAction/Header/Header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { format } from 'date-fns'; | ||
|
||
import { FicheAction } from '@/api/plan-actions'; | ||
|
||
import { Icon } from '@/ui'; | ||
|
||
import CheminsFiche from './CheminsFiche'; | ||
import TitreFiche from './TitreFiche'; | ||
|
||
type FicheActionHeaderProps = { | ||
fiche: FicheAction; | ||
isReadonly: boolean; | ||
updateTitle: (value: string | null) => void; | ||
}; | ||
|
||
const Header = ({ fiche, updateTitle, isReadonly }: FicheActionHeaderProps) => { | ||
const { titre, collectiviteId, axes } = fiche; | ||
|
||
return ( | ||
<div className="w-full mb-10" data-test="fiche-header"> | ||
{/* Titre éditable de la fiche action */} | ||
<TitreFiche | ||
titre={titre} | ||
isReadonly={isReadonly} | ||
updateTitle={updateTitle} | ||
/> | ||
|
||
{/* Fils d'ariane avec emplacements de la fiche */} | ||
<CheminsFiche titre={titre} collectiviteId={collectiviteId} axes={axes} /> | ||
|
||
{/* Création et modification de la fiche */} | ||
<div className="flex max-md:flex-col gap-2 items-center mt-3 py-3 text-sm text-grey-8 border-y boder-primary-3"> | ||
{fiche.modifiedAt && ( | ||
<div className="flex gap-1"> | ||
<Icon icon="calendar-2-line" size="sm" /> | ||
Modifiée le {format( | ||
new Date(fiche.modifiedAt), | ||
'dd/MM/yyyy' | ||
)} par {fiche.modifiedBy?.prenom} {fiche.modifiedBy?.nom} | ||
</div> | ||
)} | ||
<div className="max-md:hidden w-[1px] h-5 bg-grey-5" /> | ||
{fiche.createdAt && ( | ||
<div className="flex gap-1"> | ||
<Icon icon="file-add-line" size="sm" /> | ||
Créée le {format(new Date(fiche.createdAt), 'dd/MM/yyyy')} par{' '} | ||
{fiche.createdBy?.prenom} {fiche.createdBy?.nom} | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Header; |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...esentransitions.react/src/app/pages/collectivite/PlansActions/FicheAction/Header/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './Header'; |