fix feature steps glitch

This commit is contained in:
Julien Calixte
2023-07-30 16:44:42 +02:00
parent f68601c957
commit c72948efc1
6 changed files with 59 additions and 30 deletions

View File

@@ -15,11 +15,9 @@ import SimulationDashboard from '@/modules/simulation/SimulationDashboard.vue'
<FlowHypothesis class="text" /> <FlowHypothesis class="text" />
<SeparatorIcon /> <SeparatorIcon />
<FeatureSteps alias="introducing" /> <FeatureSteps alias="introducing" />
<SeparatorIcon /> <FlowDashboard class="above" />
<FlowDashboard />
<FeatureSteps alias="playground" /> <FeatureSteps alias="playground" />
<SeparatorIcon /> <SimulationControls class="above" />
<SimulationControls />
<SimulationDashboard /> <SimulationDashboard />
</div> </div>
</template> </template>
@@ -27,6 +25,7 @@ import SimulationDashboard from '@/modules/simulation/SimulationDashboard.vue'
<style lang="scss"> <style lang="scss">
.flow-article { .flow-article {
color: black; color: black;
background-color: white;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@@ -40,5 +39,11 @@ import SimulationDashboard from '@/modules/simulation/SimulationDashboard.vue'
margin: auto; margin: auto;
text-align: justify; text-align: justify;
} }
.above {
z-index: 1;
padding-top: 1rem;
background-color: white;
}
} }
</style> </style>

View File

@@ -2,7 +2,8 @@
import FeatureItem from '@/modules/feature/FeatureItem.vue' import FeatureItem from '@/modules/feature/FeatureItem.vue'
import { Feature } from '@/modules/feature/feature' import { Feature } from '@/modules/feature/feature'
import { FeatureStep } from '@/modules/feature/feature-steps' import { FeatureStep } from '@/modules/feature/feature-steps'
import { computed } from 'vue' import { useElementSize } from '@vueuse/core'
import { computed, ref } from 'vue'
import { Starport } from 'vue-starport' import { Starport } from 'vue-starport'
const props = defineProps<{ const props = defineProps<{
@@ -14,20 +15,26 @@ const featuresInProgress = computed(() =>
props.features.filter((feature) => feature.status === 'doing') props.features.filter((feature) => feature.status === 'doing')
) )
const featuresDone = computed(() => const featuresDone = computed(() =>
props.features props.features.filter((feature) => feature.status === 'done')
.filter((feature) => feature.status === 'done')
.sort((a, b) => (a.leadTime > b.leadTime ? -1 : 1))
) )
const remainingBlueBins = computed(() =>
Math.max(0, props.step.blueBins - featuresDone.value.length)
)
const hasFeaturesInProgress = computed( const hasFeaturesInProgress = computed(
() => featuresInProgress.value.length > 0 () => featuresInProgress.value.length > 0
) )
const isLive = computed( const isLive = computed(
() => props.step.title.toLocaleLowerCase() === 'release' () => props.step.title.toLocaleLowerCase() === 'release'
) )
const binContainer = ref<HTMLElement | null>(null)
const { width } = useElementSize(binContainer)
const binContainerWidth = computed(() => {
if (!width) {
return ''
}
return `width: ${width.value}px`
})
</script> </script>
<template> <template>
@@ -48,14 +55,18 @@ const isLive = computed(
</section> </section>
<section class="done"> <section class="done">
<h5> [{{ featuresDone.length }}]</h5> <h5> [{{ featuresDone.length }}]</h5>
<div> <div ref="binContainer">
<div v-if="!isLive" class="blue-bin-container"> <div
v-if="!isLive"
class="blue-bin-container"
:style="binContainerWidth"
>
<div <div
v-for="blueBin in remainingBlueBins" v-for="blueBin in step.blueBins"
:key="blueBin" :key="blueBin"
class="bin blue-bin" class="bin blue-bin"
> >
Blue bin blue bin
</div> </div>
</div> </div>
<div v-if="isLive" class="live"> <div v-if="isLive" class="live">
@@ -72,7 +83,7 @@ const isLive = computed(
<li v-for="feature in featuresDone" :key="feature.name"> <li v-for="feature in featuresDone" :key="feature.name">
<Starport <Starport
:port="`${props.prefix}-${feature.name}`" :port="`${props.prefix}-${feature.name}`"
style="height: calc(var(--feature-item-height) + 0.2rem)" style="height: var(--feature-item-height)"
> >
<FeatureItem :feature="feature" :is-live="isLive" /> <FeatureItem :feature="feature" :is-live="isLive" />
</Starport> </Starport>
@@ -120,12 +131,29 @@ const isLive = computed(
color: var(--color); color: var(--color);
} }
li { ul {
margin-top: 0.5rem;
display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem;
li {
z-index: 1;
}
} }
.done-list { .bin {
flex: 1; height: var(--feature-item-height);
border: none;
}
.blue-bin-container {
position: absolute;
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 0.5rem;
z-index: 0;
} }
.live { .live {

View File

@@ -33,7 +33,7 @@ onMounted(() => featureStore.initBoard(NUMBER_OF_FEATURES))
align-items: stretch; align-items: stretch;
margin: 0 1rem; margin: 0 1rem;
border: 3px solid var(--primary-color); border: 3px solid var(--primary-color);
height: 50vh; height: 60vh;
width: 100%; width: 100%;
overflow-y: hidden; overflow-y: hidden;

View File

@@ -14,9 +14,8 @@ const featureStore = useFeatureStore()
<div class="card"> <div class="card">
Features Features
<span class="numeric"> <span class="numeric">
{{ featureStore.totalFeaturesDone }}/<span class="sub"> {{ featureStore.totalFeaturesDone
{{ featureStore.totalFeaturesCount }} }}<span class="sub">/{{ featureStore.totalFeaturesCount }} </span>
</span>
</span> </span>
</div> </div>
<div class="card"> <div class="card">
@@ -94,10 +93,6 @@ const featureStore = useFeatureStore()
justify-content: center; justify-content: center;
} }
.sub {
font-size: 12pt;
}
.cards { .cards {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

View File

@@ -11,9 +11,8 @@ const strategies: Strategy[] = ['push', 'pull', 'push-dps', 'pull-dps']
<div class="simulation-dashboard"> <div class="simulation-dashboard">
<h3>Dashboard</h3> <h3>Dashboard</h3>
<h4> <h4>
{{ simulationStore.simulationsDone }}/{{ {{ simulationStore.simulationsDone
simulationStore.requestedSimulation }}<span class="sub">/{{ simulationStore.requestedSimulation }}</span>
}}
simulations simulations
</h4> </h4>
<table> <table>

View File

@@ -119,6 +119,8 @@ export const useSimulationStore = defineStore('dashboard', {
this.mean.pull = newMean() this.mean.pull = newMean()
this.mean['pull-dps'] = newMean() this.mean['pull-dps'] = newMean()
this.mean['push-dps'] = newMean() this.mean['push-dps'] = newMean()
this.simulationsDone = 0
this.requestedSimulation = 0
} }
}, },
getters: { getters: {