fix #32
This commit is contained in:
parent
64af50816b
commit
24dbf5bf8d
5 changed files with 30 additions and 11 deletions
|
|
@ -9,7 +9,13 @@
|
|||
>
|
||||
<span id="back-to-project">Retour au projet</span>
|
||||
</router-link>
|
||||
<button class="btn | ml-auto">Valider et envoyer le brief</button>
|
||||
<button
|
||||
class="btn | ml-auto"
|
||||
@click="validate"
|
||||
v-if="page.content.isvalidated != 'true'"
|
||||
>
|
||||
Valider et envoyer le brief
|
||||
</button>
|
||||
</header>
|
||||
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
|
||||
</main>
|
||||
|
|
@ -22,6 +28,7 @@ import Images from "../components/project/brief/Images.vue";
|
|||
import TitledPdfWrapper from "../components/project/TitledPdfWrapper.vue";
|
||||
import { usePageStore } from "../stores/page";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useApiStore } from "../stores/api";
|
||||
|
||||
const stepsComponents = {
|
||||
Intro,
|
||||
|
|
@ -31,6 +38,7 @@ const stepsComponents = {
|
|||
};
|
||||
|
||||
const { page } = storeToRefs(usePageStore());
|
||||
const api = useApiStore();
|
||||
|
||||
const currentStep = ref(setInitialStep());
|
||||
|
||||
|
|
@ -47,6 +55,12 @@ function setInitialStep() {
|
|||
if (isEmpty) return "Intro";
|
||||
if (hasImages) return "Images";
|
||||
}
|
||||
|
||||
function validate() {
|
||||
api.validateBrief(page.value.uri).then((res) => {
|
||||
location.href = "/" + page.value.parent;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
@ -55,4 +69,4 @@ function setInitialStep() {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
>
|
||||
<router-link
|
||||
v-if="currentTab === 'all' || !notification.isRead"
|
||||
:to="notification.location.href"
|
||||
:to="toPath(notification.location.href)"
|
||||
>
|
||||
<header>
|
||||
<p class="flex">
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
</p>
|
||||
</header>
|
||||
<p
|
||||
v-if="notification.type === 'comment'"
|
||||
v-if="notification.type"
|
||||
class="notification__body | text-md font-medium | line-clamp"
|
||||
>
|
||||
{{ notification.text }}
|
||||
|
|
@ -172,6 +172,10 @@ function readAll() {
|
|||
console.log("Could not read all notifications : ", error);
|
||||
}
|
||||
}
|
||||
|
||||
function toPath(string) {
|
||||
return string.replace(window.location.origin, "");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue