-
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: edition hors-ligne et synchronisation
Signed-off-by: Maud Royer <hello@maudroyer.fr>
- Loading branch information
Showing
20 changed files
with
613 additions
and
133 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,38 @@ | ||
<script setup> | ||
import { useCartoBioStorage } from "@/stores/storage.js" | ||
import VersionConflictModal from "@/components/versions/VersionConflictModal.vue" | ||
import { ref } from "vue" | ||
const storage = useCartoBioStorage() | ||
const modalRecordId = ref(null) | ||
</script> | ||
|
||
<template> | ||
<div class="fr-alert fr-alert--error" role="alert"> | ||
<div class="fr-alert__title">Conflit entre versions</div> | ||
<p> | ||
Les exploitations suivantes ont été modifiées pendant que vous étiez hors-ligne. Cliquez sur l'exploitation pour | ||
résoudre le conflit. | ||
</p> | ||
|
||
<ul class="fr-text--bold"> | ||
<li v-for="conflict in storage.conflicts" :key="conflict"> | ||
<a href="#" @click="modalRecordId = conflict"> | ||
{{ storage.operators[storage.records[conflict].numerobio].operator.nom }} | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<Teleport to="body"> | ||
<VersionConflictModal | ||
v-if="modalRecordId" | ||
:record-id="modalRecordId" | ||
@close="modalRecordId = null" | ||
/> | ||
</Teleport> | ||
</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
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
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
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,54 @@ | ||
<script setup> | ||
import Modal from "@/components/Modal.vue" | ||
import { useCartoBioStorage } from "@/stores/storage.js" | ||
const emit = defineEmits(['close']) | ||
const props = defineProps({ | ||
recordId: { | ||
type: String, | ||
required: true | ||
} | ||
}) | ||
const storage = useCartoBioStorage() | ||
async function duplicate() { | ||
await storage.resolveConflict(props.recordId, true) | ||
emit('close') | ||
} | ||
async function merge() { | ||
await storage.resolveConflict(props.recordId, false) | ||
emit('close') | ||
} | ||
</script> | ||
|
||
<template> | ||
<Modal @close="$emit('close')" v-bind="$attrs" icon="fr-icon-warning-fill"> | ||
<template #title>Conflit entre versions</template> | ||
<p> | ||
Il semblerait qu’une autre personne ait effectué des modifications sur un parcellaire pendant que vous le modifiiez hors-ligne : | ||
</p> | ||
<p> | ||
Version : <b>{{ storage.records[recordId].version_name }}</b> de l’exploitation <b>{{ storage.operators[storage.records[recordId].numerobio].nom }}</b><br/> | ||
</p> | ||
<p> | ||
Souhaitez-vous tout de même appliquer les changements faits hors-ligne sur cette version ? | ||
</p> | ||
|
||
<template #footer> | ||
<ul class="fr-btns-group fr-btns-group--inline"> | ||
<li> | ||
<button class="fr-btn" @click="duplicate">Créer une nouvelle version</button> | ||
</li> | ||
<li> | ||
<button class="fr-btn fr-btn--tertiary" @click="merge">Appliquer les changements</button> | ||
</li> | ||
</ul> | ||
</template> | ||
</Modal> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
Oops, something went wrong.