Skip to content

Commit 0a3e210

Browse files
committed
improve responsiveness of header
1 parent 28218cb commit 0a3e210

3 files changed

Lines changed: 59 additions & 64 deletions

File tree

confiture-web-app/src/components/AuditGenerationHeader.vue

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function confirmDuplicate(name: string) {
8585
notify(
8686
"error",
8787
"Une erreur est survenue",
88-
"Un problème empêche la duplication de l’audit. Contactez-nous à l'adresse ara@design.numerique.gouv.fr si le problème persiste."
88+
"Un problème empêche la duplication de l’audit. Contactez-nous à l'adresse ara@design.numerique.gouv.fr si le problème persiste.",
8989
);
9090
captureWithPayloads(error);
9191
});
@@ -119,7 +119,7 @@ function confirmDelete() {
119119
notify(
120120
"error",
121121
"Une erreur est survenue",
122-
"Un problème empêche la sauvegarde de vos données. Contactez-nous à l'adresse ara@design.numerique.gouv.fr si le problème persiste."
122+
"Un problème empêche la sauvegarde de vos données. Contactez-nous à l'adresse ara@design.numerique.gouv.fr si le problème persiste.",
123123
);
124124
captureWithPayloads(error);
125125
})
@@ -134,7 +134,7 @@ const uniqueId = computed(() => route.params.uniqueId as string);
134134
const resultsStore = useResultsStore();
135135
136136
const csvExportUrl = computed(
137-
() => `/api/audits/${uniqueId.value}/exports/csv`
137+
() => `/api/audits/${uniqueId.value}/exports/csv`,
138138
);
139139
140140
const csvExportFilename = computed(() => {
@@ -175,7 +175,7 @@ onMounted(() => {
175175
// verify that the sentinel is at the top of the screen
176176
el.getBoundingClientRect().top <= 64;
177177
},
178-
{ rootMargin: "-64px" }
178+
{ rootMargin: "-64px" },
179179
);
180180
181181
observer.observe(scrollSentinelRef.value!);
@@ -193,7 +193,10 @@ onMounted(() => {
193193

194194
<!-- TODO: Link to actions somehow -->
195195

196-
<div id="sticky-indicator" class="sticky-indicator fr-p-0 fr-mb-3w">
196+
<div
197+
id="sticky-indicator"
198+
class="sticky-indicator fr-grid-row fr-p-0 fr-mb-3w"
199+
>
197200
<div
198201
v-if="!systemStore.isOnline"
199202
id="offlineAlert"
@@ -209,13 +212,13 @@ onMounted(() => {
209212
</div>
210213

211214
<div
212-
class="indicator-left-side fr-col-3"
215+
class="indicator-left-side fr-col-12 fr-col-md-3"
213216
:class="{ 'with-border': showLeftSideBorders }"
214217
>
215218
<AuditProgressBar
216219
v-if="showAuditProgressBar"
217220
label="Progression de l’audit"
218-
class="fr-col-3"
221+
class="fr-pr-2w progress-bar"
219222
/>
220223

221224
<div
@@ -228,7 +231,8 @@ onMounted(() => {
228231
></span>
229232
<strong
230233
>Audit
231-
{{ auditStore.currentAudit?.editionDate ? "modifié" : "terminé" }} le
234+
{{ auditStore.currentAudit?.editionDate ? "modifié" : "terminé" }}
235+
le
232236
<time
233237
:datetime="
234238
auditStore.currentAudit?.editionDate
@@ -245,14 +249,13 @@ onMounted(() => {
245249
</div>
246250
</div>
247251

248-
<SaveIndicator
249-
v-if="route.name === 'edit-audit-step-three'"
250-
class="fr-pl-1w"
251-
/>
252-
253-
<div class="sub-header">
254-
<ul class="top-actions fr-my-0" role="list">
255-
<li class="fr-mr-2w">
252+
<div class="fr-col-12 fr-col-md-9 sub-header">
253+
<SaveIndicator
254+
v-if="route.name === 'edit-audit-step-three'"
255+
class="fr-ml-2w"
256+
/>
257+
<ul class="top-actions fr-my-0 fr-p-0" role="list">
258+
<li>
256259
<RouterLink
257260
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-settings-5-line"
258261
:to="{
@@ -264,7 +267,7 @@ onMounted(() => {
264267
</RouterLink>
265268
</li>
266269

267-
<li class="fr-mr-2w">
270+
<li>
268271
<Dropdown
269272
ref="optionsDropdownRef"
270273
title="Actions"
@@ -337,42 +340,43 @@ onMounted(() => {
337340
</div>
338341

339342
<div
340-
:class="`fr-grid-row fr-grid-row--gutters ${
341-
auditPublicationDate ? 'fr-mb-4w' : 'fr-mb-3v'
343+
:class="`fr-container--fluid ${
344+
auditPublicationDate ? 'fr-mb-4w' : 'fr-mb-3w'
342345
}`"
343346
>
344-
<div :class="`fr-col-12 fr-col-md-${12 / keyInfos.length}`">
345-
<SummaryCard
346-
:title="keyInfos[0].title"
347-
:description="
348-
unfinishedAudit
349-
? '(Disponible à la fin de l’audit)'
350-
: keyInfos[0].description
351-
"
352-
:value="unfinishedAudit ? 0 : keyInfos[0].value"
353-
:total="keyInfos[0].total"
354-
:unit="keyInfos[0].unit"
355-
:theme="unfinishedAudit ? undefined : keyInfos[0].theme"
356-
:disabled="unfinishedAudit"
357-
/>
358-
</div>
359-
<div
360-
v-for="info in keyInfos.slice(1)"
361-
:key="info.title"
362-
:class="`fr-col-12 fr-col-md-${12 / keyInfos.length}`"
363-
>
364-
<SummaryCard
365-
:title="info.title"
366-
:description="info.description"
367-
:value="info.value"
368-
:total="info.total"
369-
:unit="info.unit"
370-
:theme="info.theme"
371-
/>
347+
<div class="fr-grid-row fr-grid-row--gutters">
348+
<div :class="`fr-col-12 fr-col-md-${12 / keyInfos.length}`">
349+
<SummaryCard
350+
:title="keyInfos[0].title"
351+
:description="
352+
unfinishedAudit
353+
? '(Disponible à la fin de l’audit)'
354+
: keyInfos[0].description
355+
"
356+
:value="unfinishedAudit ? 0 : keyInfos[0].value"
357+
:total="keyInfos[0].total"
358+
:unit="keyInfos[0].unit"
359+
:theme="unfinishedAudit ? undefined : keyInfos[0].theme"
360+
:disabled="unfinishedAudit"
361+
/>
362+
</div>
363+
<div
364+
v-for="info in keyInfos.slice(1)"
365+
:key="info.title"
366+
:class="`fr-col-12 fr-col-md-${12 / keyInfos.length}`"
367+
>
368+
<SummaryCard
369+
:title="info.title"
370+
:description="info.description"
371+
:value="info.value"
372+
:total="info.total"
373+
:unit="info.unit"
374+
:theme="info.theme"
375+
/>
376+
</div>
372377
</div>
373378
</div>
374379

375-
<!-- ICI -->
376380
<div ref="scrollSentinelRef" />
377381

378382
<DuplicateModal
@@ -399,14 +403,8 @@ onMounted(() => {
399403
<style scoped>
400404
.sub-header {
401405
display: flex;
402-
align-items: end;
403406
justify-content: space-between;
404-
405-
flex-basis: initial !important;
406-
flex-direction: column;
407407
z-index: 3;
408-
409-
margin-left: auto;
410408
}
411409
412410
.heading {
@@ -419,6 +417,7 @@ onMounted(() => {
419417
420418
.top-actions {
421419
display: flex;
420+
gap: 1rem;
422421
list-style: none;
423422
}
424423
@@ -462,18 +461,11 @@ onMounted(() => {
462461
}
463462
464463
.sticky-indicator {
465-
flex-basis: initial !important;
466-
align-self: end;
467464
position: sticky;
468465
top: 0;
469466
z-index: 4;
470-
471-
display: flex;
472-
flex-wrap: wrap;
473-
gap: 0.75rem;
467+
gap: 0.5rem 0;
474468
align-items: center;
475-
flex: 1;
476-
477469
background: var(--background-default-grey);
478470
min-height: 4rem;
479471
}
@@ -515,4 +507,8 @@ onMounted(() => {
515507
.indicator-left-side.with-border {
516508
border-color: var(--border-default-grey);
517509
}
510+
511+
.progress-bar {
512+
flex-grow: 1;
513+
}
518514
</style>

confiture-web-app/src/components/AuditProgressBar.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const progressBarValue = computed(() => results.auditProgress * 100 + "%");
5151
gap: 0.25rem 0;
5252
grid-template-columns: 1fr auto;
5353
grid-template-rows: auto 0.25rem;
54-
min-width: 18rem;
5554
}
5655
5756
.audit-progress--thick {

confiture-web-app/src/pages/edit/EditAuditStepThreePage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ const accountStore = useAccountStore();
311311
:edit-unique-id="uniqueId"
312312
>
313313
<template #actions>
314-
<li class="fr-mr-2w">
314+
<li>
315315
<component
316316
:is="isOffline ? 'button' : 'RouterLink'"
317317
class="fr-btn fr-btn--secondary"

0 commit comments

Comments
 (0)