Skip to content

Commit

Permalink
fix(dashboard-renderer): attempt to split out entities-shared
Browse files Browse the repository at this point in the history
  • Loading branch information
adorack committed Feb 7, 2025
1 parent 3897079 commit 32043ca
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/analytics/dashboard-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@
"@kong-ui-public/analytics-config-store": "workspace:^",
"@kong-ui-public/analytics-metric-provider": "workspace:^",
"@kong-ui-public/analytics-utilities": "workspace:^",
"@kong-ui-public/entities-shared": "workspace:^",
"@kong-ui-public/i18n": "workspace:^",
"@kong-ui-public/sandbox-layout": "workspace:^",
"@kong/design-tokens": "1.17.2",
"@kong/kongponents": "9.17.2",
"ajv": "^8.17.1",
"pinia": ">= 2.1.7 < 3",
"swrv": "^1.0.4",
"vue": "^3.5.12",
"ajv": "^8.17.1"
"vue": "^3.5.12"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -81,7 +82,6 @@
},
"dependencies": {
"@kong-ui-public/core": "workspace:^",
"@kong-ui-public/entities-shared": "workspace:^",
"gridstack": "^11.3.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<div
class="fallback-entity-link"
data-testid="entity-link-parent"
>
{{ entityLinkData.label }}
</div>
</template>
<script setup lang="ts">
defineProps<{
entityLinkData: { label?: string },
}>()
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
v-if="props.chartOptions.entityLink"
#name="{ record }"
>
<EntityLink
<AsyncEntityLink
:entity-link-data="{
id: record.id,
label: record.name,
Expand All @@ -30,20 +30,28 @@
</template>

<script setup lang="ts">
import { defineAsyncComponent } from 'vue'
import type { RendererProps } from '../types'
import type { TopNTableOptions } from '@kong-ui-public/analytics-utilities'
import { CP_ID_TOKEN, ENTITY_ID_TOKEN } from '../constants'
import { TopNTable } from '@kong-ui-public/analytics-chart'
import type { TopNTableRecord } from '@kong-ui-public/analytics-chart'
import QueryDataProvider from './QueryDataProvider.vue'
import { EntityLink } from '@kong-ui-public/entities-shared'
import composables from '../composables'
import '@kong-ui-public/entities-shared/dist/style.css'
import FallbackEntityLink from './FallbackEntityLink.vue'
const props = defineProps<RendererProps<TopNTableOptions>>()
const { evaluateFeatureFlag } = composables.useEvaluateFeatureFlag()
const hasKebabMenuAccess = evaluateFeatureFlag('ma-3043-analytics-chart-kebab-menu', false)
const AsyncEntityLink = defineAsyncComponent(() =>
import('@kong-ui-public/entities-shared').then(({ EntityLink }) => {
return EntityLink
}).catch(() => {
return FallbackEntityLink
}))
const parseLink = (record: TopNTableRecord) => {
if (props.chartOptions?.entityLink) {
if (record.id.includes(':')) {
Expand Down
5 changes: 5 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 32043ca

Please sign in to comment.