Simplification : Brief.vue affiche toujours Images directement
Suppression du système de steps obsolète (Intro → ModeSelection → Images). /client-brief affiche maintenant toujours le composant Images, sans conditions ni paramètres d'URL (?step=images). Les briefs avec PDF sont gérés via les dialogues uniquement. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6ff59e9b07
commit
04d8da39fd
1 changed files with 1 additions and 49 deletions
|
|
@ -25,65 +25,17 @@
|
||||||
Valider et envoyer le brief
|
Valider et envoyer le brief
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
|
<Images />
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
|
||||||
import Intro from '../components/project/brief/Intro.vue';
|
|
||||||
import ModeSelection from '../components/project/brief/ModeSelection.vue';
|
|
||||||
import Images from '../components/project/brief/Images.vue';
|
import Images from '../components/project/brief/Images.vue';
|
||||||
import TitledPdfWrapper from '../components/project/TitledPdfWrapper.vue';
|
|
||||||
import { usePageStore } from '../stores/page';
|
import { usePageStore } from '../stores/page';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useApiStore } from '../stores/api';
|
import { useApiStore } from '../stores/api';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
const stepsComponents = {
|
|
||||||
Intro,
|
|
||||||
ModeSelection,
|
|
||||||
Images,
|
|
||||||
TitledPdfWrapper,
|
|
||||||
};
|
|
||||||
|
|
||||||
const { page } = storeToRefs(usePageStore());
|
const { page } = storeToRefs(usePageStore());
|
||||||
const api = useApiStore();
|
const api = useApiStore();
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const currentStep = ref(setInitialStep());
|
|
||||||
|
|
||||||
// Rediriger vers le kanban si le brief est vide et non validé
|
|
||||||
onMounted(() => {
|
|
||||||
const hasPDF = page.value?.content?.pdf?.length !== 0;
|
|
||||||
const hasImages =
|
|
||||||
page.value?.content?.moodboard?.length !== 0 ||
|
|
||||||
page.value?.content?.description?.length !== 0;
|
|
||||||
const isEmpty = !hasPDF && !hasImages;
|
|
||||||
const isValidated = page.value?.content?.isvalidated === 'true';
|
|
||||||
|
|
||||||
// Si le brief est vide et non validé, rediriger vers le projet
|
|
||||||
if (isEmpty && !isValidated && !route.query.step) {
|
|
||||||
router.push('/' + page.value.parent);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function changeStep(stepName) {
|
|
||||||
currentStep.value = stepName;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setInitialStep() {
|
|
||||||
if (useRoute().query.step === 'images') {
|
|
||||||
return 'Images';
|
|
||||||
}
|
|
||||||
const hasPDF = page.value?.content?.pdf?.length !== 0;
|
|
||||||
const hasImages =
|
|
||||||
page.value.content?.moodboard.length !== 0 ||
|
|
||||||
page.value.content.description.length !== 0;
|
|
||||||
const isEmpty = !hasPDF && !hasImages;
|
|
||||||
if (isEmpty) return 'Intro';
|
|
||||||
if (hasImages) return 'Images';
|
|
||||||
}
|
|
||||||
|
|
||||||
function validate() {
|
function validate() {
|
||||||
api.validateBrief(page.value.uri).then((res) => {
|
api.validateBrief(page.value.uri).then((res) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue