From fb954a3e5be54c3b7978b7036904c43fee55261a Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 15:18:35 +0200 Subject: [PATCH 1/5] =?UTF-8?q?R=C3=A9organisation=20visuelle=20du=20table?= =?UTF-8?q?au=20de=20bord?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DashboardPage/Dashboard.tsx | 27 ++++++++++++++----- .../components/DashboardPage/ItemPanel.tsx | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/client/src/components/DashboardPage/Dashboard.tsx b/client/src/components/DashboardPage/Dashboard.tsx index 528e026..8ffeabf 100644 --- a/client/src/components/DashboardPage/Dashboard.tsx +++ b/client/src/components/DashboardPage/Dashboard.tsx @@ -18,18 +18,31 @@ export function Dashboard() { return (
-
-
-

Ces 7 derniers jours

- -
-
-
+
+
+
+

+

+
+ Ces 7 derniers jours +
+
+
+ +
+

+
+ +
+
+
); } \ No newline at end of file diff --git a/client/src/components/DashboardPage/ItemPanel.tsx b/client/src/components/DashboardPage/ItemPanel.tsx index d84860d..84211af 100644 --- a/client/src/components/DashboardPage/ItemPanel.tsx +++ b/client/src/components/DashboardPage/ItemPanel.tsx @@ -88,7 +88,7 @@ export const ItemPanel: FunctionComponent = (props) => {

- + From f4528dd087c0f2d84bdbafc236103831fa5362f2 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 15:49:09 +0200 Subject: [PATCH 2/5] Correction affichage nom utilisateur dans la newsletter --- internal/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index c773539..d6f8c47 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -154,7 +154,7 @@ func NewDefault() *Config { BaseURL: "http://localhost:8080", ContentTemplate: dedent.Dedent(` {{- $root := . -}} - Bonjour {{ .User.Name }}, + Bonjour{{if .User.Name}} {{ .User.Name }}{{end}}, {{ if not .HasEvents -}} Aucun évènement notoire ces derniers jours. From 27720219eef088b98a8a26440ef9b76686da875e Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 15:49:32 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Correction=20d=C3=A9tection=20de=20la=20ses?= =?UTF-8?q?sion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/hooks/useLoggedIn.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/hooks/useLoggedIn.tsx b/client/src/hooks/useLoggedIn.tsx index 2764c04..4d4a432 100644 --- a/client/src/hooks/useLoggedIn.tsx +++ b/client/src/hooks/useLoggedIn.tsx @@ -9,13 +9,12 @@ export const useLoggedIn = () => { }; export function saveLoggedIn(loggedIn: boolean) { - console.log("saveLoggedIn", JSON.stringify(loggedIn)) - window.sessionStorage.setItem(LOGGED_IN_KEY, JSON.stringify(loggedIn)); + window.localStorage.setItem(LOGGED_IN_KEY, JSON.stringify(loggedIn)); } export function getSavedLoggedIn(): boolean { try { - const loggedIn = JSON.parse(window.sessionStorage.getItem(LOGGED_IN_KEY)); + const loggedIn = JSON.parse(window.localStorage.getItem(LOGGED_IN_KEY)); return !!loggedIn; } catch(err) { return false; From a3fa79370649ceb7f8da980a14b15a4947290866 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 15:50:01 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Correction=20mise=20=C3=A0=20forme=20de=20l?= =?UTF-8?q?a=20timeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Timeline.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Timeline.tsx b/client/src/components/Timeline.tsx index 036f352..4da19fc 100644 --- a/client/src/components/Timeline.tsx +++ b/client/src/components/Timeline.tsx @@ -13,7 +13,7 @@ export const Timeline: FunctionComponent = ({ events }) => { events = debounceEvents(events) || []; return ( -

+
{ events.map(evt => { return ( @@ -29,7 +29,7 @@ export const Timeline: FunctionComponent = ({ events }) => { } { events.length === 0 ? -

Aucun évènement.

: +

Aucun évènement.

: null }
From 9b8adafe60c249e0516b8806546d628da44604bf Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 16:04:10 +0200 Subject: [PATCH 5/5] =?UTF-8?q?Ajout=20du=20suivi=20des=20op=C3=A9rations?= =?UTF-8?q?=20sp=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() {
-
+
-
+
+
+ +