-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Intégration des modifications de la release 3.30 (#2227)
- Loading branch information
Showing
23 changed files
with
496 additions
and
230 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
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
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
82 changes: 45 additions & 37 deletions
82
packages/applications/legacy/src/views/components/timeline/components/DesignationItem.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 |
---|---|---|
@@ -1,54 +1,62 @@ | ||
import React from 'react'; | ||
import { ItemDate, PastIcon, ItemTitle, ContentArea } from '.'; | ||
import { DesignationItemProps } from '../helpers/extractDesignationItemProps'; | ||
import { DownloadLink } from '../..'; | ||
import { afficherDate } from '../../../helpers'; | ||
import { Routes } from '@potentiel-applications/routes'; | ||
import { DownloadLink, DownloadLinkButton } from '../../UI'; | ||
import { DesignationItemProps } from '../helpers'; | ||
|
||
// TODO: revoir cette partie | ||
// en trouvant la date de génération (date de notification) ? | ||
|
||
export const DesignationItem = ({ | ||
certificate, | ||
role, | ||
date, | ||
projectStatus, | ||
}: DesignationItemProps) => ( | ||
<> | ||
<PastIcon /> | ||
<ContentArea> | ||
<ItemDate date={date} /> | ||
<ItemTitle title="Notification des résultats" /> | ||
{certificate ? ( | ||
<Certificate {...{ certificate, role, projectStatus }} /> | ||
) : ( | ||
role === 'porteur-projet' && <span>Votre attestation sera disponible sous 24h</span> | ||
)} | ||
</ContentArea> | ||
</> | ||
); | ||
identifiantProjet, | ||
}: DesignationItemProps) => { | ||
return ( | ||
<> | ||
<PastIcon /> | ||
<ContentArea> | ||
<ItemDate date={date} /> | ||
<ItemTitle title="Notification des résultats" /> | ||
<Attestation projectStatus={projectStatus} identifiantProjet={identifiantProjet} /> | ||
</ContentArea> | ||
</> | ||
); | ||
}; | ||
|
||
type CertificateProps = { | ||
certificate: Exclude<DesignationItemProps['certificate'], undefined>; | ||
// certificate?: Exclude<DesignationItemProps['certificate'], undefined>; | ||
projectStatus: DesignationItemProps['projectStatus']; | ||
identifiantProjet: DesignationItemProps['identifiantProjet']; | ||
}; | ||
|
||
const Certificate = ({ certificate, projectStatus }: CertificateProps) => { | ||
const { status } = certificate; | ||
const Attestation = ({ projectStatus, identifiantProjet }: CertificateProps) => { | ||
// const { status } = certificate; | ||
|
||
// if (status === 'not-applicable') { | ||
// return <span>Attestation non disponible pour cette période</span>; | ||
// } | ||
|
||
// const { url: fileUrl, date } = certificate; | ||
|
||
if (status === 'not-applicable') { | ||
return <span>Attestation non disponible pour cette période</span>; | ||
} | ||
// const urlTitle = | ||
// projectStatus === 'Eliminé' | ||
// ? status === 'generated' | ||
// ? `avis de rejet (édité` | ||
// : `avis de rejet (transmis` | ||
// : status === 'generated' | ||
// ? `attestation de désignation (éditée` | ||
// : `attestation de désignation (transmise`; | ||
|
||
const { url: fileUrl, date } = certificate; | ||
const urlTitle = projectStatus === 'Eliminé' ? "l'avis de rejet" : "l'attestation de désignation"; | ||
|
||
const urlTitle = | ||
projectStatus === 'Eliminé' | ||
? status === 'generated' | ||
? `avis de rejet (édité` | ||
: `avis de rejet (transmis` | ||
: status === 'generated' | ||
? `attestation de désignation (éditée` | ||
: `attestation de désignation (transmise`; | ||
return ( | ||
<DownloadLink {...{ fileUrl }}>{`Télécharger l'${urlTitle} le ${afficherDate( | ||
date, | ||
)})`}</DownloadLink> | ||
<DownloadLink | ||
fileUrl={Routes.Candidature.téléchargerAttestation(identifiantProjet)} | ||
className="m-auto" | ||
> | ||
Télécharger {urlTitle} | ||
{/* {`Télécharger l'${urlTitle}}) le ${afficherDate(date)})`} */} | ||
</DownloadLink> | ||
); | ||
}; |
125 changes: 0 additions & 125 deletions
125
...ications/legacy/src/views/components/timeline/helpers/extractDesignationItemProps.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.