Skip to content

Commit

Permalink
fix(pluginlist): adapt empty ordering object for filtered plugin (#1759)
Browse files Browse the repository at this point in the history
* fix(pluginlist): adapt empty ordering object for filtered plugin

* test(pluginlist): change plugin item format
  • Loading branch information
TT1228 authored Nov 4, 2024
1 parent f29661f commit 0e03cd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/entities/entities-plugins/fixtures/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const plugins: FetcherRawResponse = {
name: 'basic-auth',
protocols: ['http', 'https'],
tags: ['tag1'],
ordering: {},
ordering: { 'before': { 'access': ['acl'] } },
instance_name: 'instance-1',
created_at: 1610617600,
consumer_group: { id: 'consumer-group-1' },
Expand Down
12 changes: 8 additions & 4 deletions packages/entities/entities-plugins/src/components/PluginList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@
</template>

<template #ordering="{ rowValue }">
<KBadge :appearance="rowValue ? 'warning' : 'info'">
<KBadge
:appearance="isEmpty(rowValue) ? 'info' : 'warning'"
>
{{
rowValue
? t('plugins.list.table_headers.ordering_badge.dynamic')
: t('plugins.list.table_headers.ordering_badge.static')
isEmpty(rowValue)
? t('plugins.list.table_headers.ordering_badge.static')
: t('plugins.list.table_headers.ordering_badge.dynamic')
}}
</KBadge>
</template>
Expand Down Expand Up @@ -261,6 +263,8 @@ import PluginIcon from './PluginIcon.vue'
import type { HeaderTag } from '@kong/kongponents'
import isEmpty from 'lodash-es/isEmpty'
const pluginMetaData = composables.usePluginMetaData()
const emit = defineEmits<{
Expand Down

0 comments on commit 0e03cd7

Please sign in to comment.