add dashboard with metadata and analysis

This commit is contained in:
Julien Calixte
2023-07-23 22:54:42 +02:00
parent 6fe228dba3
commit ba651d0a9f

View File

@@ -5,18 +5,34 @@ import { Strategy } from '@/modules/lean/strategy'
import { sumElements } from '@/utils' import { sumElements } from '@/utils'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
type Meta = {
totalDays: number
daysWithProblemSolving: number
strategy: Record<Strategy, number>
}
type Analysis = {
worstFeature: Feature
daysToDeliver: number
meanComplexity: number
meanLeadTime: number
}
type Dashboard = Array<{
uuid: string
meta: Meta
analysis: Analysis
}>
type State = { type State = {
steps: FeatureStep[] steps: FeatureStep[]
features: Feature[] features: Feature[]
backlog: Feature[] backlog: Feature[]
meta: { meta: Meta
totalDays: number dashboard: Dashboard
daysWithProblemSolving: number
strategy: Record<Strategy, number>
}
} }
const resetMeta = (): State['meta'] => ({ const resetMeta = (): Meta => ({
totalDays: 0, totalDays: 0,
daysWithProblemSolving: 0, daysWithProblemSolving: 0,
strategy: { strategy: {
@@ -31,7 +47,8 @@ export const useFeatureStore = defineStore('feature', {
steps: [], steps: [],
features: [], features: [],
backlog: [], backlog: [],
meta: resetMeta() meta: resetMeta(),
dashboard: []
}), }),
actions: { actions: {
initBoard() { initBoard() {
@@ -46,7 +63,6 @@ export const useFeatureStore = defineStore('feature', {
if (strategy === 'problem-solving') { if (strategy === 'problem-solving') {
this.meta.daysWithProblemSolving++ this.meta.daysWithProblemSolving++
return
} }
this.features = nextDay({ this.features = nextDay({