resolve conflict

This commit is contained in:
isUnknown 2024-10-08 17:30:56 +02:00
parent fa34aed357
commit d4fe38e65a
16 changed files with 92 additions and 19 deletions

View file

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

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

View file

@ -2,7 +2,7 @@ Description:
----
Tags: coloris & nuances, DA globale
Tags: bouton poussoir, DA globale, forme & design
----
@ -10,7 +10,7 @@ Date: 2024-10-02 02:10
----
Uuid: gc1lqYk2YUOBgEoS
Uuid: BJZhoIKbKAh76NEV
----

View file

@ -10,15 +10,15 @@ Clientbriefpdf:
----
Description: Sed congue magna magna lorem aliquam diam dolor arcu fusce adipiscing morbi suspendisse sit dolor erat lorem phasellus sollicitudin cursus dolor aliquam maximus accumsan maximus phasellus ipsum cursus nisi cursus erat nec suspendisse morbi interdum suspendisse purus eget gravida ut mi hendrerit sit molestie eros scelerisque accumsan orci dolor amet.
Description:
----
Clientbriefimages:
- file://gc1lqYk2YUOBgEoS
- file://RBUbSD0s5cYo0uQE
- file://nf6u4SZVnNUUKKU2
- file://BJZhoIKbKAh76NEV
- file://jGugtGC1EbgJQrYq
- file://TCy5v8H96mcAaTc8
----

View file

@ -21,7 +21,8 @@ return [
'routes' => [
require(__DIR__ . '/routes/logout.php'),
require(__DIR__ . '/routes/toggle-favorite.php'),
require(__DIR__ . '/routes/upload-images.php')
require(__DIR__ . '/routes/upload-images.php'),
require(__DIR__ . '/routes/save-page.php'),
],
'hooks' => [
'page.create:after' => require_once(__DIR__ . '/hooks/create-steps.php'),

View file

@ -37,6 +37,7 @@ return [
return Str::contains($path, 'pages/projects');
}
],
'-',
'inspirations' => [
'label' => 'Inspirations',
'icon' => 'images',
@ -46,6 +47,24 @@ return [
return Str::contains($path, 'pages/inspirations');
}
],
'materials' => [
'label' => 'Matériauthèque',
'icon' => 'images',
'link' => 'pages/materials',
'current' => function (string $current): bool {
$path = Kirby\Cms\App::instance()->path();
return Str::contains($path, 'pages/materials');
}
],
'creations' => [
'label' => 'Réalisations',
'icon' => 'images',
'link' => 'pages/creations',
'current' => function (string $current): bool {
$path = Kirby\Cms\App::instance()->path();
return Str::contains($path, 'pages/creations');
}
],
'-',
'notifications' => [
'label' => 'Notifications',

View file

@ -0,0 +1,22 @@
<?php
return [
'pattern' => '(:all)save-page.json',
'method' => 'POST',
'action' => function () {
$json = file_get_contents('php://input');
$data = json_decode($json);
$page = page($data->pageUri);
$newProperties = [];
foreach ($data->properties as $incomingProperty) {
$newProperties[$incomingProperty->name] = $incomingProperty->value;
}
$newPage = $page->update($newProperties);
return json_encode($newProperties);
}
];

View file

View file

View file

@ -15,6 +15,8 @@
placeholder="Ajoutez une description générale de votre projet…"
rows="3"
class="border border-grey-200 | rounded-xl | p-16 | w-full"
v-model="page.content.description"
@input="savePage()"
></textarea>
</div>
<fieldset class="project-details__filters | flex-1">
@ -223,14 +225,6 @@ const { page } = usePageStore();
const toast = useToast();
const selectedTags = ref([]);
const beforeSend = (event) => {
const formData = event.formData;
formData.append(
"pageUri",
"projects/miss-dior-blooming-bouquet/client-brief"
);
};
const modal = ref(null);
watch(modal, (newValue) => {
if (newValue) {
@ -246,7 +240,34 @@ watch(modal, (newValue) => {
const images = ref(page.images);
const onAdvancedUpload = (event) => {
const isWaitingForSave = ref(false);
function savePage() {
if (!isWaitingForSave.value) {
isWaitingForSave.value = true;
setTimeout(() => {
const headers = {
method: "POST",
body: JSON.stringify({
pageUri: page.uri,
properties: [
{
name: "description",
value: page.content.description,
},
],
}),
};
fetch("/save-page.json", headers)
.then((res) => res.json())
.then((json) => {
isWaitingForSave.value = false;
console.log(json);
});
}, 3000);
}
}
function onAdvancedUpload(event) {
if (event.xhr.status === 200) {
toast.add({
severity: "success",
@ -266,7 +287,15 @@ const onAdvancedUpload = (event) => {
});
console.error(JSON.parse(event.xhr.response));
}
};
}
function beforeSend(event) {
const formData = event.formData;
formData.append(
"pageUri",
"projects/miss-dior-blooming-bouquet/client-brief"
);
}
</script>
<style>