Parcourir la source

fix missing publication directors field on empty data

Olivier Massot il y a 2 ans
Parent
commit
fa8357ff9c

+ 4 - 6
components/Layout/Parameters/Website.vue

@@ -55,7 +55,6 @@
         </v-col>
 
         <v-col cols="6">
-          <v-row>
             <!-- les publicationDirectors sont des entités Access -->
             <UiInputAutocompleteAccesses
                 v-model="parameters.publicationDirectors"
@@ -63,9 +62,8 @@
                 multiple
                 chips
             />
-          </v-row>
 
-          <v-row class="my-8" v-if="!organizationProfile.isCmf">
+          <div class="my-8" v-if="!organizationProfile.isCmf">
             <v-btn
               v-if="!parameters.desactivateOpentalentSiteWeb"
               color="error"
@@ -106,14 +104,14 @@
                 </v-btn>
               </template>
             </LazyLayoutDialog>
-          </v-row>
+          </div>
 
-          <v-row>
+          <div>
             <UiInputText
                 v-model="parameters.otherWebsite"
                 field="otherWebsite"
             />
-          </v-row>
+          </div>
         </v-col>
       </v-row>
     </UiForm>

+ 9 - 3
components/Ui/Input/Autocomplete/Accesses.vue

@@ -144,8 +144,12 @@ const nameFilter: Ref<string | null> = ref(null)
 const query: ComputedRef<AnyJson> = computed(() => {
   let q: AnyJson = {'groups[]': 'access_people_ref'}
 
-  if (!initialized.value) {
-    q['id[in]'] = Array.isArray(props.modelValue) ? props.modelValue.join(',') : props.modelValue
+  if (!initialized.value && props.modelValue) {
+    if (Array.isArray(props.modelValue) && props.modelValue.length > 0) {
+      q['id[in]'] = props.modelValue.join(',')
+    } else {
+      q['id[in]'] = props.modelValue
+    }
     return q
   }
 
@@ -220,5 +224,7 @@ const onUpdateModelValue = (event: Array<number>) => {
 </script>
 
 <style scoped lang="scss">
-
+  .v-autocomplete {
+    min-width: 350px;
+  }
 </style>