From 23bfd67b21634ded1cc4b3fff50103858d1be550 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Mon, 18 Nov 2024 15:52:15 +0100 Subject: [PATCH] kanban - fix steps statuses --- .../2_proposal/cinema-4-13b-022685-fr.pdf.txt | 8 ++++ public/site/blueprints/files/pdf.yml | 3 ++ public/site/plugins/helpers/index.php | 2 + src/components/project/ProjectStep.vue | 43 ++++++++++++++++--- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/public/content/projects/1_miss-dior-blooming-bouquet/2_proposal/cinema-4-13b-022685-fr.pdf.txt b/public/content/projects/1_miss-dior-blooming-bouquet/2_proposal/cinema-4-13b-022685-fr.pdf.txt index 215ec8d..5723493 100644 --- a/public/content/projects/1_miss-dior-blooming-bouquet/2_proposal/cinema-4-13b-022685-fr.pdf.txt +++ b/public/content/projects/1_miss-dior-blooming-bouquet/2_proposal/cinema-4-13b-022685-fr.pdf.txt @@ -1,3 +1,11 @@ +Comments: + +---- + +Label: Offre initiale + +---- + Uuid: 7cCbXLUJWENOMUwh ---- diff --git a/public/site/blueprints/files/pdf.yml b/public/site/blueprints/files/pdf.yml index 1b5b69b..0da7b07 100644 --- a/public/site/blueprints/files/pdf.yml +++ b/public/site/blueprints/files/pdf.yml @@ -6,3 +6,6 @@ focus: false fields: comments: type: hidden + label: + label: Nom + type: text diff --git a/public/site/plugins/helpers/index.php b/public/site/plugins/helpers/index.php index 3d296df..30d6b78 100644 --- a/public/site/plugins/helpers/index.php +++ b/public/site/plugins/helpers/index.php @@ -2,9 +2,11 @@ function getFileData($file) { $data = [ + 'modified' => $file->modified('YYYY-MM-dd'), 'url' => $file->url(), 'uuid' => (string) $file->uuid(), 'name' => $file->filename(), + 'label' => (string) $file->label(), 'type' => (string) $file->type(), ]; diff --git a/src/components/project/ProjectStep.vue b/src/components/project/ProjectStep.vue index 613e1f9..9084485 100644 --- a/src/components/project/ProjectStep.vue +++ b/src/components/project/ProjectStep.vue @@ -6,7 +6,7 @@ {{ step.label }}
-
+

{{ step.label }}

@@ -58,6 +58,32 @@ }}
+ +
@@ -85,13 +111,20 @@ const steps = page.steps.map((item) => { const status = setStatus(); function setStatus() { - if (page.content.currentstep === step.id) { + const currentStepId = page.content.currentstep; + + const currentStepIndex = page.steps.findIndex( + (item) => item.id === currentStepId + ); + const stepIndex = page.steps.findIndex((item) => item.id === step.id); + + if (currentStepIndex === stepIndex) { return "in-progress"; } - if (steps.indexOf(step.id) < steps.indexOf(page.content.currentstep)) { - return "completed"; + if (currentStepIndex > stepIndex) { + return "done"; } - if (steps.indexOf(step.id) > steps.indexOf(page.content.currentstep)) { + if (currentStepIndex < stepIndex) { return "uncompleted"; } }