Merge branch 'main' of https://framagit.org/isUnknown/design-to-pack
* 'main' of https://framagit.org/isUnknown/design-to-pack: #83 - lock some permissions #83 - make proposal step optional fix #87
This commit is contained in:
commit
d7b479ce42
9 changed files with 43 additions and 10 deletions
|
|
@ -9,6 +9,15 @@ status:
|
||||||
unlisted: false
|
unlisted: false
|
||||||
listed: true
|
listed: true
|
||||||
label: Activée
|
label: Activée
|
||||||
|
options:
|
||||||
|
delete: false
|
||||||
|
changeTitle: false
|
||||||
|
changeTemplate: false
|
||||||
|
changeStatus: true
|
||||||
|
changeSlug: false
|
||||||
|
move: false
|
||||||
|
duplicate: false
|
||||||
|
sort: false
|
||||||
|
|
||||||
tabs:
|
tabs:
|
||||||
content:
|
content:
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,15 @@ status:
|
||||||
unlisted: false
|
unlisted: false
|
||||||
listed: true
|
listed: true
|
||||||
label: Activée
|
label: Activée
|
||||||
|
options:
|
||||||
|
delete: false
|
||||||
|
changeTitle: false
|
||||||
|
changeTemplate: false
|
||||||
|
changeStatus: true
|
||||||
|
changeSlug: false
|
||||||
|
move: false
|
||||||
|
duplicate: false
|
||||||
|
sort: false
|
||||||
|
|
||||||
tabs:
|
tabs:
|
||||||
content:
|
content:
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,17 @@ image:
|
||||||
back: black
|
back: black
|
||||||
color: white
|
color: white
|
||||||
query: false
|
query: false
|
||||||
|
status:
|
||||||
|
draft:
|
||||||
|
label: Désactivée
|
||||||
|
unlisted: false
|
||||||
|
listed: true
|
||||||
|
label: Activée
|
||||||
options:
|
options:
|
||||||
delete: false
|
delete: false
|
||||||
changeTitle: false
|
changeTitle: false
|
||||||
changeTemplate: false
|
changeTemplate: false
|
||||||
changeStatus: false
|
changeStatus: true
|
||||||
changeSlug: false
|
changeSlug: false
|
||||||
move: false
|
move: false
|
||||||
duplicate: false
|
duplicate: false
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ return [
|
||||||
"pdf" => $newFile->id()
|
"pdf" => $newFile->id()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $newPage->toArray();
|
return getFileData($newFile);
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return [
|
return [
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ $project = [
|
||||||
'url' => $page->url(),
|
'url' => $page->url(),
|
||||||
'modified' => $page->modified('Y-MM-d'),
|
'modified' => $page->modified('Y-MM-d'),
|
||||||
'status' => $page->status(),
|
'status' => $page->status(),
|
||||||
'logo' => $page->client()->toPage()->logo()->toFile()->url(),
|
'logo' => $page->client()->isNotEmpty() && $page->client()->toPage() ? $page->client()->toPage()->logo()->toFile()->url() : null,
|
||||||
'steps' => $page->getSteps(),
|
'steps' => $page->getSteps(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
<div
|
<div
|
||||||
v-if="comment.author.uuid === userStore.user.uuid"
|
v-if="userStore.canEditComment(comment)"
|
||||||
class="comment__ctas | mt-8"
|
class="comment__ctas | mt-8"
|
||||||
>
|
>
|
||||||
<button class="btn btn--transparent btn--icon btn--sm" data-icon="edit">
|
<button class="btn btn--transparent btn--icon btn--sm" data-icon="edit">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore, storeToRefs } from "pinia";
|
||||||
import { ref } from "vue";
|
|
||||||
import { usePageStore } from "./page";
|
import { usePageStore } from "./page";
|
||||||
|
|
||||||
export const useBriefStore = defineStore("brief", () => {
|
export const useBriefStore = defineStore("brief", () => {
|
||||||
async function addPdf(event, briefUri, redirectToParent = false) {
|
async function addPdf(event, briefUri, redirectToParent = false) {
|
||||||
const file = event.target.files[0];
|
const file = event.target.files[0];
|
||||||
const { page } = usePageStore();
|
const { page } = storeToRefs(usePageStore());
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|
@ -20,7 +19,7 @@ export const useBriefStore = defineStore("brief", () => {
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
page.value = result;
|
page.value.steps[0].files.push(result);
|
||||||
} else {
|
} else {
|
||||||
console.error("Error uploading file:", result.error);
|
console.error("Error uploading file:", result.error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,5 +24,15 @@ export const useUserStore = defineStore("user", () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return { user, notifications, readNotification, readAllNotifications };
|
function canEditComment(comment) {
|
||||||
|
return user.value.uuid === comment.author.uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
user,
|
||||||
|
notifications,
|
||||||
|
readNotification,
|
||||||
|
readAllNotifications,
|
||||||
|
canEditComment,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import Header from "../components/project/Header.vue";
|
||||||
import DialogWrapper from "../components/project/DialogWrapper.vue";
|
import DialogWrapper from "../components/project/DialogWrapper.vue";
|
||||||
import { usePageStore } from "../stores/page";
|
import { usePageStore } from "../stores/page";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { computed, watch } from "vue";
|
import { watch } from "vue";
|
||||||
import { useDialogStore } from "../stores/dialog";
|
import { useDialogStore } from "../stores/dialog";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue