From c28861184b6dfa1143ed8096fd6ec98f903056f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Fri, 8 Nov 2024 12:35:37 +0100 Subject: [PATCH] Fix RTE labels not provided in worfklow content configurator --- .../components/ModuleFields/Editor/String.vue | 1 - .../PageBlocks/ContentConfigurator.vue | 1 - .../DisplayElements/Configurators/Text.vue | 1 - .../src/components/Configurator/Content.vue | 5 +- .../CRichTextInput/RToolbar/TMark/Link.vue | 35 +++++-------- .../CRichTextInput/RToolbar/TMark/base.vue | 2 +- .../src/components/navigation/CSidebar.vue | 52 +++++++++++-------- lib/vue/src/components/navigation/CTopbar.vue | 40 +++++++------- locale/en/corteza-webapp-compose/block.yaml | 1 - .../en/corteza-webapp-workflow/general.yaml | 1 - locale/en/corteza-webapp-workflow/steps.yaml | 9 +++- .../src/scss/main/18201141_custom_webapp.scss | 8 --- 12 files changed, 75 insertions(+), 81 deletions(-) diff --git a/client/web/compose/src/components/ModuleFields/Editor/String.vue b/client/web/compose/src/components/ModuleFields/Editor/String.vue index 51c0e345c..cb736c2cb 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/String.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/String.vue @@ -71,7 +71,6 @@ :labels="{ urlPlaceholder: $t('content.urlPlaceholder'), ok: $t('content.ok'), - openLinkInNewTab: $t('content.openLinkInNewTab'), }" /> diff --git a/client/web/compose/src/components/PageBlocks/ContentConfigurator.vue b/client/web/compose/src/components/PageBlocks/ContentConfigurator.vue index a70617d39..d1732cff1 100644 --- a/client/web/compose/src/components/PageBlocks/ContentConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/ContentConfigurator.vue @@ -6,7 +6,6 @@ :labels="{ urlPlaceholder: $t('content.urlPlaceholder'), ok: $t('content.ok'), - openLinkInNewTab: $t('content.openLinkInNewTab'), }" /> diff --git a/client/web/reporter/src/components/Report/Blocks/DisplayElements/Configurators/Text.vue b/client/web/reporter/src/components/Report/Blocks/DisplayElements/Configurators/Text.vue index 7ccf46c49..2d83f9a15 100644 --- a/client/web/reporter/src/components/Report/Blocks/DisplayElements/Configurators/Text.vue +++ b/client/web/reporter/src/components/Report/Blocks/DisplayElements/Configurators/Text.vue @@ -6,7 +6,6 @@ :labels="{ urlPlaceholder: $t('label.urlPlaceholder'), ok: $t('label.ok'), - openLinkInNewTab: $t('label.openLinkInNewTab'), }" /> diff --git a/client/web/workflow/src/components/Configurator/Content.vue b/client/web/workflow/src/components/Configurator/Content.vue index 28f471d2f..70fb0c8f8 100644 --- a/client/web/workflow/src/components/Configurator/Content.vue +++ b/client/web/workflow/src/components/Configurator/Content.vue @@ -2,9 +2,8 @@ @@ -59,14 +50,14 @@ import base from './base.vue' * input the URL that should be applied. */ export default { - name: 't-mark-link', + name: 'TMarkLink', extends: base, props: { labels: { type: Object, - default: () => ({}) - } + default: () => ({}), + }, }, data () { diff --git a/lib/vue/src/components/input/CRichTextInput/RToolbar/TMark/base.vue b/lib/vue/src/components/input/CRichTextInput/RToolbar/TMark/base.vue index 76ed9aade..647d2460e 100644 --- a/lib/vue/src/components/input/CRichTextInput/RToolbar/TMark/base.vue +++ b/lib/vue/src/components/input/CRichTextInput/RToolbar/TMark/base.vue @@ -21,7 +21,7 @@ export default { }, currentValue: { type: String, - required: false, + default: '', }, }, methods: { diff --git a/lib/vue/src/components/navigation/CSidebar.vue b/lib/vue/src/components/navigation/CSidebar.vue index 18f9b4ab9..1d1f4da0f 100644 --- a/lib/vue/src/components/navigation/CSidebar.vue +++ b/lib/vue/src/components/navigation/CSidebar.vue @@ -81,7 +81,6 @@ /> -
'' + default: () => '', }, logo: { type: String, - default: () => '' + default: () => '', }, right: { @@ -189,7 +188,7 @@ export default { data () { return { - sidebarSettings : {}, + sidebarSettings: {}, isMobile: false, } }, @@ -202,6 +201,10 @@ export default { set (expanded) { this.$emit('update:expanded', expanded) + + if (!expanded) { + this.isPinned = false + } }, }, @@ -216,18 +219,6 @@ export default { }, }, - created () { - this.checkIfMobile() - - this.$root.$on('close-sidebar', this.closeSidebar) - window.addEventListener('resize', this.checkIfMobile) - }, - - beforeDestroy () { - this.$root.$off('close-sidebar', this.closeSidebar) - window.removeEventListener('resize', this.checkIfMobile) - }, - watch: { '$route.name': { immediate: true, @@ -243,6 +234,18 @@ export default { }, }, + created () { + this.checkIfMobile() + + this.$root.$on('close-sidebar', this.closeSidebar) + window.addEventListener('resize', this.checkIfMobile) + }, + + beforeDestroy () { + this.$root.$off('close-sidebar', this.closeSidebar) + window.removeEventListener('resize', this.checkIfMobile) + }, + methods: { checkIfMobile: throttle(function () { this.isMobile = window.innerWidth < 1024 || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) @@ -272,15 +275,18 @@ export default { }, defaultSidebarAppearance () { - const localstorage_settings = JSON.parse(window.localStorage.getItem('sidebarSettings')) - if (localstorage_settings) { - this.sidebarSettings = localstorage_settings + const localStorageSettings = JSON.parse(window.localStorage.getItem('sidebarSettings')) + + if (localStorageSettings) { + this.sidebarSettings = localStorageSettings } - const app_sidebar = (localstorage_settings || {})[this.$root.$options.name] + + const appSidebar = (localStorageSettings || {})[this.$root.$options.name] + if (!this.isMobile) { - if (app_sidebar) { - this.isExpanded = app_sidebar.pinned - this.isPinned = app_sidebar.pinned + if (appSidebar) { + this.isExpanded = appSidebar.pinned + this.isPinned = appSidebar.pinned } else { this.openSidebar() } diff --git a/lib/vue/src/components/navigation/CTopbar.vue b/lib/vue/src/components/navigation/CTopbar.vue index 704369a36..fab6d6866 100644 --- a/lib/vue/src/components/navigation/CTopbar.vue +++ b/lib/vue/src/components/navigation/CTopbar.vue @@ -2,9 +2,7 @@