prepare physical sample component

This commit is contained in:
isUnknown 2024-12-11 14:37:06 +01:00
parent d7e2a58448
commit 30876abff3
24 changed files with 180 additions and 37 deletions

View file

@ -0,0 +1,9 @@
Cover:
----
Uuid: fF3uEQ4fXtB4wSIY
----
Template: pdf

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View file

@ -0,0 +1,9 @@
Favoriteforusers:
----
Uuid: GgNiFbKpuBHuiKoI
----
Template: inspiration

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

View file

@ -0,0 +1 @@
Uuid: 0XaNKWTOhgkS3CJj

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View file

@ -0,0 +1,9 @@
Favoriteforusers:
----
Uuid: ClSfHdtHGaFpNi5Z
----
Template: inspiration

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

View file

@ -0,0 +1,9 @@
Favoriteforusers:
----
Uuid: qpFySer4qbeUBUaS
----
Template: inspiration

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

View file

@ -0,0 +1,9 @@
Favoriteforusers:
----
Uuid: R6hghlGnjA4EVi85
----
Template: inspiration

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View file

@ -0,0 +1,9 @@
Favoriteforusers:
----
Uuid: PrjUSAOoUuwy3Vce
----
Template: inspiration

View file

@ -0,0 +1,35 @@
Title: Échantillon physique
----
Stepname: physicalSample
----
Cover: - file://0XaNKWTOhgkS3CJj
----
Date: 2024-12-11
----
Description: Lacus euismod bibendum enim hendrerit euismod pellentesque elementum rutrum dolor scelerisque vivamus placerat proin commodo et suspendisse magna et dolor lorem phasellus vivamus ipsum dolor. Congue phasellus gravida facilisis quam proin molestie molestie nisi purus sed orci arcu rutrum magna phasellus leo erat dolor dolor scelerisque eu a scelerisque aliquam.
----
Media:
- file://GgNiFbKpuBHuiKoI
- file://qpFySer4qbeUBUaS
- file://ClSfHdtHGaFpNi5Z
- file://R6hghlGnjA4EVi85
- file://PrjUSAOoUuwy3Vce
----
Stepindex: 6
----
Uuid: SvuSmrScFYqZm33m

View file

@ -1,13 +0,0 @@
Title: Échantillon physique
----
Stepname: physicalSample
----
Stepindex: 6
----
Uuid: SvuSmrScFYqZm33m

View file

@ -22,20 +22,8 @@ tabs:
fields:
stepName:
type: hidden
value: test
pdf:
label: PDF
type: files
multiple: false
uploads: pdf
description:
type: textarea
size: tiny
buttons: false
maxlength: 700
moodboard:
label: Images
type: files
uploads: image
layout: cards
size: medium

View file

@ -11,7 +11,16 @@ status:
label: Activée
tabs:
contentTab:
fields:
stepName:
type: hidden
content:
label: Idéation industrielle
icon: document
columns:
- width: 1/1
fields:
stepName:
type: hidden
pdf:
label: PDF
type: files
multiple: false
uploads: pdf

View file

@ -11,7 +11,35 @@ status:
label: Activée
tabs:
contentTab:
fields:
stepName:
type: hidden
content:
label: Échantillon physique
icon: document
columns:
- width: 1/1
fields:
stepName:
type: hidden
cover:
type: files
multiple: false
layout: cards
size: full
image:
ratio: 6/1
cover: true
date:
type: date
display: DD/MM/YY
required: true
default: today
width: 2/12
description:
type: text
required: true
width: 10/12
media:
type: files
layout: cards
size: large
required: true
uploads: inspiration

View file

@ -17,7 +17,7 @@ class ProjectPage extends Page {
$files = [];
$uri = null;
if (str_contains($child->stepName()->value(), 'Brief')) {
if (str_contains($child->stepName()->value(), 'Brief') || $child->stepName()->value() === "industrialIdeation") {
$this->handleBriefStep($child, $files, $uri);
}
@ -28,6 +28,10 @@ class ProjectPage extends Page {
if ($child->stepName() == 'virtualSample') {
$this->handleVirtualSampleStep($child, $files, $uri);
}
if ($child->stepName() == 'physicalSample') {
$this->handlePhysicalSampleStep($child, $files, $uri);
}
return [
'label' => $child->title()->value(),
@ -36,6 +40,8 @@ class ProjectPage extends Page {
'index' => intval($child->stepIndex()->value()),
'modified' => $child->modified('Y-MM-dd'),
'isValidated' => $child->isValidated() == 'true' ? true : false,
'description' => $child->description()->isNotempty() ? $child->description()->value() : null,
'cover' => $child->cover()->isNotempty() ? $child->cover()->toFile()->url() : null,
'uri' => $uri,
'files' => $files,
];
@ -98,6 +104,16 @@ class ProjectPage extends Page {
$files['static']['finishedGlass'] = getFileData($child->finishedGlass()->toFile());
}
}
private function handlePhysicalSampleStep($child, &$files, &$uri) {
$uri = $child->parent()->uri() . '?dialog=' . $child->slug();
if ($child->media()->isNotEmpty()) {
foreach ($child->media()->toFiles() as $file) {
$files[] = getFileData($file);
}
}
}
public function getStepLabel() {
$stepsLabel = [

View file

@ -2,16 +2,20 @@
<TitledPdfWrapper
v-if="
dialog.content.slug.includes('brief') ||
dialog.content.slug === 'proposal'
dialog.content.slug === 'proposal' ||
dialog.content.slug === 'industrial-ideation'
"
/>
<VirtualSample v-if="dialog.content.slug === 'virtual-sample'" />
<PhysicalSample v-if="dialog.content.slug === 'physical-content'" />
</template>
<script setup>
import TitledPdfWrapper from "./TitledPdfWrapper.vue";
import { useDialogStore } from "../../stores/dialog";
import VirtualSample from "./virtual-sample/VirtualSample.vue";
import PhysicalSample from "./PhysicalSample.vue";
const dialog = useDialogStore();
</script>

View file

@ -0,0 +1,3 @@
<template></template>
<script setup></script>
<style></style>

View file

@ -16,7 +16,14 @@
step.files.length
"
>
<article class="card" v-if="step.id !== 'proposal'">
<article
class="card"
v-if="
step.id !== 'proposal' &&
step.id !== 'industrialIdeation' &&
step.id !== 'physicalSample'
"
>
<hgroup class="order-last">
<h3 class="card__title | font-serif | text-lg">
<router-link :to="'/' + step.uri" class="link-full">{{
@ -80,7 +87,12 @@
</footer>
</article>
<template v-if="step.id == 'proposal' && step.files.length">
<template
v-if="
step.id == 'proposal' ||
(step.id == 'industrialIdeation' && step.files.length)
"
>
<article
class="card"
v-for="(file, index) in step.files"
@ -141,6 +153,8 @@
</article>
</template>
</template>
<template v-if="step.id === 'physicalSample'"></template>
<!-- Empty state -->
<template v-else></template>
</div>