✨ (strategy) add next day without new feature
This commit is contained in:
@@ -20,6 +20,9 @@ onMounted(() => featureStore.initBoard())
|
||||
<button @click="featureStore.nextDay('push')">
|
||||
add feature and next day
|
||||
</button>
|
||||
<button @click="featureStore.nextDay('turn-off')">
|
||||
next day without new feature
|
||||
</button>
|
||||
Total days: {{ featureStore.meta.totalDays }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ export const featureSteps: FeatureStep[] = [
|
||||
{
|
||||
title: 'Design',
|
||||
stepIndex: 3,
|
||||
blueBuckets: 1
|
||||
blueBuckets: 2
|
||||
},
|
||||
{
|
||||
title: 'Development',
|
||||
|
||||
@@ -11,24 +11,31 @@ type State = {
|
||||
backlog: Feature[]
|
||||
meta: {
|
||||
totalDays: number
|
||||
strategy: Record<Strategy, number>
|
||||
}
|
||||
}
|
||||
|
||||
const resetMeta = (): State['meta'] => ({
|
||||
totalDays: 0,
|
||||
strategy: {
|
||||
push: 0,
|
||||
'turn-off': 0
|
||||
}
|
||||
})
|
||||
|
||||
export const useFeatureStore = defineStore('feature', {
|
||||
state: (): State => ({
|
||||
steps: [],
|
||||
features: [],
|
||||
backlog: [],
|
||||
meta: {
|
||||
totalDays: 0
|
||||
}
|
||||
meta: resetMeta()
|
||||
}),
|
||||
actions: {
|
||||
initBoard() {
|
||||
this.backlog = newBoard()
|
||||
this.steps = featureSteps
|
||||
this.features = initBoard(this.steps, this.backlog)
|
||||
this.meta.totalDays = 0
|
||||
this.meta = resetMeta()
|
||||
},
|
||||
nextDay(strategy: Strategy) {
|
||||
this.features = nextDay({
|
||||
@@ -38,6 +45,7 @@ export const useFeatureStore = defineStore('feature', {
|
||||
strategy
|
||||
})
|
||||
this.meta.totalDays++
|
||||
this.meta.strategy[strategy]++
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type Strategy = 'push'
|
||||
export type Strategy = 'push' | 'turn-off'
|
||||
|
||||
Reference in New Issue
Block a user