From 3158b8b6448a40438334a77fe363481f2b2534c3 Mon Sep 17 00:00:00 2001 From: Poornima Nayar Date: Thu, 10 Oct 2019 12:26:09 +0100 Subject: [PATCH 01/85] Clean up of change password section in member details --- .../src/views/components/users/change-password.html | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html index ef364264ab..2a33c945bd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html @@ -6,7 +6,7 @@
- + Change password
@@ -14,11 +14,7 @@ - + {{changePasswordForm.resetPassword.errorMsg}} @@ -62,7 +58,7 @@ - + Cancel From 6cf697acb2ac38de4de78de15eef342b44455b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Oct 2019 11:48:13 +0200 Subject: [PATCH 02/85] Added property actions button --- src/Umbraco.Web.UI.Client/src/less/belle.less | 1 + .../less/components/umb-property-actions.less | 45 ++++++++++++++ .../umb-property-actions.html | 12 ++++ .../umbpropertyactions.component.js | 62 +++++++++++++++++++ .../components/property/umb-property.html | 3 + 5 files changed, 123 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less create mode 100644 src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html create mode 100644 src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js diff --git a/src/Umbraco.Web.UI.Client/src/less/belle.less b/src/Umbraco.Web.UI.Client/src/less/belle.less index 83d254c73c..e36a55bca0 100644 --- a/src/Umbraco.Web.UI.Client/src/less/belle.less +++ b/src/Umbraco.Web.UI.Client/src/less/belle.less @@ -137,6 +137,7 @@ @import "components/umb-grid.less"; @import "components/umb-empty-state.less"; @import "components/umb-property-editor.less"; +@import "components/umb-property-actions.less"; @import "components/umb-color-swatches.less"; @import "components/check-circle.less"; @import "components/umb-file-icon.less"; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less new file mode 100644 index 0000000000..940daccbb6 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less @@ -0,0 +1,45 @@ +.umb-property-actions__toggle { + position: relative; + display: flex; + flex: 0 0 auto; + padding: 6px 6px; + text-align: center; + cursor: pointer; + border-radius: 3px; + + background-color: @ui-action-hover; + + i { + height: 3px !important; + width: 3px !important; + border-radius: 3px; + background: @ui-action-type; + display: inline-block; + margin: 0 2px 0 0; + + &:last-child { + margin: 0; + } + } + + &:hover { + i { + background: @ui-action-type-hover; + } + } +} + +.umb-property .umb-property-actions__toggle { + margin-top: 2px; + opacity: 0; + transition: opacity 120ms; +} +.umb-property:hover .umb-property-actions__toggle, +.umb-property .umb-property-actions__toggle:focus { + opacity: 1; +} + +.umb-property-actions .dropdown-menu { + left: auto; + top: auto; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html new file mode 100644 index 0000000000..8d2134bc37 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html @@ -0,0 +1,12 @@ +
+ + + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js new file mode 100644 index 0000000000..7aad8f5361 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js @@ -0,0 +1,62 @@ +(function () { + 'use strict'; + + /** + * A component to render the property action toggle + */ + + function umbPropertyActionsController(keyboardService) { + + var vm = this; + + vm.isOpen = false; + + function initDropDown() { + keyboardService.bind("esc", function() { + navigationService.hideNavigation(); + }); + } + function destroyDropDown() { + keyboardService.unbind("esc"); + } + + vm.toggle = function() { + if (vm.isOpen === true) { + vm.close(); + } else { + vm.open(); + } + } + vm.open = function() { + vm.isOpen = true; + initDropDown(); + } + vm.close = function() { + vm.isOpen = false; + destroyDropDown(); + } + + vm.executeAction = function(action) { + action.method(); + } + + vm.$onDestroy = function () { + if (vm.isOpen === true) { + destroyDropDown(); + } + } + + } + + var umbPropertyActionsComponent = { + templateUrl: 'views/components/property/property-actions/umb-property-actions.html', + bindings: { + actions: "<" + }, + controllerAs: 'vm', + controller: umbPropertyActionsController + }; + + angular.module('umbraco.directives').component('umbPropertyActions', umbPropertyActionsComponent); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html index 9d2588484c..4a7de0d8a7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html @@ -18,6 +18,9 @@ * + + +
From 88a34f5bcd37f6b0f2efd37f0a879f92d99d6ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Oct 2019 14:28:06 +0200 Subject: [PATCH 03/85] current state, not complete. --- .../property/umbproperty.directive.js | 9 + .../src/common/services/clipboard.service.js | 462 ++++++++++-------- .../less/components/umb-property-actions.less | 2 +- .../umb-property-actions.html | 2 +- .../components/property/umb-property.html | 4 +- .../nestedcontent/nestedcontent.controller.js | 24 + 6 files changed, 296 insertions(+), 207 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js index 302378b8c0..182aa664d4 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js @@ -32,6 +32,15 @@ angular.module("umbraco.directives") self.setPropertyError = function (errorMsg) { $scope.property.propertyErrorMessage = errorMsg; }; + + $scope.$on("ExposePropertyEditorAPI", function(event, api) { + + //avoid eventual parent properties to capture this. + event.stopPropagation(); + + $scope.propertyActions = api.propertyActions; + }); + } }; }); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js index 647133f0b7..519bc4791e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js @@ -1,203 +1,259 @@ -/** - * @ngdoc service - * @name umbraco.services.clipboardService - * - * @requires notificationsService - * @requires eventsService - * - * @description - * Service to handle clipboard in general across the application. Responsible for handling the data both storing and retrive. - * The service has a set way for defining a data-set by a entryType and alias, which later will be used to retrive the posible entries for a paste scenario. - * - */ -function clipboardService(notificationsService, eventsService, localStorageService) { - - - var STORAGE_KEY = "umbClipboardService"; - - var retriveStorage = function() { - if (localStorageService.isSupported === false) { - return null; - } - var dataJSON; - var dataString = localStorageService.get(STORAGE_KEY); - if (dataString != null) { - dataJSON = JSON.parse(dataString); - } - - if(dataJSON == null) { - dataJSON = new Object(); - } - - if(dataJSON.entries === undefined) { - dataJSON.entries = []; - } - - return dataJSON; - } - - var saveStorage = function(storage) { - var storageString = JSON.stringify(storage); - - try { - var storageJSON = JSON.parse(storageString); - localStorageService.set(STORAGE_KEY, storageString); - - eventsService.emit("clipboardService.storageUpdate"); - - return true; - } catch(e) { - return false; - } - - return false; - } - - - var service = {}; - - /** - * @ngdoc method - * @name umbraco.services.clipboardService#copy - * @methodOf umbraco.services.clipboardService - * - * @param {string} type A string defining the type of data to storing, example: 'elementType', 'contentNode' - * @param {string} alias A string defining the alias of the data to store, example: 'product' - * @param {object} data A object containing the properties to be saved. - * - * @description - * Saves a single JS-object with a type and alias to the clipboard. - */ - service.copy = function(type, alias, data) { - - var storage = retriveStorage(); - - var shallowCloneData = Object.assign({}, data);// Notice only a shallow copy, since we dont need to deep copy. (that will happen when storing the data) - delete shallowCloneData.key; - delete shallowCloneData.$$hashKey; - - var key = data.key || data.$$hashKey || console.error("missing unique key for this content"); - - // remove previous copies of this entry: - storage.entries = storage.entries.filter( - (entry) => { - return entry.unique !== key; - } - ); - - var entry = {unique:key, type:type, alias:alias, data:shallowCloneData}; - storage.entries.push(entry); - - if (saveStorage(storage) === true) { - notificationsService.success("Clipboard", "Copied to clipboard."); - } else { - notificationsService.success("Clipboard", "Couldnt copy this data to clipboard."); - } - - }; - - - /** - * @ngdoc method - * @name umbraco.services.supportsCopy#supported - * @methodOf umbraco.services.clipboardService - * - * @description - * Determins wether the current browser is able to performe its actions. - */ - service.isSupported = function() { - return localStorageService.isSupported; - }; - - /** - * @ngdoc method - * @name umbraco.services.supportsCopy#hasEntriesOfType - * @methodOf umbraco.services.clipboardService - * - * @param {string} type A string defining the type of data test for. - * @param {string} aliases A array of strings providing the alias of the data you want to test for. - * - * @description - * Determines whether the current clipboard has entries that match a given type and one of the aliases. - */ - service.hasEntriesOfType = function(type, aliases) { - - if(service.retriveEntriesOfType(type, aliases).length > 0) { - return true; - } - - return false; - }; - - /** - * @ngdoc method - * @name umbraco.services.supportsCopy#retriveEntriesOfType - * @methodOf umbraco.services.clipboardService - * - * @param {string} type A string defining the type of data to recive. - * @param {string} aliases A array of strings providing the alias of the data you want to recive. - * - * @description - * Returns an array of entries matching the given type and one of the provided aliases. - */ - service.retriveEntriesOfType = function(type, aliases) { - - var storage = retriveStorage(); - - // Find entries that are fulfilling the criteria for this nodeType and nodeTypesAliases. - var filteretEntries = storage.entries.filter( - (entry) => { - return (entry.type === type && aliases.filter(alias => alias === entry.alias).length > 0); - } - ); - - return filteretEntries; - }; - - /** - * @ngdoc method - * @name umbraco.services.supportsCopy#retriveEntriesOfType - * @methodOf umbraco.services.clipboardService - * - * @param {string} type A string defining the type of data to recive. - * @param {string} aliases A array of strings providing the alias of the data you want to recive. - * - * @description - * Returns an array of data of entries matching the given type and one of the provided aliases. - */ - service.retriveDataOfType = function(type, aliases) { - return service.retriveEntriesOfType(type, aliases).map((x) => x.data); - }; - - /** - * @ngdoc method - * @name umbraco.services.supportsCopy#retriveEntriesOfType - * @methodOf umbraco.services.clipboardService - * - * @param {string} type A string defining the type of data to remove. - * @param {string} aliases A array of strings providing the alias of the data you want to remove. - * - * @description - * Removes entries matching the given type and one of the provided aliases. - */ - service.clearEntriesOfType = function(type, aliases) { - - var storage = retriveStorage(); - - // Find entries that are NOT fulfilling the criteria for this nodeType and nodeTypesAliases. - var filteretEntries = storage.entries.filter( - (entry) => { - return !(entry.type === type && aliases.filter(alias => alias === entry.alias).length > 0); - } - ); - - storage.entries = filteretEntries; - - saveStorage(storage); - }; - - - - return service; -} -angular.module("umbraco.services").factory("clipboardService", clipboardService); +/** + * @ngdoc service + * @name umbraco.services.clipboardService + * + * @requires notificationsService + * @requires eventsService + * + * @description + * Service to handle clipboard in general across the application. Responsible for handling the data both storing and retrive. + * The service has a set way for defining a data-set by a entryType and alias, which later will be used to retrive the posible entries for a paste scenario. + * + */ +function clipboardService(notificationsService, eventsService, localStorageService) { + + + var STORAGE_KEY = "umbClipboardService"; + + var retriveStorage = function() { + if (localStorageService.isSupported === false) { + return null; + } + var dataJSON; + var dataString = localStorageService.get(STORAGE_KEY); + if (dataString != null) { + dataJSON = JSON.parse(dataString); + } + + if(dataJSON == null) { + dataJSON = new Object(); + } + + if(dataJSON.entries === undefined) { + dataJSON.entries = []; + } + + return dataJSON; + } + + var saveStorage = function(storage) { + var storageString = JSON.stringify(storage); + + try { + var storageJSON = JSON.parse(storageString); + localStorageService.set(STORAGE_KEY, storageString); + + eventsService.emit("clipboardService.storageUpdate"); + + return true; + } catch(e) { + return false; + } + + return false; + } + + var prepareEntryForStorage = function(entryData) { + + var shallowCloneData = Object.assign({}, entryData);// Notice only a shallow copy, since we dont need to deep copy. (that will happen when storing the data) + delete shallowCloneData.key; + delete shallowCloneData.$$hashKey; + + return shallowCloneData; + } + + + var service = {}; + + /** + * @ngdoc method + * @name umbraco.services.clipboardService#copy + * @methodOf umbraco.services.clipboardService + * + * @param {string} type A string defining the type of data to storing, example: 'elementType', 'contentNode' + * @param {string} alias A string defining the alias of the data to store, example: 'product' or ['banana', 'apple'] + * @param {object} data A object containing the properties to be saved. + * + * @description + * Saves a single JS-object with a type and alias to the clipboard. + */ + service.copy = function(type, alias, entryData) { + + var storage = retriveStorage(); + + var key = entryData.key || entryData.$$hashKey || console.error("missing unique key for this content"); + + // remove previous copies of this entry: + storage.entries = storage.entries.filter( + (entry) => { + return entry.unique !== key; + } + ); + + var entry = {unique:key, type:type, alias:alias, data:prepareEntryForStorage(entryData)}; + storage.entries.push(entry); + + if (saveStorage(storage) === true) { + notificationsService.success("Clipboard", "Copied to clipboard."); + } else { + notificationsService.success("Clipboard", "Couldnt copy this data to clipboard."); + } + + }; + + + /** + * @ngdoc method + * @name umbraco.services.clipboardService#copyArray + * @methodOf umbraco.services.clipboardService + * + * @param {string} type A string defining the type of data to storing, example: 'elementTypeArray', 'contentNodeArray' + * @param {string} aliases An array of strings defining the alias of the data to store, example: 'product' or ['banana', 'apple'] + * @param {object} entries An array of objects of objects containing the properties to be saved. + * @param {string} displayLabel A string or array of string defining the alias of the data to store, example: 'product' or ['banana', 'apple'] + * + * @description + * Saves a single JS-object with a type and alias to the clipboard. + */ + service.copyArray = function(type, aliases, entries, displayLabel, key) { + + var storage = retriveStorage(); + + // Clean up each entry + var copiedEntries = entries.filter( + (entry) => { + return prepareEntryForStorage(entry); + } + ); + + var entry = {unique:key, type:type, aliases:aliases, data:copiedEntries}; + storage.entries.push(entry); + + if (saveStorage(storage) === true) { + notificationsService.success("Clipboard", "Copied to clipboard."); + } else { + notificationsService.success("Clipboard", "Couldnt copy this data to clipboard."); + } + +}; + + + /** + * @ngdoc method + * @name umbraco.services.supportsCopy#supported + * @methodOf umbraco.services.clipboardService + * + * @description + * Determins wether the current browser is able to performe its actions. + */ + service.isSupported = function() { + return localStorageService.isSupported; + }; + + /** + * @ngdoc method + * @name umbraco.services.supportsCopy#hasEntriesOfType + * @methodOf umbraco.services.clipboardService + * + * @param {string} type A string defining the type of data test for. + * @param {string} aliases A array of strings providing the alias of the data you want to test for. + * + * @description + * Determines whether the current clipboard has entries that match a given type and one of the aliases. + */ + service.hasEntriesOfType = function(type, aliases) { + + if(service.retriveEntriesOfType(type, aliases).length > 0) { + return true; + } + + return false; + }; + + /** + * @ngdoc method + * @name umbraco.services.supportsCopy#retriveEntriesOfType + * @methodOf umbraco.services.clipboardService + * + * @param {string} type A string defining the type of data to recive. + * @param {string} aliases A array of strings providing the alias of the data you want to recive. + * + * @description + * Returns an array of entries matching the given type and one of the provided aliases. + */ + service.retriveEntriesOfType = function(type, allowedAliases) { + + var storage = retriveStorage(); + + // Find entries that are fulfilling the criteria for this nodeType and nodeTypesAliases. + var filteretEntries = storage.entries.filter( + (entry) => { + return ( + entry.type === type + && + (entry.alias && allowedAliases.filter(allowedAlias => allowedAlias === entry.alias).length > 0) + || + (entry.aliases && entry.aliases.filter(entryAlias => allowedAliases.filter(allowedAlias => allowedAlias === entryAlias).length > 0).length > 0) + ); + } + ); + + return filteretEntries; + }; + + /** + * @ngdoc method + * @name umbraco.services.supportsCopy#retriveEntriesOfType + * @methodOf umbraco.services.clipboardService + * + * @param {string} type A string defining the type of data to recive. + * @param {string} aliases A array of strings providing the alias of the data you want to recive. + * + * @description + * Returns an array of data of entries matching the given type and one of the provided aliases. + */ + service.retriveDataOfType = function(type, aliases) { + return service.retriveEntriesOfType(type, aliases).map((x) => x.data); + }; + + /** + * @ngdoc method + * @name umbraco.services.supportsCopy#retriveEntriesOfType + * @methodOf umbraco.services.clipboardService + * + * @param {string} type A string defining the type of data to remove. + * @param {string} aliases A array of strings providing the alias of the data you want to remove. + * + * @description + * Removes entries matching the given type and one of the provided aliases. + */ + service.clearEntriesOfType = function(type, aliases) { + + var storage = retriveStorage(); + + // Find entries that are NOT fulfilling the criteria for this nodeType and nodeTypesAliases. + var filteretEntries = storage.entries.filter( + (entry) => { + return !( + entry.type === type + && + (entry.alias && allowedAliases.filter(allowedAlias => allowedAlias === entry.alias).length > 0) + || + (entry.aliases && entry.aliases.filter(entryAlias => allowedAliases.filter(allowedAlias => allowedAlias === entryAlias).length > 0).length > 0) + ); + } + ); + + storage.entries = filteretEntries; + + saveStorage(storage); + }; + + + + return service; +} + + +angular.module("umbraco.services").factory("clipboardService", clipboardService); + diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less index 940daccbb6..997da7f79f 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less @@ -30,7 +30,7 @@ } .umb-property .umb-property-actions__toggle { - margin-top: 2px; + margin-top: 10px; opacity: 0; transition: opacity 120ms; } diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html index 8d2134bc37..a1bc3d904d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html @@ -5,7 +5,7 @@
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html index 4a7de0d8a7..17bd37e468 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html @@ -7,7 +7,7 @@
    diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 536169778c..4c0906735d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -390,6 +390,18 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop $event.stopPropagation(); } + var copyAllEntries = function() { + + syncCurrentNode(); + + var aliases = _.reduce($scope.nodes, function (node) { + return node.contentTypeAlias; + }); + + clipboardService.copyArray("elementTypeArray", aliases, $scope.nodes); + $event.stopPropagation(); + } + $scope.pasteFromClipboard = function(newNode) { if (newNode === undefined) { @@ -575,6 +587,18 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop $scope.realCurrentNode = newVal; }); + + $scope.propertyActions = [ + { + labelKey: 'actions_copy', + icon: 'documents', + method: copyAllEntries + } + ]; + + $scope.$emit("ExposePropertyEditorAPI", $scope);// must be executed at a state where the API is set. + + var unsubscribe = $scope.$on("formSubmitting", function (ev, args) { updateModel(); }); From a42fc8fc8e159fd327adfdac226875a540299961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Oct 2019 15:23:23 +0200 Subject: [PATCH 04/85] work on copyArray feature for clipboardService --- .../src/common/services/clipboard.service.js | 33 ++++++++++++------- .../umb-property-actions.html | 2 +- .../nestedcontent/nestedcontent.controller.js | 27 ++++++++++----- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js index 519bc4791e..ea7ef8cf78 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js @@ -71,26 +71,27 @@ function clipboardService(notificationsService, eventsService, localStorageServi * @methodOf umbraco.services.clipboardService * * @param {string} type A string defining the type of data to storing, example: 'elementType', 'contentNode' - * @param {string} alias A string defining the alias of the data to store, example: 'product' or ['banana', 'apple'] - * @param {object} data A object containing the properties to be saved. + * @param {string} alias A string defining the alias of the data to store, example: 'product' + * @param {object} entry A object containing the properties to be saved, this could be the object of a ElementType, ContentNode, ... + * @param {string} displayLabel (optional) A string swetting the label to display when showing paste entries. * * @description * Saves a single JS-object with a type and alias to the clipboard. */ - service.copy = function(type, alias, entryData) { + service.copy = function(type, alias, entry, displayLabel) { var storage = retriveStorage(); - var key = entryData.key || entryData.$$hashKey || console.error("missing unique key for this content"); + var uniqueKey = entry.key || entry.$$hashKey || console.error("missing unique key for this content"); // remove previous copies of this entry: storage.entries = storage.entries.filter( (entry) => { - return entry.unique !== key; + return entry.unique !== uniqueKey; } ); - var entry = {unique:key, type:type, alias:alias, data:prepareEntryForStorage(entryData)}; + var entry = {unique:uniqueKey, type:type, alias:alias, data:prepareEntryForStorage(entry), label:displayLabel || entry.name}; storage.entries.push(entry); if (saveStorage(storage) === true) { @@ -108,15 +109,16 @@ function clipboardService(notificationsService, eventsService, localStorageServi * @methodOf umbraco.services.clipboardService * * @param {string} type A string defining the type of data to storing, example: 'elementTypeArray', 'contentNodeArray' - * @param {string} aliases An array of strings defining the alias of the data to store, example: 'product' or ['banana', 'apple'] - * @param {object} entries An array of objects of objects containing the properties to be saved. - * @param {string} displayLabel A string or array of string defining the alias of the data to store, example: 'product' or ['banana', 'apple'] + * @param {string} aliases An array of strings defining the alias of the data to store, example: ['banana', 'apple'] + * @param {object} entries An array of objects of objects containing the properties to be saved, example: [ElementType, ElementType, ...] + * @param {string} displayLabel A string setting the label to display when showing paste entries. + * @param {string} uniqueKey A string prodiving an identifier for this entry, existing entries with this key will be removed to ensure that you only have the latest copy of this data. * * @description * Saves a single JS-object with a type and alias to the clipboard. */ - service.copyArray = function(type, aliases, entries, displayLabel, key) { - + service.copyArray = function(type, aliases, entries, displayLabel, displayIcon, uniqueKey) { + var storage = retriveStorage(); // Clean up each entry @@ -126,7 +128,14 @@ function clipboardService(notificationsService, eventsService, localStorageServi } ); - var entry = {unique:key, type:type, aliases:aliases, data:copiedEntries}; + // remove previous copies of this entry: + storage.entries = storage.entries.filter( + (entry) => { + return entry.unique !== uniqueKey; + } + ); + + var entry = {unique:uniqueKey, type:type, aliases:aliases, data:copiedEntries, label:displayLabel, icon:displayIcon}; storage.entries.push(entry); if (saveStorage(storage) === true) { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html index a1bc3d904d..1492cbd820 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html @@ -3,7 +3,7 @@
    -
    +
    • From 68687080ab8586e2259b72038ed3d726f32d3752 Mon Sep 17 00:00:00 2001 From: Poornima Nayar Date: Sun, 27 Oct 2019 09:48:24 +0000 Subject: [PATCH 17/85] More tweaks based on comments --- .../src/views/components/users/change-password.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html index 001939cc2f..bed26e06f4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html @@ -6,21 +6,21 @@
    - {{changePasswordForm.resetPassword.errorMsg}} - + @@ -59,9 +59,9 @@ - +
    From 43692c81e4fca69c19ecce4c2cc1dec13a035fbd Mon Sep 17 00:00:00 2001 From: Poornima Nayar Date: Sun, 27 Oct 2019 10:06:06 +0000 Subject: [PATCH 18/85] Removed href from the button --- .../src/views/components/users/change-password.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html index bed26e06f4..b7b8ec12c7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html @@ -59,7 +59,7 @@ - From 5dd7eda2ab7c0c86da58f3fb8090821763ffabb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 28 Oct 2019 10:25:51 +0100 Subject: [PATCH 19/85] Revert change. --- src/Umbraco.Web.UI.Client/src/less/main.less | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index f5424b0348..86a1acbeae 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -117,7 +117,6 @@ h5.-black { } .umb-control-group { position: relative; - margin-top: 20px; &::after { content: ''; display:block; From ed909e9f93e1a087596261dee0bfad1d8ff25f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 28 Oct 2019 15:55:02 +0100 Subject: [PATCH 20/85] updated look + ability to disable a property-action --- .../property/umbproperty.directive.js | 8 +- .../common/services/propertyeditor.service.js | 8 +- src/Umbraco.Web.UI.Client/src/less/belle.less | 1 + .../src/less/components/umb-contextmenu.less | 74 +++++++++++++++++ .../less/components/umb-property-actions.less | 49 +++--------- .../umb-property-actions.html | 6 +- .../components/property/umb-property.html | 2 +- .../nestedcontent/nestedcontent.controller.js | 80 ++++++++++++------- 8 files changed, 150 insertions(+), 78 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js index 6030efadf1..90fcc7630b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js @@ -16,6 +16,9 @@ angular.module("umbraco.directives") replace: true, templateUrl: 'views/components/property/umb-property.html', link: function (scope) { + + scope.propertyEditorAPI = {}; + userService.getCurrentUser().then(function (u) { var isAdmin = u.userGroups.indexOf('admin') !== -1; scope.propertyAlias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? scope.property.alias : null; @@ -32,13 +35,14 @@ angular.module("umbraco.directives") self.setPropertyError = function (errorMsg) { $scope.property.propertyErrorMessage = errorMsg; }; - + var unsubscribe = $scope.$on("ExposePropertyEditorAPI", function(event, api) { //avoid eventual parent properties to capture this. event.stopPropagation(); - $scope.propertyActions = api.propertyActions; + $scope.propertyEditorAPI = api; + //$scope.propertyActions = api.propertyActions; }); $scope.$on("$destroy", function () { diff --git a/src/Umbraco.Web.UI.Client/src/common/services/propertyeditor.service.js b/src/Umbraco.Web.UI.Client/src/common/services/propertyeditor.service.js index 29ec641f3b..0b24e78567 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/propertyeditor.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/propertyeditor.service.js @@ -10,12 +10,14 @@ * * @param {object} scope An object containing API for the PropertyEditor */ - function exposeAPI(scope) { + function exposeAPI(scope, api) { if (!scope) { throw "scope cannot be null"; } - - scope.$emit("ExposePropertyEditorAPI", scope); + if (!api) { + throw "api cannot be null"; + } + scope.$emit("ExposePropertyEditorAPI", api); } return { diff --git a/src/Umbraco.Web.UI.Client/src/less/belle.less b/src/Umbraco.Web.UI.Client/src/less/belle.less index e36a55bca0..74326d6dfe 100644 --- a/src/Umbraco.Web.UI.Client/src/less/belle.less +++ b/src/Umbraco.Web.UI.Client/src/less/belle.less @@ -129,6 +129,7 @@ @import "components/umb-media-grid.less"; @import "components/umb-folder-grid.less"; @import "components/umb-content-grid.less"; +@import "components/umb-contextmenu.less"; @import "components/umb-layout-selector.less"; @import "components/tooltip/umb-tooltip.less"; @import "components/tooltip/umb-tooltip-list.less"; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less new file mode 100644 index 0000000000..00d289f4d7 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less @@ -0,0 +1,74 @@ +.umb-contextmenu { + margin: 0; + list-style: none; + user-select: none; + + overflow: hidden; + border-radius: 3px; + border: 1px solid @dropdownBorder; + .box-shadow(0 5px 20px rgba(0,0,0,.3)); + + .sep { + display: block; + border-top: 1px solid @gray-9; + + &:first-child { + border-top: none; + } + } + +} + +.umb-contextmenu-item { + + .icon { + font-size: 18px; + vertical-align: middle; + } + + .menu-label { + display: inline-block; + vertical-align: middle; + margin-left: 5px; + } + + button { + + position: relative; + + display: block; + font-weight: normal; + line-height: @baseLineHeight; + white-space: nowrap; + + background-color: @ui-option; + border: 0; + padding: 7px 12px; + color: @ui-option-type; + width: 100%; + + font-size: 14px; + text-align: left; + + &:hover { + text-decoration: none; + color: @ui-option-type-hover; + background-color: @ui-option-hover; + } + } + + &.-opens-dialog { + .menu-label:after { + // adds an ellipsis (...) after the menu label for actions that open a dialog + content: '\2026'; + } + } + button:disabled { + cursor: not-allowed; + color: @ui-option-disabled-type; + &:hover { + color: @ui-option-disabled-type-hover; + background-color: @ui-option; + } + } +} diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less index 5f693977f1..cc11baebb0 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less @@ -26,8 +26,6 @@ margin: 0; } } -} -.umb-property-actions__toggle { &:hover { i { background: @ui-action-type-hover; @@ -42,12 +40,13 @@ top: -15px; border-radius: 3px 3px 0 0; - border-top: 1px solid @dropdownBorder; - border-left: 1px solid @dropdownBorder; - border-right: 1px solid @dropdownBorder; border-top-left-radius: 3px; border-top-right-radius: 3px; + border: 1px solid @dropdownBorder; + + border-bottom: 1px solid @gray-9; + .box-shadow(0 5px 20px rgba(0,0,0,.3)); background-color: white; @@ -69,51 +68,25 @@ .umb-property-actions__menu { - display: block; - border-radius: 3px; - position: absolute; z-index: 1000; + display: block; + float: left; min-width: 160px; list-style: none; - ul > { + .umb-contextmenu { - border: 1px solid @dropdownBorder; - - border-top-right-radius: 3px; - border-bottom-left-radius: 3px; - border-bottom-right-radius: 3px; - - overflow: hidden; - - .box-shadow(0 5px 20px rgba(0,0,0,.3)); + border-top-left-radius: 0; + margin-top:1px; + } - ul > li > button { + .umb-contextmenu-item > button { - position: relative; z-index:2;// need to stay on top of menu-toggle-open shadow. - display: block; - font-weight: normal; - line-height: @baseLineHeight; - white-space: nowrap; - cursor:pointer; - - background: @ui-option; - border: 0; - padding: 8px 20px; - color: @ui-option-type; - width: 100%; - text-align: left; - - &:hover { - text-decoration: none; - color: @ui-option-type-hover; - background: @ui-option-hover; - } } } diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html index be9b8e1276..ebab65d573 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html @@ -3,9 +3,9 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 7903a03062..6efafadd7a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -211,6 +211,39 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop $scope.labels.content_createEmpty = data[1]; }); + + + var copyAllEntries = function() { + + syncCurrentNode(); + + // list aliases + var aliases = $scope.nodes.map((node) => node.contentTypeAlias); + + // remove dublicates + aliases = aliases.filter((item, index) => aliases.indexOf(item) === index); + + // Retrive variant name + var culture = $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture; + var activeVariant = _.find(editorState.current.variants, function (v) { + return !v.language || v.language.culture === culture; + }); + + localizationService.localize("clipboard_labelForArrayOfItemsFrom", [$scope.model.label, activeVariant.name]).then(function(data) { + clipboardService.copyArray("elementTypeArray", aliases, $scope.nodes, data, "icon-thumbnail-list", $scope.model.id); + }); + } + + var CopyAllEntriesAction = { + labelKey: 'clipboard_labelForCopyAllEntries', + labelTokens: [$scope.model.label], + icon: 'documents', + method: copyAllEntries, + isDisabled: true + } + + + // helper to force the current form into the dirty state $scope.setDirty = function () { if ($scope.propertyForm) { @@ -473,26 +506,6 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop $event.stopPropagation(); } - var copyAllEntries = function() { - - syncCurrentNode(); - - // list aliases - var aliases = $scope.nodes.map((node) => node.contentTypeAlias); - - // remove dublicates - aliases = aliases.filter((item, index) => aliases.indexOf(item) === index); - - // Retrive variant name - var culture = $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture; - var activeVariant = _.find(editorState.current.variants, function (v) { - return !v.language || v.language.culture === culture; - }); - - localizationService.localize("clipboard_labelForArrayOfItemsFrom", [$scope.model.label, activeVariant.name]).then(function(data) { - clipboardService.copyArray("elementTypeArray", aliases, $scope.nodes, data, "icon-thumbnail-list", $scope.model.id); - }); - } $scope.pasteFromClipboard = function(newNode) { @@ -600,6 +613,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop $scope.inited = true; + updatePropertyActionStates(); checkAbilityToPasteContent(); } } @@ -656,6 +670,9 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop return obj; } + + + function syncCurrentNode() { if ($scope.realCurrentNode) { $scope.$broadcast("ncSyncVal", { key: $scope.realCurrentNode.key }); @@ -672,6 +689,12 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop } $scope.model.value = newValues; } + + updatePropertyActionStates(); + } + + function updatePropertyActionStates() { + CopyAllEntriesAction.isDisabled = $scope.model.value.length === 0; } $scope.$watch("currentNode", function (newVal) { @@ -680,18 +703,13 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop }); - $scope.propertyActions = [ - { - labelKey: 'clipboard_labelForCopyAllEntries', - labelTokens: [$scope.model.label], - icon: 'documents', - method: copyAllEntries - } + var api = {}; + api.propertyActions = [ + CopyAllEntriesAction ]; - - //$scope.$emit("ExposePropertyEditorAPI", $scope);// must be executed at a state where the API is set. - propertyEditorService.exposeAPI($scope);// must be executed at a state where the API is set. - + + propertyEditorService.exposeAPI($scope, api);// must be executed at a state where the API is set. + var unsubscribe = $scope.$on("formSubmitting", function (ev, args) { updateModel(); }); From 1c5d8efe772e8b6d126adf13b4030ab914b67117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 28 Oct 2019 17:18:08 +0100 Subject: [PATCH 21/85] corrected variable name for property-action --- .../nestedcontent/nestedcontent.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 6efafadd7a..f0ed98d8bc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -234,7 +234,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop }); } - var CopyAllEntriesAction = { + var copyAllEntriesAction = { labelKey: 'clipboard_labelForCopyAllEntries', labelTokens: [$scope.model.label], icon: 'documents', @@ -694,7 +694,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop } function updatePropertyActionStates() { - CopyAllEntriesAction.isDisabled = $scope.model.value.length === 0; + copyAllEntriesAction.isDisabled = $scope.model.value.length === 0; } $scope.$watch("currentNode", function (newVal) { @@ -705,7 +705,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop var api = {}; api.propertyActions = [ - CopyAllEntriesAction + copyAllEntriesAction ]; propertyEditorService.exposeAPI($scope, api);// must be executed at a state where the API is set. From 11560aa138577174cc46e8ef960cb673ef14d227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 28 Oct 2019 17:21:58 +0100 Subject: [PATCH 22/85] sligthly darker line in the bottom to enhance the depth --- .../src/less/components/umb-contextmenu.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less index 00d289f4d7..c0932ecdab 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less @@ -7,6 +7,7 @@ border-radius: 3px; border: 1px solid @dropdownBorder; .box-shadow(0 5px 20px rgba(0,0,0,.3)); + border-bottom: 1px solid rgba(0,0,0,.25); .sep { display: block; From 1f954fb9bee228c4528bacf00d7597dc3f17cd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 09:55:59 +0100 Subject: [PATCH 23/85] sligthly less bottom border on contextmenu. --- .../src/less/components/umb-contextmenu.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less index c0932ecdab..8512e2020d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-contextmenu.less @@ -7,7 +7,7 @@ border-radius: 3px; border: 1px solid @dropdownBorder; .box-shadow(0 5px 20px rgba(0,0,0,.3)); - border-bottom: 1px solid rgba(0,0,0,.25); + border-bottom: 1px solid rgba(0,0,0,.2); .sep { display: block; From 3a8123f00c5a1f8cfc9fa7acbc325b28255d5ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 11:26:35 +0100 Subject: [PATCH 24/85] Update src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js Removed comment Co-Authored-By: Warren Buckley --- .../directives/components/property/umbproperty.directive.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js index 90fcc7630b..06b9e51fba 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js @@ -42,7 +42,6 @@ angular.module("umbraco.directives") event.stopPropagation(); $scope.propertyEditorAPI = api; - //$scope.propertyActions = api.propertyActions; }); $scope.$on("$destroy", function () { From 338c4b7bcfacb7a7c5a1529be32c1a0944261afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 12:50:47 +0100 Subject: [PATCH 25/85] Set notification to error + removed console.logs --- .../src/common/services/clipboard.service.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js index c62c960b7a..f1bda350e5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js @@ -97,7 +97,7 @@ function clipboardService(notificationsService, eventsService, localStorageServi if (saveStorage(storage) === true) { notificationsService.success("Clipboard", "Copied to clipboard."); } else { - notificationsService.success("Clipboard", "Couldnt copy this data to clipboard."); + notificationsService.error("Clipboard", "Couldnt copy this data to clipboard."); } }; @@ -134,14 +134,12 @@ function clipboardService(notificationsService, eventsService, localStorageServi var entry = {unique:uniqueKey, type:type, aliases:aliases, data:copiedDatas, label:displayLabel, icon:displayIcon}; - console.log(entry); - storage.entries.push(entry); if (saveStorage(storage) === true) { notificationsService.success("Clipboard", "Copied to clipboard."); } else { - notificationsService.success("Clipboard", "Couldnt copy this data to clipboard."); + notificationsService.error("Clipboard", "Couldnt copy this data to clipboard."); } }; @@ -241,8 +239,6 @@ function clipboardService(notificationsService, eventsService, localStorageServi service.clearEntriesOfType = function(type, allowedAliases) { var storage = retriveStorage(); - - console.log("BEFORE: ", storage.entries) // Find entries that are NOT fulfilling the criteria for this nodeType and nodeTypesAliases. var filteretEntries = storage.entries.filter( @@ -260,8 +256,6 @@ function clipboardService(notificationsService, eventsService, localStorageServi ); storage.entries = filteretEntries; - - console.log("AFTER: ", storage.entries) saveStorage(storage); }; From 0c29d57ef9f385edc57c33fdc69a5141b51005df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 14:54:31 +0100 Subject: [PATCH 26/85] ensured that all entry aliases meets the allowed aliases + refactored the test method --- .../src/common/services/clipboard.service.js | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js index f1bda350e5..c3a1ba6432 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/clipboard.service.js @@ -61,6 +61,16 @@ function clipboardService(notificationsService, eventsService, localStorageServi return shallowCloneData; } + + var isEntryCompatible = function(entry, type, allowedAliases) { + return entry.type === type + && + ( + (entry.alias && allowedAliases.filter(allowedAlias => allowedAlias === entry.alias).length > 0) + || + (entry.aliases && entry.aliases.filter(entryAlias => allowedAliases.filter(allowedAlias => allowedAlias === entryAlias).length > 0).length === entry.aliases.length) + ); + } var service = {}; @@ -195,15 +205,7 @@ function clipboardService(notificationsService, eventsService, localStorageServi // Find entries that are fulfilling the criteria for this nodeType and nodeTypesAliases. var filteretEntries = storage.entries.filter( (entry) => { - return ( - entry.type === type - && - ( - (entry.alias && allowedAliases.filter(allowedAlias => allowedAlias === entry.alias).length > 0) - || - (entry.aliases && entry.aliases.filter(entryAlias => allowedAliases.filter(allowedAlias => allowedAlias === entryAlias).length > 0).length > 0) - ) - ); + return isEntryCompatible(entry, type, allowedAliases); } ); @@ -243,15 +245,7 @@ function clipboardService(notificationsService, eventsService, localStorageServi // Find entries that are NOT fulfilling the criteria for this nodeType and nodeTypesAliases. var filteretEntries = storage.entries.filter( (entry) => { - return !( - entry.type === type - && - ( - (entry.alias && allowedAliases.filter(allowedAlias => allowedAlias === entry.alias).length > 0) - || - (entry.aliases && entry.aliases.filter(entryAlias => allowedAliases.filter(allowedAlias => allowedAlias === entryAlias).length > 0).length > 0) - ) - ); + return !isEntryCompatible(entry, type, allowedAliases); } ); From 3d542acc423e7df3f1f44b9ac5d4bc4667875ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 15:24:23 +0100 Subject: [PATCH 27/85] Revert-style-hack that ensures that we only show property-actions on properties that are directly begin hovered --- .../src/less/components/umb-property-actions.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less index cc11baebb0..3ce284870e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less @@ -65,6 +65,10 @@ .umb-property .umb-property-actions__toggle:focus { opacity: 1; } +// Revert-style-hack that ensures that we only show property-actions on properties that are directly begin hovered. +.umb-property:hover .umb-property:not(:hover) .umb-property-actions__toggle { + opacity: 0; +} .umb-property-actions__menu { From 77fd959166d7e1c959afd5d88ce1ab174a987c0f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 29 Oct 2019 16:31:31 +0100 Subject: [PATCH 28/85] Fix bad merge --- .../src/views/components/application/umb-navigation.html | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html index fdd9b44a1e..0aab35ca21 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html @@ -10,12 +10,8 @@ From 5641a6cd357dbc34e2b45ebf21c634a82c379864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 17:19:15 +0100 Subject: [PATCH 29/85] correcting minor typo in gulp watch script --- src/Umbraco.Web.UI.Client/gulp/tasks/watchTask.js | 6 +++--- src/Umbraco.Web.UI.Client/gulp/util/processLess.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/gulp/tasks/watchTask.js b/src/Umbraco.Web.UI.Client/gulp/tasks/watchTask.js index ee9ce0bb64..4c59fd9162 100644 --- a/src/Umbraco.Web.UI.Client/gulp/tasks/watchTask.js +++ b/src/Umbraco.Web.UI.Client/gulp/tasks/watchTask.js @@ -20,14 +20,14 @@ function watchTask(cb) { //Setup a watcher for all groups of JS files _.forEach(config.sources.js, function (group) { if(group.watch !== false) { - watch(group.files, { ignoreInitial: true, interval: watchInterval }, function JS_Group_Compile() { return processJs(group.files, group.out) }); + watch(group.files, { ignoreInitial: true, interval: watchInterval }, function JS_Group_Compile() { return processJs(group.files, group.out); }); } }); //Setup a watcher for all groups of LESS files _.forEach(config.sources.less, function (group) { if(group.watch !== false) { - watch(group.watch, { ignoreInitial: true, interval: watchInterval }, function Less_Group_Compile() { processLess(group.files, group.out) }); + watch(group.watch, { ignoreInitial: true, interval: watchInterval }, function Less_Group_Compile() { return processLess(group.files, group.out); }); } }); @@ -38,7 +38,7 @@ function watchTask(cb) { viewWatcher = watch(group.files, { ignoreInitial: true, interval: watchInterval }); viewWatcher.on('change', function(path, stats) { console.log("copying " + group.files + " to " + config.root + config.targets.views + group.folder); - src(group.files).pipe( dest(config.root + config.targets.views + group.folder) ) + src(group.files).pipe( dest(config.root + config.targets.views + group.folder) ); }); } }); diff --git a/src/Umbraco.Web.UI.Client/gulp/util/processLess.js b/src/Umbraco.Web.UI.Client/gulp/util/processLess.js index 389b827332..94150043c1 100644 --- a/src/Umbraco.Web.UI.Client/gulp/util/processLess.js +++ b/src/Umbraco.Web.UI.Client/gulp/util/processLess.js @@ -16,7 +16,7 @@ module.exports = function(files, out) { cssnano({zindex: false}) ]; - console.log("LESS: ", files, " -> ", config.root + config.targets.js + out) + console.log("LESS: ", files, " -> ", config.root + config.targets.css + out) var task = gulp.src(files) .pipe(less()) From 4cf42bbb68c52d88209629726532012495ee5b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 29 Oct 2019 17:38:02 +0100 Subject: [PATCH 30/85] Added specific styling to the DataType Delete dialog for better looks and overview --- src/Umbraco.Web.UI.Client/src/less/belle.less | 2 ++ .../umb-dialog-datatype-delete.less | 33 +++++++++++++++++++ .../src/views/datatypes/delete.html | 14 ++++---- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/less/components/contextdialogs/umb-dialog-datatype-delete.less diff --git a/src/Umbraco.Web.UI.Client/src/less/belle.less b/src/Umbraco.Web.UI.Client/src/less/belle.less index 83d254c73c..245ad394ac 100644 --- a/src/Umbraco.Web.UI.Client/src/less/belle.less +++ b/src/Umbraco.Web.UI.Client/src/less/belle.less @@ -187,6 +187,8 @@ @import "components/users/umb-user-preview.less"; @import "components/users/umb-user-picker-list.less"; +@import "components/contextdialogs/umb-dialog-datatype-delete.less"; + // Utilities @import "utilities/layout/_display.less"; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/contextdialogs/umb-dialog-datatype-delete.less b/src/Umbraco.Web.UI.Client/src/less/components/contextdialogs/umb-dialog-datatype-delete.less new file mode 100644 index 0000000000..0e0b8f22bd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/less/components/contextdialogs/umb-dialog-datatype-delete.less @@ -0,0 +1,33 @@ +.umb-dialog-datatype-delete { + + + .umb-dialog-datatype-delete__table-head-column-name { + width: 140px; + } + + .umb-table-body__icon { + margin-right: 5px; + vertical-align: top; + display: inline-block; + } + + .table tbody td { + vertical-align: top; + } + .table tbody td > span { + margin: 5px 0; + vertical-align: middle; + } + .table tbody p { + line-height: 12px; + margin: 5px 0; + vertical-align: middle; + } + + .table tbody .icon { + vertical-align: top; + margin-right: 5px; + display: inline-block; + } + +} diff --git a/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html b/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html index 6c415e9f38..ce2e75e742 100644 --- a/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html +++ b/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html @@ -1,4 +1,4 @@ -
    +
    @@ -44,14 +44,14 @@ - + - +
    NameName Properties
    {{::relation.name}}{{::property.name}}{{$last ? '' : ', '}}

    {{::property.name}}

    @@ -68,14 +68,14 @@ - + - +
    NameName Properties
    {{::relation.name}}{{::property.name}}{{$last ? '' : ', '}}

    {{::property.name}}

    @@ -92,14 +92,14 @@ - + - +
    NameName Properties
    {{::relation.name}}{{::property.name}}{{$last ? '' : ', '}}

    {{::property.name}}

    From bfdbc4cb8b07de5a06f167a02b49e17bf0fc8e3e Mon Sep 17 00:00:00 2001 From: Anders Bjerner Date: Tue, 29 Oct 2019 18:18:43 +0100 Subject: [PATCH 31/85] Introduced confirm and confirmDelete functions in the Angular overlay service (#6526) --- .../src/common/services/overlay.service.js | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/overlay.service.js b/src/Umbraco.Web.UI.Client/src/common/services/overlay.service.js index 2165c1b7cb..0b8965e4fe 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/overlay.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/overlay.service.js @@ -65,10 +65,39 @@ open(overlay); } + function confirm(overlay) { + + if (!overlay.closeButtonLabelKey) overlay.closeButtonLabelKey = "general_cancel"; + if (!overlay.view) overlay.view = "views/common/overlays/confirm/confirm.html"; + if (!overlay.close) overlay.close = function () { close(); }; + + switch (overlay.confirmType) { + + case "delete": + if (!overlay.confirmMessageStyle) overlay.confirmMessageStyle = "danger"; + if (!overlay.submitButtonStyle) overlay.submitButtonStyle = "danger"; + if (!overlay.submitButtonLabelKey) overlay.submitButtonLabelKey = "contentTypeEditor_yesDelete"; + break; + + default: + if (!overlay.submitButtonLabelKey) overlay.submitButtonLabelKey = "general_confirm"; + + } + + open(overlay); + + } + + function confirmDelete(overlay) { + confirm(overlay); + } + var service = { open: open, close: close, - ysod: ysod + ysod: ysod, + confirm: confirm, + confirmDelete: confirmDelete }; return service; From f018b32f998a3df68c5fd7077511155cf3ab49d3 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Tue, 29 Oct 2019 18:25:08 +0100 Subject: [PATCH 32/85] Use umb-checkbox in template section (#6531) --- .../insertfield/insertfield.controller.js | 32 ++++++++++--------- .../insertfield/insertfield.html | 21 ++++++------ .../templatesections.controller.js | 31 +++++++++++++----- .../templatesections/templatesections.html | 8 ++--- 4 files changed, 56 insertions(+), 36 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.controller.js index f2cc0dbecb..3de26ba99c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.controller.js @@ -5,8 +5,8 @@ var vm = this; - vm.field; - vm.defaultValue; + vm.field = null; + vm.defaultValue = null; vm.recursive = false; vm.showDefaultValue = false; @@ -16,10 +16,14 @@ function onInit() { + var labelKeys = [ + "template_insertPageField" + ]; + // set default title if(!$scope.model.title) { - localizationService.localize("template_insertPageField").then(function(value){ - $scope.model.title = value; + localizationService.localizeMany(labelKeys).then(function (data) { + $scope.model.title = data[0]; }); } @@ -37,42 +41,40 @@ function generateOutputSample() { - var fallback; + var fallback = null; - if(vm.recursive !== false && vm.defaultValue !== undefined){ + if (vm.recursive !== false && vm.defaultValue !== null) { fallback = "Fallback.To(Fallback.Ancestors, Fallback.DefaultValue)"; - }else if(vm.recursive !== false){ + } else if (vm.recursive !== false) { fallback = "Fallback.ToAncestors"; - }else if(vm.defaultValue !== undefined){ + } else if (vm.defaultValue !== null) { fallback = "Fallback.ToDefaultValue"; } - var pageField = (vm.field !== undefined ? '@Model.Value("' + vm.field + '"' : "") - + (fallback !== undefined? ', fallback: ' + fallback : "") - + (vm.defaultValue !== undefined ? ', defaultValue: new HtmlString("' + vm.defaultValue + '")' : "") + var pageField = (vm.field !== null ? '@Model.Value("' + vm.field + '"' : "") + + (fallback !== null? ', fallback: ' + fallback : "") + + (vm.defaultValue !== null ? ', defaultValue: new HtmlString("' + vm.defaultValue + '")' : "") + (vm.field ? ')' : ""); $scope.model.umbracoField = pageField; return pageField; - } function submit(model) { - if($scope.model.submit) { + if ($scope.model.submit) { $scope.model.submit(model); } } function close() { - if($scope.model.close) { + if ($scope.model.close) { $scope.model.close(); } } onInit(); - } angular.module("umbraco").controller("Umbraco.Editors.InsertFieldController", InsertFieldController); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.html index b2c6382b98..bbb2e8c798 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertfield/insertfield.html @@ -33,10 +33,9 @@
    - +
    @@ -52,13 +51,17 @@
    -
    diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js index 36d7c0f4ed..8c728150da 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js @@ -1,26 +1,42 @@ (function () { "use strict"; - function TemplateSectionsController($scope, formHelper) { + function TemplateSectionsController($scope, formHelper, localizationService) { var vm = this; + vm.labels = {}; + vm.select = select; vm.submit = submit; vm.close = close; $scope.model.mandatoryRenderSection = false; - if(!$scope.model.title) { - $scope.model.title = "Sections"; - } - function onInit() { - if($scope.model.hasMaster) { + if ($scope.model.hasMaster) { $scope.model.insertType = 'addSection'; } else { $scope.model.insertType = 'renderBody'; } + + var labelKeys = [ + "template_insertSections", + "template_sectionMandatory" + ]; + + localizationService.localizeMany(labelKeys).then(function (data) { + vm.labels.title = data[0]; + vm.labels.sectionMandatory = data[1]; + + setTitle(vm.labels.title); + }); + } + + function setTitle(value) { + if (!$scope.model.title) { + $scope.model.title = value; + } } function select(type) { @@ -34,13 +50,12 @@ } function close() { - if($scope.model.close) { + if ($scope.model.close) { $scope.model.close(); } } onInit(); - } angular.module("umbraco").controller("Umbraco.Editors.TemplateSectionsController", TemplateSectionsController); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html index 5b946976d7..045a1403e2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html @@ -44,10 +44,10 @@
    - - +
    + +
    +
    From 99272a48f3f742f9cb4bab1451c1c5b04267262a Mon Sep 17 00:00:00 2001 From: Carole Rennie Logan Date: Tue, 29 Oct 2019 18:07:40 +0000 Subject: [PATCH 33/85] Copy to clipboard in query builder (#6584) --- .../querybuilder/querybuilder.controller.js | 6 + .../querybuilder/querybuilder.html | 234 +++++++++--------- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 1 + .../Umbraco/config/lang/en_us.xml | 1 + 4 files changed, 123 insertions(+), 119 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js index faca3b3fa0..4d537bd73c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js @@ -31,6 +31,7 @@ vm.datePickerChange = datePickerChange; vm.submit = submit; vm.close = close; + vm.copyQuery = copyQuery; function onInit() { @@ -120,6 +121,11 @@ query.filters.push({}); } + function copyQuery() { + var copyText = $scope.model.result.queryExpression; + navigator.clipboard.writeText(copyText); + } + function trashFilter(query, filter) { for (var i = 0; i < query.filters.length; i++) { if (query.filters[i] == filter) { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html index 779ca739d2..f01f325265 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html @@ -15,164 +15,160 @@ -
    +
    -
    -
    +
    +
    - I want + I want - - from + from - - + + -
    +
    -
    +
    - - where - - - and - + + where + + + and + -
    + +
    -
    +
    - - + + - - - - {{term.name}} - - - + + + + {{term.name}} + + + -
    +
    - + - - - + + + - - - - + + + + - + - - - + + + - - - + + + -
    +
    -
    +
    - order by + order by -
    + +
    - - + + -
    -
    +
    +
    {{model.result.resultCount}} items, returned in {{model.result.executionTime}} ms
    - + -
    {{model.result.queryExpression}}
    +
    {{model.result.queryExpression}}
    + + copy to clipboard + -
    +
    diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 15be061e72..24f4f74062 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -1495,6 +1495,7 @@ To manage your website, simply open the Umbraco back office and start adding con Query builder items returned, in + copy to clipboard I want all content content of type "%0%" diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index ea7b7bdf0c..ef363137fe 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1509,6 +1509,7 @@ To manage your website, simply open the Umbraco back office and start adding con Query builder items returned, in + copy to clipboard I want all content content of type "%0%" From 990d14e7919b9e802c804f1b6eea1417dc6a39a2 Mon Sep 17 00:00:00 2001 From: Steve Megson Date: Tue, 29 Oct 2019 18:12:06 +0000 Subject: [PATCH 34/85] Set focus to Umb-Tags when clicking property label (#6608) --- .../components/tags/umbtagseditor.directive.js | 9 +++++---- .../src/views/components/tags/umb-tags-editor.html | 4 ++-- .../src/views/propertyeditors/tags/tags.html | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js index 7d1def43a8..7ff7f7fa66 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js @@ -18,6 +18,7 @@ config: "<", validation: "<", culture: " + culture="model.culture" + input-id="{{model.alias}}">
    From 3a111eceb3920293922c3bf083a9fcda9b71c57a Mon Sep 17 00:00:00 2001 From: Steve Megson Date: Tue, 29 Oct 2019 18:15:22 +0000 Subject: [PATCH 35/85] Set focus to RTE when clicking property label (#6609) --- .../src/common/services/tinymce.service.js | 11 ++++++++--- .../src/views/propertyeditors/rte/rte.controller.js | 4 ++++ .../src/views/propertyeditors/rte/rte.html | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 1351da081a..4d4f8792cf 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -735,7 +735,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s //get all macro divs and load their content $(editor.dom.select(".umb-macro-holder.mceNonEditable")).each(function () { - self.loadMacroContent($(this), null); + self.loadMacroContent($(this), null, editor); }); }); @@ -850,14 +850,15 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s } var $macroDiv = $(editor.dom.select("div.umb-macro-holder." + uniqueId)); + editor.setDirty(true); //async load the macro content - this.loadMacroContent($macroDiv, macroObject); + this.loadMacroContent($macroDiv, macroObject, editor); }, /** loads in the macro content async from the server */ - loadMacroContent: function ($macroDiv, macroData) { + loadMacroContent: function ($macroDiv, macroData, editor) { //if we don't have the macroData, then we'll need to parse it from the macro div if (!macroData) { @@ -893,7 +894,11 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s $macroDiv.removeClass("loading"); htmlResult = htmlResult.trim(); if (htmlResult !== "") { + var wasDirty = editor.isDirty(); $ins.html(htmlResult); + if (!wasDirty) { + editor.undoManager.clear(); + } } }); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index c2bf5d0336..748d8da1a4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -101,6 +101,10 @@ angular.module("umbraco") } }); + $scope.focus = function () { + tinyMceEditor.focus(); + } + //when the element is disposed we need to unsubscribe! // NOTE: this is very important otherwise if this is part of a modal, the listener still exists because the dom // element might still be there even after the modal has been hidden. diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html index d2cf29d75a..b147e5ccca 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html @@ -2,6 +2,7 @@
    +
    From 7f0a077f588b42761c42eb268faeced61bba6538 Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Tue, 29 Oct 2019 19:37:15 +0100 Subject: [PATCH 36/85] Add SecurityCodeScan static code analyzer (#6636) * Added SecurityCodeScan to all projects * Enable analysing of content items --- src/Umbraco.Core/Umbraco.Core.csproj | 8 +++++++- src/Umbraco.Examine/Umbraco.Examine.csproj | 8 +++++++- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 6 ++++++ src/Umbraco.Web/Umbraco.Web.csproj | 8 +++++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 309dc97b81..ffe20afdb3 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -10,6 +10,7 @@ Umbraco.Core ..\ + $(AdditionalFileItemNames);Content true @@ -60,6 +61,11 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + + 3.3.0 + runtime; build; native; contentfiles; analyzers + all + 1.3.0 @@ -1565,4 +1571,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj index e30d355dfe..24408cd7d4 100644 --- a/src/Umbraco.Examine/Umbraco.Examine.csproj +++ b/src/Umbraco.Examine/Umbraco.Examine.csproj @@ -10,6 +10,7 @@ Umbraco.Examine ..\ + $(AdditionalFileItemNames);Content true @@ -56,6 +57,11 @@ + + 3.3.0 + runtime; build; native; contentfiles; analyzers + all + @@ -104,4 +110,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index f1ae2010db..ca4c8e106d 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -31,6 +31,7 @@ (see FindAppConfigFile target in detailed build output) --> Web.config + $(AdditionalFileItemNames);Content true @@ -104,6 +105,11 @@ + + 3.3.0 + runtime; build; native; contentfiles; analyzers + all + 8.1.0 diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index e04adc9e84..41c2d93489 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -13,6 +13,7 @@ true Off + $(AdditionalFileItemNames);Content true @@ -88,6 +89,11 @@ + + 3.3.0 + runtime; build; native; contentfiles; analyzers + all + @@ -1272,4 +1278,4 @@ - \ No newline at end of file + From 6a90a8755b139680ac8541907dd10a22725e75bc Mon Sep 17 00:00:00 2001 From: Poornima Nayar Date: Thu, 10 Oct 2019 17:30:18 +0100 Subject: [PATCH 37/85] Update the create dialog on Relation to use umb-radiobutton --- src/Umbraco.Web.UI.Client/src/views/relationtypes/create.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/relationtypes/create.html b/src/Umbraco.Web.UI.Client/src/views/relationtypes/create.html index 67a48e77cd..ab65241c95 100644 --- a/src/Umbraco.Web.UI.Client/src/views/relationtypes/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/relationtypes/create.html @@ -14,13 +14,13 @@