Skip to content

Commit

Permalink
fix(entities-plugins): wrong custom plugin tab active state [KM-647] (#…
Browse files Browse the repository at this point in the history
…1754)

`activeTab` is not reactive, causing the custom plugin to activate on the serverless CP
  • Loading branch information
2eha0 authored Oct 31, 2024
1 parent bbb9121 commit a101a32
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions packages/entities/entities-plugins/src/components/PluginSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,27 @@ const noSearchResults = computed((): boolean => {
return (Object.keys(pluginsList.value).length > 0 && !hasFilteredResults.value)
})
const tabs = props.config.app === 'konnect'
? [{
hash: '#kong',
title: t('plugins.select.tabs.kong.title'),
},
{
hash: '#custom',
title: t('plugins.select.tabs.custom.title'),
disabled: props.disableCustomPlugins,
}]
: []
const activeTab = ref(tabs.length ? route?.hash || tabs[0]?.hash || '' : '')
const tabs = computed(() => {
return props.config.app === 'konnect'
? [{
hash: '#kong',
title: t('plugins.select.tabs.kong.title'),
},
{
hash: '#custom',
title: t('plugins.select.tabs.custom.title'),
disabled: props.disableCustomPlugins,
}]
: []
})
const activeTab = computed(() => {
let hash = tabs.value.length ? route?.hash || tabs.value[0]?.hash || '' : ''
// If custom plugins are disabled, default to kong tab
if (hash === '#custom' && props.disableCustomPlugins) {
hash = '#kong'
}
return hash
})
const buildPluginList = (): PluginCardList => {
// If availableOnServer is false, we included unavailable plugins from pluginMeta in addition to available plugins
Expand Down

0 comments on commit a101a32

Please sign in to comment.