fix: remove Infinity states

This commit is contained in:
Julien Calixte
2024-12-23 19:28:43 +01:00
parent f86a1cf0c6
commit d551044673
2 changed files with 15 additions and 8 deletions

View File

@@ -51,7 +51,7 @@ const featureStore = useFeatureStore()
<div class="card">
ETA
<div class="data">
<span class="numeric">{{ featureStore.eat }}</span>
<span class="numeric">{{ featureStore.eta }}</span>
days
</div>
</div>

View File

@@ -10,8 +10,8 @@ import {
nextDay
} from '@/modules/pull-system/feature/feature-board'
import { featureSteps } from '@/modules/pull-system/feature/feature-steps'
import { Strategy } from '@/modules/lean/strategy'
import { FeatureState, Meta } from '@/store-type'
import type { Strategy } from '@/modules/pull-system/lean/strategy'
import type { FeatureState, Meta } from '@/store-type'
import { defineStore } from 'pinia'
const resetMeta = (): Meta => ({
@@ -57,10 +57,12 @@ export const useFeatureStore = defineStore('feature', {
meanComplexity: (state) => getMeanComplexity(state.features),
meanLeadTime: (state) => getMeanLeadTime(state.features),
meanQualityIssue: (state) => getMeanQualityIssue(state.features),
taktTime: (state): string =>
(
taktTime: (state): string => {
const taktTime = (
state.meta.totalDays / state.features.filter(isFeatureDone).length || 0
).toFixed(2),
).toFixed(2)
return taktTime === 'Infinity' ? '-' : taktTime
},
featuresGroupedByStep: (state) => {
const groupedByStep: Record<number, Feature[]> = {}
@@ -74,12 +76,17 @@ export const useFeatureStore = defineStore('feature', {
return groupedByStep
},
eat(): string {
return (
eta(): string {
if (this.taktTime === '-') {
return '-'
}
const eta = (
parseFloat(this.taktTime) *
(this.features.filter((feature) => !isFeatureDone(feature)).length +
this.backlog.length)
).toFixed(2)
return eta === 'Infinity' ? '-' : eta
},
totalFeaturesCount: (state) => state.backlog.length + state.features.length,
totalFeaturesDone: (state) =>