prepare physical sample component
This commit is contained in:
parent
d7e2a58448
commit
30876abff3
24 changed files with 180 additions and 37 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue