✨ (lean) add push strategy
This commit is contained in:
@@ -17,7 +17,9 @@ onMounted(() => featureStore.initBoard())
|
|||||||
{{ featureStore.meanLeadTime }} days
|
{{ featureStore.meanLeadTime }} days
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button @click="featureStore.nextDay()">next day</button>
|
<button @click="featureStore.nextDay('push')">
|
||||||
|
add feature and next day
|
||||||
|
</button>
|
||||||
Total days: {{ featureStore.meta.totalDays }}
|
Total days: {{ featureStore.meta.totalDays }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Feature } from '@/modules/feature/feature'
|
import { Feature } from '@/modules/feature/feature'
|
||||||
import { FeatureStep } from '@/modules/feature/feature-steps'
|
import { FeatureStep } from '@/modules/feature/feature-steps'
|
||||||
import { features } from '@/modules/feature/feature.fixture'
|
import { features } from '@/modules/feature/feature.fixture'
|
||||||
|
import { Strategy } from '@/modules/lean/strategy'
|
||||||
import { pickRandomElement, popNElement, shuffleArray } from '@/utils'
|
import { pickRandomElement, popNElement, shuffleArray } from '@/utils'
|
||||||
|
|
||||||
const MAX_FEATURES = 30
|
const MAX_FEATURES = 30
|
||||||
@@ -73,11 +74,13 @@ export const initBoard = (
|
|||||||
export const nextDay = ({
|
export const nextDay = ({
|
||||||
backlog,
|
backlog,
|
||||||
features,
|
features,
|
||||||
initialStep
|
initialStep,
|
||||||
|
strategy
|
||||||
}: {
|
}: {
|
||||||
backlog: Feature[]
|
backlog: Feature[]
|
||||||
features: Feature[]
|
features: Feature[]
|
||||||
initialStep: number
|
initialStep: number
|
||||||
|
strategy: Strategy
|
||||||
}): Feature[] => {
|
}): Feature[] => {
|
||||||
features.forEach((feature) => {
|
features.forEach((feature) => {
|
||||||
const isFeatureLive = feature.step === 0 && feature.status === 'done'
|
const isFeatureLive = feature.step === 0 && feature.status === 'done'
|
||||||
@@ -111,7 +114,7 @@ export const nextDay = ({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (features.length < MAX_FEATURES) {
|
if (strategy === 'push' && features.length < MAX_FEATURES) {
|
||||||
const [newFeature] = popNElement(backlog, 1)
|
const [newFeature] = popNElement(backlog, 1)
|
||||||
|
|
||||||
if (newFeature) {
|
if (newFeature) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Feature } from '@/modules/feature/feature'
|
import { Feature } from '@/modules/feature/feature'
|
||||||
import { initBoard, newBoard, nextDay } from '@/modules/feature/feature-board'
|
import { initBoard, newBoard, nextDay } from '@/modules/feature/feature-board'
|
||||||
import { FeatureStep, featureSteps } from '@/modules/feature/feature-steps'
|
import { FeatureStep, featureSteps } from '@/modules/feature/feature-steps'
|
||||||
|
import { Strategy } from '@/modules/lean/strategy'
|
||||||
import { sumElements } from '@/utils'
|
import { sumElements } from '@/utils'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
@@ -29,11 +30,12 @@ export const useFeatureStore = defineStore('feature', {
|
|||||||
this.features = initBoard(this.steps, this.backlog)
|
this.features = initBoard(this.steps, this.backlog)
|
||||||
this.meta.totalDays = 0
|
this.meta.totalDays = 0
|
||||||
},
|
},
|
||||||
nextDay() {
|
nextDay(strategy: Strategy) {
|
||||||
this.features = nextDay({
|
this.features = nextDay({
|
||||||
backlog: this.backlog,
|
backlog: this.backlog,
|
||||||
features: this.features,
|
features: this.features,
|
||||||
initialStep: this.steps[0].stepIndex
|
initialStep: this.steps[0].stepIndex,
|
||||||
|
strategy
|
||||||
})
|
})
|
||||||
this.meta.totalDays++
|
this.meta.totalDays++
|
||||||
}
|
}
|
||||||
|
|||||||
1
src/modules/lean/strategy.ts
Normal file
1
src/modules/lean/strategy.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export type Strategy = 'push'
|
||||||
Reference in New Issue
Block a user