✨ (lean) add pull system
This commit is contained in:
@@ -18,8 +18,8 @@ const featuresDone = computed(() =>
|
||||
.sort((a, b) => (a.leadTime > b.leadTime ? -1 : 1))
|
||||
)
|
||||
|
||||
const remainingBlueBuckets = computed(() =>
|
||||
Math.max(0, props.step.blueBuckets - featuresDone.value.length)
|
||||
const remainingBlueBins = computed(() =>
|
||||
Math.max(0, props.step.blueBins - featuresDone.value.length)
|
||||
)
|
||||
const hasFeaturesInProgress = computed(
|
||||
() => featuresInProgress.value.length > 0
|
||||
@@ -48,10 +48,10 @@ const isLive = computed(
|
||||
<section class="done">
|
||||
<h5>📝✅ [{{ featuresDone.length }}]</h5>
|
||||
<div>
|
||||
<div class="blue-bin-container">
|
||||
<div v-if="!isLive" class="blue-bin-container">
|
||||
<div
|
||||
v-for="blueBucket in remainingBlueBuckets"
|
||||
:key="blueBucket"
|
||||
v-for="blueBin in remainingBlueBins"
|
||||
:key="blueBin"
|
||||
class="bin blue-bin"
|
||||
>
|
||||
Blue bucket
|
||||
|
||||
@@ -17,9 +17,8 @@ onMounted(() => featureStore.initBoard())
|
||||
{{ featureStore.meanLeadTime }} days
|
||||
</div>
|
||||
<div>
|
||||
<button @click="featureStore.nextDay('push')">
|
||||
add feature and next day
|
||||
</button>
|
||||
<button @click="featureStore.nextDay('push')">push system</button>
|
||||
<button @click="featureStore.nextDay('pull')">pull system</button>
|
||||
<button @click="featureStore.nextDay('turn-off')">
|
||||
next day without new feature
|
||||
</button>
|
||||
|
||||
@@ -75,10 +75,12 @@ export const nextDay = ({
|
||||
backlog,
|
||||
features,
|
||||
initialStep,
|
||||
steps,
|
||||
strategy
|
||||
}: {
|
||||
backlog: Feature[]
|
||||
features: Feature[]
|
||||
steps: FeatureStep[]
|
||||
initialStep: number
|
||||
strategy: Strategy
|
||||
}): Feature[] => {
|
||||
@@ -95,7 +97,27 @@ export const nextDay = ({
|
||||
feature.status = 'done'
|
||||
break
|
||||
case 'done':
|
||||
feature.status = 'doing'
|
||||
if (strategy === 'pull') {
|
||||
const nextStep = steps.find(
|
||||
(step) => step.stepIndex === feature.step - 1
|
||||
)
|
||||
if (!nextStep) {
|
||||
break
|
||||
}
|
||||
|
||||
const hasBlueBinAvailableNextStep =
|
||||
nextStep.blueBins -
|
||||
features.filter(
|
||||
(f) => f.step === feature.step - 1 && f.status === 'done'
|
||||
).length >
|
||||
0
|
||||
|
||||
if (hasBlueBinAvailableNextStep) {
|
||||
feature.status = 'doing'
|
||||
}
|
||||
} else {
|
||||
feature.status = 'doing'
|
||||
}
|
||||
|
||||
if (
|
||||
hasQualityIssue(
|
||||
@@ -114,11 +136,39 @@ export const nextDay = ({
|
||||
}
|
||||
})
|
||||
|
||||
if (strategy === 'push' && features.length < MAX_FEATURES) {
|
||||
const [newFeature] = popNElement(backlog, 1)
|
||||
if (features.length < MAX_FEATURES) {
|
||||
switch (strategy) {
|
||||
case 'push': {
|
||||
const [newFeature] = popNElement(backlog, 1)
|
||||
|
||||
if (newFeature) {
|
||||
features.push({ ...newFeature, step: initialStep })
|
||||
if (newFeature) {
|
||||
features.push({ ...newFeature, step: initialStep })
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'pull': {
|
||||
const firstStep = steps.find((step) => step.stepIndex === initialStep)
|
||||
if (!firstStep) {
|
||||
break
|
||||
}
|
||||
|
||||
const hasBlueBinAvailableOnFirstStep =
|
||||
firstStep.blueBins -
|
||||
features.filter(
|
||||
(f) => f.step === initialStep && f.status === 'done'
|
||||
).length >
|
||||
0
|
||||
|
||||
if (hasBlueBinAvailableOnFirstStep) {
|
||||
const [newFeature] = popNElement(backlog, 1)
|
||||
|
||||
if (newFeature) {
|
||||
features.push({ ...newFeature, step: initialStep })
|
||||
}
|
||||
}
|
||||
}
|
||||
case 'turn-off':
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export type FeatureStep = {
|
||||
title: string
|
||||
blueBuckets: number
|
||||
blueBins: number
|
||||
stepIndex: number
|
||||
}
|
||||
|
||||
@@ -8,26 +8,26 @@ export const featureSteps: FeatureStep[] = [
|
||||
{
|
||||
title: 'Product',
|
||||
stepIndex: 4,
|
||||
blueBuckets: 2
|
||||
blueBins: 2
|
||||
},
|
||||
{
|
||||
title: 'Design',
|
||||
stepIndex: 3,
|
||||
blueBuckets: 2
|
||||
blueBins: 2
|
||||
},
|
||||
{
|
||||
title: 'Development',
|
||||
stepIndex: 2,
|
||||
blueBuckets: 2
|
||||
blueBins: 2
|
||||
},
|
||||
{
|
||||
title: 'Test',
|
||||
stepIndex: 1,
|
||||
blueBuckets: 2
|
||||
blueBins: 2
|
||||
},
|
||||
{
|
||||
title: 'Release',
|
||||
stepIndex: 0,
|
||||
blueBuckets: 0
|
||||
blueBins: Infinity
|
||||
}
|
||||
]
|
||||
|
||||
@@ -19,6 +19,7 @@ const resetMeta = (): State['meta'] => ({
|
||||
totalDays: 0,
|
||||
strategy: {
|
||||
push: 0,
|
||||
pull: 0,
|
||||
'turn-off': 0
|
||||
}
|
||||
})
|
||||
@@ -41,6 +42,7 @@ export const useFeatureStore = defineStore('feature', {
|
||||
this.features = nextDay({
|
||||
backlog: this.backlog,
|
||||
features: this.features,
|
||||
steps: this.steps,
|
||||
initialStep: this.steps[0].stepIndex,
|
||||
strategy
|
||||
})
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type Strategy = 'push' | 'turn-off'
|
||||
export type Strategy = 'push' | 'pull' | 'turn-off'
|
||||
|
||||
Reference in New Issue
Block a user