This commit is contained in:
isUnknown 2024-10-16 15:32:24 +02:00
parent 9d6ee634fb
commit 698fc0965e
9 changed files with 43 additions and 30 deletions

View file

@ -1,17 +0,0 @@
Description: nouvelle description
----
Tags:
----
Date: 2024-10-15 01:10
----
Uuid: cKGbZhC6pCTXislx
----
Template: image

View file

@ -6,7 +6,11 @@ Stepname: clientBrief
---- ----
<<<<<<< HEAD
Pdf: Pdf:
=======
Pdf: - file://fGa7zaC6S5zprMyo
>>>>>>> afa93ed (dynamize project step status)
---- ----

View file

@ -2,7 +2,7 @@
<section <section
class="flex-1" class="flex-1"
aria-labelledby="votre-brief-label" aria-labelledby="votre-brief-label"
data-status="done" :data-status="status"
> >
<h2 id="votre-brief-label"> <h2 id="votre-brief-label">
<span data-icon="votre-brief">{{ step.text }}</span> <span data-icon="votre-brief">{{ step.text }}</span>
@ -41,10 +41,36 @@
<script setup> <script setup>
import dayjs from "dayjs"; import dayjs from "dayjs";
import "dayjs/locale/fr"; import "dayjs/locale/fr";
import { usePageStore } from "../../stores/page";
dayjs.locale("fr");
const { step } = defineProps({ const { step } = defineProps({
step: Object, step: Object,
}); });
dayjs.locale("fr");
const { page } = usePageStore();
const steps = [
"clientBrief",
"proposal",
"extended-brief",
"industrialIdeation",
"virtualSample",
"physicalSample",
];
const status = setStatus();
function setStatus() {
if (page.content.currentstep === step.value) {
return "in-progress";
}
if (steps.indexOf(step.value) < steps.indexOf(page.content.currentstep)) {
return "completed";
}
if (steps.indexOf(step.value) > steps.indexOf(page.content.currentstep)) {
return "uncompleted";
}
}
</script> </script>

View file

@ -107,7 +107,7 @@ async function addPdf(event) {
if (response.ok) { if (response.ok) {
console.log("File uploaded successfully."); console.log("File uploaded successfully.");
page.value = result; page.value = result;
emit("update:step", "PdfViewer"); location.href = location.origin + "/" + page.value.parent;
} else { } else {
console.error("Error uploading file:", result.error); console.error("Error uploading file:", result.error);
} }