project blueprint - add optional steps

This commit is contained in:
isUnknown 2024-09-26 15:46:13 +02:00
parent 0df79ba8a8
commit 595c275100
5 changed files with 67 additions and 13 deletions

View file

@ -2,12 +2,16 @@ Title: Miss Dior Blooming Bouquet
----
Optionalsteps: industrialIdeation, physicalSample
----
Currentstep: brief
----
Client: - page://G418qZ4ABsoWFx4i
----
Currentstep: clientBrief
----
Uuid: 513oEM4JFuWBt2Bw

View file

@ -8,16 +8,25 @@ tabs:
columns:
- width: 1/1
fields:
optionalSteps:
label: Étapes optionnelles
type: checkboxes
width: 1/2
columns: 2
options:
industrialIdeation: Idéation industrielle
physicalSample: Échantillon physique
help: Après modification, sauvegardez et rechargez la page pour mettre à jour la liste ci-dessous.
currentStep:
label: Étape en cours
type: radio
columns: 4
columns: 6
default: clientBrief
options:
clientBrief: Brief client
proposal: Offre commerciale
extendedBrief: Brief enrichi
virtualSample: Échantillon virtuel
type: query
query: page.getSteps
text: "{{ item.text }}"
value: "{{ item.value }}"
- width: 1/3
fields:
client:

View file

@ -0,0 +1,42 @@
<?php
class ProjectPage extends Page {
public function getSteps() {
$steps = [
[
'text' => '1. Brief',
'value' => 'brief'
],
[
'text' => '2. Offre commerciale',
'value' => 'proposal'
],
[
'text' => '3. Brief enrichi',
'value' => 'extendedBrief'
],
];
if (str_contains($this->optionalSteps(), 'industrialIdeation')) {
$steps[] = [
'text' => '4. Idéation industrielle',
'value' => 'industrialIdeation'
];
}
$steps[] = [
'text' => count($steps) + 1 . '. Échantillon virtuel',
'value' => 'virtualSample'
];
if (str_contains($this->optionalSteps(), 'physicalSample')) {
$steps[] = [
'text' => count($steps) + 1 . '.Échantillon physique',
'value' => 'physicalSample'
];
}
return $steps;
}
}

View file

@ -1,5 +1,4 @@
<?php
$children = $page->children()->map(function ($child) {
return [
'title' => $child->title()->value(),

View file

@ -5,12 +5,12 @@
<button class="btn | ml-auto">Demander un RDV</button>
</header>
<!-- <component :is="stepsComponents[currentStep]" @update:step="changeStep" /> -->
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
<!-- <VirtualSample /> -->
<!-- Kanban: Status Brief Enrichi -->
<div class="kanban">
<!-- <div class="kanban">
<section
class="flex-1"
aria-labelledby="votre-brief-label"
@ -150,7 +150,7 @@
</div>
</div>
</section>
</div>
</div> -->
</main>
</template>