From 37cde0d982cc5a22ecce90fba5a8cb5e9fdff581 Mon Sep 17 00:00:00 2001 From: jamesread Date: Tue, 16 Jun 2026 11:56:14 +0100 Subject: [PATCH] fix: custom CSS and custom JS (#804 and #803) hopefully --- .../DashboardComponentDirectory.vue | 11 +- .../components/DashboardComponentDisplay.vue | 7 +- .../DashboardComponentMostRecentExecution.vue | 25 ++-- .../resources/vue/views/EntityDetailsView.vue | 12 +- integration-tests/.mocharc.yml | 2 + integration-tests/tests/cssClass/cssClass.mjs | 11 ++ .../themes/cssclass-theme/theme.css | 5 + integration-tests/tests/customJs/config.yaml | 16 +++ .../tests/customJs/custom-webui/custom.js | 1 + integration-tests/tests/customJs/customJs.mjs | 35 +++++ .../tests/entityHtmlDisplay/config.yaml | 25 ++++ .../entities/html_display.yaml | 2 + .../entityHtmlDisplay/entityHtmlDisplay.mjs | 34 +++++ .../internal/api/dashboard_entities_test.go | 126 ++++++++++++++++++ 14 files changed, 289 insertions(+), 23 deletions(-) create mode 100644 integration-tests/tests/customJs/config.yaml create mode 100644 integration-tests/tests/customJs/custom-webui/custom.js create mode 100644 integration-tests/tests/customJs/customJs.mjs create mode 100644 integration-tests/tests/entityHtmlDisplay/config.yaml create mode 100644 integration-tests/tests/entityHtmlDisplay/entities/html_display.yaml create mode 100644 integration-tests/tests/entityHtmlDisplay/entityHtmlDisplay.mjs create mode 100644 service/internal/api/dashboard_entities_test.go diff --git a/frontend/resources/vue/components/DashboardComponentDirectory.vue b/frontend/resources/vue/components/DashboardComponentDirectory.vue index 9a2afae7..42c034ac 100644 --- a/frontend/resources/vue/components/DashboardComponentDirectory.vue +++ b/frontend/resources/vue/components/DashboardComponentDirectory.vue @@ -32,17 +32,19 @@ const unicodeIcon = computed(() => { function navigateToDirectory() { const params = { title: props.component.title } - + if (props.component.entityType && props.component.entityKey) { params.entityType = props.component.entityType params.entityKey = props.component.entityKey } - + router.push({ name: 'Dashboard', params }) } - \ No newline at end of file + diff --git a/frontend/resources/vue/components/DashboardComponentDisplay.vue b/frontend/resources/vue/components/DashboardComponentDisplay.vue index 95c3b5dc..16cf3ea6 100644 --- a/frontend/resources/vue/components/DashboardComponentDisplay.vue +++ b/frontend/resources/vue/components/DashboardComponentDisplay.vue @@ -13,7 +13,9 @@ const props = defineProps({ }) - \ No newline at end of file + diff --git a/frontend/resources/vue/components/DashboardComponentMostRecentExecution.vue b/frontend/resources/vue/components/DashboardComponentMostRecentExecution.vue index bcf03d76..53c6fb84 100644 --- a/frontend/resources/vue/components/DashboardComponentMostRecentExecution.vue +++ b/frontend/resources/vue/components/DashboardComponentMostRecentExecution.vue @@ -1,8 +1,8 @@