♻️ (production flow) add input design system and change step to te…

This commit is contained in:
Julien Calixte
2023-05-27 23:01:35 +02:00
parent d4e0f0043e
commit 67af65afff
4 changed files with 37 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ const store = useProductionFlow();
<template>
<section class="production-flow">
<add-flow />
<add-step />
<ul>
<li :key="step.name" v-for="step in store.$state.steps">
{{ step.name }}

View File

@@ -1,23 +0,0 @@
<script setup lang="ts">
import { useProductionFlow } from "@/modules/flow/store/useProductionFlow.store";
const store = useProductionFlow();
const addStep = () => {
store.addStep({
name: "Recette",
outputs: ["Go production"],
prerequisites: ["app in staging"],
});
};
</script>
<template>
<form class="add-flow" @submit.prevent>
<button @click="addStep">Add a step</button>
</form>
</template>
<style scoped>
.add-flow {
}
</style>

View File

@@ -0,0 +1,31 @@
<script setup lang="ts">
import FormInput from "@/components/design-system/form/FormInput.vue"
import { useProductionFlow } from "@/modules/flow/store/useProductionFlow.store"
import { ref } from "vue"
const store = useProductionFlow()
const newTeam = ref("")
const addTeam = () => {
store.addTeam({
name: "User Acceptance Testing",
outputs: ["Go for live"],
prerequisites: ["new app version is step in staging environment"],
intention:
"Test the app as a whole to validate that the User Experience has no bug",
responsible: "Product Owner",
})
}
</script>
<template>
<form class="add-step" @submit.prevent>
<FormInput id="team" label="Team" v-model="newTeam" />
<button @click="addTeam">Add a step</button>
</form>
</template>
<style scoped lang="scss">
.add-step {
}
</style>

View File

@@ -1,7 +1,7 @@
import { pinia } from "@/store/store"
import { defineStore } from "pinia"
interface Step {
interface Team {
name: string
intention: string
responsible: string
@@ -10,11 +10,11 @@ interface Step {
}
interface State {
steps: Step[]
teams: Team[]
}
const initialState: State = {
steps: [
teams: [
{
name: "In production",
intention: "Deliver feature to the user",
@@ -28,8 +28,8 @@ const initialState: State = {
const useStore = defineStore("production-flow", {
state: () => ({ ...initialState }),
actions: {
addStep(step: Step) {
this.$state.steps = [step, ...this.$state.steps]
addTeam(team: Team) {
this.$state.teams = [team, ...this.$state.teams]
},
},
})