Просмотр исходного кода

Merge branch 'hotfix/bug_with_iri_encoded_fields' into develop

Olivier Massot 5 месяцев назад
Родитель
Сommit
bca8795497

+ 0 - 11
components/Ui/Input/Autocomplete/Accesses.vue

@@ -21,7 +21,6 @@ Champs autocomplete dédié à la recherche des Accesses d'une structure
       prepend-inner-icon="fas fa-magnifying-glass"
       :return-object="false"
       :variant="variant"
-      :class="pending || pageStore.loading ? 'hide-selection' : ''"
       @update:model-value="onUpdateModelValue"
       @update:search="onUpdateSearch"
     />
@@ -259,14 +258,4 @@ const onUpdateModelValue = (event: Array<number>) => {
 .v-autocomplete {
   min-width: 350px;
 }
-
-.hide-selection {
-  /**
-      On cache le contenu au chargement en attendant de résoudre le bug qui fait
-      que ce sont les ids ou les IRIs qui s'affichent le temps du chargement
-   */
-  :deep(.v-chip__content) {
-    color: transparent !important;
-  }
-}
 </style>

+ 6 - 4
services/data/normalizer/hydraNormalizer.ts

@@ -24,21 +24,23 @@ class HydraNormalizer {
     const iriEncodedFields =
       Object.getPrototypeOf(entity).constructor.getIriEncodedFields()
 
+    const data = _.cloneDeep(entity)
+
     for (const field in iriEncodedFields) {
-      const value = entity[field]
+      const value = data[field]
       const targetEntity = iriEncodedFields[field].entity
 
       if (_.isArray(value)) {
-        entity[field] = value.map((id: number) => {
+        data[field] = value.map((id: number) => {
           return UrlUtils.makeIRI(targetEntity, id)
         })
       } else {
-        entity[field] =
+        data[field] =
           value !== null ? UrlUtils.makeIRI(targetEntity, value) : null
       }
     }
 
-    return entity.$toJson()
+    return data.$toJson()
   }
 
   /**