Skip to content

Commit

Permalink
fix(entities-plugins): plugin select (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder authored Nov 29, 2023
1 parent cd8a020 commit 8beb7e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('<PluginSelect />', () => {
cy.get('.kong-ui-entities-plugin-select-form .plugins-results-container').should('be.visible')

for (const key in disabledPlugins) {
cy.get(`.plugin-card.disabled [data-testid="${key}-card"]`).should('be.visible')
cy.get(`.plugin-card-content.disabled[data-testid="${key}-card"]`).should('be.visible')
}
})

Expand Down Expand Up @@ -409,7 +409,7 @@ describe('<PluginSelect />', () => {
cy.get('.kong-ui-entities-plugin-select-form .plugins-results-container').should('be.visible')

for (const key in disabledPlugins) {
cy.get(`.plugin-card.disabled [data-testid="${key}-card"]`).should('be.visible')
cy.get(`.plugin-card-content.disabled[data-testid="${key}-card"]`).should('be.visible')
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ const buildPluginList = (): PluginCardList => {
// returning an array of unique plugin ids
// either grab all plugins from metadata file or use list of available plugins provided by API
return [...new Set(
Object.assign(
Object.keys({ ...(!props.availableOnServer ? pluginMetaData : {}) }),
availablePlugins.value,
),
[
...Object.keys({ ...(!props.availableOnServer ? pluginMetaData : {}) }),
...availablePlugins.value,
],
)]
// Filter out ignored plugins
.filter((plugin: string) => !props.ignoredPlugins.includes(plugin))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<template>
<KTooltip
class="plugin-card plugin-card-cursor-pointer"
:class="{
'disabled': isDisabled,
}"
:label="plugin.disabledMessage"
position-fixed
>
<KCard
class="plugin-card-content"
:class="{ disabled: isDisabled }"
:data-testid="`${plugin.id}-card`"
:disabled="isDisabled"
has-hover
@click="isDisabled || isCustomPlugin ? undefined : handleClick()"
>
Expand Down Expand Up @@ -218,6 +214,7 @@ const handleCustomClick = (): void => {
.plugin-card,
.plugin-card-content {
color: initial;
cursor: pointer;
display: flex;
flex-basis: 100%;
flex-flow: row-wrap;
Expand Down

0 comments on commit 8beb7e1

Please sign in to comment.