From 33f00a508fefd5b120c184bed68451cb651acae7 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 22 Nov 2021 18:50:10 +0100 Subject: [PATCH] V9/feature/merge v8 22/11/2021 (#11681) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changes to GetReducedEventList (#11444) * Instead of only using first event, we combine events of same type into a single event with multiple arguments * Added generic method to DRY up grouping logic. * Renamed method to better reflect new functionality. Co-authored-by: Andy Butland * Merge pull request #11360 from umbraco/v8/bugfix/11057-mandatory-image-not-validating-after-first-time-failure Fixes 11057: Mandatory Image not validating after first time failure (cherry picked from commit 5cc70d2160d2cb917d5d9983a715474619cb87e1) * Additional optional sanitization of scripting in TinyMCE (#10653) (cherry picked from commit f68dba7bcb16308af17c5385b8e586165e44b578) * Bump version to 8.17.1 * Hide localization key while loading * ContentVersion cleanup backoffice UI (#11637) * init rollback ui prototype * add busy state to button, deselect version, add pagination status * add localisation * style current version * disable rollback button when nothing is selected * stop click event * Endpoints for paginated content versions. Light on tests, tight on time. * Endpoints to "pin" content versions * camel case json output. Not sure why json formatter not set for controller, bit risky to add it now * wire up paging * wire up pin/unpin * rename getPagedRollbackVersions to getPagedContentVersions * prevent selection of current version and current draft * add current draft and current version to UI * remove pointer if the row is not selectable * Improve warning for globally disabled cleanup feature. * Fix current loses prevent cleanup state on publish. * Added umbracoLog audit entries for "pin" / "unpin" * Match v9 defaults for keepVersions settings * Fix - losing preventCleanup on save current with content changes * update pin/unpin button labels * fix pagination bug * add missing " * always send culture when a doc type can vary Co-authored-by: Mads Rasmussen * Bugfix - DocumentVersionRepository.Get should not join culture variation * Bugfix - Missing write lock * Bugfix - Policy returns items to delete not items to keep. Switch to inverse behavior. Co-authored-by: Andy Butland Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Co-authored-by: Niels Lyngsø Co-authored-by: Sebastiaan Janssen Co-authored-by: Ronald Barendse Co-authored-by: Paul Johnson Co-authored-by: Mads Rasmussen --- .../localization/localize.directive.js | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js index e957d78660bd..2262da4c168e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js @@ -1,5 +1,4 @@ -angular.module("umbraco.directives") - +angular.module('umbraco.directives') /** * @ngdoc directive * @name umbraco.directives.directive:localize @@ -8,12 +7,12 @@ angular.module("umbraco.directives") * @description *
* Component
- * Localize a specific token to put into the HTML as an item + * Localize a specific token to put into the HTML as an item. *
*
* Attribute
- * Add a HTML attribute to an element containing the HTML attribute name you wish to localise - * Using the format of '@section_key' or 'section_key' + * Add an HTML attribute to an element containing the HTML attribute name you wish to localize, + * using the format of '@section_key' or 'section_key'. *
* ##Usage *
@@ -36,12 +35,11 @@ angular.module("umbraco.directives")
                 watchTokens: '@'
             },
             replace: true,
-
             link: function (scope, element, attrs) {
                 var key = scope.key;
-                scope.text = "";
+                scope.text = '';
 
-                // A render function to be able to update tokens as values update.
+                // A render function to be able to update tokens as values update
                 function render() {
                     element.html(localizationService.tokenReplace(scope.text, scope.tokens || null));
                 }
@@ -50,26 +48,28 @@ angular.module("umbraco.directives")
                     scope.text = value;
                     render();
                 });
+
                 if (scope.watchTokens === 'true') {
                     scope.$watch("tokens", render, true);
                 }
             }
         };
     })
-
     .directive('localize', function ($log, localizationService) {
         return {
             restrict: 'A',
             link: function (scope, element, attrs) {
-                //Support one or more attribute properties to update
+                // Support one or more attribute properties to update
                 var keys = attrs.localize.split(',');
 
                 Utilities.forEach(keys, (value, key) => {
                     var attr = element.attr(value);
-
                     if (attr) {
+                        // Localizing is done async, so make sure the key isn't visible
+                        element.removeAttr(value);
+                        
                         if (attr[0] === '@') {
-                            //If the translation key starts with @ then remove it
+                            // If the translation key starts with @ then remove it
                             attr = attr.substring(1);
                         }
 
@@ -82,5 +82,4 @@ angular.module("umbraco.directives")
                 });
             }
         };
-
     });