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