From 9b8adafe60c249e0516b8806546d628da44604bf Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 16:04:10 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20suivi=20des=20op=C3=A9rations=20sp?= =?UTF-8?q?=C3=A9cifiques=20dans=20les=20vues=20DAD=20et=20GdT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DecisionSupportFilePage.tsx | 6 ++- .../DecisionSupportFilePage/TimelinePanel.tsx | 36 ++++++++++++++++++ .../WorkgroupPage/TimelinePanel.tsx | 37 +++++++++++++++++++ .../WorkgroupPage/WorkgroupPage.tsx | 8 +++- 4 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 client/src/components/DecisionSupportFilePage/TimelinePanel.tsx create mode 100644 client/src/components/WorkgroupPage/TimelinePanel.tsx diff --git a/client/src/components/DecisionSupportFilePage/DecisionSupportFilePage.tsx b/client/src/components/DecisionSupportFilePage/DecisionSupportFilePage.tsx index daf112a..a2dd2fa 100644 --- a/client/src/components/DecisionSupportFilePage/DecisionSupportFilePage.tsx +++ b/client/src/components/DecisionSupportFilePage/DecisionSupportFilePage.tsx @@ -9,6 +9,7 @@ import { useDecisionSupportFiles } from '../../gql/queries/dsf'; import { useCreateDecisionSupportFileMutation, useUpdateDecisionSupportFileMutation } from '../../gql/mutations/dsf'; import { OptionsSection } from './OptionsSection'; import { useIsAuthorized } from '../../gql/queries/authorization'; +import { TimelinePanel } from './TimelinePanel'; export interface DecisionSupportFilePageProps { @@ -127,7 +128,7 @@ export const DecisionSupportFilePage: FunctionComponent
-
+
  • -
    +
    +
diff --git a/client/src/components/DecisionSupportFilePage/TimelinePanel.tsx b/client/src/components/DecisionSupportFilePage/TimelinePanel.tsx new file mode 100644 index 0000000..a537abf --- /dev/null +++ b/client/src/components/DecisionSupportFilePage/TimelinePanel.tsx @@ -0,0 +1,36 @@ +import React, { FunctionComponent, useState } from 'react'; +import { DecisionSupportFile } from '../../types/decision'; +import { Timeline } from '../Timeline'; +import { useEvents } from '../../gql/queries/event'; + +export interface TimelinePanelProps { + dsf: DecisionSupportFile, +}; + +export const TimelinePanel: FunctionComponent = ({ dsf }) => { + const { events } = useEvents({ + variables: { + filter: { + objectType: 'dsf', + objectId: dsf.id + } + } + }); + + return ( +
+

+

+
+ Suivi des opérations +
+
+
+
+

+
+ +
+
+ ); +}; \ No newline at end of file diff --git a/client/src/components/WorkgroupPage/TimelinePanel.tsx b/client/src/components/WorkgroupPage/TimelinePanel.tsx new file mode 100644 index 0000000..0f52f62 --- /dev/null +++ b/client/src/components/WorkgroupPage/TimelinePanel.tsx @@ -0,0 +1,37 @@ +import React, { FunctionComponent, useState } from 'react'; +import { DecisionSupportFile } from '../../types/decision'; +import { Timeline } from '../Timeline'; +import { useEvents } from '../../gql/queries/event'; +import { Workgroup } from '../../types/workgroup'; + +export interface TimelinePanelProps { + workgroup: Workgroup, +}; + +export const TimelinePanel: FunctionComponent = ({ workgroup }) => { + const { events } = useEvents({ + variables: { + filter: { + objectType: 'workgroup', + objectId: workgroup.id + } + } + }); + + return ( +
+

+

+
+ Suivi des opérations +
+
+
+
+

+
+ +
+
+ ); +}; \ No newline at end of file diff --git a/client/src/components/WorkgroupPage/WorkgroupPage.tsx b/client/src/components/WorkgroupPage/WorkgroupPage.tsx index 218ec69..b9f74b3 100644 --- a/client/src/components/WorkgroupPage/WorkgroupPage.tsx +++ b/client/src/components/WorkgroupPage/WorkgroupPage.tsx @@ -9,6 +9,7 @@ import { User } from '../../types/user'; import { InfoPanel } from './InfoPanel'; import { Workgroup } from '../../types/workgroup'; import { useJoinWorkgroupMutation, useLeaveWorkgroupMutation, useCloseWorkgroupMutation } from '../../gql/mutations/workgroups'; +import { TimelinePanel } from './TimelinePanel'; export function WorkgroupPage() { const { id } = useParams(); @@ -134,12 +135,15 @@ export function WorkgroupPage() {
-
+
-
+
+
+ +