From b79732761ca669c2d645078f191d8c7536b40474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 21 Nov 2022 15:41:17 +0100 Subject: [PATCH 1/2] Display media trashed state on custom view for image demo block --- .../umbBlockGridDemoImageBlock.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoImageBlock.html b/src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoImageBlock.html index cd3379994a7b..e5c6a4d04d7c 100644 --- a/src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoImageBlock.html +++ b/src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoImageBlock.html @@ -66,11 +66,22 @@ transition: opacity 120ms; } + .is-trashed { + background-color: #d42054 !important; + color:white !important; + } + .is-trashed .file-name { + opacity: 1; + } + - \ No newline at end of file From 11e3e2e18eb7d93adb55837258edc7d18214ea55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 21 Nov 2022 16:34:38 +0100 Subject: [PATCH 2/2] correct missing translations --- .../EmbeddedResources/Lang/da.xml | 3 +++ .../EmbeddedResources/Lang/en.xml | 3 +++ .../EmbeddedResources/Lang/en_us.xml | 3 +++ .../umb-block-grid-column-editor-option.html | 2 +- ...b-block-grid-configuration-area-entry.html | 8 ++++---- .../umbBlockGridAreaEditor.component.js | 3 --- ...ockGridConfigurationAreaEntry.component.js | 19 ++++++++++--------- 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml index 1c23c53e3858..dc2fa4047844 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml @@ -2267,6 +2267,9 @@ Mange hilsner fra Umbraco robotten Sortings tilstand Afslut sortings tilstand Dette område alias skal være unikt sammenlignet med andre områder af denne Blok. + Konfigurer område + Slet område + Tilføj mulighed for %0% koloner Hvad er Indholdsskabeloner? diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 7bb861fb3d66..d393489bd432 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -2818,6 +2818,9 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Sort mode End sort mode This Areas Alias must be unique compared to the other Areas of this Block. + Configure area + Delete area + Add spanning %0% columns option What are Content Templates? diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 7e1aa9525ace..6dbed10067c3 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -2921,6 +2921,9 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Sort mode End sort mode This Areas Alias must be unique compared to the other Areas of this Block. + Configure area + Delete area + Add spanning %0% columns option What are Content Templates? diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-column-editor-option.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-column-editor-option.html index ab63757bb510..05f55d3a0761 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-column-editor-option.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-column-editor-option.html @@ -18,7 +18,7 @@
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-configuration-area-entry.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-configuration-area-entry.html index 524be4f4cd96..9909b640a199 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-configuration-area-entry.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-configuration-area-entry.html @@ -4,18 +4,18 @@
- -
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridAreaEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridAreaEditor.component.js index 3b9b6b4bea1a..914e701fa67c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridAreaEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridAreaEditor.component.js @@ -164,7 +164,6 @@ } vm.requestDeleteArea = function (area) { - // TODO: Translations localizationService.localizeMany(["general_delete", "blockEditor_confirmDeleteBlockAreaMessage", "blockEditor_confirmDeleteBlockAreaNotice"]).then(function (data) { overlayService.confirmDelete({ title: data[0], @@ -216,8 +215,6 @@ vm.openArea = null; vm.openAreaOverlay = function (area) { - - // TODO: use the right localization key: localizationService.localize("blockEditor_blockConfigurationOverlayTitle").then(function (localized) { var clonedAreaData = Utilities.copy(area); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridConfigurationAreaEntry.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridConfigurationAreaEntry.component.js index f7c1351c4771..64d5e421e2cc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridConfigurationAreaEntry.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umbBlockGridConfigurationAreaEntry.component.js @@ -2,9 +2,7 @@ "use strict"; /** - * * Note for new backoffice: there is a lot of similarities between the Area configuration and the Block entry, as they both share Grid scaling features. - * TODO: Can we already as part of this PR make it shared as a dictionary or something? */ @@ -100,6 +98,13 @@ function updateGridLayoutData() { + if(!layoutContainer) { + layoutContainer = $element[0].closest('.umb-block-grid-area-editor__grid-wrapper'); + if(!layoutContainer) { + console.error($element[0], 'could not find area-container'); + } + } + const computedStyles = window.getComputedStyle(layoutContainer); gridColumns = computedStyles.gridTemplateColumns.trim().split("px").map(x => Number(x)); @@ -126,12 +131,6 @@ window.addEventListener('mouseup', vm.onMouseUp); window.addEventListener('mouseleave', vm.onMouseUp); - - layoutContainer = $element[0].closest('.umb-block-grid-area-editor__grid-wrapper'); - if(!layoutContainer) { - console.error($element[0], 'could not find area-container'); - } - updateGridLayoutData(); scaleBoxBackdropEl = document.createElement('div'); @@ -217,6 +216,8 @@ vm.scaleHandlerKeyUp = function($event) { + updateGridLayoutData(); + let addCol = 0; let addRow = 0; @@ -236,7 +237,7 @@ } // Todo: Ensure value fit with configuration. - vm.area.columnSpan = Math.max(vm.area.columnSpan + addCol, 1); + vm.area.columnSpan = Math.min(Math.max(vm.area.columnSpan + addCol, 1), gridColumns.length); vm.area.rowSpan = Math.max(vm.area.rowSpan + addRow, 1); $event.originalEvent.stopPropagation();