From 615f94d6e4fddcecf16f1691560966ba2574b4b0 Mon Sep 17 00:00:00 2001
From: VioMrqs <27735540+VioMrqs@users.noreply.github.com>
Date: Wed, 18 Sep 2024 15:25:20 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Pas=20vraiment=20un=20fix=20sur?=
=?UTF-8?q?=20la=20timeline?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/components/timeline/Timeline.tsx | 4 +-
.../timeline/components/DesignationItem.tsx | 87 ++++++++++---------
.../helpers/extractDesignationItemProps.ts | 2 +
3 files changed, 50 insertions(+), 43 deletions(-)
diff --git a/packages/applications/legacy/src/views/components/timeline/Timeline.tsx b/packages/applications/legacy/src/views/components/timeline/Timeline.tsx
index 61cc2dbdc7..1101dce2d2 100644
--- a/packages/applications/legacy/src/views/components/timeline/Timeline.tsx
+++ b/packages/applications/legacy/src/views/components/timeline/Timeline.tsx
@@ -44,7 +44,7 @@ import { IdentifiantProjet } from '@potentiel-domain/common';
export type TimelineProps = {
projectEventList: ProjectEventListDTO;
- identifiantProjet: IdentifiantProjet.RawType
+ identifiantProjet: IdentifiantProjet.RawType;
};
type ItemProps =
@@ -67,7 +67,7 @@ export const Timeline = ({
events,
project: { status },
},
- identifiantProjet
+ identifiantProjet,
}: TimelineProps) => {
const itemProps: ItemProps[] = [
extractDesignationItemProps(events, status, identifiantProjet),
diff --git a/packages/applications/legacy/src/views/components/timeline/components/DesignationItem.tsx b/packages/applications/legacy/src/views/components/timeline/components/DesignationItem.tsx
index aa879c5416..a2f3f32f21 100644
--- a/packages/applications/legacy/src/views/components/timeline/components/DesignationItem.tsx
+++ b/packages/applications/legacy/src/views/components/timeline/components/DesignationItem.tsx
@@ -1,54 +1,59 @@
import React from 'react';
import { ItemDate, PastIcon, ItemTitle, ContentArea } from '.';
import { DesignationItemProps } from '../helpers/extractDesignationItemProps';
-import { DownloadLink } from '../..';
-import { afficherDate } 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) => (
- <>
-
-
-
-
- {certificate ? (
-
- ) : (
- role === 'porteur-projet' && Votre attestation sera disponible sous 24h
- )}
-
- >
-);
-
-type CertificateProps = {
- certificate: Exclude;
- projectStatus: DesignationItemProps['projectStatus'];
+ identifiantProjet,
+}: DesignationItemProps) => {
+ return (
+ <>
+
+
+
+
+ {/* */}
+
+ >
+ );
};
-const Certificate = ({ certificate, projectStatus }: CertificateProps) => {
- const { status } = certificate;
+// type CertificateProps = {
+// certificate?: Exclude;
+// projectStatus: DesignationItemProps['projectStatus'];
+// identifiantProjet: DesignationItemProps['identifiantProjet'];
+// };
- if (status === 'not-applicable') {
- return Attestation non disponible pour cette période;
- }
+// const Attestation = ({ certificate, projectStatus, identifiantProjet }: CertificateProps) => {
+// const { status } = certificate;
- const { url: fileUrl, date } = certificate;
+// if (status === 'not-applicable') {
+// return Attestation non disponible pour cette période;
+// }
- 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 (
- {`Télécharger l'${urlTitle} le ${afficherDate(
- date,
- )})`}
- );
-};
+//const { url: fileUrl, date } = certificate;
+
+// 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 (
+//
+// {`Télécharger l'${urlTitle}}) le ${afficherDate(
+// date,)})`}
+//
+// );
+// };
diff --git a/packages/applications/legacy/src/views/components/timeline/helpers/extractDesignationItemProps.ts b/packages/applications/legacy/src/views/components/timeline/helpers/extractDesignationItemProps.ts
index 02db7306c6..fe23d6e65f 100644
--- a/packages/applications/legacy/src/views/components/timeline/helpers/extractDesignationItemProps.ts
+++ b/packages/applications/legacy/src/views/components/timeline/helpers/extractDesignationItemProps.ts
@@ -9,6 +9,8 @@ import { or } from '../../../../core/utils';
import { Routes } from '@potentiel-applications/routes';
import { IdentifiantProjet } from '@potentiel-domain/common';
+// TODO: reprendre cette partie
+
export type DesignationItemProps = {
type: 'designation';
date: number;