fix: eraser not resetting features

This commit is contained in:
Julien Calixte
2024-12-31 10:14:00 +01:00
parent 474b5bfaab
commit 76540f5a5a
5 changed files with 24 additions and 32 deletions

View File

@@ -57,16 +57,16 @@ const feature: Feature = {
<p>Each day, you can choose between 3 strategies:</p> <p>Each day, you can choose between 3 strategies:</p>
<ol> <ol>
<li> <li>
Push system
<PushSystemIcon /> <PushSystemIcon />
Push system
</li> </li>
<li> <li>
Pull system
<PullSystemIcon /> <PullSystemIcon />
Pull system
</li> </li>
<li> <li>
Problem solving
<ProblemSolvingIcon /> <ProblemSolvingIcon />
Problem solving
</li> </li>
</ol> </ol>
<p> <p>

View File

@@ -15,28 +15,16 @@ const featureStore = useFeatureStore()
<template> <template>
<div class="flow-controls"> <div class="flow-controls">
<div class="row"> <div class="row">
<button <button @click="featureStore.nextDay('push')" :disabled="featureStore.isProjectFinished">
@click="featureStore.nextDay('push')"
:disabled="featureStore.isProjectFinished"
>
<PushSystemIcon color="white" /> <PushSystemIcon color="white" />
</button> </button>
<button <button @click="featureStore.nextDay('pull')" :disabled="featureStore.isProjectFinished">
@click="featureStore.nextDay('pull')"
:disabled="featureStore.isProjectFinished"
>
<PullSystemIcon color="white" /> <PullSystemIcon color="white" />
</button> </button>
<button <button @click="featureStore.nextDay('problem-solving')" :disabled="featureStore.isProjectFinished">
@click="featureStore.nextDay('problem-solving')"
:disabled="featureStore.isProjectFinished"
>
<ProblemSolvingIcon color="white" /> <ProblemSolvingIcon color="white" />
</button> </button>
<button <button v-if="withEraser" @click="featureStore.initBoard('mobile-app', NUMBER_OF_FEATURES)">
v-if="withEraser"
@click="featureStore.initBoard(NUMBER_OF_FEATURES)"
>
<EraserIcon color="white" /> <EraserIcon color="white" />
</button> </button>
</div> </div>

View File

@@ -1,3 +1,4 @@
import { newsAppFeatures } from '@/data/app-feature'
import type { import type {
Feature, Feature,
FeatureStatus FeatureStatus
@@ -74,7 +75,8 @@ const mayBeInProgress = ({
} }
export const newBacklog = (type: 'bird' | 'mobile-app', limit?: number) => { export const newBacklog = (type: 'bird' | 'mobile-app', limit?: number) => {
const initialFeatures = type === 'bird' ? birdFeatures : mobileAppFeatures const initialFeatures =
type === 'bird' ? [...birdFeatures] : [...mobileAppFeatures]
return limit !== undefined return limit !== undefined
? popNElement(shuffleArray(initialFeatures), limit) ? popNElement(shuffleArray(initialFeatures), limit)
: shuffleArray(initialFeatures) : shuffleArray(initialFeatures)

View File

@@ -12,7 +12,7 @@ export const features: Feature[] = birds.map((name) => ({
qualityIssue: 0 qualityIssue: 0
})) }))
export const birdFeatures: Feature[] = birds.map((name) => ({ export const birdFeatures: readonly Feature[] = birds.map((name) => ({
name, name,
complexity: randomInteger(1, 5), complexity: randomInteger(1, 5),
leadTime: 0, leadTime: 0,
@@ -21,11 +21,13 @@ export const birdFeatures: Feature[] = birds.map((name) => ({
qualityIssue: 0 qualityIssue: 0
})) }))
export const mobileAppFeatures: Feature[] = newsAppFeatures.map((name) => ({ export const mobileAppFeatures: readonly Feature[] = newsAppFeatures.map(
name, (name) => ({
complexity: randomInteger(1, 5), name,
leadTime: 0, complexity: randomInteger(1, 5),
status: 'doing', leadTime: 0,
step: Infinity, status: 'doing',
qualityIssue: 0 step: Infinity,
})) qualityIssue: 0
})
)

View File

@@ -1,6 +1,6 @@
import { Feature } from '@/modules/pull-system/feature/feature' import type { Feature } from '@/modules/pull-system/feature/feature'
import { FeatureStep } from '@/modules/pull-system/feature/feature-steps' import type { FeatureStep } from '@/modules/pull-system/feature/feature-steps'
import { Strategy } from '@/modules/lean/strategy' import type { Strategy } from '@/modules/pull-system/lean/strategy'
export type Meta = { export type Meta = {
totalDays: number totalDays: number