-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: page listes des parcellaires stockés
Signed-off-by: Maud Royer <hello@maudroyer.fr>
- Loading branch information
Showing
6 changed files
with
191 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup> | ||
import Modal from "@/components/Modal.vue" | ||
defineEmits(['close']) | ||
</script> | ||
|
||
<template> | ||
<Modal @close="$emit('close')" v-bind="$attrs" icon="fr-icon-warning-fill"> | ||
<template #title>Espace de stockage complet</template> | ||
|
||
<p> | ||
Vous avez atteint la limite de stockage de votre navigateur. | ||
</p> | ||
<p> | ||
Pour télécharger de nouveaux parcellaires, veuillez en supprimer | ||
parmi la liste des parcellaires téléchargés. | ||
</p> | ||
|
||
|
||
<template #footer> | ||
<ul class="fr-btns-group fr-btns-group--inline"> | ||
<li> | ||
<router-link to="/exploitations/stockage/" class="fr-btn fr-btn--primary">Voir la liste</router-link> | ||
</li> | ||
<li> | ||
<button class="fr-btn fr-btn--tertiary" @click="$emit('close')">Annuler</button> | ||
</li> | ||
</ul> | ||
</template> | ||
</Modal> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<script setup> | ||
import { useOperatorStore } from "@/stores/operator.js" | ||
import { computed } from "vue" | ||
import { usePermissions } from "@/stores/permissions.js" | ||
const operatorStore = useOperatorStore() | ||
const permissions = usePermissions() | ||
const storedRecords = computed(() => { | ||
return Array.from((function* records() { | ||
for (const [, [operator, records]] of Object.entries(operatorStore.storage)) { | ||
for (const record of records) { | ||
if (localStorage.getItem(`record-${record.record_id}`)) { | ||
yield { | ||
operator, | ||
record | ||
} | ||
} | ||
} | ||
} | ||
})()) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<main class="fr-container fr-pb-2w"> | ||
<nav role="navigation" class="fr-breadcrumb fr-mb-2w"> | ||
<ol class="fr-breadcrumb__list"> | ||
<li><router-link class="fr-breadcrumb__link" :to="permissions.startPage">Exploitations</router-link></li> | ||
<li><a class="fr-breadcrumb__link" aria-current="page">Parcellaires téléchargés</a></li> | ||
</ol> | ||
</nav> | ||
<h1 class="fr-h3">Parcellaires téléchargés</h1> | ||
<div class="fr-table fr-table--bordered"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Nom de l'exploitation</th> | ||
<th>Nom de version</th> | ||
<th>Date d'audit</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr | ||
v-for="{operator, record} in storedRecords" | ||
:key="record.record_id" | ||
@click="$router.push(`/exploitations/${operator.numeroBio}/${record.record_id}/`)" | ||
> | ||
<td>{{ operator.nom }}</td> | ||
<td>{{ record.version_name }}</td> | ||
<td>{{ record.audit_date }}</td> | ||
<td> | ||
<button | ||
type="button" | ||
class="fr-btn fr-btn--tertiary-no-outline fr-icon-close-circle-fill" | ||
@click.stop.prevent="operatorStore.clearDownloadRecord(record.record_id)" | ||
>Supprimer des téléchargements</button> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</main> | ||
</template> | ||
|
||
<style scoped> | ||
.fr-table table { | ||
width: 100%; | ||
display: table; | ||
& tbody tr:hover, | ||
& tbody button:hover { | ||
cursor: pointer; | ||
background-color: var(--background-alt-blue-france-hover); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters