From 9f86610e6cf479e7d7ed84c878d0126b5f66605d Mon Sep 17 00:00:00 2001 From: Yaninck DUTHE Date: Fri, 11 Jun 2021 11:52:11 +0200 Subject: [PATCH 1/6] First test to publish frontend gl project --- src/frontend/boilerplates/archipelago/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/boilerplates/archipelago/.env b/src/frontend/boilerplates/archipelago/.env index 58ca156ea..5ca5fa0ca 100644 --- a/src/frontend/boilerplates/archipelago/.env +++ b/src/frontend/boilerplates/archipelago/.env @@ -1,3 +1,3 @@ -REACT_APP_MIDDLEWARE_URL=http://localhost:3000/ +REACT_APP_MIDDLEWARE_URL=https://data.gl.flod.io/ REACT_APP_MAPBOX_ACCESS_TOKEN= PORT=5000 From 48fa81f9ef5d3a953b99ce65bf2550fd4cea3604 Mon Sep 17 00:00:00 2001 From: Yaninck DUTHE Date: Fri, 11 Jun 2021 23:21:27 +0200 Subject: [PATCH 2/6] [GL] Change semapps title --- src/frontend/boilerplates/archipelago/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/boilerplates/archipelago/src/App.js b/src/frontend/boilerplates/archipelago/src/App.js index ec5834869..fe2f81489 100644 --- a/src/frontend/boilerplates/archipelago/src/App.js +++ b/src/frontend/boilerplates/archipelago/src/App.js @@ -18,7 +18,7 @@ const App = () => ( Date: Wed, 16 Jun 2021 16:27:45 +0200 Subject: [PATCH 3/6] [GL] Add project partOf project --- .../src/resources/Agent/Activity/Project/ProjectEdit.js | 3 ++- .../src/resources/Agent/Activity/Project/ProjectShow.js | 7 +++++++ .../src/resources/Agent/Activity/Project/index.js | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js index 1fd64b001..3975c032f 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js @@ -2,7 +2,7 @@ import React from 'react'; import { ImageInput, SelectInput, TextInput, TabbedForm, FormTab } from 'react-admin'; import { EditWithPermissions } from '@semapps/auth-provider'; import { MarkdownInput } from '@semapps/markdown-components'; -import { ActorsInput, DocumentsInput, ThemesInput, ResourcesInput } from '../../../../pair'; +import { ActorsInput, DocumentsInput, ThemesInput, ResourcesInput, ActivitiesInput } from '../../../../pair'; import ProjectTitle from './ProjectTitle'; import { ImageField, ReferenceInput } from '@semapps/semantic-data-provider'; @@ -22,6 +22,7 @@ const ProjectEdit = props => ( + diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js index be9b8f5b5..58d676af3 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js @@ -15,6 +15,13 @@ const ProjectShow = props => ( + + + + + + + diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js index 6664a26e4..7aafb91b4 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js @@ -30,10 +30,11 @@ export default { 'pair:description': 'Description', 'pair:hasStatus': 'Statut', 'pair:homePage': 'Site web', - 'pair:involves': 'Implique', + 'pair:involves': 'Implique les acteurs', 'pair:needs': 'Compétences requises', 'pair:documentedBy': 'Documenté par', - 'pair:hasTopic': 'A pour thème' + 'pair:hasTopic': 'A pour thème', + 'pair:partOf': 'Fait partie du projet...' } } } From b982eb4d0880c26753b0c7add26178134402cd9f Mon Sep 17 00:00:00 2001 From: Yaninck DUTHE Date: Wed, 16 Jun 2021 17:27:31 +0200 Subject: [PATCH 4/6] [GL] Add task requires task & project hasPart Activities --- .../Agent/Activity/Project/ProjectEdit.js | 1 + .../Agent/Activity/Project/ProjectShow.js | 6 ++++++ .../src/resources/Agent/Activity/Project/index.js | 5 +++-- .../src/resources/Agent/Activity/Task/TaskEdit.js | 1 + .../src/resources/Agent/Activity/Task/TaskShow.js | 12 ++++++++++++ .../src/resources/Agent/Activity/Task/index.js | 15 ++++++++------- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js index 3975c032f..8d2161d65 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectEdit.js @@ -23,6 +23,7 @@ const ProjectEdit = props => ( + diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js index 58d676af3..731bfb120 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/ProjectShow.js @@ -22,6 +22,12 @@ const ProjectShow = props => ( + + + + + + diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js index 7aafb91b4..5f2c148b9 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Project/index.js @@ -32,9 +32,10 @@ export default { 'pair:homePage': 'Site web', 'pair:involves': 'Implique les acteurs', 'pair:needs': 'Compétences requises', - 'pair:documentedBy': 'Documenté par', + 'pair:documentedBy': 'Documents liés', 'pair:hasTopic': 'A pour thème', - 'pair:partOf': 'Fait partie du projet...' + 'pair:partOf': 'Fait partie du projet', + 'pair:hasPart': 'Contient les activités' } } } diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskEdit.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskEdit.js index 841d619fd..ec924df17 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskEdit.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskEdit.js @@ -49,6 +49,7 @@ const TaskEdit = props => ( + diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskShow.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskShow.js index 8199f934e..c2d766b44 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskShow.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/TaskShow.js @@ -44,6 +44,18 @@ const TaskShow = props => ( + + + + + + + + + + + + diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js index 60f9a198c..49d6d4939 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js @@ -27,18 +27,19 @@ export default { fields: { 'pair:label': 'Titre', 'pair:description': 'Description', - 'pair:assignedTo': 'Est assigné à', - 'pair:partOf': 'Fait partie de', + 'pair:assignedTo': 'Est assigné à la personne', + 'pair:partOf': 'Fait partie du projet', 'pair:hasType': 'Type', 'pair:hasStatus': 'Statut', 'pair:dueDate': 'Date attendue', 'pair:endDate': 'Date de fin effective', - 'pair:hasFollower': 'Suivie par', - 'pair:involves': 'Implique', - 'pair:inspiredBy': 'Inspiré par', + 'pair:hasFollower': "Suivie par la personne", + 'pair:involves': "Implique la personne", + 'pair:inspiredBy': 'Inspiré par la tâche', 'pair:hasTopic': 'A pour thème', - 'pair:needs': 'A besoin de', - 'pair:uses': 'Utilise' + 'pair:needs': 'A besoin de la compétence', + 'pair:uses': 'Utilise le doc', + 'pair:requires': 'Est dépendant de la tâche' } } } From bcef50c5092e6769869017bb723a7c5a617ec031 Mon Sep 17 00:00:00 2001 From: fluidlog Date: Wed, 16 Jun 2021 15:28:35 +0000 Subject: [PATCH 5/6] Automatic prettier --- .../archipelago/src/resources/Agent/Activity/Task/index.js | 4 ++-- .../packages/ldp/services/resource/actions/patch.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js index 49d6d4939..ea1e713fd 100644 --- a/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js +++ b/src/frontend/boilerplates/archipelago/src/resources/Agent/Activity/Task/index.js @@ -33,8 +33,8 @@ export default { 'pair:hasStatus': 'Statut', 'pair:dueDate': 'Date attendue', 'pair:endDate': 'Date de fin effective', - 'pair:hasFollower': "Suivie par la personne", - 'pair:involves': "Implique la personne", + 'pair:hasFollower': 'Suivie par la personne', + 'pair:involves': 'Implique la personne', 'pair:inspiredBy': 'Inspiré par la tâche', 'pair:hasTopic': 'A pour thème', 'pair:needs': 'A besoin de la compétence', diff --git a/src/middleware/packages/ldp/services/resource/actions/patch.js b/src/middleware/packages/ldp/services/resource/actions/patch.js index 32e25f0d2..ef641f460 100644 --- a/src/middleware/packages/ldp/services/resource/actions/patch.js +++ b/src/middleware/packages/ldp/services/resource/actions/patch.js @@ -93,7 +93,9 @@ module.exports = { // We want to remove in old triples only the triples for which we have provided a new literal value const literalTriplesToAdd = triplesToAdd.filter(t => t.object.termType === 'Literal'); const triplesToRemove = oldTriples.filter(ot => - literalTriplesToAdd.some(nt => nt.subject.value === ot.subject.value && nt.predicate.value === ot.predicate.value) + literalTriplesToAdd.some( + nt => nt.subject.value === ot.subject.value && nt.predicate.value === ot.predicate.value + ) ); // The exact same data have been posted, skip From 199aa9d0f30d0a3006ad2ecb5b13ddc711f268c0 Mon Sep 17 00:00:00 2001 From: fluidlog Date: Mon, 28 Jun 2021 15:56:22 +0000 Subject: [PATCH 6/6] Automatic prettier --- .../auth-provider/src/authProvider.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/frontend/packages/auth-provider/src/authProvider.js b/src/frontend/packages/auth-provider/src/authProvider.js index 0f7df83e0..02113bd81 100644 --- a/src/frontend/packages/auth-provider/src/authProvider.js +++ b/src/frontend/packages/auth-provider/src/authProvider.js @@ -1,17 +1,23 @@ import jwtDecode from 'jwt-decode'; import { defaultToArray, getAclUri, getAclContext } from './utils'; -const authProvider = ({ middlewareUri, allowAnonymous = true, checkUser, httpClient, checkPermissions, resources }) => ({ +const authProvider = ({ + middlewareUri, + allowAnonymous = true, + checkUser, + httpClient, + checkPermissions, + resources +}) => ({ login: async params => { const url = new URL(window.location.href); - window.location.href = `${middlewareUri}auth?redirectUrl=` + encodeURIComponent(url.origin + '/login?login=true') + window.location.href = `${middlewareUri}auth?redirectUrl=` + encodeURIComponent(url.origin + '/login?login=true'); }, logout: async () => { const url = new URL(window.location.href); - if( !allowAnonymous ) { + if (!allowAnonymous) { localStorage.removeItem('token'); - window.location.href = - `${middlewareUri}auth/logout?redirectUrl=` + encodeURIComponent(url.origin + '/login') + window.location.href = `${middlewareUri}auth/logout?redirectUrl=` + encodeURIComponent(url.origin + '/login'); } else { // Redirect to login page after disconnecting from SSO // The login page will remove the token, display a notification and redirect to the homepage @@ -24,10 +30,10 @@ const authProvider = ({ middlewareUri, allowAnonymous = true, checkUser, httpCli }, checkAuth: async () => { const token = localStorage.getItem('token'); - if( !token && !allowAnonymous ) throw new Error(); + if (!token && !allowAnonymous) throw new Error(); }, checkUser: userData => { - if( checkUser ) { + if (checkUser) { return checkUser(userData); } else { return true;