From 42dc155b461acf39efab816f355758c6b6232920 Mon Sep 17 00:00:00 2001 From: Maud Royer Date: Fri, 31 May 2024 17:45:20 +0200 Subject: [PATCH] feat: edition hors-ligne et synchronisation Signed-off-by: Maud Royer --- src/components/Conflict.vue | 38 +++ src/components/Features/FeatureGroup.vue | 7 +- .../Features/MassActionsSelector.vue | 4 +- .../SingleItemCertificationBodyForm.test.js | 17 +- src/components/Features/Table.test.js | 12 +- .../record/CertificationSection.vue | 17 +- src/components/record/Header.test.js | 2 +- src/components/record/Header.vue | 1 - .../record/modals/CultureTypeModal.vue | 7 +- src/components/versions/EditVersionModal.vue | 4 +- .../versions/VersionConflictModal.vue | 54 ++++ .../certification/exploitations/index.vue | 5 +- src/pages/exploitations/[numeroBio]/index.vue | 16 +- src/stores/features.js | 27 +- src/stores/operator.js | 34 ++- src/stores/record.js | 103 ++++--- src/stores/record.test.js | 16 +- src/stores/storage.js | 289 +++++++++++++++++- src/stores/storage.test.js | 86 +++++- tests-setup.js | 7 +- 20 files changed, 613 insertions(+), 133 deletions(-) create mode 100644 src/components/Conflict.vue create mode 100644 src/components/versions/VersionConflictModal.vue diff --git a/src/components/Conflict.vue b/src/components/Conflict.vue new file mode 100644 index 00000000..788f3aca --- /dev/null +++ b/src/components/Conflict.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/components/Features/FeatureGroup.vue b/src/components/Features/FeatureGroup.vue index f09a5280..5f2e59c3 100644 --- a/src/components/Features/FeatureGroup.vue +++ b/src/components/Features/FeatureGroup.vue @@ -90,10 +90,9 @@ class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl" :class="{'fr-btn': true, 'fr-btn--tertiary-no-outline': true, 'fr-icon-edit-line': true }" @click="toggleEditForm(feature.id)" aria-label="Modifier" - :disabled="!isOnline" /> - +
  • Modifier le contour @@ -108,7 +107,7 @@ @@ -26,7 +25,7 @@ + + + + diff --git a/src/pages/certification/exploitations/index.vue b/src/pages/certification/exploitations/index.vue index edced7e4..c521dc53 100644 --- a/src/pages/certification/exploitations/index.vue +++ b/src/pages/certification/exploitations/index.vue @@ -43,6 +43,9 @@ meta:
    + + +
    @@ -154,8 +157,8 @@ import { monthYearDateFormat, dateFormat } from '@/components/dates.js' import { searchOperators } from '@/cartobio-api.js' import { useUserStore } from '@/stores/user.js' import { useOnline } from "@vueuse/core" -import { useOperatorStore } from "@/stores/operator.js" import { useCartoBioStorage } from "@/stores/storage.js" +import Conflict from "@/components/Conflict.vue" const props = defineProps({ search: { diff --git a/src/pages/exploitations/[numeroBio]/index.vue b/src/pages/exploitations/[numeroBio]/index.vue index 2ce573bd..565a1bac 100644 --- a/src/pages/exploitations/[numeroBio]/index.vue +++ b/src/pages/exploitations/[numeroBio]/index.vue @@ -48,6 +48,8 @@ meta: + +
    @@ -110,12 +112,12 @@ meta: v-for="record in records" :key="record?.record_id" class="version-row fr-enlarge-link" - :class="{ 'version-row--disabled': !isOnline && !record.storedOffline }" + :class="{ 'version-row--disabled': !isOnline && !storage.records[record.record_id] }" role="link" > @@ -130,7 +132,14 @@ meta: