From b30e1196f4a062099a3b6494170ad2172027f296 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Sat, 8 Feb 2025 20:18:44 +0100 Subject: [PATCH 01/57] canvas included in the main page, still shiting with vue --- front/MyINPulse-front/src/App.vue | 21 ++ .../src/components/canvas/Avantage.vue | 21 ++ .../src/components/canvas/Canaux.vue | 21 ++ .../src/components/canvas/Couts.vue | 21 ++ .../src/components/canvas/Header.vue | 37 ++++ .../src/components/canvas/Indicateurs.vue | 21 ++ .../src/components/canvas/Lean-canvas.vue | 42 ++++ .../src/components/canvas/Probleme.vue | 21 ++ .../src/components/canvas/Revenus.vue | 21 ++ .../src/components/canvas/Segments.vue | 21 ++ .../src/components/canvas/Solution.vue | 21 ++ .../src/components/canvas/Valeur.vue | 21 ++ .../src/components/canvas/style-project.css | 184 ++++++++++++++++++ front/MyINPulse-front/src/main.ts | 3 +- front/MyINPulse-front/src/router/index.ts | 7 + .../MyINPulse-front/src/views/CanvasView.vue | 12 ++ 16 files changed, 494 insertions(+), 1 deletion(-) create mode 100644 front/MyINPulse-front/src/components/canvas/Avantage.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Canaux.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Couts.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Header.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Indicateurs.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Lean-canvas.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Probleme.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Revenus.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Segments.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Solution.vue create mode 100644 front/MyINPulse-front/src/components/canvas/Valeur.vue create mode 100644 front/MyINPulse-front/src/components/canvas/style-project.css create mode 100644 front/MyINPulse-front/src/views/CanvasView.vue diff --git a/front/MyINPulse-front/src/App.vue b/front/MyINPulse-front/src/App.vue index 71701b5..6c3e95f 100644 --- a/front/MyINPulse-front/src/App.vue +++ b/front/MyINPulse-front/src/App.vue @@ -3,6 +3,7 @@ import { RouterLink, RouterView } from 'vue-router' import HelloWorld from './components/HelloWorld.vue' import Header from './components/Header.vue'; import ProjectComp from './components/Project-comp.vue'; +import CanvasView from './components/canvas/Lean-canvas.vue'; + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Canaux.vue b/front/MyINPulse-front/src/components/canvas/Canaux.vue new file mode 100644 index 0000000..6aee546 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Canaux.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Couts.vue b/front/MyINPulse-front/src/components/canvas/Couts.vue new file mode 100644 index 0000000..c232d3f --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Couts.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Header.vue b/front/MyINPulse-front/src/components/canvas/Header.vue new file mode 100644 index 0000000..e860400 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Header.vue @@ -0,0 +1,37 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Indicateurs.vue b/front/MyINPulse-front/src/components/canvas/Indicateurs.vue new file mode 100644 index 0000000..0fd6d1a --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Indicateurs.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue b/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue new file mode 100644 index 0000000..0141a17 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue @@ -0,0 +1,42 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Probleme.vue b/front/MyINPulse-front/src/components/canvas/Probleme.vue new file mode 100644 index 0000000..d36b983 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Probleme.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Revenus.vue b/front/MyINPulse-front/src/components/canvas/Revenus.vue new file mode 100644 index 0000000..0b8b57e --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Revenus.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Segments.vue b/front/MyINPulse-front/src/components/canvas/Segments.vue new file mode 100644 index 0000000..76eaba5 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Segments.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Solution.vue b/front/MyINPulse-front/src/components/canvas/Solution.vue new file mode 100644 index 0000000..b3d5a05 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Solution.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Valeur.vue b/front/MyINPulse-front/src/components/canvas/Valeur.vue new file mode 100644 index 0000000..d577863 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/Valeur.vue @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/style-project.css b/front/MyINPulse-front/src/components/canvas/style-project.css new file mode 100644 index 0000000..7761d40 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/style-project.css @@ -0,0 +1,184 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 10px; + } + + .canvas { + display: flex; + flex-direction: column; + max-width: 1200px; + margin: 20px auto; + border: 2px dashed #d33; + background: #fff; + } + + .row { + display: flex; + } + + .cell { + flex: 1; + border: 1px solid #ddd; + padding: 10px; + text-align: center; + background-color: #f1f1f1; + } + + .produit { + background-color: #f9e4e4; + } + + .marche { + background-color: #e4f1f9; + } + + .valeur { + background-color: #f9f4e4; + } + + h3 { + margin: 0; + font-size: 18px; + color: #333; + } + + p { + margin: 5px 0 0; + font-size: 14px; + } + + + body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f9f9f9; + } + + h1 img { + height: 80px; + } + + .canvas { + max-width: 1200px; + margin: 20px auto; + padding: 20px; + border: 2px dashed #d33; + background-color: #fff; + } + + .row { + display: flex; + margin-bottom: 10px; + } + + .cell { + flex: 1; + border: 1px solid #ddd; + padding: 20px; + text-align: center; + background-color: #f1f1f1; + } + + #ade { + max-width: 1200px; + margin: 20px auto; + padding: 20px; + text-align: center; + background-color: #e8f5e9; + border: 2px solid #4caf50; + border-radius: 10px; + } + + #ade h3 { + color: #2e7d32; + } + + #ade p { + margin: 10px 0; + font-size: 16px; + color: #333; + } + header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px 20px; + background-color: #fff; + border-bottom: 2px solid #ddd; + } + + header img { + height: 60px; + } + + header .contact-menu { + position: relative; + } + + .expanded { + transform: scale(1.2); /* L'élément reste agrandi */ + transition: transform 0.3s ease; /* Animation fluide */ + } + + .contact-button, .return { + padding: 10px 15px; + border: none; + border-radius: 4px; + background-color: #2196f3; + color: #fff; + cursor: pointer; + } + + .contact-button:hover, .return:hover { + background-color: #1976d2; + } + + /* Dropdown styling */ + .contact-dropdown { + position: absolute; + right: 0; + top: 50px; + display: none; + flex-direction: column; + gap: 10px; + padding: 15px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + z-index: 10; + } + + .contact-dropdown button { + padding: 8px 12px; + border: none; + border-radius: 4px; + background-color: #4caf50; + color: #fff; + cursor: pointer; + } + + .contact-dropdown button:hover { + background-color: #388e3c; + } + + .return { + background-color: #f44336; + } + + .return:hover { + background-color: #d32f2f; + } + + .header-buttons { + display: flex; + align-items: center; + gap: 15px; + } + + + a{ + color: white; + } \ No newline at end of file diff --git a/front/MyINPulse-front/src/main.ts b/front/MyINPulse-front/src/main.ts index e33d5c1..5bf00b7 100644 --- a/front/MyINPulse-front/src/main.ts +++ b/front/MyINPulse-front/src/main.ts @@ -25,7 +25,8 @@ keycloakService.CallInit(() => { }) -createApp(App).mount('#app'); +// this shit made by me so i can run the canva vue app +createApp(App).use(router).mount('#app'); // TODO: fix the comment /* diff --git a/front/MyINPulse-front/src/router/index.ts b/front/MyINPulse-front/src/router/index.ts index e9697d9..54cde30 100644 --- a/front/MyINPulse-front/src/router/index.ts +++ b/front/MyINPulse-front/src/router/index.ts @@ -19,6 +19,13 @@ const router = createRouter({ // which is lazy-loaded when the route is visited. component: () => import('../views/Home.vue'), }, + + // route pour les canvas (made by adnane), in fact the two vue apps are separated for now + { + path: '/canvas', + name: 'canvas', + component: () => import('../views/CanvasView.vue'), + }, ], }) diff --git a/front/MyINPulse-front/src/views/CanvasView.vue b/front/MyINPulse-front/src/views/CanvasView.vue new file mode 100644 index 0000000..d87bd29 --- /dev/null +++ b/front/MyINPulse-front/src/views/CanvasView.vue @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file -- 2.47.2 From 4fda5513a920e58e50419140abec3965fbe55f3c Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Sat, 8 Feb 2025 20:33:03 +0100 Subject: [PATCH 02/57] error corrected --- front/MyINPulse-front/src/App.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/MyINPulse-front/src/App.vue b/front/MyINPulse-front/src/App.vue index 65e6bf6..f187256 100644 --- a/front/MyINPulse-front/src/App.vue +++ b/front/MyINPulse-front/src/App.vue @@ -43,8 +43,8 @@ button:hover { \ No newline at end of file + + + \ No newline at end of file -- 2.47.2 From 5145b833aea1fcbc031e04ba09f9a9c449fdfafc Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Mon, 10 Feb 2025 15:15:58 +0100 Subject: [PATCH 04/57] feat: rendez-vous agenda for admin and user --- front/MyINPulse-front/src/App.vue | 5 +- .../MyINPulse-front/src/components/Agenda.vue | 0 .../src/components/Project-comp.vue | 77 ++++++++++++++++--- 3 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 front/MyINPulse-front/src/components/Agenda.vue diff --git a/front/MyINPulse-front/src/App.vue b/front/MyINPulse-front/src/App.vue index 4977758..72b8407 100644 --- a/front/MyINPulse-front/src/App.vue +++ b/front/MyINPulse-front/src/App.vue @@ -16,6 +16,7 @@ import ErrorWrapper from "@/views/errorWrapper.vue"; :key="index" :projectName="project.name" :listName="project.members" + :projectLink="project.link" />
@@ -59,12 +60,12 @@ export default { projects: [ { name: 'Projet Alpha', - //link: './project-alpha.html', + link: '/project-alpha.html',//to test members: ['Alice', 'Bob', 'Charlie'], }, { name: 'Projet Beta', - //link: './project-beta.html', + link: './project-beta.html', //to test members: ['David', 'Eve', 'Frank'], }, ], diff --git a/front/MyINPulse-front/src/components/Agenda.vue b/front/MyINPulse-front/src/components/Agenda.vue new file mode 100644 index 0000000..e69de29 diff --git a/front/MyINPulse-front/src/components/Project-comp.vue b/front/MyINPulse-front/src/components/Project-comp.vue index 258a6d5..a2e054b 100644 --- a/front/MyINPulse-front/src/components/Project-comp.vue +++ b/front/MyINPulse-front/src/components/Project-comp.vue @@ -1,31 +1,38 @@ - + \ No newline at end of file -- 2.47.2 From 9d71c93b5bfebe7a8a325ab11a81d2c5081d9339 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Mon, 10 Feb 2025 15:53:10 +0100 Subject: [PATCH 05/57] feat: layout changes --- .../src/components/canvas/Lean-canvas.vue | 111 +++++++++++------- 1 file changed, 70 insertions(+), 41 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue b/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue index 0141a17..40b1b80 100644 --- a/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue +++ b/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue @@ -1,42 +1,71 @@ - - - - - \ No newline at end of file +
+ + + + + + + + + +
+ + + + + \ No newline at end of file -- 2.47.2 From 6a3d4239aba6d1611c2f121313dea0020ea5857a Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Mon, 10 Feb 2025 22:46:59 +0100 Subject: [PATCH 06/57] feat: canvas are now generic --- front/MyINPulse-front/src/App.vue | 2 +- .../src/components/canvas/Avantage.vue | 21 ----- .../src/components/canvas/Canaux.vue | 21 ----- .../src/components/canvas/CanvasItem.vue | 56 +++++++++++ .../src/components/canvas/Couts.vue | 21 ----- .../src/components/canvas/Header.vue | 37 -------- .../src/components/canvas/HeaderCanvas.vue | 36 ++++++++ .../src/components/canvas/Indicateurs.vue | 21 ----- .../src/components/canvas/Lean-canvas.vue | 71 -------------- .../src/components/canvas/LeanCanvas.vue | 92 +++++++++++++++++++ .../src/components/canvas/Probleme.vue | 21 ----- .../src/components/canvas/Revenus.vue | 21 ----- .../src/components/canvas/Segments.vue | 21 ----- .../src/components/canvas/Solution.vue | 21 ----- .../src/components/canvas/Valeur.vue | 21 ----- .../src/components/canvas/style-project.css | 15 +-- .../MyINPulse-front/src/views/CanvasView.vue | 8 +- 17 files changed, 194 insertions(+), 312 deletions(-) delete mode 100644 front/MyINPulse-front/src/components/canvas/Avantage.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Canaux.vue create mode 100644 front/MyINPulse-front/src/components/canvas/CanvasItem.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Couts.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Header.vue create mode 100644 front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Indicateurs.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Lean-canvas.vue create mode 100644 front/MyINPulse-front/src/components/canvas/LeanCanvas.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Probleme.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Revenus.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Segments.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Solution.vue delete mode 100644 front/MyINPulse-front/src/components/canvas/Valeur.vue diff --git a/front/MyINPulse-front/src/App.vue b/front/MyINPulse-front/src/App.vue index 72b8407..a42626d 100644 --- a/front/MyINPulse-front/src/App.vue +++ b/front/MyINPulse-front/src/App.vue @@ -3,7 +3,7 @@ import { RouterLink, RouterView } from 'vue-router' import HelloWorld from './components/HelloWorld.vue' import Header from './components/Header.vue'; import ProjectComp from './components/Project-comp.vue'; -import CanvasView from './components/canvas/Lean-canvas.vue'; +import CanvasView from './components/canvas/LeanCanvas.vue'; import ErrorWrapper from "@/views/errorWrapper.vue"; diff --git a/front/MyINPulse-front/src/components/canvas/Avantage.vue b/front/MyINPulse-front/src/components/canvas/Avantage.vue deleted file mode 100644 index 59532ce..0000000 --- a/front/MyINPulse-front/src/components/canvas/Avantage.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Canaux.vue b/front/MyINPulse-front/src/components/canvas/Canaux.vue deleted file mode 100644 index 6aee546..0000000 --- a/front/MyINPulse-front/src/components/canvas/Canaux.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue new file mode 100644 index 0000000..120f255 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -0,0 +1,56 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Couts.vue b/front/MyINPulse-front/src/components/canvas/Couts.vue deleted file mode 100644 index c232d3f..0000000 --- a/front/MyINPulse-front/src/components/canvas/Couts.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Header.vue b/front/MyINPulse-front/src/components/canvas/Header.vue deleted file mode 100644 index e860400..0000000 --- a/front/MyINPulse-front/src/components/canvas/Header.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue new file mode 100644 index 0000000..565ef2f --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/front/MyINPulse-front/src/components/canvas/Indicateurs.vue b/front/MyINPulse-front/src/components/canvas/Indicateurs.vue deleted file mode 100644 index 0fd6d1a..0000000 --- a/front/MyINPulse-front/src/components/canvas/Indicateurs.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue b/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue deleted file mode 100644 index 40b1b80..0000000 --- a/front/MyINPulse-front/src/components/canvas/Lean-canvas.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue new file mode 100644 index 0000000..355ff27 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/front/MyINPulse-front/src/components/canvas/Probleme.vue b/front/MyINPulse-front/src/components/canvas/Probleme.vue deleted file mode 100644 index d36b983..0000000 --- a/front/MyINPulse-front/src/components/canvas/Probleme.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Revenus.vue b/front/MyINPulse-front/src/components/canvas/Revenus.vue deleted file mode 100644 index 0b8b57e..0000000 --- a/front/MyINPulse-front/src/components/canvas/Revenus.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Segments.vue b/front/MyINPulse-front/src/components/canvas/Segments.vue deleted file mode 100644 index 76eaba5..0000000 --- a/front/MyINPulse-front/src/components/canvas/Segments.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Solution.vue b/front/MyINPulse-front/src/components/canvas/Solution.vue deleted file mode 100644 index b3d5a05..0000000 --- a/front/MyINPulse-front/src/components/canvas/Solution.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/Valeur.vue b/front/MyINPulse-front/src/components/canvas/Valeur.vue deleted file mode 100644 index d577863..0000000 --- a/front/MyINPulse-front/src/components/canvas/Valeur.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/style-project.css b/front/MyINPulse-front/src/components/canvas/style-project.css index 7761d40..4369b49 100644 --- a/front/MyINPulse-front/src/components/canvas/style-project.css +++ b/front/MyINPulse-front/src/components/canvas/style-project.css @@ -58,14 +58,8 @@ body { h1 img { height: 80px; - } - - .canvas { - max-width: 1200px; - margin: 20px auto; - padding: 20px; - border: 2px dashed #d33; - background-color: #fff; + margin: 40px; + text-align: center; } .row { @@ -117,11 +111,6 @@ body { position: relative; } - .expanded { - transform: scale(1.2); /* L'élément reste agrandi */ - transition: transform 0.3s ease; /* Animation fluide */ - } - .contact-button, .return { padding: 10px 15px; border: none; diff --git a/front/MyINPulse-front/src/views/CanvasView.vue b/front/MyINPulse-front/src/views/CanvasView.vue index d87bd29..0c17286 100644 --- a/front/MyINPulse-front/src/views/CanvasView.vue +++ b/front/MyINPulse-front/src/views/CanvasView.vue @@ -1,5 +1,10 @@ \ No newline at end of file -- 2.47.2 From 09e4b3262fc35f79d8cff6c4eccae0fb6a9d8f36 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Tue, 11 Feb 2025 19:55:28 +0100 Subject: [PATCH 07/57] feat: switching to composition API standard --- .../src/components/canvas/CanvasItem.vue | 50 ++++++++++----- .../src/components/canvas/LeanCanvas.vue | 62 ++++++------------- .../MyINPulse-front/src/views/CanvasView.vue | 11 ++-- 3 files changed, 59 insertions(+), 64 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index 120f255..d999eb9 100644 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -1,25 +1,40 @@ @@ -29,14 +44,21 @@ .cell { display: flex; - flex-direction: column; /* Pour empiler le titre et la description */ - align-items: center; /* Centre horizontalement */ - justify-content: center; /* Centre verticalement */ - text-align: center; /* Centre le texte */ + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; transition: all 0.3s ease; cursor: pointer; } + .cell_Expanded { + display: flex; + flex-direction: column; + align-items: center; + transition: all 0.3s ease; + cursor: pointer; + } .expanded { position: fixed; diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue index 355ff27..ee085bb 100644 --- a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -1,5 +1,5 @@ - - \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/Project-comp.vue b/front/MyINPulse-front/src/components/Project-comp.vue index a2e054b..bbdd841 100644 --- a/front/MyINPulse-front/src/components/Project-comp.vue +++ b/front/MyINPulse-front/src/components/Project-comp.vue @@ -110,6 +110,16 @@ const goToLink = () => { } - + button { + padding: 10px 15px; + background-color: #007bff; + color: white; + border: none; + cursor: pointer; + border-radius: 5px; +} + button:hover { + background-color: #0056b3; + } \ No newline at end of file diff --git a/front/MyINPulse-front/src/router/router.ts b/front/MyINPulse-front/src/router/router.ts index 16f4939..f77493e 100644 --- a/front/MyINPulse-front/src/router/router.ts +++ b/front/MyINPulse-front/src/router/router.ts @@ -12,7 +12,13 @@ const router = createRouter({ component: () => import('../views/test.vue'), }, - // route pour les canvas (made by adnane), in fact the two vue apps are separated for now + { + path: '/', + name: 'Admin-main', + component: () => import('../views/AdminMain.vue'), + }, + +// route pour les canvas (made by adnane), in fact the two vue apps are separated for now { path: '/canvas', name: 'canvas', diff --git a/front/MyINPulse-front/src/views/AdminMain.vue b/front/MyINPulse-front/src/views/AdminMain.vue new file mode 100644 index 0000000..2f5c4fc --- /dev/null +++ b/front/MyINPulse-front/src/views/AdminMain.vue @@ -0,0 +1,82 @@ + + + + + + + + \ No newline at end of file -- 2.47.2 From 651fb2b1a1031a18d145c5dd3efc6b3614718fa8 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Tue, 18 Feb 2025 07:20:58 +0100 Subject: [PATCH 12/57] feat: adding first fake api (use this cmd in fake_data reportory: json-server --watch db.json --port 5000) + fetching witch axios for now (npm install axios) --- front/MyINPulse-front/fake_data/db.json | 8 ++ front/MyINPulse-front/src/App.vue | 5 +- .../src/components/canvas/HeaderCanvas.vue | 108 ++++++++++++++++-- front/MyINPulse-front/src/views/test.vue | 2 +- 4 files changed, 108 insertions(+), 15 deletions(-) create mode 100644 front/MyINPulse-front/fake_data/db.json diff --git a/front/MyINPulse-front/fake_data/db.json b/front/MyINPulse-front/fake_data/db.json new file mode 100644 index 0000000..53ffa8a --- /dev/null +++ b/front/MyINPulse-front/fake_data/db.json @@ -0,0 +1,8 @@ +{ + "entrepreneurs": [ + { "id": 1, "name": "Alice", "email": "alice@example.com" }, + { "id": 2, "name": "Bob", "email": "bob@example.com" }, + { "id": 3, "name": "Charlie", "email": "charlie@example.com" } + ] + } + \ No newline at end of file diff --git a/front/MyINPulse-front/src/App.vue b/front/MyINPulse-front/src/App.vue index 9485baf..7302268 100644 --- a/front/MyINPulse-front/src/App.vue +++ b/front/MyINPulse-front/src/App.vue @@ -6,12 +6,9 @@ import ErrorWrapper from "@/views/errorWrapper.vue"; diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue index 565ef2f..1b05ff2 100644 --- a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -2,35 +2,123 @@
INPulse Logo
-
+
+ diff --git a/front/MyINPulse-front/src/views/test.vue b/front/MyINPulse-front/src/views/test.vue index 90db6d1..9bff439 100644 --- a/front/MyINPulse-front/src/views/test.vue +++ b/front/MyINPulse-front/src/views/test.vue @@ -3,7 +3,7 @@ import {store} from "../main.ts"; import {callApi} from "@/services/api.ts"; import ErrorModal from "@/components/errorModal.vue"; import {errorList} from "@/services/popupDisplayer.ts"; -import TempModal from "@/components/temp-modal.vue"; +//import TempModal from "@/components/temp-modal.vue"; import ErrorWrapper from "@/App.vue"; function addResToTable(id: any){ return (req: any) => { -- 2.47.2 From 9f3754776f8cad3238281c84f51a2f44b3ca80b8 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Tue, 18 Feb 2025 22:17:57 +0100 Subject: [PATCH 13/57] fix: fixed the code for AdminMain --- front/MyINPulse-front/src/views/AdminMain.vue | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/front/MyINPulse-front/src/views/AdminMain.vue b/front/MyINPulse-front/src/views/AdminMain.vue index 2f5c4fc..657425c 100644 --- a/front/MyINPulse-front/src/views/AdminMain.vue +++ b/front/MyINPulse-front/src/views/AdminMain.vue @@ -24,37 +24,27 @@ import ProjectComp from '../components/Project-comp.vue'; - -- 2.47.2 From 79e949bdd4cba421037cef55c2a5330046ceebf2 Mon Sep 17 00:00:00 2001 From: MAILLAL Anas Date: Wed, 19 Feb 2025 01:36:52 +0100 Subject: [PATCH 14/57] feat: configured gradle file to generate code for api interface from swagger specification --- MyINPulse-back/build.gradle | 32 +++++ .../src/main/resources/openapi/main.yaml | 133 ++++++------------ 2 files changed, 75 insertions(+), 90 deletions(-) rename Documentation/BackendApi/openapi.yaml => MyINPulse-back/src/main/resources/openapi/main.yaml (85%) diff --git a/MyINPulse-back/build.gradle b/MyINPulse-back/build.gradle index abdd6a9..1f37fd3 100644 --- a/MyINPulse-back/build.gradle +++ b/MyINPulse-back/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.4.2' id 'io.spring.dependency-management' version '1.1.7' + id 'org.openapi.generator' version '7.11.0' } group = 'enseirb' @@ -20,8 +21,39 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' implementation 'org.springframework.boot:spring-boot-starter-web' + // swagger Codegen + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' + implementation 'jakarta.validation:jakarta.validation-api:3.0.2' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + +} + +sourceSets { + main { + java { + srcDir "$buildDir/generated/src/main/java" + } + } +} +sourceSets { + main { + java.srcDir("$buildDir/generated/src/main/java") + } +} + +openApiGenerate { + generatorName.set("spring") + inputSpec.set("$rootDir/src/main/resources/openapi.yaml") + outputDir.set("$buildDir/generated") + apiPackage.set("enseirb.myinpulse.api") + modelPackage.set("enseirb.myinpulse.model") + configOptions.put("dateLibrary", "java8") + configOptions.put("useSpringBoot3", "true") + //configOptions.put("interfaceOnly", "true") + configOptions.put("library", "spring-boot") } tasks.named('test') { diff --git a/Documentation/BackendApi/openapi.yaml b/MyINPulse-back/src/main/resources/openapi/main.yaml similarity index 85% rename from Documentation/BackendApi/openapi.yaml rename to MyINPulse-back/src/main/resources/openapi/main.yaml index a116633..fd8d645 100644 --- a/Documentation/BackendApi/openapi.yaml +++ b/MyINPulse-back/src/main/resources/openapi/main.yaml @@ -15,22 +15,24 @@ tags: components: schemas: - founder: + user: + type: object + properties: + nom: + type: string + prenom: + type: string + email: + type: string + scondaryEmail: + type: string + tel: + type: string + user-entrepreneur: type: object properties: user: - type: object - properties: - nom: - type: string - prenom: - type: string - email: - type: string - scondaryEmail: - type: string - tel: - type: string + $ref: "#/components/schemas/user" entrepreneur: type: object properties: @@ -40,6 +42,11 @@ components: type: string status: type: string + user-admin: + type: object + properties: + admin: + $ref: "#/components/schemas/user" securitySchemes: MyINPulse: @@ -139,13 +146,13 @@ paths: name: type: string founder: - $ref: "#/components/schemas/founder" + $ref: "#/components/schemas/user-entrepreneur" "400": description: Bad request "401": description: Authorization information is missing or invalid - /projects/lcsection/{projectId}/{title}/{date}: + /shared/projects/lcsection/{projectId}/{title}/{date}: get: summary: Retourne la liste de sections de LC avec un titre donné tags: @@ -173,7 +180,7 @@ paths: description: the name of lc section - in: path name: date - required: true + required: false schema: type: string description: the date corresponding to the wanted version of lc section @@ -198,7 +205,7 @@ paths: "401": description: Authorization information is missing or invalid - /projects/entrepreneurs/{projectId}: + /shared/projects/entrepreneurs/{projectId}: get: summary: Retourne la liste d'entrepreneurs associée à un projet donné tags: @@ -224,14 +231,15 @@ paths: schema: type: array items: - type: string + $ref: "#/components/schemas/user-entrepreneur" "400": description: Bad request "401": description: Authorization information is missing or invalid - /projects/contacts/entrepreneurs/{projectId}: + + /shared/projects/admin/{projectId}: get: - summary: Retourne la liste des contactes d'entrepreneurs associée à un projet donné + summary: Retourne les inforùations de l'admin qui accompagne le projet tags: - Shared API security: @@ -239,9 +247,8 @@ paths: - MyINPulse-admin - MyINPulse-entrepreneur description: - JSON array of contacts for - each participant in the project with id - projectID. + JSON object containing information (name, gmail, tel, etc..) + the admin supervising the project with id projectID. parameters: - in: path name: projectId @@ -254,64 +261,16 @@ paths: content: application/json: schema: - type: array - items: - type: object - properties: - name: - type: string - email: - type: string - tel: - type: string + $ref: "#/components/schemas/user-admin" "400": description: Bad request "401": description: Authorization information is missing or invalid - /projects/contacts/admin/{projectId}: + /shared/projects/appointments/{projectId}: get: - summary: Retourne les contacts de l'admin que accompagne le projet - tags: - - Shared API - security: - - MyINPulse: - - MyINPulse-admin - - MyINPulse-entrepreneur - description: - JSON object containing contact information (name, gmail, tel, etc..) - the admin supervising the project with id - projectID. - parameters: - - in: path - name: projectId - schema: - type: integer - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - type: object - properties: - name: - type: string - email: - type: string - tel: - type: string - "400": - description: Bad request - "401": - description: Authorization information is - missing or invalid - - /projects/appointments/{projectId}: - get: - summary: Retourne les rendez-vous du project + summary: Retourne les rendez-vous du projet tags: - Shared API security: @@ -350,7 +309,7 @@ paths: "401": description: Authorization information is missing or invalid - /projects/appointments/report/{apointementId}: + /shared/projects/appointments/report/{apointementId}: get: summary: Retourne le rapport pdf du rendez-vous tags: @@ -382,7 +341,7 @@ paths: description: Authorization information is missing or invalid - /projects/request: + /entrepreneur/projects/request: post: summary: demander la création et validation d'un projet tags: @@ -404,7 +363,7 @@ paths: name: type: string founder: - $ref: "#/components/schemas/founder" + $ref: "#/components/schemas/user-entrepreneur" responses: "200": description: OK @@ -470,12 +429,8 @@ paths: properties: name: type: string - founderName: - type: string - founderEmail: - type: string - school: - type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" responses: "200": @@ -513,7 +468,7 @@ paths: description: Authorization information is missing or invalid - /lcsection/add/{projectId}: + /entrepreneur/lcsection/add/{projectId}: post: summary: ajouter une sections au LC description: @@ -549,7 +504,7 @@ paths: "401": description: Authorization information is missing or invalid - /lcsection/modify/{sectionId}: + /entrepreneur/lcsection/modify/{sectionId}: put: summary: modifier les données d'une section LC description: @@ -587,7 +542,7 @@ paths: description: Authorization information is missing or invalid - /lcsection/remove/{sectionId}: + /entrepreneur/lcsection/remove/{sectionId}: delete: summary: supprimer une section LC. description: @@ -612,7 +567,7 @@ paths: description: Authorization information is missing or invalid - /appointments/request: + /shared/appointments/request: post: summary: demander une rendez-vous description: @@ -696,6 +651,4 @@ paths: "401": description: Authorization information is missing or invalid - - - \ No newline at end of file + \ No newline at end of file -- 2.47.2 From d75d45e2043234131cecfae36cba2d141e98e6d7 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 19 Feb 2025 11:02:15 +0100 Subject: [PATCH 15/57] fix + feat: api test + error fix --- front/MyINPulse-front/fake_data/db.json | 10 +- front/MyINPulse-front/fake_data/open.sh | 2 + .../src/components/canvas/CanvasItem.vue | 98 ++++++++++-------- .../src/components/canvas/HeaderCanvas.vue | 52 +++++----- .../src/components/icons/logo inpulse.png | Bin 5269 -> 40328 bytes front/MyINPulse-front/src/views/AdminMain.vue | 10 +- 6 files changed, 89 insertions(+), 83 deletions(-) create mode 100755 front/MyINPulse-front/fake_data/open.sh diff --git a/front/MyINPulse-front/fake_data/db.json b/front/MyINPulse-front/fake_data/db.json index 53ffa8a..51a02c3 100644 --- a/front/MyINPulse-front/fake_data/db.json +++ b/front/MyINPulse-front/fake_data/db.json @@ -1,8 +1,10 @@ { - "entrepreneurs": [ + "entrepreneurs": [ { "id": 1, "name": "Alice", "email": "alice@example.com" }, { "id": 2, "name": "Bob", "email": "bob@example.com" }, { "id": 3, "name": "Charlie", "email": "charlie@example.com" } - ] - } - \ No newline at end of file + ], + "data": [ + { "data": "this is a fake data to test api" } + ] +} diff --git a/front/MyINPulse-front/fake_data/open.sh b/front/MyINPulse-front/fake_data/open.sh new file mode 100755 index 0000000..cd3b9b6 --- /dev/null +++ b/front/MyINPulse-front/fake_data/open.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +json-server --watch db.json --port 5000 \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index b96a575..29228ce 100644 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -7,51 +7,63 @@

{{ title }}

{{ currentDescription }}

- + - - expanded.value = !expanded.value; - }; - - return { - expanded, - currentDescription, - toggleExpand - }; - } - }; - - - - \ No newline at end of file + } + diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue index 1b05ff2..6c8f6b0 100644 --- a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -17,39 +17,35 @@ - + diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue index 6c8f6b0..1fbe025 100644 --- a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -47,6 +47,7 @@ onMounted(fetchEntrepreneurs); diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue index ebfb9bf..175082b 100644 --- a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -37,6 +37,7 @@ export default { -- 2.47.2 From b355463dd911fe4fe4a26eb3b5749363f31a22c5 Mon Sep 17 00:00:00 2001 From: MAILLAL Anas Date: Tue, 25 Feb 2025 22:34:33 +0100 Subject: [PATCH 17/57] docs: added needed modications and reorganized yaml file --- .../openapi/main.yaml | 514 ++++++++++-------- 1 file changed, 295 insertions(+), 219 deletions(-) rename {MyINPulse-back/src/main/resources => Documentation}/openapi/main.yaml (83%) diff --git a/MyINPulse-back/src/main/resources/openapi/main.yaml b/Documentation/openapi/main.yaml similarity index 83% rename from MyINPulse-back/src/main/resources/openapi/main.yaml rename to Documentation/openapi/main.yaml index fd8d645..00dc3d4 100644 --- a/MyINPulse-back/src/main/resources/openapi/main.yaml +++ b/Documentation/openapi/main.yaml @@ -59,6 +59,14 @@ components: MyINPulse-entrepreneur: Utilisateur paths: + +# _ ____ __ __ ___ _ _ _ ____ ___ +# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _| +# / _ \ | | | | |\/| || || \| | / _ \ | |_) | | +# / ___ \| |_| | | | || || |\ | / ___ \| __/| | +# /_/ \_\____/|_| |_|___|_| \_| /_/ \_\_| |___| +# + /admin/projects: get: summary: Retourne la liste of projets associés à l'admin @@ -90,37 +98,182 @@ paths: description: Bad request "401": description: Authorization information is missing or invalid - - /admin/appointments/upcoming: - get: - summary: Retourne la list des prochains rendez-vous de l'admin - tags: + /admin/projects/pending/decision: + post: + summary: valider un projet en attente de validation + tags: - Admin API - security: - - MyINPulse: - - MyINPulse-admin description: - JSON array of upcoming appointment data (name, date, time etc..) for an admin. + if the request is accepted the status of the + project is changed to ongoing, entrepreneur + account is confirmed and the project is linked + to the admin accepting the request and the + entrepreneur requesting it. Else the pending + project and user info are deleted. + security: + - MyINPulse: + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + pedingProjectId: + type: integer + decision: + type: boolean + responses: - "200": + "200": description: OK - content: - application/json: - schema: - type: array - items: - type: object - properties: - name: - type: string - date: - type: string - time: - type: string "400": description: Bad request "401": - description: Authorization information is missing or invalid + description: Authorization information is + missing or invalid + + /admin/projects/add: + post: + summary: Ajout manuel d'un projet + description: + Adds a project with the + inputed details + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /admin/appointments/report/{appointmentId}: + put: + summary: enregistrer un rapport du rendez-vous + description: + Generate a PDF file formatted + from input text and links it + to the appointement. + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: appointmentId + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + body: + type: string + conclusion: + type: string + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + post: + summary: modifier un rapport déja éxistant du rendez-vous + description: + Modifies the report file to input + text and links it to the appointement. + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: appointmentId + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + body: + type: string + conclusion: + type: string + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /admin/projects/remove/{projectId}: + delete: + summary: supression d'un project + description: + Removes the project + with the inputed id projectId + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: projectId + required: true + schema: + type: integer + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /admin/projects/pending: get: summary: Retourne la liste des projets en attente de validation @@ -151,8 +304,48 @@ paths: description: Bad request "401": description: Authorization information is missing or invalid - - /shared/projects/lcsection/{projectId}/{title}/{date}: + +# +# ____ _ _ _ ____ ___ +# / ___|| |__ __ _ _ __ ___ __| | / \ | _ \_ _| +# \___ \| '_ \ / _` | '__/ _ \/ _` | / _ \ | |_) | | +# ___) | | | | (_| | | | __/ (_| | / ___ \| __/| | +# |____/|_| |_|\__,_|_| \___|\__,_| /_/ \_\_| |___| +# + + /shared/appointments/upcoming: + get: + summary: Retourne la list des prochains rendez-vous de l'utilisateur + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of upcoming appointment data (name, date, time etc..) for a user. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + date: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/lcsection/{projectId}: get: summary: Retourne la liste de sections de LC avec un titre donné tags: @@ -172,18 +365,19 @@ paths: schema: type: integer required: true - - in: path - name: title - schema: - type: string - required: true - description: the name of lc section - - in: path - name: date - required: false - schema: - type: string - description: the date corresponding to the wanted version of lc section + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: integer + description: the number associated with the title of the lcsection + date: + type: string + description: the date corresponding to the wanted version of lc section responses: "200": description: OK @@ -239,7 +433,7 @@ paths: /shared/projects/admin/{projectId}: get: - summary: Retourne les inforùations de l'admin qui accompagne le projet + summary: Retourne les informations de l'admin qui accompagne le projet tags: - Shared API security: @@ -340,7 +534,65 @@ paths: "401": description: Authorization information is missing or invalid - + + /shared/appointments/request: + post: + summary: demander un rendez-vous + description: + will add an appointement request request by the applicant + to have an appointment to be confirmed or denied by the + specified participants of the appointement. + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-entrepreneur + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + start_time: + type: string + end_time: + type: string + place: + type: string + applicantId: + type: integer + participants: + type: array + items: + type: integer + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + +# _____ _ _ _____ ____ _____ ____ ____ _____ _ _ _____ _ _ ____ +# | ____| \ | |_ _| _ \| ____| _ \| _ \| ____| \ | | ____| | | | _ \ +# | _| | \| | | | | |_) | _| | |_) | |_) | _| | \| | _| | | | | |_) | +# | |___| |\ | | | | _ <| |___| __/| _ <| |___| |\ | |___| |_| | _ < +# |_____|_|_\_| |_| |_| \_\_____|_| |_| \_\_____|_| \_|_____|\___/|_| \_\ +# / \ | _ \_ _| +# / _ \ | |_) | | +# / ___ \| __/| | +# /_/ \_\_| |___| +# + + /entrepreneur/projects/request: post: summary: demander la création et validation d'un projet @@ -373,101 +625,7 @@ paths: description: Authorization information is missing or invalid - /admin/projects/pending/decision: - post: - summary: valider un projet en attente de validation - tags: - - Admin API - description: - if the request is accepted the status of the - project is changed to ongoing, entrepreneur - account is confirmed and the project is linked - to the admin accepting the request and the - entrepreneur requesting it. Else the pending - project and user info are deleted. - security: - - MyINPulse: - - MyINPulse-admin - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - pedingProjectId: - type: integer - decision: - type: boolean - - responses: - "200": - description: OK - "400": - description: Bad request - "401": - description: Authorization information is - missing or invalid - - /admin/projects/add: - post: - summary: Ajout mannuel d'un projet - description: - Adds a project with the - inputed details - tags: - - Admin API - security: - - MyINPulse: - - MyINPulse-admin - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - founder: - $ref: "#/components/schemas/user-entrepreneur" - - responses: - "200": - description: OK - "400": - description: Bad request - "401": - description: Authorization information is - missing or invalid - - /admin/projects/remove/{projectId}: - delete: - summary: supression d'un project - description: - Removes the project - with the inputed id projectId - tags: - - Admin API - security: - - MyINPulse: - - MyINPulse-admin - parameters: - - in: path - name: projectId - required: true - schema: - type: integer - - responses: - "200": - description: OK - "400": - description: Bad request - "401": - description: Authorization information is - missing or invalid - + /entrepreneur/lcsection/add/{projectId}: post: summary: ajouter une sections au LC @@ -567,88 +725,6 @@ paths: description: Authorization information is missing or invalid - /shared/appointments/request: - post: - summary: demander une rendez-vous - description: - will add an appointement request request by the applicant - to have an appointment to be confirmed or denied by the - specified participants of the appointement. - tags: - - Shared API - security: - - MyINPulse: - - MyINPulse-entrepreneur - - MyINPulse-admin - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - title: - type: string - start_time: - type: string - end_time: - type: string - place: - type: string - applicantId: - type: integer - participants: - type: array - items: - type: integer - - responses: - "200": - description: OK - "400": - description: Bad request - "401": - description: Authorization information is - missing or invalid - - /admin/appointments/report/{appointmentId}: - post: - summary: enregistrer une rapport du rendez-vous - description: - Generate a PDF file formatted - from input text and links it - to the appointement. - tags: - - Admin API - security: - - MyINPulse: - - MyINPulse-admin - parameters: - - in: path - name: appointmentId - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - title: - type: string - body: - type: string - conclusion: - type: string - - responses: - "200": - description: OK - "400": - description: Bad request - "401": - description: Authorization information is - missing or invalid + + \ No newline at end of file -- 2.47.2 From 8071c01c5d002e8577d60f0123a04c466902fa0e Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Tue, 25 Feb 2025 22:53:15 +0100 Subject: [PATCH 18/57] fix: fixing the issues regarding the use of href --- .../src/components/Project-comp.vue | 14 +++++++++++--- front/MyINPulse-front/src/views/AdminMain.vue | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/front/MyINPulse-front/src/components/Project-comp.vue b/front/MyINPulse-front/src/components/Project-comp.vue index bbdd841..5a18b6c 100644 --- a/front/MyINPulse-front/src/components/Project-comp.vue +++ b/front/MyINPulse-front/src/components/Project-comp.vue @@ -1,7 +1,7 @@ - diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue index 1fbe025..8b08628 100644 --- a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -10,7 +10,9 @@ {{ email }} - + diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue index 175082b..a687982 100644 --- a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -10,30 +10,21 @@ - + \ No newline at end of file -- 2.47.2 From 9ba8e3e84e4d3f72045dd2d2d748b93c59e1e7d5 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 19 Mar 2025 10:52:12 +0100 Subject: [PATCH 22/57] feat: fake-data can be edited, switching to end-points branch --- .../src/components/canvas/CanvasItem.vue | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index 729fef2..3e504e8 100644 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -5,7 +5,9 @@ @@ -64,9 +66,20 @@ const startEditing = () => { isEditing.value = true; }; -const saveEdit = () => { - currentDescription.value = editedDescription.value; - isEditing.value = false; +const saveEdit = async () => { + try { + const id = 1; // Mets l'ID ici (dans ton cas, l'unique entrée) + + await axios.put(`http://localhost:5000/data/${id}`, { + canva_data: editedDescription.value + }); + + // Mettre à jour l'affichage local après la mise à jour réussie + currentDescription.value = editedDescription.value; + isEditing.value = false; + } catch (error) { + console.error("Erreur lors de la mise à jour des données :", error); + } }; const cancelEdit = () => { @@ -135,8 +148,8 @@ const cancelEdit = () => { .button-container { position: absolute; - bottom: 20px; - right: 20px; + bottom: 40px; + right: 40px; display: flex; gap: 10px; } -- 2.47.2 From 279c171ba220687da9b18c3b6822c6d856de448c Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 19 Mar 2025 11:54:34 +0100 Subject: [PATCH 23/57] fix: Doc added (for me) --- Documentation/openapi/main.yaml | 741 ++++++++++++++++++++++++++++++++ 1 file changed, 741 insertions(+) create mode 100644 Documentation/openapi/main.yaml diff --git a/Documentation/openapi/main.yaml b/Documentation/openapi/main.yaml new file mode 100644 index 0000000..263e9ab --- /dev/null +++ b/Documentation/openapi/main.yaml @@ -0,0 +1,741 @@ +openapi: 3.0.3 +info: + title: MyInpulse Backend Api + description: this document servers as a documentation for the backend api. + version: 0.0.0 + +tags: + - name: Entrepreneurs API + description: La partie de l'api dédiée aux entrepreneurs + - name: Admin API + description: La partie de l'api dédiée aux entrepreneurs + - name: Shared API + description: La partie de l'api dédiée aux entrepreneurs et admins + + +components: + schemas: + user: + type: object + properties: + nom: + type: string + prenom: + type: string + email: + type: string + example: "example@exmaple.com" + secondaryEmail: + type: string + example: "example@exmaple.com" + tel: + type: string + example: "0612345678" + user-entrepreneur: + type: object + properties: + user: + $ref: "#/components/schemas/user" + entrepreneur: + type: object + properties: + ecole: + type: string + example: "enseirb" + filiere: + type: string + example: "info" + status: + type: boolean + example: false + user-admin: + type: object + properties: + admin: + $ref: "#/components/schemas/user" + + securitySchemes: + MyINPulse: + type: oauth2 + flows: + implicit: + authorizationUrl: https://petstore3.swagger.io/oauth/authorize + scopes: + MyINPulse-admin: Administrateur + MyINPulse-entrepreneur: Utilisateur + +paths: + +# _ ____ __ __ ___ _ _ _ ____ ___ +# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _| +# / _ \ | | | | |\/| || || \| | / _ \ | |_) | | +# / ___ \| |_| | | | || || |\ | / ___ \| __/| | +# /_/ \_\____/|_| |_|___|_| \_| /_/ \_\_| |___| +# + + /admin/projects: + get: + summary: Retourne la liste of projets associés à l'admin + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + description: + JSON array of who's elements are objects containing necessary information for the view + (project name, entrepreneur names, etc..) + of the projects an admin is watching over. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + E_names: + type: string + description: entrepreneur names + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + /admin/projects/pending/decision: + post: + summary: valider un projet en attente de validation + tags: + - Admin API + description: + if the request is accepted the status of the + project is changed to ongoing, entrepreneur + account is confirmed and the project is linked + to the admin accepting the request and the + entrepreneur requesting it. Else the pending + project and user info are deleted. + security: + - MyINPulse: + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + pedingProjectId: + type: integer + decision: + type: boolean + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /admin/projects/add: + post: + summary: Ajout manuel d'un projet + description: + Adds a project with the + inputed details + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /admin/appointments/report/{appointmentId}: + put: + summary: enregistrer un rapport du rendez-vous + description: + Generate a PDF file formatted + from input text and links it + to the appointement. + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: appointmentId + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + body: + type: string + conclusion: + type: string + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + post: + summary: modifier un rapport déja éxistant du rendez-vous + description: + Modifies the report file to input + text and links it to the appointement. + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: appointmentId + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + body: + type: string + conclusion: + type: string + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /admin/projects/remove/{projectId}: + delete: + summary: supression d'un project + description: + Removes the project + with the inputed id projectId + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: projectId + required: true + schema: + type: integer + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /admin/projects/pending: + get: + summary: Retourne la liste des projets en attente de validation + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + description: + JSON array of who's elements are objects containing + necessary information for the view (project name, + entrepreneur names, etc..) of all pending projects. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + +# +# ____ _ _ _ ____ ___ +# / ___|| |__ __ _ _ __ ___ __| | / \ | _ \_ _| +# \___ \| '_ \ / _` | '__/ _ \/ _` | / _ \ | |_) | | +# ___) | | | | (_| | | | __/ (_| | / ___ \| __/| | +# |____/|_| |_|\__,_|_| \___|\__,_| /_/ \_\_| |___| +# + + /shared/appointments/upcoming: + get: + summary: Retourne la list des prochains rendez-vous de l'utilisateur + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of upcoming appointment data (name, date, time etc..) for a user. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + date: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/lcsection/{projectId}/{title}/{date}: + get: + summary: Retourne la liste de sections de LC avec un titre donné + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array containing Lean Canvas + section data with a title for the + current date (or given date if the + date parameter is passed) + parameters: + - in: path + required: true + name: projectId + schema: + type: integer + - in: path + required: true + description: this number can be 1, 2,...,8. It is associated with the title of the lcsection + name: title + schema: + type: integer + enum: [1, 2, 3, 4, 5, 6, 7, 8] + + - in: path + required: true + name: date + description: the date corresponding to the wanted version of lc section. "Nan" for the latest version + example: "NaN" + schema: + type: string + + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + section: + type: string + txt: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/entrepreneurs/{projectId}: + get: + summary: Retourne la liste d'entrepreneurs associée à un projet donné + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of entrepreneur + names associated with a project + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/user-entrepreneur" + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/admin/{projectId}: + get: + summary: Retourne les informations de l'admin qui accompagne le projet + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON object containing information (name, gmail, tel, etc..) + the admin supervising the project with id projectID. + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/user-admin" + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /shared/projects/appointments/{projectId}: + get: + summary: Retourne les rendez-vous du projet + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of upcoming and past appointment + data for the project with id projectID. + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + appointementId: + type: integer + name: + type: string + date: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + /shared/projects/appointments/report/{apointementId}: + get: + summary: Retourne le rapport pdf du rendez-vous + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + PDF file containing the ap- + pointment report + parameters: + - in: path + name: apointementId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/pdf: + schema: + type: string + format: binary + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /shared/appointments/request: + post: + summary: demander un rendez-vous + description: + will add an appointement request request by the applicant + to have an appointment to be confirmed or denied by the + specified participants of the appointement. + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-entrepreneur + - MyINPulse-admin + requestBody: + description: \"participants\" property is an array containing userids of the participants in the appointement + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + start_time: + type: string + end_time: + type: string + place: + type: string + applicantId: + type: integer + participants: + #/* */ + type: array + items: + type: integer + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + +# _____ _ _ _____ ____ _____ ____ ____ _____ _ _ _____ _ _ ____ +# | ____| \ | |_ _| _ \| ____| _ \| _ \| ____| \ | | ____| | | | _ \ +# | _| | \| | | | | |_) | _| | |_) | |_) | _| | \| | _| | | | | |_) | +# | |___| |\ | | | | _ <| |___| __/| _ <| |___| |\ | |___| |_| | _ < +# |_____|_|_\_| |_| |_| \_\_____|_| |_| \_\_____|_| \_|_____|\___/|_| \_\ +# / \ | _ \_ _| +# / _ \ | |_) | | +# / ___ \| __/| | +# /_/ \_\_| |___| +# + + + /entrepreneur/projects/request: + post: + summary: demander la création et validation d'un projet + tags: + - Entrepreneurs API + description: + Adds project to pending projects + to then be accepted or rejected by + an admin + security: + - MyINPulse: + - MyINPulse-entrepreneur + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /entrepreneur/lcsection/add/{projectId}: + post: + summary: ajouter une sections au LC + description: + Adds input data to the user's LC + with a specified title. + tags: + - Entrepreneurs API + security: + - MyINPulse: + - MyINPulse-entrepreneur + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + txt: + type: string + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + /entrepreneur/lcsection/modify/{sectionId}: + put: + summary: modifier les données d'une section LC + description: + Modifies input Lean Canvas section by changing it to + the information in the request body and changes the + time stamp. + tags: + - Entrepreneurs API + security: + - MyINPulse: + - MyINPulse-entrepreneur + parameters: + - in: path + name: sectionId + schema: + type: integer + required: true + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + txt: + type: string + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /entrepreneur/lcsection/remove/{sectionId}: + delete: + summary: supprimer une section LC. + description: + Deletes section from Lean Canvas + tags: + - Entrepreneurs API + security: + - MyINPulse: + - MyINPulse-entrepreneur + parameters: + - in: path + name: sectionId + schema: + type: integer + required: true + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + + \ No newline at end of file -- 2.47.2 From 5f51a1008bc3cfa605e16aed6d181c6746edeff3 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Thu, 20 Mar 2025 22:42:49 +0100 Subject: [PATCH 24/57] fix: fixing conflicts --- front/MyINPulse-front/fake_data/db.json | 10 + front/MyINPulse-front/fake_data/open.sh | 2 + .../src/components/canvas/CanvasItem.vue | 181 ++++++++++++++++++ .../src/components/canvas/HeaderCanvas.vue | 120 ++++++++++++ .../src/components/canvas/LeanCanvas.vue | 56 ++++++ .../src/components/canvas/style-project.css | 156 +++++++++++++++ .../MyINPulse-front/src/plugins/authStore.ts | 14 ++ 7 files changed, 539 insertions(+) create mode 100644 front/MyINPulse-front/fake_data/db.json create mode 100755 front/MyINPulse-front/fake_data/open.sh create mode 100644 front/MyINPulse-front/src/components/canvas/CanvasItem.vue create mode 100644 front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue create mode 100644 front/MyINPulse-front/src/components/canvas/LeanCanvas.vue create mode 100644 front/MyINPulse-front/src/components/canvas/style-project.css create mode 100644 front/MyINPulse-front/src/plugins/authStore.ts diff --git a/front/MyINPulse-front/fake_data/db.json b/front/MyINPulse-front/fake_data/db.json new file mode 100644 index 0000000..8a5776e --- /dev/null +++ b/front/MyINPulse-front/fake_data/db.json @@ -0,0 +1,10 @@ +{ + "entrepreneurs": [ + { "id": 1, "name": "Alice", "email": "alice@example.com" }, + { "id": 2, "name": "Bob", "email": "bob@example.com" }, + { "id": 3, "name": "Charlie", "email": "charlie@example.com" } + ], + "data": [ + { "canva_data": "this is a fake data to test api" } + ] +} diff --git a/front/MyINPulse-front/fake_data/open.sh b/front/MyINPulse-front/fake_data/open.sh new file mode 100755 index 0000000..cd3b9b6 --- /dev/null +++ b/front/MyINPulse-front/fake_data/open.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +json-server --watch db.json --port 5000 \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue new file mode 100644 index 0000000..729fef2 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -0,0 +1,181 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue new file mode 100644 index 0000000..8b08628 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -0,0 +1,120 @@ + + + + + + + diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue new file mode 100644 index 0000000..a687982 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/front/MyINPulse-front/src/components/canvas/style-project.css b/front/MyINPulse-front/src/components/canvas/style-project.css new file mode 100644 index 0000000..e505a15 --- /dev/null +++ b/front/MyINPulse-front/src/components/canvas/style-project.css @@ -0,0 +1,156 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 10px; + } + + .row { + display: flex; + } + + .cell { + flex: 1; + border: 1px solid #ddd; + padding: 10px; + text-align: center; + background-color: #f1f1f1; + } + + .produit { + background-color: #f9e4e4; + } + + .marche { + background-color: #e4f1f9; + } + + .valeur { + background-color: #f9f4e4; + } + + h3 { + margin: 0; + font-size: 18px; + color: #333; + } + + p { + margin: 5px 0 0; + font-size: 14px; + } + + + body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f9f9f9; + } + + h1 img { + height: 80px; + margin: 40px; + text-align: center; + } + + .row { + display: flex; + margin-bottom: 10px; + } + + #ade { + max-width: 1200px; + margin: 20px auto; + padding: 20px; + text-align: center; + background-color: #e8f5e9; + border: 2px solid #4caf50; + border-radius: 10px; + } + + #ade h3 { + color: #2e7d32; + } + + #ade p { + margin: 10px 0; + font-size: 16px; + color: #333; + } + header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px 20px; + background-color: #fff; + border-bottom: 2px solid #ddd; + } + + header img { + height: 60px; + } + + header .contact-menu { + position: relative; + } + + .contact-button, .return { + padding: 10px 15px; + border: none; + border-radius: 4px; + background-color: #2196f3; + color: #fff; + cursor: pointer; + } + + .contact-button:hover, .return:hover { + background-color: #1976d2; + } + + /* Dropdown styling */ + .contact-dropdown { + position: absolute; + right: 0; + top: 50px; + display: none; + flex-direction: column; + gap: 10px; + padding: 15px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + z-index: 10; + } + + .contact-dropdown button { + padding: 8px 12px; + border: none; + border-radius: 4px; + background-color: #4caf50; + color: #fff; + cursor: pointer; + } + + .contact-dropdown button:hover { + background-color: #388e3c; + } + + .return { + background-color: #f44336; + } + + .return:hover { + background-color: #d32f2f; + } + + .header-buttons { + display: flex; + align-items: center; + gap: 15px; + } + + + a{ + color: white; + } \ No newline at end of file diff --git a/front/MyINPulse-front/src/plugins/authStore.ts b/front/MyINPulse-front/src/plugins/authStore.ts new file mode 100644 index 0000000..1a5c06e --- /dev/null +++ b/front/MyINPulse-front/src/plugins/authStore.ts @@ -0,0 +1,14 @@ +// file: src/plugins/authStore.js + +import { useAuthStore } from "@/stores/authStore.ts"; +import keycloakService from '@/services/keycloak'; +// Setup auth store as a plugin so it can be accessed globally in our FE +const authStorePlugin = { + install(app: any, option: any) { + const store = useAuthStore(option.pinia); + app.config.globalProperties.$store = store; + keycloakService.CallInitStore(store); + } +} + +export default authStorePlugin; \ No newline at end of file -- 2.47.2 From 0f8c83c2e2ad758561ed9472037d084bed5fe7bd Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Fri, 21 Mar 2025 01:20:34 +0100 Subject: [PATCH 25/57] feat: adding the endpoints' doc to the branch for an easy access --- Documentation/openapi/main.yaml | 741 ++++++++++++++++++++++++++++++++ 1 file changed, 741 insertions(+) create mode 100644 Documentation/openapi/main.yaml diff --git a/Documentation/openapi/main.yaml b/Documentation/openapi/main.yaml new file mode 100644 index 0000000..263e9ab --- /dev/null +++ b/Documentation/openapi/main.yaml @@ -0,0 +1,741 @@ +openapi: 3.0.3 +info: + title: MyInpulse Backend Api + description: this document servers as a documentation for the backend api. + version: 0.0.0 + +tags: + - name: Entrepreneurs API + description: La partie de l'api dédiée aux entrepreneurs + - name: Admin API + description: La partie de l'api dédiée aux entrepreneurs + - name: Shared API + description: La partie de l'api dédiée aux entrepreneurs et admins + + +components: + schemas: + user: + type: object + properties: + nom: + type: string + prenom: + type: string + email: + type: string + example: "example@exmaple.com" + secondaryEmail: + type: string + example: "example@exmaple.com" + tel: + type: string + example: "0612345678" + user-entrepreneur: + type: object + properties: + user: + $ref: "#/components/schemas/user" + entrepreneur: + type: object + properties: + ecole: + type: string + example: "enseirb" + filiere: + type: string + example: "info" + status: + type: boolean + example: false + user-admin: + type: object + properties: + admin: + $ref: "#/components/schemas/user" + + securitySchemes: + MyINPulse: + type: oauth2 + flows: + implicit: + authorizationUrl: https://petstore3.swagger.io/oauth/authorize + scopes: + MyINPulse-admin: Administrateur + MyINPulse-entrepreneur: Utilisateur + +paths: + +# _ ____ __ __ ___ _ _ _ ____ ___ +# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _| +# / _ \ | | | | |\/| || || \| | / _ \ | |_) | | +# / ___ \| |_| | | | || || |\ | / ___ \| __/| | +# /_/ \_\____/|_| |_|___|_| \_| /_/ \_\_| |___| +# + + /admin/projects: + get: + summary: Retourne la liste of projets associés à l'admin + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + description: + JSON array of who's elements are objects containing necessary information for the view + (project name, entrepreneur names, etc..) + of the projects an admin is watching over. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + E_names: + type: string + description: entrepreneur names + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + /admin/projects/pending/decision: + post: + summary: valider un projet en attente de validation + tags: + - Admin API + description: + if the request is accepted the status of the + project is changed to ongoing, entrepreneur + account is confirmed and the project is linked + to the admin accepting the request and the + entrepreneur requesting it. Else the pending + project and user info are deleted. + security: + - MyINPulse: + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + pedingProjectId: + type: integer + decision: + type: boolean + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /admin/projects/add: + post: + summary: Ajout manuel d'un projet + description: + Adds a project with the + inputed details + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /admin/appointments/report/{appointmentId}: + put: + summary: enregistrer un rapport du rendez-vous + description: + Generate a PDF file formatted + from input text and links it + to the appointement. + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: appointmentId + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + body: + type: string + conclusion: + type: string + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + post: + summary: modifier un rapport déja éxistant du rendez-vous + description: + Modifies the report file to input + text and links it to the appointement. + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: appointmentId + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + body: + type: string + conclusion: + type: string + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /admin/projects/remove/{projectId}: + delete: + summary: supression d'un project + description: + Removes the project + with the inputed id projectId + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + parameters: + - in: path + name: projectId + required: true + schema: + type: integer + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /admin/projects/pending: + get: + summary: Retourne la liste des projets en attente de validation + tags: + - Admin API + security: + - MyINPulse: + - MyINPulse-admin + description: + JSON array of who's elements are objects containing + necessary information for the view (project name, + entrepreneur names, etc..) of all pending projects. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + +# +# ____ _ _ _ ____ ___ +# / ___|| |__ __ _ _ __ ___ __| | / \ | _ \_ _| +# \___ \| '_ \ / _` | '__/ _ \/ _` | / _ \ | |_) | | +# ___) | | | | (_| | | | __/ (_| | / ___ \| __/| | +# |____/|_| |_|\__,_|_| \___|\__,_| /_/ \_\_| |___| +# + + /shared/appointments/upcoming: + get: + summary: Retourne la list des prochains rendez-vous de l'utilisateur + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of upcoming appointment data (name, date, time etc..) for a user. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + date: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/lcsection/{projectId}/{title}/{date}: + get: + summary: Retourne la liste de sections de LC avec un titre donné + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array containing Lean Canvas + section data with a title for the + current date (or given date if the + date parameter is passed) + parameters: + - in: path + required: true + name: projectId + schema: + type: integer + - in: path + required: true + description: this number can be 1, 2,...,8. It is associated with the title of the lcsection + name: title + schema: + type: integer + enum: [1, 2, 3, 4, 5, 6, 7, 8] + + - in: path + required: true + name: date + description: the date corresponding to the wanted version of lc section. "Nan" for the latest version + example: "NaN" + schema: + type: string + + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + section: + type: string + txt: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/entrepreneurs/{projectId}: + get: + summary: Retourne la liste d'entrepreneurs associée à un projet donné + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of entrepreneur + names associated with a project + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/user-entrepreneur" + "400": + description: Bad request + "401": + description: Authorization information is missing or invalid + + /shared/projects/admin/{projectId}: + get: + summary: Retourne les informations de l'admin qui accompagne le projet + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON object containing information (name, gmail, tel, etc..) + the admin supervising the project with id projectID. + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/user-admin" + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /shared/projects/appointments/{projectId}: + get: + summary: Retourne les rendez-vous du projet + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + JSON array of upcoming and past appointment + data for the project with id projectID. + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + appointementId: + type: integer + name: + type: string + date: + type: string + time: + type: string + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + /shared/projects/appointments/report/{apointementId}: + get: + summary: Retourne le rapport pdf du rendez-vous + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-admin + - MyINPulse-entrepreneur + description: + PDF file containing the ap- + pointment report + parameters: + - in: path + name: apointementId + schema: + type: integer + required: true + responses: + "200": + description: OK + content: + application/pdf: + schema: + type: string + format: binary + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /shared/appointments/request: + post: + summary: demander un rendez-vous + description: + will add an appointement request request by the applicant + to have an appointment to be confirmed or denied by the + specified participants of the appointement. + tags: + - Shared API + security: + - MyINPulse: + - MyINPulse-entrepreneur + - MyINPulse-admin + requestBody: + description: \"participants\" property is an array containing userids of the participants in the appointement + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + start_time: + type: string + end_time: + type: string + place: + type: string + applicantId: + type: integer + participants: + #/* */ + type: array + items: + type: integer + + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + +# _____ _ _ _____ ____ _____ ____ ____ _____ _ _ _____ _ _ ____ +# | ____| \ | |_ _| _ \| ____| _ \| _ \| ____| \ | | ____| | | | _ \ +# | _| | \| | | | | |_) | _| | |_) | |_) | _| | \| | _| | | | | |_) | +# | |___| |\ | | | | _ <| |___| __/| _ <| |___| |\ | |___| |_| | _ < +# |_____|_|_\_| |_| |_| \_\_____|_| |_| \_\_____|_| \_|_____|\___/|_| \_\ +# / \ | _ \_ _| +# / _ \ | |_) | | +# / ___ \| __/| | +# /_/ \_\_| |___| +# + + + /entrepreneur/projects/request: + post: + summary: demander la création et validation d'un projet + tags: + - Entrepreneurs API + description: + Adds project to pending projects + to then be accepted or rejected by + an admin + security: + - MyINPulse: + - MyINPulse-entrepreneur + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + founder: + $ref: "#/components/schemas/user-entrepreneur" + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + /entrepreneur/lcsection/add/{projectId}: + post: + summary: ajouter une sections au LC + description: + Adds input data to the user's LC + with a specified title. + tags: + - Entrepreneurs API + security: + - MyINPulse: + - MyINPulse-entrepreneur + parameters: + - in: path + name: projectId + schema: + type: integer + required: true + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + txt: + type: string + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + /entrepreneur/lcsection/modify/{sectionId}: + put: + summary: modifier les données d'une section LC + description: + Modifies input Lean Canvas section by changing it to + the information in the request body and changes the + time stamp. + tags: + - Entrepreneurs API + security: + - MyINPulse: + - MyINPulse-entrepreneur + parameters: + - in: path + name: sectionId + schema: + type: integer + required: true + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + txt: + type: string + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + /entrepreneur/lcsection/remove/{sectionId}: + delete: + summary: supprimer une section LC. + description: + Deletes section from Lean Canvas + tags: + - Entrepreneurs API + security: + - MyINPulse: + - MyINPulse-entrepreneur + parameters: + - in: path + name: sectionId + schema: + type: integer + required: true + responses: + "200": + description: OK + "400": + description: Bad request + "401": + description: Authorization information is + missing or invalid + + + + \ No newline at end of file -- 2.47.2 From 79baddb8f663bd1f8448b51e0f890bfa8bc097a1 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Sun, 23 Mar 2025 21:59:27 +0100 Subject: [PATCH 26/57] fix + feat: fixed some bugs + added a mock parser since the damn backend is not working, not finished tho (bugs) --- front/MyINPulse-front/fake_data/db.json | 61 +++++- .../src/components/canvas/CanvasItem.vue | 188 ++++++++++++++---- .../src/components/canvas/LeanCanvas.vue | 21 +- .../MyINPulse-front/src/views/CanvasView.vue | 3 +- .../src/views/errorWrapper.vue | 2 +- 5 files changed, 216 insertions(+), 59 deletions(-) mode change 100644 => 100755 front/MyINPulse-front/src/components/canvas/CanvasItem.vue diff --git a/front/MyINPulse-front/fake_data/db.json b/front/MyINPulse-front/fake_data/db.json index 8a5776e..c04a261 100644 --- a/front/MyINPulse-front/fake_data/db.json +++ b/front/MyINPulse-front/fake_data/db.json @@ -1,10 +1,63 @@ { "entrepreneurs": [ - { "id": 1, "name": "Alice", "email": "alice@example.com" }, - { "id": 2, "name": "Bob", "email": "bob@example.com" }, - { "id": 3, "name": "Charlie", "email": "charlie@example.com" } + { "id": 1, "name": "Alice", "email": "alice@example.com" }, + { "id": 2, "name": "Bob", "email": "bob@example.com" }, + { "id": 3, "name": "Charlie", "email": "charlie@example.com" } ], "data": [ - { "canva_data": "this is a fake data to test api" } + { + "projectId": 1, + "title": 1, + "title_text": "1. Problème", + "description": "3 problèmes essentiels à résoudre pour le client" + }, + { + "projectId": 1, + "title": 2, + "title_text": "2. Segments", + "description": "Les segments de clientèle visés" + }, + { + "projectId": 1, + "title": 3, + "title_text": "3. Valeur", + "description": "La proposition de valeur" + }, + { + "projectId": 1, + "title": 4, + "title_text": "4. Solution", + "description": "Les solutions proposées" + }, + { + "projectId": 1, + "title": 5, + "title_text": "5. Avantage", + "description": "Les avantages concurrentiels" + }, + { + "projectId": 1, + "title": 6, + "title_text": "6. Canaux", + "description": "Les canaux de distribution" + }, + { + "projectId": 1, + "title": 7, + "title_text": "7. Indicateurs", + "description": "Les indicateurs clés de performance" + }, + { + "projectId": 1, + "title": 8, + "title_text": "8. Coûts", + "description": "Les coûts associés" + }, + { + "projectId": 1, + "title": 9, + "title_text": "9. Revenus", + "description": "Les sources de revenus" + } ] } diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue old mode 100644 new mode 100755 index 3e504e8..b4d43d9 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -1,23 +1,28 @@ @@ -25,16 +30,22 @@ import { ref, defineProps } from "vue"; import axios from "axios"; -const props = defineProps<{ - title: string; +const IS_MOCK_MODE = true; + +const props = defineProps<{ + projectId: number; + title: number; + title_text: string; description: string; }>(); const expanded = ref(false); -const isEditing = ref(false); -const currentDescription = ref(props.description); -const editedDescription = ref(props.description); +const currentDescriptions = ref([]); +const editedDescriptions = ref([]); +const isEditing = ref([]); + +/* const fetchData = async () => { try { const response = await axios.get("http://localhost:5000/data"); // Met à jour l'URL @@ -48,43 +59,121 @@ const fetchData = async () => { console.error("Erreur lors de la récupération des données :", error); } }; +*/ +// Fonction de simulation de l'API +const mockFetch = async (projectId: number, title: number, date: string) => { + console.log(`Mock fetch pour projectId: ${projectId}, title: ${title}, date: ${date}`); + + return new Promise<{ txt: string }[]>((resolve) => { + setTimeout(() => { + resolve([ + { txt: "Ceci est une description 1 pour tester the damn front, Why are u still reading dumbass this is just some nonsense sentence XD" }, + { txt: "Ceci est une description 1 pour tester the damn front, Bruh are u still here?" }, + { txt: "Ceci est une description 1 pour tester the damn front, .-. BRUH" } + ]); + }, 500); // Simule un délai réseau de 500ms + }); +}; + +// Fonction fetchData avec possibilité d'utiliser le mock +const fetchData = async (projectId: number, title: number, date: string, useMock = false) => { + try { + const responseData = useMock + ? await mockFetch(projectId, title, date) + : (await axios.get<{ txt: string }[]>( + `http://localhost:5000/shared/projects/lcsection/${projectId}/${title}/${date}` + )).data; + + if (responseData.length > 0) { + currentDescriptions.value = responseData.map((item) => item.txt); + editedDescriptions.value = [...currentDescriptions.value]; // Copie initiale + isEditing.value = Array(responseData.length).fill(false); + } else { + console.warn("Aucune donnée reçue."); + } + } catch (error) { + console.error("Erreur lors de la récupération des données :", error); + } +}; + +// Utilisation du mock dans handleClick pour tester sans serveur const handleClick = async () => { if (!expanded.value) { - await fetchData(); - } else if (!isEditing.value) { - currentDescription.value = props.description; - editedDescription.value = props.description; + await fetchData(props.projectId, props.title, "NaN", IS_MOCK_MODE); // true pour activer le mock + } else if (!isEditing.value.includes(true)) { + // Réinitialiser les descriptions si aucune édition n'est en cours + currentDescriptions.value = [props.description]; + editedDescriptions.value = [props.description]; } - if (!isEditing.value) { + if (!isEditing.value.includes(true)) { expanded.value = !expanded.value; } }; -const startEditing = () => { - isEditing.value = true; + +const startEditing = (index: number) => { + isEditing.value[index] = true; }; -const saveEdit = async () => { +/* +const saveEdit = async (index: number) => { try { - const id = 1; // Mets l'ID ici (dans ton cas, l'unique entrée) - + const id = index + 1; // À adapter selon l'ID réel des données await axios.put(`http://localhost:5000/data/${id}`, { - canva_data: editedDescription.value + canva_data: editedDescriptions.value[index] }); // Mettre à jour l'affichage local après la mise à jour réussie - currentDescription.value = editedDescription.value; - isEditing.value = false; + currentDescriptions.value[index] = editedDescriptions.value[index]; + isEditing.value[index] = false; } catch (error) { console.error("Erreur lors de la mise à jour des données :", error); } }; +*/ -const cancelEdit = () => { - editedDescription.value = currentDescription.value; - isEditing.value = false; +// Fonction de mock pour l'enregistrement +const mockSaveEdit = async (index: number) => { + try { + const id = index + 1; // À adapter selon l'ID réel des données + console.log(`Mock save pour l'ID ${id} avec la description : ${editedDescriptions.value[index]}`); + + // Simuler un délai d'enregistrement comme une requête réseau + await new Promise((resolve) => setTimeout(resolve, 500)); // Simulation de délai réseau + + // Mettre à jour l'affichage local après la mise à jour réussie + currentDescriptions.value[index] = editedDescriptions.value[index]; + isEditing.value[index] = false; + } catch (error) { + console.error("Erreur lors de la mise à jour des données mockées :", error); + } +}; + +// Utilisation de `mockSaveEdit` au lieu de `saveEdit` dans `handleClick` ou tout autre endroit +const saveEdit = async (index: number) => { + if (IS_MOCK_MODE) { + await mockSaveEdit(index); + } else { + try { + const id = index + 1; + await axios.put(`http://localhost:5000/data/${id}`, { + canva_data: editedDescriptions.value[index] + }); + + // Mettre à jour l'affichage local après la mise à jour réussie + currentDescriptions.value[index] = editedDescriptions.value[index]; + isEditing.value[index] = false; + } catch (error) { + console.error("Erreur lors de la mise à jour des données :", error); + } + } +}; + +const cancelEdit = (index: number) => { + editedDescriptions.value[index] = currentDescriptions.value[index]; + isEditing.value[index] = false; }; @@ -122,6 +211,17 @@ const cancelEdit = () => { color: #666; } +.cell .description { + width: 800px; + height: 100px; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + padding: 10px; +} + .expanded { position: fixed; top: 0; @@ -137,21 +237,21 @@ const cancelEdit = () => { } .edit-input { - width: 80%; + width: 800px; height: 100px; font-size: 16px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; margin-top: 10px; + box-sizing: border-box; } + .button-container { - position: absolute; - bottom: 40px; - right: 40px; display: flex; gap: 10px; + margin-top: 10px; } .edit-button, .save-button, .cancel-button { @@ -160,7 +260,8 @@ const cancelEdit = () => { border-radius: 5px; cursor: pointer; transition: background 0.3s ease; - font-size: 16px; + font-size: 12px; + margin-right: 5px; } .edit-button { @@ -190,5 +291,4 @@ const cancelEdit = () => { background-color: #c82333; } - - \ No newline at end of file + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue index a687982..61da1b2 100644 --- a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -4,7 +4,9 @@ v-for="(item, index) in items" :key="index" :title="item.title" + :title_text="item.title_text" :description="item.description" + :projectId="item.projectId" :class="item.class" /> @@ -15,16 +17,17 @@ import { ref } from "vue"; import CanvasItem from "@/components/canvas/CanvasItem.vue"; const items = ref([ - { title: "1. Problème", description: "3 problèmes essentiels à résoudre pour le client", class: "Probleme" }, - { title: "2. Segments", description: "Les segments de clientèle visés", class: "Segments" }, - { title: "3. Valeur", description: "La proposition de valeur", class: "Valeur" }, - { title: "4. Solution", description: "Les solutions proposées", class: "Solution" }, - { title: "5. Avantage", description: "Les avantages concurrentiels", class: "Avantage" }, - { title: "6. Canaux", description: "Les canaux de distribution", class: "Canaux" }, - { title: "7. Indicateurs", description: "Les indicateurs clés de performance", class: "Indicateurs" }, - { title: "8. Coûts", description: "Les coûts associés", class: "Couts" }, - { title: "9. Revenus", description: "Les sources de revenus", class: "Revenus" } + { projectId: 1, title: 1, title_text: "1. Problème", description: "3 problèmes essentiels à résoudre pour le client", class: "Probleme" }, + { projectId: 1, title: 2, title_text: "2. Segments", description: "Les segments de clientèle visés", class: "Segments" }, + { projectId: 1, title: 3, title_text: "3. Valeur", description: "La proposition de valeur", class: "Valeur" }, + { projectId: 1, title: 4, title_text: "4. Solution", description: "Les solutions proposées", class: "Solution" }, + { projectId: 1, title: 5, title_text: "5. Avantage", description: "Les avantages concurrentiels", class: "Avantage" }, + { projectId: 1, title: 6, title_text: "6. Canaux", description: "Les canaux de distribution", class: "Canaux" }, + { projectId: 1, title: 7, title_text: "7. Indicateurs", description: "Les indicateurs clés de performance", class: "Indicateurs" }, + { projectId: 1, title: 8, title_text: "8. Coûts", description: "Les coûts associés", class: "Couts" }, + { projectId: 1, title: 9, title_text: "9. Revenus", description: "Les sources de revenus", class: "Revenus" } ]); + -- 2.47.2 From 323cb0538880ce0eff3aca3309b89f25ce057948 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:07:50 +0100 Subject: [PATCH 28/57] fix: css fixing --- .../src/components/canvas/CanvasItem.vue | 67 +++++++++++++++---- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index b4d43d9..8cf2124 100755 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -2,7 +2,7 @@

{{ title_text }}

-
+
-
+
@@ -87,7 +87,7 @@ const fetchData = async (projectId: number, title: number, date: string, useMock if (responseData.length > 0) { currentDescriptions.value = responseData.map((item) => item.txt); - editedDescriptions.value = [...currentDescriptions.value]; // Copie initiale + editedDescriptions.value = [...currentDescriptions.value]; isEditing.value = Array(responseData.length).fill(false); } else { console.warn("Aucune donnée reçue."); @@ -211,8 +211,8 @@ const cancelEdit = (index: number) => { color: #666; } -.cell .description { - width: 800px; +.cell { + width: 100%; height: 100px; overflow: hidden; display: flex; @@ -236,32 +236,71 @@ const cancelEdit = (index: number) => { box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } +.description { + width: 100%; + height: 100%; + font-size: 16px; + margin-top: 10px; + /*box-sizing: border-box;*/ + align-items: center; + justify-content: center; + text-align: center; + margin-left: 2%; +} + +.description + .p { + align-items: center; + justify-content: center; + text-align: center; +} + .edit-input { - width: 800px; - height: 100px; + width: 100%; + height: 100%; font-size: 16px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; margin-top: 10px; box-sizing: border-box; + margin-left: 2%; } - .button-container { - display: flex; - gap: 10px; - margin-top: 10px; + display: block; + margin-top: 20px; + justify-content: center; + align-items: center; } -.edit-button, .save-button, .cancel-button { - padding: 10px 15px; +.section-bloc ,.editing-section-bloc { + width: 100%; + justify-content: center; + align-items: center; + display: flex; + margin-right: 10%; + margin: 10px; +} + +.edit-button { + width: 100px; + height: 40px; + border: none; + border-radius: 5px; + cursor: pointer; + transition: background 0.3s ease; + font-size: 12px; + margin-right: 20px; +} + +.save-button, .cancel-button { + width: 100px; + height: 40px; border: none; border-radius: 5px; cursor: pointer; transition: background 0.3s ease; font-size: 12px; - margin-right: 5px; } .edit-button { -- 2.47.2 From e769dd6757b9e1f2cf4f1f4a95e2978880b902d4 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:30:59 +0100 Subject: [PATCH 29/57] fix: css fixing (again) --- .../src/components/canvas/CanvasItem.vue | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index 8cf2124..2d7f5e9 100755 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -211,17 +211,6 @@ const cancelEdit = (index: number) => { color: #666; } -.cell { - width: 100%; - height: 100px; - overflow: hidden; - display: flex; - align-items: center; - justify-content: center; - text-align: center; - padding: 10px; -} - .expanded { position: fixed; top: 0; @@ -236,15 +225,16 @@ const cancelEdit = (index: number) => { box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } + .description { + display: flex; + align-items: center; /* Centre verticalement */ + justify-content: center; /* Centre horizontalement */ + text-align: center; /* Centre le texte à l'intérieur */ width: 100%; height: 100%; font-size: 16px; margin-top: 10px; - /*box-sizing: border-box;*/ - align-items: center; - justify-content: center; - text-align: center; margin-left: 2%; } @@ -266,11 +256,13 @@ const cancelEdit = (index: number) => { margin-left: 2%; } + .button-container { display: block; margin-top: 20px; justify-content: center; align-items: center; + gap: 10px; } .section-bloc ,.editing-section-bloc { @@ -301,6 +293,7 @@ const cancelEdit = (index: number) => { cursor: pointer; transition: background 0.3s ease; font-size: 12px; + margin-bottom: 5px; } .edit-button { -- 2.47.2 From 4ef92efd0e132e233ff317bae6c33becd5228170 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Wed, 26 Mar 2025 11:31:54 +0100 Subject: [PATCH 30/57] fix: js to ts in header --- front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue index 8b08628..0fea105 100644 --- a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue @@ -19,7 +19,7 @@ - + + \ No newline at end of file -- 2.47.2 From 288f983816d8f5a286b90651fc672a72300288cc Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:44:49 +0100 Subject: [PATCH 32/57] merging --- front/MyINPulse-front/eslint.config.js | 29 ++++ .../src/components/HeaderComponent.vue | 26 ++++ .../src/components/ProjectComponent.vue | 130 ++++++++++++++++++ .../src/views/testComponent.vue | 79 +++++++++++ 4 files changed, 264 insertions(+) create mode 100644 front/MyINPulse-front/eslint.config.js create mode 100644 front/MyINPulse-front/src/components/HeaderComponent.vue create mode 100644 front/MyINPulse-front/src/components/ProjectComponent.vue create mode 100644 front/MyINPulse-front/src/views/testComponent.vue diff --git a/front/MyINPulse-front/eslint.config.js b/front/MyINPulse-front/eslint.config.js new file mode 100644 index 0000000..0fe1e5b --- /dev/null +++ b/front/MyINPulse-front/eslint.config.js @@ -0,0 +1,29 @@ +import eslint from "@eslint/js"; +import eslintConfigPrettier from "eslint-config-prettier"; +import eslintPluginVue from "eslint-plugin-vue"; +import globals from "globals"; +import typescriptEslint from "typescript-eslint"; + +export default typescriptEslint.config( + { ignores: ["*.d.ts", "**/coverage", "**/dist"] }, + { + extends: [ + eslint.configs.recommended, + ...typescriptEslint.configs.recommended, + ...eslintPluginVue.configs["flat/recommended"], + ], + files: ["**/*.{ts,vue}"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: globals.browser, + parserOptions: { + parser: typescriptEslint.parser, + }, + }, + rules: { + // your rules + }, + }, + eslintConfigPrettier +); diff --git a/front/MyINPulse-front/src/components/HeaderComponent.vue b/front/MyINPulse-front/src/components/HeaderComponent.vue new file mode 100644 index 0000000..b285ca1 --- /dev/null +++ b/front/MyINPulse-front/src/components/HeaderComponent.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/front/MyINPulse-front/src/components/ProjectComponent.vue b/front/MyINPulse-front/src/components/ProjectComponent.vue new file mode 100644 index 0000000..c3d9f29 --- /dev/null +++ b/front/MyINPulse-front/src/components/ProjectComponent.vue @@ -0,0 +1,130 @@ + + + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/views/testComponent.vue b/front/MyINPulse-front/src/views/testComponent.vue new file mode 100644 index 0000000..9ba1d5a --- /dev/null +++ b/front/MyINPulse-front/src/views/testComponent.vue @@ -0,0 +1,79 @@ + + + + + -- 2.47.2 From 14a953536ab3999042f8f27e8f5c76300aadc99d Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:45:40 +0100 Subject: [PATCH 33/57] merging --- front/MyINPulse-front/.prettierrc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 front/MyINPulse-front/.prettierrc diff --git a/front/MyINPulse-front/.prettierrc b/front/MyINPulse-front/.prettierrc new file mode 100644 index 0000000..18a9a8a --- /dev/null +++ b/front/MyINPulse-front/.prettierrc @@ -0,0 +1,7 @@ +{ + "useTabs":false, + "semi":true, + "trailingComma":"es5", + "arrowParens":"always", + "tabWidth":4 +} \ No newline at end of file -- 2.47.2 From 4ec292cca7762997bec7f1161ea314e6f281211a Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:50:23 +0100 Subject: [PATCH 34/57] fix: merging --- front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue old mode 100644 new mode 100755 -- 2.47.2 From 15ccb5630aae57ef43a6481ef1148c9bf1905824 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:52:04 +0100 Subject: [PATCH 35/57] MERGING --- .gitea/workflows/front.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitea/workflows/front.yaml diff --git a/.gitea/workflows/front.yaml b/.gitea/workflows/front.yaml new file mode 100644 index 0000000..6ad24d2 --- /dev/null +++ b/.gitea/workflows/front.yaml @@ -0,0 +1,24 @@ +name: CI +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install everything + working-directory: ./front/MyINPulse-front + run: npm i + + - name: Run ESLint + working-directory: ./front/MyINPulse-front + run: npx eslint + + - name: Run prettier + working-directory: ./front/MyINPulse-front + run: npx prettier src --check + + - name: Build frontend + working-directory: ./front/MyINPulse-front + run: npm run build \ No newline at end of file -- 2.47.2 From 0ae6e7dfda77a5f3d7af6ed1a638ef649b2b2590 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 26 Mar 2025 11:53:49 +0100 Subject: [PATCH 36/57] merging --- .../src/components/canvas/HeaderCanvas.vue | 120 ------------------ 1 file changed, 120 deletions(-) delete mode 100755 front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue diff --git a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue b/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue deleted file mode 100755 index 8b08628..0000000 --- a/front/MyINPulse-front/src/components/canvas/HeaderCanvas.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - -- 2.47.2 From b9f3bbbe15361d3e9af90ec511800e1a1c66afa9 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Wed, 26 Mar 2025 11:59:16 +0100 Subject: [PATCH 37/57] fix: Adnane? --- front/MyINPulse-front/src/trash.vue | 215 ---------------------------- 1 file changed, 215 deletions(-) delete mode 100644 front/MyINPulse-front/src/trash.vue diff --git a/front/MyINPulse-front/src/trash.vue b/front/MyINPulse-front/src/trash.vue deleted file mode 100644 index 2220673..0000000 --- a/front/MyINPulse-front/src/trash.vue +++ /dev/null @@ -1,215 +0,0 @@ - - - - - \ No newline at end of file -- 2.47.2 From 00a733c03bbf507427514919cb26b51b4a4f23e3 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 2 Apr 2025 10:52:41 +0200 Subject: [PATCH 38/57] fix: manine try now --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 6f4e820..beb949c 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,8 @@ dev-front: clean vite keycloak @cp config/frontdev.docker-compose.yaml docker-compose.yaml @docker compose up -d --build @cd ./front/MyINPulse-front/ && npm run dev + @echo "cd MyINPulse-back" && echo 'export $$(cat .env | xargs)' + @echo "./gradlew bootRun --args='--server.port=8081'" prod: clean keycloak @cp config/prod.env front/MyINPulse-front/.env @@ -40,6 +42,7 @@ prod: clean keycloak @cp config/prod.env .env @cp config/prod.docker-compose.yaml docker-compose.yaml @docker compose up -d --build + -- 2.47.2 From 03897e11395651ad8df60f13261e1226c254e956 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 2 Apr 2025 11:51:39 +0200 Subject: [PATCH 39/57] feat: mode admin added 'first try' --- .../src/components/canvas/CanvasItem.vue | 105 ++++++++++-------- 1 file changed, 61 insertions(+), 44 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index 6c2e6df..9065461 100755 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -3,26 +3,41 @@

{{ title_text }}

- - - -- 2.47.2 From 84d8d4523b59ebc7907c9ef577c3c31b8e1ef2b2 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Wed, 9 Apr 2025 00:09:58 +0200 Subject: [PATCH 44/57] feat: added a function for post and delete that follows callApi that only does get --- front/MyINPulse-front/src/services/api.ts | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/front/MyINPulse-front/src/services/api.ts b/front/MyINPulse-front/src/services/api.ts index 5c4fc7b..64e03a6 100644 --- a/front/MyINPulse-front/src/services/api.ts +++ b/front/MyINPulse-front/src/services/api.ts @@ -65,4 +65,28 @@ function callApi( ); } -export { callApi }; +function postApi( + endpoint: string, + data: any, + onSuccessHandler?: (response: AxiosResponse) => void, + onErrorHandler?: (error: AxiosError) => void +): void { + axiosInstance + .post(endpoint, data) + .then(onSuccessHandler ?? defaultApiSuccessHandler) + .catch(onErrorHandler ?? defaultApiErrorHandler); +} + +function deleteApi( + endpoint: string, + onSuccessHandler?: (response: AxiosResponse) => void, + onErrorHandler?: (error: AxiosError) => void +): void { + axiosInstance + .delete(endpoint) + .then(onSuccessHandler ?? defaultApiSuccessHandler) + .catch(onErrorHandler ?? defaultApiErrorHandler); +} + + +export { callApi, postApi, deleteApi }; -- 2.47.2 From 8c4b9ceb9de6bee6bdb474f0a2b72fb9ce1a356d Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 9 Apr 2025 00:19:56 +0200 Subject: [PATCH 45/57] feat: still enhancing the visuals --- .../src/components/canvas/CanvasItem.vue | 12 +++++------- .../src/components/canvas/HeaderCanvas.vue | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue index 2ff2219..cbb1e0d 100755 --- a/front/MyINPulse-front/src/components/canvas/CanvasItem.vue +++ b/front/MyINPulse-front/src/components/canvas/CanvasItem.vue @@ -199,9 +199,6 @@ const cancelEdit = (index: number) => { -- 2.47.2 From 60290956ecca2e7e8d5f9809240be6f720ddc50e Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Wed, 9 Apr 2025 00:46:44 +0200 Subject: [PATCH 46/57] feat: added form to add project and pending project section for admin, i forgot to push them --- .../src/components/AddProjectForm.vue | 102 ++++++++++++ .../components/PendingProjectComponent.vue | 149 ++++++++++++++++++ front/MyINPulse-front/src/views/AdminMain.vue | 41 +++-- 3 files changed, 282 insertions(+), 10 deletions(-) create mode 100644 front/MyINPulse-front/src/components/AddProjectForm.vue create mode 100644 front/MyINPulse-front/src/components/PendingProjectComponent.vue diff --git a/front/MyINPulse-front/src/components/AddProjectForm.vue b/front/MyINPulse-front/src/components/AddProjectForm.vue new file mode 100644 index 0000000..7b59104 --- /dev/null +++ b/front/MyINPulse-front/src/components/AddProjectForm.vue @@ -0,0 +1,102 @@ + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/components/PendingProjectComponent.vue b/front/MyINPulse-front/src/components/PendingProjectComponent.vue new file mode 100644 index 0000000..8c8c250 --- /dev/null +++ b/front/MyINPulse-front/src/components/PendingProjectComponent.vue @@ -0,0 +1,149 @@ + + + + + + + + + \ No newline at end of file diff --git a/front/MyINPulse-front/src/views/AdminMain.vue b/front/MyINPulse-front/src/views/AdminMain.vue index 0e37829..eacccd2 100644 --- a/front/MyINPulse-front/src/views/AdminMain.vue +++ b/front/MyINPulse-front/src/views/AdminMain.vue @@ -1,8 +1,9 @@ diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue index c566f16..8f84140 100644 --- a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -1,5 +1,5 @@ diff --git a/front/MyINPulse-front/src/services/api.ts b/front/MyINPulse-front/src/services/api.ts index 64e03a6..6b9513f 100644 --- a/front/MyINPulse-front/src/services/api.ts +++ b/front/MyINPulse-front/src/services/api.ts @@ -89,4 +89,4 @@ function deleteApi( } -export { callApi, postApi, deleteApi }; +export { axiosInstance, callApi, postApi, deleteApi }; diff --git a/front/MyINPulse-front/src/views/CanvasView.vue b/front/MyINPulse-front/src/views/CanvasView.vue index 336acd1..822d6dc 100644 --- a/front/MyINPulse-front/src/views/CanvasView.vue +++ b/front/MyINPulse-front/src/views/CanvasView.vue @@ -1,12 +1,24 @@ @@ -14,5 +26,89 @@ // @ts-ignore import HeaderCanvas from "../components/canvas/HeaderCanvas.vue"; import LeanCanvas from '../components/canvas/LeanCanvas.vue'; +import { ref, onMounted } from "vue"; +import { axiosInstance } from "@/services/api.ts"; + +const IS_MOCK_MODE = true; + +// Variables pour les informations de l'administrateur +const admin = ref({ + idUser: 0, + userSurname: "", + userName: "", + primaryMail: "", + secondaryMail: "", + phoneNumber: "" +}); + +const mockAdminData = { + idUser: 1, + userSurname: "ALAMI", + userName: "Adnane", + primaryMail: "mock.admin@example.com", + secondaryMail: "admin.backup@example.com", + phoneNumber: "0600000000" +}; + +// Fonction pour récupérer les données de l'administrateur +const fetchAdminData = async (projectId: number, useMock = IS_MOCK_MODE) => { + try { + if (useMock) { + console.log("Utilisation des données mockées pour l'administrateur"); + admin.value = mockAdminData; + return; + } + + const response = await axiosInstance.get(`/shared/projects/admin/${projectId}`); + admin.value = response.data; + } catch (error) { + console.error("Erreur lors de la récupération des données de l'administrateur :", error); + } +}; + +// Appeler la fonction fetch au montage du composant +onMounted(() => { + const projectId = 1; + fetchAdminData(projectId); +}); - \ No newline at end of file + + \ No newline at end of file -- 2.47.2 From 2b31753265c9e8d07438bbc71b1a9fad4f2a11fd Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Sat, 12 Apr 2025 03:55:30 +0200 Subject: [PATCH 48/57] feat: added an login page but the auth issue is still persisting, found a way to interprete the token the line is commneted in case it breaks code or needs a change --- .../src/components/LoginComponent.vue | 171 ++++++++++++++++++ .../components/PendingProjectComponent.vue | 2 +- front/MyINPulse-front/src/router/router.ts | 6 +- front/MyINPulse-front/src/stores/authStore.ts | 2 +- 4 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 front/MyINPulse-front/src/components/LoginComponent.vue diff --git a/front/MyINPulse-front/src/components/LoginComponent.vue b/front/MyINPulse-front/src/components/LoginComponent.vue new file mode 100644 index 0000000..ef48942 --- /dev/null +++ b/front/MyINPulse-front/src/components/LoginComponent.vue @@ -0,0 +1,171 @@ + + + + + + diff --git a/front/MyINPulse-front/src/components/PendingProjectComponent.vue b/front/MyINPulse-front/src/components/PendingProjectComponent.vue index 8c8c250..c6c95a6 100644 --- a/front/MyINPulse-front/src/components/PendingProjectComponent.vue +++ b/front/MyINPulse-front/src/components/PendingProjectComponent.vue @@ -3,7 +3,7 @@

{{ projectName }}

-

projet mis le: {{ creationDate }}

+

Projet mis le: {{ creationDate }}

diff --git a/front/MyINPulse-front/src/router/router.ts b/front/MyINPulse-front/src/router/router.ts index 6883c33..365e276 100644 --- a/front/MyINPulse-front/src/router/router.ts +++ b/front/MyINPulse-front/src/router/router.ts @@ -11,7 +11,11 @@ const router = createRouter({ // which is lazy-loaded when the route is visited. component: () => import('../views/testComponent.vue'), }, - + { + path: '/login', + name: 'login', + component: () => import('../components/LoginComponent.vue'), + }, { path: '/', name: 'Admin-main', diff --git a/front/MyINPulse-front/src/stores/authStore.ts b/front/MyINPulse-front/src/stores/authStore.ts index 06187ca..a5874d4 100644 --- a/front/MyINPulse-front/src/stores/authStore.ts +++ b/front/MyINPulse-front/src/stores/authStore.ts @@ -54,7 +54,7 @@ const useAuthStore = defineStore("storeAuth", { async logout() { try { await keycloakService.CallLogout( - import.meta.env.VITE_APP_URL + "/test" + import.meta.env.VITE_APP_URL + "/login" //redirect to login page instead of test... ); await this.clearUserData(); } catch (error) { -- 2.47.2 From 70658e4fb98b1582b55f524068623e8566d5acb6 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Sat, 12 Apr 2025 22:22:22 +0200 Subject: [PATCH 49/57] fix: fixed an issue with the server by adding the dependency of jwt --- front/MyINPulse-front/package.json | 3 ++- front/MyINPulse-front/src/components/LoginComponent.vue | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/front/MyINPulse-front/package.json b/front/MyINPulse-front/package.json index ff46180..57ec628 100644 --- a/front/MyINPulse-front/package.json +++ b/front/MyINPulse-front/package.json @@ -18,7 +18,8 @@ "pinia": "^2.3.1", "pinia-plugin-persistedstate": "^4.2.0", "vue": "^3.5.13", - "vue-router": "^4.5.0" + "vue-router": "^4.5.0", + "jwt-decode": "^4.0.0" }, "devDependencies": { "@playwright/test": "^1.49.1", diff --git a/front/MyINPulse-front/src/components/LoginComponent.vue b/front/MyINPulse-front/src/components/LoginComponent.vue index ef48942..b752fe3 100644 --- a/front/MyINPulse-front/src/components/LoginComponent.vue +++ b/front/MyINPulse-front/src/components/LoginComponent.vue @@ -1,7 +1,7 @@ + + + \ No newline at end of file -- 2.47.2 From 03bbc77e8aaea13a4449ed43104fdf6d877480cd Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Mon, 14 Apr 2025 01:32:29 +0200 Subject: [PATCH 51/57] fix: linting all the files possible error may still occur but i just ignored them cuz it's commented code, probably will fix them later if it persists --- front/MyINPulse-front/package-lock.json | 10 ++++++++++ front/MyINPulse-front/src/App.vue | 2 +- front/MyINPulse-front/src/components/Agenda.vue | 6 +++--- .../src/components/LoginComponent.vue | 2 +- .../src/components/ProjectComponent.vue | 4 ++-- .../src/components/canvas/CanvasItem.vue | 12 ++++++------ .../src/components/canvas/LeanCanvas.vue | 2 +- front/MyINPulse-front/src/views/AdminMain.vue | 12 ++++++------ front/MyINPulse-front/src/views/CanvasView.vue | 4 ++-- 9 files changed, 32 insertions(+), 22 deletions(-) diff --git a/front/MyINPulse-front/package-lock.json b/front/MyINPulse-front/package-lock.json index 8809acc..641b0b6 100644 --- a/front/MyINPulse-front/package-lock.json +++ b/front/MyINPulse-front/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^1.7.9", "cors": "^2.8.5", + "jwt-decode": "^4.0.0", "keycloak-js": "^26.1.0", "pinia": "^2.3.1", "pinia-plugin-persistedstate": "^4.2.0", @@ -3588,6 +3589,15 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/keycloak-js": { "version": "26.1.0", "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-26.1.0.tgz", diff --git a/front/MyINPulse-front/src/App.vue b/front/MyINPulse-front/src/App.vue index c675988..795a6d2 100644 --- a/front/MyINPulse-front/src/App.vue +++ b/front/MyINPulse-front/src/App.vue @@ -1,5 +1,5 @@ diff --git a/front/MyINPulse-front/src/components/Agenda.vue b/front/MyINPulse-front/src/components/Agenda.vue index f771e2a..e1af6d0 100644 --- a/front/MyINPulse-front/src/components/Agenda.vue +++ b/front/MyINPulse-front/src/components/Agenda.vue @@ -15,9 +15,9 @@ import { defineProps } from "vue"; interface rendezVous{ - projectName: String, - date: String, - lieu: String, + projectName: string, + date: string, + lieu: string, } const props = defineProps<{ diff --git a/front/MyINPulse-front/src/components/LoginComponent.vue b/front/MyINPulse-front/src/components/LoginComponent.vue index b752fe3..64a0ea4 100644 --- a/front/MyINPulse-front/src/components/LoginComponent.vue +++ b/front/MyINPulse-front/src/components/LoginComponent.vue @@ -54,7 +54,7 @@ onMounted(() => {
-
+

Access Token:

{{ store.user.token }}
diff --git a/front/MyINPulse-front/src/components/ProjectComponent.vue b/front/MyINPulse-front/src/components/ProjectComponent.vue index c3d9f29..0cff5f3 100644 --- a/front/MyINPulse-front/src/components/ProjectComponent.vue +++ b/front/MyINPulse-front/src/components/ProjectComponent.vue @@ -1,5 +1,5 @@ @@ -55,7 +55,7 @@ const IS_ADMIN = false; const props = defineProps<{ projectId: number; title: number; - title_text: string; + titleText: string; description: string; }>(); diff --git a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue index 8f84140..1f3219b 100644 --- a/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue +++ b/front/MyINPulse-front/src/components/canvas/LeanCanvas.vue @@ -6,7 +6,7 @@ :title="item.title" :title_text="item.title_text" :description="item.description" - :projectId="item.projectId" + :project-id="item.projectId" :class="['canvas-item', item.class, 'card', 'shadow', 'p-3']" />
diff --git a/front/MyINPulse-front/src/views/AdminMain.vue b/front/MyINPulse-front/src/views/AdminMain.vue index eacccd2..5675037 100644 --- a/front/MyINPulse-front/src/views/AdminMain.vue +++ b/front/MyINPulse-front/src/views/AdminMain.vue @@ -7,9 +7,9 @@
@@ -18,15 +18,15 @@
- +
diff --git a/front/MyINPulse-front/src/views/CanvasView.vue b/front/MyINPulse-front/src/views/CanvasView.vue index 822d6dc..3f535f9 100644 --- a/front/MyINPulse-front/src/views/CanvasView.vue +++ b/front/MyINPulse-front/src/views/CanvasView.vue @@ -1,7 +1,7 @@ - \ No newline at end of file + \ No newline at end of file -- 2.47.2 From 8b863ee4b128b0464cf9d8fc476011c3f7b93676 Mon Sep 17 00:00:00 2001 From: Mohamed Maoulainine Maoulainine Date: Wed, 16 Apr 2025 11:59:03 +0200 Subject: [PATCH 57/57] fix: adminview --- front/MyINPulse-front/src/components/ProjectComponent.vue | 2 +- front/MyINPulse-front/src/views/AdminMain.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/front/MyINPulse-front/src/components/ProjectComponent.vue b/front/MyINPulse-front/src/components/ProjectComponent.vue index 0cff5f3..983115f 100644 --- a/front/MyINPulse-front/src/components/ProjectComponent.vue +++ b/front/MyINPulse-front/src/components/ProjectComponent.vue @@ -31,7 +31,7 @@ const router = useRouter(); const goToLink = () => { if (props.projectLink) { - router.push(props.projectLink);0 + router.push(props.projectLink); } }; diff --git a/front/MyINPulse-front/src/views/AdminMain.vue b/front/MyINPulse-front/src/views/AdminMain.vue index 5675037..2b2bd4b 100644 --- a/front/MyINPulse-front/src/views/AdminMain.vue +++ b/front/MyINPulse-front/src/views/AdminMain.vue @@ -23,12 +23,12 @@ />
- + - +