add a dashboard

This commit is contained in:
Julien Calixte
2023-07-22 12:32:47 +02:00
parent 45771d2d4f
commit c1a26ac429
3 changed files with 35 additions and 4 deletions

View File

@@ -25,7 +25,10 @@ const hasFeaturesDone = computed(() => props.step.featuresInProgress.length > 0)
:key="feature.name" :key="feature.name"
class="bin" class="bin"
> >
<div>
{{ feature.name }} {{ feature.name }}
</div>
<div class="lead-time">{{ feature.leadTime }} days</div>
</li> </li>
</ul> </ul>
</section> </section>
@@ -37,7 +40,10 @@ const hasFeaturesDone = computed(() => props.step.featuresInProgress.length > 0)
:key="feature.name" :key="feature.name"
class="bin" class="bin"
> >
<div>
{{ feature.name }} {{ feature.name }}
</div>
<div class="lead-time">{{ feature.leadTime }} days</div>
</li> </li>
</ul> </ul>
<div <div
@@ -52,6 +58,8 @@ const hasFeaturesDone = computed(() => props.step.featuresInProgress.length > 0)
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
@import url('https://fonts.googleapis.com/css2?family=Cutive+Mono&display=swap');
.feature-step { .feature-step {
header { header {
padding: 0.5rem; padding: 0.5rem;
@@ -74,7 +82,7 @@ const hasFeaturesDone = computed(() => props.step.featuresInProgress.length > 0)
.bin { .bin {
margin-top: 1rem; margin-top: 1rem;
border: 3px solid var(--background-color); border: 3px solid var(--background-color);
height: 60px; height: 62px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -88,5 +96,14 @@ const hasFeaturesDone = computed(() => props.step.featuresInProgress.length > 0)
color: white; color: white;
font-size: 18pt; font-size: 18pt;
} }
li {
flex-direction: column;
}
.lead-time {
font-family: 'Cutive Mono', monospace;
font-weight: bold;
}
} }
</style> </style>

View File

@@ -25,5 +25,17 @@ export const createFeatureBoard = () => {
return featureSteps return featureSteps
} }
return { initBoard } const nextDay = (featureSteps: FeatureStep[]): FeatureStep[] => {
featureSteps.forEach((step) => {
step.featuresInProgress.forEach((feature) => feature.leadTime++)
if (step.title.toLowerCase() !== 'release') {
step.featuresDone.forEach((feature) => feature.leadTime++)
}
})
return featureSteps
}
return { initBoard, nextDay }
} }

View File

@@ -30,3 +30,5 @@ export const pickRandomIndex = <T>(array: T[]) =>
export const pickRandomElement = <T>(array: T[]) => export const pickRandomElement = <T>(array: T[]) =>
array[pickRandomIndex(array)] array[pickRandomIndex(array)]
export const sumElements = (array: number[]) => array.reduce((a, b) => a + b, 0)