From 71933352b62e36134543ef8e442f2765ba6d6f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Paunovi=C4=87?= Date: Wed, 5 Feb 2025 12:18:29 +0100 Subject: [PATCH 1/9] chore(ui): remove the option to change editor theme separately (#7192) * chore(ui): remove obsolete log statements from console * chore(ui): remove the option to change editor theme separately --- ui/src/App.vue | 3 -- .../components/charts/executions/BarChart.vue | 2 - ui/src/components/inputs/Editor.vue | 11 ++--- ui/src/components/settings/BasicSettings.vue | 46 +++++-------------- ui/src/translations/en.json | 1 - ui/src/utils/utils.js | 4 +- 6 files changed, 16 insertions(+), 51 deletions(-) diff --git a/ui/src/App.vue b/ui/src/App.vue index ec26f0f4e58..c3560b6996d 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -105,11 +105,8 @@ }, methods: { displayApp() { - console.log("App is loaded"); Utils.switchTheme(this.$store); - console.log(this.$store.getters["misc/theme"]); - document.getElementById("loader-wrapper").style.display = "none"; document.getElementById("app-container").style.display = "block"; this.loaded = true; diff --git a/ui/src/components/dashboard/components/charts/executions/BarChart.vue b/ui/src/components/dashboard/components/charts/executions/BarChart.vue index b0aca1dffca..72957367f80 100644 --- a/ui/src/components/dashboard/components/charts/executions/BarChart.vue +++ b/ui/src/components/dashboard/components/charts/executions/BarChart.vue @@ -74,10 +74,8 @@ const tooltipContent = ref("") const parsedData = computed(() => { - console.log("theme", theme.value) let datasets = props.data.reduce(function (accumulator, value) { Object.keys(value.executionCounts).forEach(function (state) { - console.log("theme", theme.value) if (accumulator[state] === undefined) { accumulator[state] = { label: state, diff --git a/ui/src/components/inputs/Editor.vue b/ui/src/components/inputs/Editor.vue index 0729c5749f8..ebbe9496ea6 100644 --- a/ui/src/components/inputs/Editor.vue +++ b/ui/src/components/inputs/Editor.vue @@ -83,6 +83,8 @@ const MonacoEditor = defineAsyncComponent(() => import("./MonacoEditor.vue")); + import Utils from "../../utils/utils"; + export default { props: { modelValue: {type: String, default: ""}, @@ -139,14 +141,7 @@ ...mapGetters("core", ["guidedProperties"]), ...mapGetters("flow", ["flowValidation"]), themeComputed() { - const savedEditorTheme = localStorage.getItem("editorTheme"); - return savedEditorTheme === "syncWithSystem" - ? window.matchMedia("(prefers-color-scheme: dark)").matches - ? "dark" - : "light" - : savedEditorTheme === "light" - ? "light" - : "dark"; + return Utils.getTheme(); }, containerClass() { return [ diff --git a/ui/src/components/settings/BasicSettings.vue b/ui/src/components/settings/BasicSettings.vue index f4969778e96..caf9316d1a1 100644 --- a/ui/src/components/settings/BasicSettings.vue +++ b/ui/src/components/settings/BasicSettings.vue @@ -102,6 +102,17 @@ /> + + + + + - - - - - - - - - - - - @@ -283,7 +271,6 @@ editorType: undefined, lang: undefined, theme: undefined, - editorTheme: undefined, chartColor: undefined, dateFormat: undefined, timezone: undefined, @@ -325,7 +312,6 @@ this.pendingSettings.lang = Utils.getLang(); this.pendingSettings.theme = Utils.getTheme(); - this.pendingSettings.editorTheme = Utils.getTheme("editorTheme") let scheme = localStorage.getItem("scheme") || "classic"; if(scheme === "default") scheme = "classic"; @@ -372,9 +358,6 @@ onTimezone(value) { this.pendingSettings.timezone = value; }, - onEditorTheme(value) { - this.pendingSettings.editorTheme = value; - }, onChartColor(value) { this.pendingSettings.chartColor = value; }, @@ -513,13 +496,6 @@ {value: "syncWithSystem", text: "Sync With System"} ] }, - editorThemesOptions() { - return [ - {value: "light", text: "Light"}, - {value: "dark", text: "Dark"}, - {value: "syncWithSystem", text: "Sync With System"} - ] - }, dateFormats() { return [ {value: "YYYY-MM-DDTHH:mm:ssZ"}, diff --git a/ui/src/translations/en.json b/ui/src/translations/en.json index 8fdd8ccef9c..d6b67fd07c6 100644 --- a/ui/src/translations/en.json +++ b/ui/src/translations/en.json @@ -752,7 +752,6 @@ "label": "Theme Preferences", "fields": { "mode": "Theme Mode", - "editor_theme": "Editor Theme", "editor_font_size": "Editor Font Size", "logs_font_size": "Logs Font Size", "editor_font_family": "Editor Font Family", diff --git a/ui/src/utils/utils.js b/ui/src/utils/utils.js index 5344b36a2ad..99cdc9023c6 100644 --- a/ui/src/utils/utils.js +++ b/ui/src/utils/utils.js @@ -235,8 +235,8 @@ export default class Utils { localStorage.setItem("theme", theme); } - static getTheme(which = "theme") { - let theme = localStorage.getItem(which) || "light"; + static getTheme() { + let theme = localStorage.getItem("theme") || "light"; if(theme === "syncWithSystem") { theme = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; From 1ee6402fa22a3fc1cc39fdb09ffa1bc9c0a2b720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Paunovi=C4=87?= Date: Wed, 5 Feb 2025 12:23:34 +0100 Subject: [PATCH 2/9] chore(translations): remove extra keys from translation files (#7193) --- ui/src/translations/de.json | 3 --- ui/src/translations/es.json | 3 --- ui/src/translations/fr.json | 3 --- ui/src/translations/hi.json | 3 --- ui/src/translations/it.json | 3 --- ui/src/translations/ja.json | 3 --- ui/src/translations/ko.json | 3 --- ui/src/translations/pl.json | 3 --- ui/src/translations/pt.json | 3 --- ui/src/translations/ru.json | 3 --- ui/src/translations/zh_CN.json | 3 --- 11 files changed, 33 deletions(-) diff --git a/ui/src/translations/de.json b/ui/src/translations/de.json index fac8c376ee0..ddf633784ad 100644 --- a/ui/src/translations/de.json +++ b/ui/src/translations/de.json @@ -682,7 +682,6 @@ "label": "Modus-Einstellungen", "fields": { "mode": "Modus", - "editor_theme": "Editor-Thema", "editor_font_size": "Editor-Schriftgröße", "editor_font_family": "Editor-Schriftfamilie", "editor_folding_stratgy": "Automatisch Code im Editor zusammenklappen", @@ -1068,9 +1067,7 @@ "main": "Haupteigenschaften", "error_handlers": "Fehlerbehandler", "tasks": "Aufgaben", - "advanced": "Erweiterte Konfiguration", "finally": "Schließlich", - "other": "Andere Eigenschaften", "optional": "Optionale Eigenschaften" }, "creation": { diff --git a/ui/src/translations/es.json b/ui/src/translations/es.json index acf768af0a7..d77dff261d3 100644 --- a/ui/src/translations/es.json +++ b/ui/src/translations/es.json @@ -682,7 +682,6 @@ "label": "Preferencias de Tema", "fields": { "mode": "Modo de Tema", - "editor_theme": "Tema del Editor", "editor_font_size": "Tamaño de Fuente del Editor", "editor_font_family": "Familia de Fuente del Editor", "editor_folding_stratgy": "Plegado Automático de Código en el Editor", @@ -1068,9 +1067,7 @@ "main": "Propiedades principales", "error_handlers": "Manejadores de Errores", "tasks": "Tareas", - "advanced": "Configuración avanzada", "finally": "Finalmente", - "other": "Otras propiedades", "optional": "Propiedades opcionales" }, "creation": { diff --git a/ui/src/translations/fr.json b/ui/src/translations/fr.json index b7e4c03754a..f578ca42d99 100644 --- a/ui/src/translations/fr.json +++ b/ui/src/translations/fr.json @@ -682,7 +682,6 @@ "label": "Préférences de thème", "fields": { "mode": "Mode thème", - "editor_theme": "Thème de l'éditeur", "editor_font_size": "Taille de Police de l'éditeur", "editor_font_family": "Police de caractères de l'éditeur", "editor_folding_stratgy": "Stratégie de Pliage Automatique ou Multi-Lignes de l'Éditeur", @@ -1068,9 +1067,7 @@ "main": "Principales propriétés", "error_handlers": "Gestionnaires d'erreurs", "tasks": "Tâches", - "advanced": "Configuration avancée", "finally": "Enfin", - "other": "Autres propriétés", "optional": "Propriétés optionnelles" }, "creation": { diff --git a/ui/src/translations/hi.json b/ui/src/translations/hi.json index 29e6291229c..bcb5b389db4 100644 --- a/ui/src/translations/hi.json +++ b/ui/src/translations/hi.json @@ -682,7 +682,6 @@ "label": "थीम प्राथमिकताएँ", "fields": { "mode": "थीम मोड", - "editor_theme": "संपादक थीम", "editor_font_size": "संपादक फ़ॉन्ट आकार", "editor_font_family": "संपादक फ़ॉन्ट परिवार", "editor_folding_stratgy": "संपादक में स्वचालित कोड फोल्डिंग", @@ -1068,9 +1067,7 @@ "main": "मुख्य गुणधर्म", "error_handlers": "त्रुटि हैंडलर", "tasks": "कार्य", - "advanced": "उन्नत कॉन्फ़िगरेशन", "finally": "अंत में", - "other": "अन्य गुण", "optional": "वैकल्पिक गुण" }, "creation": { diff --git a/ui/src/translations/it.json b/ui/src/translations/it.json index 245d3d47693..3b58cb5bdc6 100644 --- a/ui/src/translations/it.json +++ b/ui/src/translations/it.json @@ -682,7 +682,6 @@ "label": "Preferenze del Tema", "fields": { "mode": "Modalità Tema", - "editor_theme": "Tema dell'Editor", "editor_font_size": "Dimensione del Font dell'Editor", "editor_font_family": "Famiglia del Font dell'Editor", "editor_folding_stratgy": "Piegatura automatica del codice nell'Editor", @@ -1068,9 +1067,7 @@ "main": "Proprietà principali", "error_handlers": "Gestori degli Errori", "tasks": "Attività", - "advanced": "Configurazione avanzata", "finally": "Infine", - "other": "Altre proprietà", "optional": "Proprietà opzionali" }, "creation": { diff --git a/ui/src/translations/ja.json b/ui/src/translations/ja.json index eefafdea6a0..a052ba66adf 100644 --- a/ui/src/translations/ja.json +++ b/ui/src/translations/ja.json @@ -682,7 +682,6 @@ "label": "テーマ設定", "fields": { "mode": "テーマモード", - "editor_theme": "エディタテーマ", "editor_font_size": "エディタフォントサイズ", "editor_font_family": "エディタフォントファミリー", "editor_folding_stratgy": "エディタでの自動コード折りたたみ", @@ -1068,9 +1067,7 @@ "main": "メインプロパティ", "error_handlers": "エラーハンドラー", "tasks": "タスク", - "advanced": "高度な設定", "finally": "最後に", - "other": "その他のプロパティ", "optional": "オプションのプロパティ" }, "creation": { diff --git a/ui/src/translations/ko.json b/ui/src/translations/ko.json index 73c380ff91e..1869643b8b1 100644 --- a/ui/src/translations/ko.json +++ b/ui/src/translations/ko.json @@ -682,7 +682,6 @@ "label": "테마 설정", "fields": { "mode": "테마 모드", - "editor_theme": "편집기 테마", "editor_font_size": "편집기 글꼴 크기", "editor_font_family": "편집기 글꼴 패밀리", "editor_folding_stratgy": "편집기에서 자동 코드 접기", @@ -1068,9 +1067,7 @@ "main": "주요 속성", "error_handlers": "오류 처리기", "tasks": "작업", - "advanced": "고급 구성", "finally": "마지막으로", - "other": "기타 속성", "optional": "선택적 속성" }, "creation": { diff --git a/ui/src/translations/pl.json b/ui/src/translations/pl.json index b5ca9546979..ec1e3de4a75 100644 --- a/ui/src/translations/pl.json +++ b/ui/src/translations/pl.json @@ -682,7 +682,6 @@ "label": "Preferencje Motywu", "fields": { "mode": "Tryb Motywu", - "editor_theme": "Motyw Edytora", "editor_font_size": "Rozmiar Czcionki Edytora", "editor_font_family": "Rodzina Czcionki Edytora", "editor_folding_stratgy": "Automatyczne Zwijanie Kodu w Edytorze", @@ -1068,9 +1067,7 @@ "main": "Główne właściwości", "error_handlers": "Obsługa błędów", "tasks": "Zadania", - "advanced": "Zaawansowana konfiguracja", "finally": "Na koniec", - "other": "Inne właściwości", "optional": "Właściwości opcjonalne" }, "creation": { diff --git a/ui/src/translations/pt.json b/ui/src/translations/pt.json index d9b72c256ae..7eafa2d7b5d 100644 --- a/ui/src/translations/pt.json +++ b/ui/src/translations/pt.json @@ -682,7 +682,6 @@ "label": "Preferências de Tema", "fields": { "mode": "Modo de Tema", - "editor_theme": "Tema do Editor", "editor_font_size": "Tamanho da Fonte do Editor", "editor_font_family": "Família de Fonte do Editor", "editor_folding_stratgy": "Dobramento Automático de Código no Editor", @@ -1068,9 +1067,7 @@ "main": "Propriedades principais", "error_handlers": "Manipuladores de Erros", "tasks": "Tarefas", - "advanced": "Configuração avançada", "finally": "Finalmente", - "other": "Outras propriedades", "optional": "Propriedades opcionais" }, "creation": { diff --git a/ui/src/translations/ru.json b/ui/src/translations/ru.json index 1c87261c1e5..d10be4e7883 100644 --- a/ui/src/translations/ru.json +++ b/ui/src/translations/ru.json @@ -682,7 +682,6 @@ "label": "Настройки темы", "fields": { "mode": "Режим темы", - "editor_theme": "Тема редактора", "editor_font_size": "Размер шрифта редактора", "editor_font_family": "Шрифт редактора", "editor_folding_stratgy": "Автоматическое сворачивание кода в редакторе", @@ -1068,9 +1067,7 @@ "main": "Основные свойства", "error_handlers": "Обработчики ошибок", "tasks": "Задачи", - "advanced": "Расширенная конфигурация", "finally": "Наконец", - "other": "Другие свойства", "optional": "Необязательные свойства" }, "creation": { diff --git a/ui/src/translations/zh_CN.json b/ui/src/translations/zh_CN.json index e7e048f1b50..90f9e48e726 100644 --- a/ui/src/translations/zh_CN.json +++ b/ui/src/translations/zh_CN.json @@ -682,7 +682,6 @@ "label": "主题偏好", "fields": { "mode": "主题模式", - "editor_theme": "编辑器主题", "editor_font_size": "编辑器字体大小", "editor_font_family": "编辑器字体家族", "editor_folding_stratgy": "编辑器中的自动代码折叠", @@ -1068,9 +1067,7 @@ "main": "主要属性", "error_handlers": "错误处理程序", "tasks": "任务", - "advanced": "高级配置", "finally": "最后", - "other": "其他属性", "optional": "可选属性" }, "creation": { From 0b1eda0f037490f6ffff92658573c005d89a5057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Paunovi=C4=87?= Date: Wed, 5 Feb 2025 12:51:31 +0100 Subject: [PATCH 3/9] chore(ui): consolidate markdown files (#7197) --- ui/src/assets/{documentations => docs}/basic.md | 0 ui/src/assets/{markdown => docs}/dashboard_home.md | 0 ui/src/components/dashboard/components/DashboardEditor.vue | 2 +- ui/src/components/plugins/PluginDocumentation.vue | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename ui/src/assets/{documentations => docs}/basic.md (100%) rename ui/src/assets/{markdown => docs}/dashboard_home.md (100%) diff --git a/ui/src/assets/documentations/basic.md b/ui/src/assets/docs/basic.md similarity index 100% rename from ui/src/assets/documentations/basic.md rename to ui/src/assets/docs/basic.md diff --git a/ui/src/assets/markdown/dashboard_home.md b/ui/src/assets/docs/dashboard_home.md similarity index 100% rename from ui/src/assets/markdown/dashboard_home.md rename to ui/src/assets/docs/dashboard_home.md diff --git a/ui/src/components/dashboard/components/DashboardEditor.vue b/ui/src/components/dashboard/components/DashboardEditor.vue index 0ea000a9c82..fab14db7d18 100644 --- a/ui/src/components/dashboard/components/DashboardEditor.vue +++ b/ui/src/components/dashboard/components/DashboardEditor.vue @@ -169,7 +169,7 @@ import YamlUtils from "../../../utils/yamlUtils.js"; import yaml from "yaml"; import ContentSave from "vue-material-design-icons/ContentSave.vue"; - import intro from "../../../assets/markdown/dashboard_home.md?raw"; + import intro from "../../../assets/docs/dashboard_home.md?raw"; import Markdown from "../../layout/Markdown.vue"; import TimeSeries from "./charts/custom/TimeSeries.vue"; import Bar from "./charts/custom/Bar.vue"; diff --git a/ui/src/components/plugins/PluginDocumentation.vue b/ui/src/components/plugins/PluginDocumentation.vue index cb231fe25f0..3b63a264d1c 100644 --- a/ui/src/components/plugins/PluginDocumentation.vue +++ b/ui/src/components/plugins/PluginDocumentation.vue @@ -31,7 +31,7 @@