* '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:
Timothée Goguely 2025-01-07 11:57:59 +01:00
commit d7b479ce42
9 changed files with 43 additions and 10 deletions

View file

@ -9,6 +9,15 @@ status:
unlisted: false
listed: true
label: Activée
options:
delete: false
changeTitle: false
changeTemplate: false
changeStatus: true
changeSlug: false
move: false
duplicate: false
sort: false
tabs:
content:

View file

@ -9,6 +9,15 @@ status:
unlisted: false
listed: true
label: Activée
options:
delete: false
changeTitle: false
changeTemplate: false
changeStatus: true
changeSlug: false
move: false
duplicate: false
sort: false
tabs:
content:

View file

@ -4,11 +4,17 @@ image:
back: black
color: white
query: false
status:
draft:
label: Désactivée
unlisted: false
listed: true
label: Activée
options:
delete: false
changeTitle: false
changeTemplate: false
changeStatus: false
changeStatus: true
changeSlug: false
move: false
duplicate: false

View file

@ -46,7 +46,7 @@ return [
"pdf" => $newFile->id()
]);
return $newPage->toArray();
return getFileData($newFile);
} catch (Exception $e) {
return [

View file

@ -4,7 +4,7 @@ $project = [
'url' => $page->url(),
'modified' => $page->modified('Y-MM-d'),
'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(),
];

View file

@ -30,7 +30,7 @@
}}
</p>
<div
v-if="comment.author.uuid === userStore.user.uuid"
v-if="userStore.canEditComment(comment)"
class="comment__ctas | mt-8"
>
<button class="btn btn--transparent btn--icon btn--sm" data-icon="edit">

View file

@ -1,11 +1,10 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import { defineStore, storeToRefs } from "pinia";
import { usePageStore } from "./page";
export const useBriefStore = defineStore("brief", () => {
async function addPdf(event, briefUri, redirectToParent = false) {
const file = event.target.files[0];
const { page } = usePageStore();
const { page } = storeToRefs(usePageStore());
if (file) {
const formData = new FormData();
@ -20,7 +19,7 @@ export const useBriefStore = defineStore("brief", () => {
const result = await response.json();
if (response.ok) {
page.value = result;
page.value.steps[0].files.push(result);
} else {
console.error("Error uploading file:", result.error);
}

View file

@ -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,
};
});

View file

@ -16,7 +16,7 @@ import Header from "../components/project/Header.vue";
import DialogWrapper from "../components/project/DialogWrapper.vue";
import { usePageStore } from "../stores/page";
import { storeToRefs } from "pinia";
import { computed, watch } from "vue";
import { watch } from "vue";
import { useDialogStore } from "../stores/dialog";
import { useRoute } from "vue-router";