From 77b918790a3d63a4dd0222f0baa74875699162ff Mon Sep 17 00:00:00 2001 From: Mo Mesgin Date: Mon, 9 Sep 2024 11:57:10 -0700 Subject: [PATCH 1/3] fix issues related to select component after vue3 upgrade --- shell/components/auth/AllowedPrincipals.vue | 7 +++++-- shell/components/auth/SelectPrincipal.vue | 2 +- shell/components/form/LabeledSelect.vue | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/shell/components/auth/AllowedPrincipals.vue b/shell/components/auth/AllowedPrincipals.vue index fcdc9781edb..6cd44c2fdda 100644 --- a/shell/components/auth/AllowedPrincipals.vue +++ b/shell/components/auth/AllowedPrincipals.vue @@ -4,7 +4,6 @@ import ArrayList from '@shell/components/form/ArrayList'; import Principal from '@shell/components/auth/Principal'; import SelectPrincipal from '@shell/components/auth/SelectPrincipal'; import { _EDIT } from '@shell/config/query-params'; -import { addObject } from '@shell/utils/array'; export default { components: { @@ -56,7 +55,11 @@ export default { methods: { addPrincipal(id) { - addObject(this.authConfig.allowedPrincipalIds, id); + const currentIds = this.authConfig.allowedPrincipalIds; + // add new id and remove duplicates + const updatedIds = [...new Set([...currentIds, id])]; + + this.authConfig.allowedPrincipalIds = updatedIds; }, } }; diff --git a/shell/components/auth/SelectPrincipal.vue b/shell/components/auth/SelectPrincipal.vue index b76171fa120..27b6c918459 100644 --- a/shell/components/auth/SelectPrincipal.vue +++ b/shell/components/auth/SelectPrincipal.vue @@ -188,7 +188,7 @@ export default { :filterable="false" class="select-principal" :class="{'retain-selection': retainSelection}" - @input="add" + @update:value="add" @search="onSearch" @on-open="resetTooltipContent()" @on-close="setTooltipContent()" diff --git a/shell/components/form/LabeledSelect.vue b/shell/components/form/LabeledSelect.vue index 629c291a587..4ae873dfe45 100644 --- a/shell/components/form/LabeledSelect.vue +++ b/shell/components/form/LabeledSelect.vue @@ -13,6 +13,8 @@ import { LABEL_SELECT_NOT_OPTION_KINDS } from '@shell/types/components/labeledSe export default { name: 'LabeledSelect', + inheritAttrs: false, + components: { LabeledTooltip }, mixins: [ CompactInput, @@ -245,6 +247,7 @@ export default {