Merge branch 'develop' into dist/ubuntu/bionic/develop
This commit is contained in:
commit
1a0456ee84
@ -18,18 +18,31 @@ export function Dashboard() {
|
||||
|
||||
return (
|
||||
<div className="columns">
|
||||
<div className="column is-5">
|
||||
<div className="box">
|
||||
<h3 className="is-size-3 mb-3">Ces 7 derniers jours</h3>
|
||||
<Timeline events={events} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="column is-4">
|
||||
<DecisionSupportFilePanel />
|
||||
</div>
|
||||
<div className="column is-3">
|
||||
<div className="column is-4">
|
||||
<WorkgroupsPanel />
|
||||
</div>
|
||||
<div className="column is-4">
|
||||
<div className="panel is-info">
|
||||
<p className="level panel-heading mb-0">
|
||||
<div className="level-left">
|
||||
<div className="level-item">
|
||||
Ces 7 derniers jours
|
||||
</div>
|
||||
</div>
|
||||
<div className="level-right">
|
||||
<button disabled={true} className="button level-item is-outlined is-info is-inverted">
|
||||
<i className="icon fa fa-sliders-h"></i>
|
||||
</button>
|
||||
</div>
|
||||
</p>
|
||||
<div className="panel-block">
|
||||
<Timeline events={events} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -88,7 +88,7 @@ export const ItemPanel: FunctionComponent<ItemPanelProps> = (props) => {
|
||||
</div>
|
||||
<div className="panel-block">
|
||||
<p className="control has-icons-left">
|
||||
<input className="input" type="text" placeholder="Filtrer..." />
|
||||
<input disabled={true} className="input" type="text" placeholder="Filtrer..." />
|
||||
<span className="icon is-left">
|
||||
<i className="fas fa-search" aria-hidden="true"></i>
|
||||
</span>
|
||||
|
@ -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<DecisionSupportFilePageP
|
||||
</div>
|
||||
</section>
|
||||
<div className="columns mt-3">
|
||||
<div className="column is-9">
|
||||
<div className="column is-8">
|
||||
<div className="tabs is-medium is-toggle">
|
||||
<ul>
|
||||
<li className={`has-background-white ${state.selectedTabIndex === 0 ? 'is-active': ''}`}
|
||||
@ -164,9 +165,10 @@ export const DecisionSupportFilePage: FunctionComponent<DecisionSupportFilePageP
|
||||
null
|
||||
}
|
||||
</div>
|
||||
<div className="column is-3">
|
||||
<div className="column is-4">
|
||||
<MetadataPanel readOnly={!isAuthorized} dsf={state.dsf} updateDSF={updateDSF} />
|
||||
<AppendixPanel dsf={state.dsf} />
|
||||
<TimelinePanel dsf={state.dsf} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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<TimelinePanelProps> = ({ dsf }) => {
|
||||
const { events } = useEvents({
|
||||
variables: {
|
||||
filter: {
|
||||
objectType: 'dsf',
|
||||
objectId: dsf.id
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="panel">
|
||||
<p className="level panel-heading mb-0">
|
||||
<div className="level-left">
|
||||
<div className="level-item">
|
||||
Suivi des opérations
|
||||
</div>
|
||||
</div>
|
||||
<div className="level-right">
|
||||
</div>
|
||||
</p>
|
||||
<div className="panel-block">
|
||||
<Timeline events={events} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
@ -13,7 +13,7 @@ export const Timeline: FunctionComponent<TimelineProps> = ({ events }) => {
|
||||
events = debounceEvents(events) || [];
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="timeline">
|
||||
<div className="timeline" style={{width: '100%'}}>
|
||||
{
|
||||
events.map(evt => {
|
||||
return (
|
||||
@ -29,7 +29,7 @@ export const Timeline: FunctionComponent<TimelineProps> = ({ events }) => {
|
||||
}
|
||||
{
|
||||
events.length === 0 ?
|
||||
<p className="has-text-centered is-italic">Aucun évènement.</p> :
|
||||
<p className="has-text-centered is-italic mb-1 mt-1">Aucun évènement.</p> :
|
||||
null
|
||||
}
|
||||
</div>
|
||||
|
37
client/src/components/WorkgroupPage/TimelinePanel.tsx
Normal file
37
client/src/components/WorkgroupPage/TimelinePanel.tsx
Normal file
@ -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<TimelinePanelProps> = ({ workgroup }) => {
|
||||
const { events } = useEvents({
|
||||
variables: {
|
||||
filter: {
|
||||
objectType: 'workgroup',
|
||||
objectId: workgroup.id
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="panel">
|
||||
<p className="level panel-heading mb-0">
|
||||
<div className="level-left">
|
||||
<div className="level-item">
|
||||
Suivi des opérations
|
||||
</div>
|
||||
</div>
|
||||
<div className="level-right">
|
||||
</div>
|
||||
</p>
|
||||
<div className="panel-block">
|
||||
<Timeline events={events} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
@ -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() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
<div className="column is-4">
|
||||
<InfoPanel workgroup={state.workgroup as Workgroup} />
|
||||
</div>
|
||||
<div className="column">
|
||||
<div className="column is-4">
|
||||
<MembersPanel users={state.workgroup.members as User[]} />
|
||||
</div>
|
||||
<div className="column is-4">
|
||||
<TimelinePanel workgroup={state.workgroup} />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user