Progression vue brief client

- l'étape courante est déterminée en fonction des données de la page
- les images sont ajoutées au champ
- les images déjà ajoutées sont affichées directement
- changement donnée briefClient -> clientBrief (cohérence avec le nommage front)
This commit is contained in:
isUnknown 2024-10-02 15:29:31 +02:00
parent 3d93905983
commit 13b6b371d7
18 changed files with 245 additions and 66 deletions

View file

@ -9,17 +9,29 @@ import { ref } from "vue";
import Header from "../components/project/Header.vue";
import Intro from "../components/project/ClientBrief/Intro.vue";
import ModeSelection from "../components/project/ClientBrief/ModeSelection.vue";
import AddImages from "../components/project/ClientBrief/AddImages.vue";
import Images from "../components/project/ClientBrief/Images.vue";
import { usePageStore } from "../stores/page";
const stepsComponents = {
Intro,
ModeSelection,
AddImages,
Images,
};
const currentStep = ref("AddImages");
const { page } = usePageStore();
const currentStep = ref(setInitialStep());
function changeStep(stepName) {
currentStep.value = stepName;
}
function setInitialStep() {
const hasPDF = page.content.clientbriefpdf.length !== 0;
const hasImages = page.content.clientbriefimages.length !== 0;
const isEmpty = !hasPDF && !hasImages;
if (isEmpty) return "Intro";
if (hasPDF) return "PDF";
if (hasImages) return "Images";
}
</script>