Skip to content

Commit

Permalink
Corrige la mise à jour des paramètres de l'audit (#875)
Browse files Browse the repository at this point in the history
* fix store data objects being referenced instead of cloned in forms components

* update changelog

---------

Co-authored-by: Quentin Bellanger <hello@quentin-bellanger.com>
  • Loading branch information
hissalht and bellangerq authored Nov 22, 2024
1 parent 00018f6 commit e3b6b52
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Tous les changements notables de Ara sont documentés ici avec leur date, leur catégorie (nouvelle fonctionnalité, correction de bug ou autre changement) et leur pull request (PR) associée.

## 22/11/2024

### Corrections 🐛

- Corrige la "fausse" mise à jour des paramètres de l’audit quand on quitte la page sans sauvegarder ([#875](https://github.com/DISIC/Ara/pull/875))

## 21/11/2024

### Corrections 🐛
Expand Down
4 changes: 2 additions & 2 deletions confiture-web-app/src/components/audit/AuditSettingsForm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { nextTick, ref, watch } from "vue";
import { nextTick, ref, toRaw, watch } from "vue";
import { useRoute } from "vue-router";
import { useAccountStore } from "../../store/account";
Expand Down Expand Up @@ -62,7 +62,7 @@ const accountStore = useAccountStore();
const auditType = ref(props.audit?.auditType);
const procedureName = ref(props.audit?.procedureName);
const pages = ref(props.audit?.pages);
const pages = ref(structuredClone(toRaw(props.audit?.pages)));
const auditorEmail = ref(props.audit?.auditorEmail);
const auditorName = ref(props.audit?.auditorName ?? "");
Expand Down
6 changes: 3 additions & 3 deletions confiture-web-app/src/pages/audit/AuditDeclarationPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, nextTick, ref, watch } from "vue";
import { computed, nextTick, ref, toRaw, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import TestEnvironmentSelection from "../../components/audit/TestEnvironmentSelection/TestEnvironmentSelection.vue";
Expand Down Expand Up @@ -144,7 +144,7 @@ watch(
contactFormUrl.value = audit.contactFormUrl ?? "";
validatedTechnologies.value = audit.technologies.length
? audit.technologies
? structuredClone(toRaw(audit.technologies))
: [];
defaultTools.value = audit.tools.length
Expand All @@ -155,7 +155,7 @@ watch(
? audit.tools.filter((tool) => !availableTools.includes(tool))
: [];
environments.value = audit.environments ?? [];
environments.value = structuredClone(toRaw(audit.environments)) ?? [];
notCompliantContent.value = audit.notCompliantContent ?? "";
derogatedContent.value = audit.derogatedContent ?? "";
Expand Down
6 changes: 3 additions & 3 deletions confiture-web-app/src/store/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ export const useResultsStore = defineStore("results", {
const transversePageId =
auditStore.currentAudit?.transverseElementsPage.id;

return (
!this.allResults
return !(
this.allResults
?.filter((r) => r.pageId !== transversePageId)
.some((r) => r.status === CriteriumResultStatus.NOT_TESTED) ?? false
.some((r) => r.status === CriteriumResultStatus.NOT_TESTED) ?? true
);
},

Expand Down

0 comments on commit e3b6b52

Please sign in to comment.