Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entities-plugins): wrong custom plugin tab active state [KM-647] #1754

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading