@@ -32,7 +33,7 @@
diff --git a/packages/analytics/dashboard-renderer/src/components/BaseAnalyticsChartRenderer.vue b/packages/analytics/dashboard-renderer/src/components/BaseAnalyticsChartRenderer.vue
new file mode 100644
index 0000000000..65357da1d9
--- /dev/null
+++ b/packages/analytics/dashboard-renderer/src/components/BaseAnalyticsChartRenderer.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ {{ i18n.t('renderer.edit') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/analytics/dashboard-renderer/src/components/DashboardRenderer.vue b/packages/analytics/dashboard-renderer/src/components/DashboardRenderer.vue
index b037b76ea0..dbd7873f72 100644
--- a/packages/analytics/dashboard-renderer/src/components/DashboardRenderer.vue
+++ b/packages/analytics/dashboard-renderer/src/components/DashboardRenderer.vue
@@ -26,6 +26,7 @@
:definition="tile.meta"
:height="tile.layout.size.rows * (config.tileHeight || DEFAULT_TILE_HEIGHT) + parseInt(KUI_SPACE_70, 10)"
:query-ready="queryReady"
+ @edit-tile="onEditTile(tile)"
/>
@@ -53,6 +54,10 @@ const props = defineProps<{
config: DashboardConfig,
}>()
+const emit = defineEmits<{
+ (e: 'edit-tile', tile: GridTile
): void
+}>()
+
const { i18n } = composables.useI18n()
// Note: queryBridge is not directly used by the DashboardRenderer component. It is required by many of the
@@ -129,7 +134,7 @@ const gridTiles = computed(() => {
})
const mergedContext = computed(() => {
- let { tz, refreshInterval } = props.context
+ let { tz, refreshInterval, editable } = props.context
if (!tz) {
tz = (new Intl.DateTimeFormat()).resolvedOptions().timeZone
@@ -140,17 +145,26 @@ const mergedContext = computed(() => {
refreshInterval = DEFAULT_TILE_REFRESH_INTERVAL_MS
}
+ if (editable === undefined) {
+ editable = false
+ }
+
return {
...props.context,
tz,
timeSpec: timeSpec.value,
refreshInterval,
+ editable,
}
})
// Right now, tiles don't have unique keys. Perhaps in the future they will,
// and we can use that instead of `index` as the fragment key.
+const onEditTile = (tile: GridTile) => {
+ emit('edit-tile', tile)
+}
+
diff --git a/packages/analytics/dashboard-renderer/src/locales/en.json b/packages/analytics/dashboard-renderer/src/locales/en.json
index b823239c6d..b41b0e493d 100644
--- a/packages/analytics/dashboard-renderer/src/locales/en.json
+++ b/packages/analytics/dashboard-renderer/src/locales/en.json
@@ -5,7 +5,8 @@
"24h": "Last 24-Hour Summary",
"7d": "Last 7-Day Summary",
"30d": "Last 30-Day Summary"
- }
+ },
+ "edit": "Edit"
},
"queryDataProvider": {
"timeRangeExceeded": "The time range for this report is outside of your organization's data retention period"
diff --git a/packages/analytics/dashboard-renderer/src/types/dashboard-renderer-types.ts b/packages/analytics/dashboard-renderer/src/types/dashboard-renderer-types.ts
index a1fac860ce..974298e930 100644
--- a/packages/analytics/dashboard-renderer/src/types/dashboard-renderer-types.ts
+++ b/packages/analytics/dashboard-renderer/src/types/dashboard-renderer-types.ts
@@ -22,6 +22,7 @@ export interface DashboardRendererContext {
timeSpec?: TimeRangeV4
tz?: string
refreshInterval?: number
+ editable?: boolean
}
type FromSchemaWithOptions = FromSchema