From 575c3482d3696ba881bb2d753652e02ff712d540 Mon Sep 17 00:00:00 2001 From: Stephan Heunis Date: Fri, 21 Feb 2025 13:36:25 +0100 Subject: [PATCH] Refactor configuration handling The goal here was to allow configuration to be used more seamlessly in the app header component and main shaclvue component in order to drive text values such as app name and urls and color themes and more. Before, the appheader and appfooter were children of the main App.vue component, along with the ShaclVue component. In order to prevent the convoluted provide/inject setup that was necessary before, the header and footer were moved into ShaclVue, becoming its children, and the main App.vue component is now a single simple entrypoint for the ShaclVue component, without any configuration or logic attached to it. New configuration options were introduced: - app name - docs url - source code url - app theme: link color - app theme: hover color - app theme: active color - app theme: left hand side panel color - app theme: logo name This also makes future additions to the theme easier and compartmenalized. --- public/config.json | 10 ++ public/shacl_vue_logo.svg | 84 +++++++++ src/App.vue | 100 +---------- src/components/AppFooter.vue | 78 ++------ src/components/AppHeader.vue | 66 ++++--- src/components/ShaclVue.vue | 293 ++++++++++++++++--------------- src/composables/configuration.js | 42 ++++- src/modules/utils.js | 23 +++ 8 files changed, 358 insertions(+), 338 deletions(-) create mode 100644 public/shacl_vue_logo.svg diff --git a/public/config.json b/public/config.json index 8a5b509..a2fc048 100644 --- a/public/config.json +++ b/public/config.json @@ -1,4 +1,14 @@ { + "app_name": "shacl-vue", + "documentation_url": "", + "source_code_url": "", + "app_theme": { + "link_color": "#41b883", + "hover_color": "#1565C0", + "active_color": "#D32F2F", + "panel_color": "#41b883", + "logo": "shacl_vue_logo.svg" + }, "shapes_url": "dlschemas_shacl.ttl", "use_default_shapes": false, "data_url": "dlschemas_data.ttl", diff --git a/public/shacl_vue_logo.svg b/public/shacl_vue_logo.svg new file mode 100644 index 0000000..ce1a35c --- /dev/null +++ b/public/shacl_vue_logo.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/App.vue b/src/App.vue index 115b32d..535b3f7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,106 +1,10 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/AppFooter.vue b/src/components/AppFooter.vue index 1b10151..5bbbf70 100644 --- a/src/components/AppFooter.vue +++ b/src/components/AppFooter.vue @@ -1,79 +1,23 @@ - - diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 5c9b4f8..5a36ae0 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -5,13 +5,13 @@ - shacl-vue + {{ appName }} - - - - - - + + + + + + + + + + @@ -98,11 +102,18 @@