From c0b713d0e4c6a8779933791709d883b79cf0e37d Mon Sep 17 00:00:00 2001 From: Jan Skovgaard Date: Tue, 23 Oct 2018 16:06:06 +0200 Subject: [PATCH 01/16] 3381 - Media picker: Trashed media warning looks weird (#3382) --- .../src/less/property-editors.less | 14 ++++++- .../mediapicker/mediapicker.controller.js | 12 +++--- .../mediapicker/mediapicker.html | 38 ++++++++++--------- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 412a87d909..e9f4acd120 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -235,6 +235,18 @@ div.umb-codeeditor .umb-btn-toolbar { } } +.umb-mediapicker .label{ + &__trashed{ + background-color: @red; + position: absolute; + top: 50%; + left: 50%; + z-index: 1; + transform: translate3d(-50%,-50%,0); + margin: 0; + } +} + .umb-mediapicker .picked-image { position: absolute; bottom: 10px; @@ -333,7 +345,7 @@ div.umb-codeeditor .umb-btn-toolbar { background-image: url(../img/checkered-background.png); } -.umb-sortable-thumbnails li img.trashed { +.umb-sortable-thumbnails li .trashed { opacity:0.3; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js index bf7462942a..7b8445a4dc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js @@ -16,7 +16,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl } function setupViewModel() { - $scope.images = []; + $scope.mediaItems = []; $scope.ids = []; $scope.isMultiPicker = multiPicker; @@ -41,7 +41,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl // on whether it is simply resaved or not. // This is done by remapping the int/guid ids into a new array of items, where we create "Deleted item" placeholders // when there is no match for a selected id. This will ensure that the values being set on save, are the same as before. - + medias = _.map(ids, function(id) { var found = _.find(medias, @@ -72,7 +72,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl media.thumbnail = mediaHelper.resolveFileFromEntity(media, true); } - $scope.images.push(media); + $scope.mediaItems.push(media); if ($scope.model.config.idType === "udi") { $scope.ids.push(media.udi); @@ -89,7 +89,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl setupViewModel(); $scope.remove = function(index) { - $scope.images.splice(index, 1); + $scope.mediaItems.splice(index, 1); $scope.ids.splice(index, 1); $scope.sync(); }; @@ -117,7 +117,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl media.thumbnail = mediaHelper.resolveFileFromEntity(media, true); } - $scope.images.push(media); + $scope.mediaItems.push(media); if ($scope.model.config.idType === "udi") { $scope.ids.push(media.udi); @@ -145,7 +145,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl // content picker. Then we don't have to worry about setting ids, render models, models, we just set one and let the // watch do all the rest. $timeout(function(){ - angular.forEach($scope.images, function(value, key) { + angular.forEach($scope.mediaItems, function(value, key) { r.push($scope.model.config.idType === "udi" ? value.udi : value.id); }); $scope.ids = r; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.html index 2efed8b3e8..7e9568bdd2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.html @@ -1,31 +1,35 @@
-

-

- -
-
    -
  • +

    +

    + +
    +
      +
    • + +

      + + +

      - - + - - + + - +
      - - .{{image.extension}} + + .{{media.metaData.umbracoExtension.Value}} - {{image.name}} - + {{media.name}} +
    • - +
    • From 39045b1edc2cfbdb7bfda2d85349d6ddb39d479d Mon Sep 17 00:00:00 2001 From: Jan Skovgaard Date: Tue, 23 Oct 2018 16:32:07 +0200 Subject: [PATCH 02/16] 3324 - Suggestion: Align image cropper property editor UI with color picker and checkbox lists (#3325) --- .../components/prevalues/multivalues.less | 4 + src/Umbraco.Web.UI.Client/src/less/main.less | 21 +++- .../src/less/property-editors.less | 115 ++++++++++++++++-- .../imagecropper.prevalues.controller.js | 50 ++++++-- .../imagecropper/imagecropper.prevalues.html | 105 ++++++++++------ src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 2 - .../umbraco/config/lang/en_us.xml | 2 - src/Umbraco.Web.UI/umbraco/config/lang/es.xml | 2 - src/Umbraco.Web.UI/umbraco/config/lang/fr.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/pl.xml | 2 - src/Umbraco.Web.UI/umbraco/config/lang/ru.xml | 2 - src/Umbraco.Web.UI/umbraco/config/lang/sv.xml | 2 - src/Umbraco.Web.UI/umbraco/config/lang/zh.xml | 2 - .../ImageCropperPropertyEditor.cs | 2 +- 14 files changed, 229 insertions(+), 83 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less b/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less index 43f6697eb1..0dbc4c381c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less @@ -5,6 +5,10 @@ .umb-overlay & { width: 500px; } + + p{ + margin: 7px 0; + } } .umb-prevalues-multivalues__left { diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index b16e437cc2..46f0f86d8d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -23,7 +23,7 @@ margin-top: 0px; margin-bottom: 15px; font-size: 14px; - color: @gray-7; + color: @gray-7; } h5{ @@ -134,7 +134,7 @@ h5.-black { padding-bottom: 0; } -.block-form .umb-control-group label .help-block, +.block-form .umb-control-group label .help-block, .block-form .umb-control-group label small { font-size: 13px; padding-top: 2px; @@ -243,9 +243,9 @@ label:not([for]) { } .umb-version { - color: @gray-7; - position: absolute; - bottom: 5px; + color: @gray-7; + position: absolute; + bottom: 5px; right: 20px; } @@ -653,3 +653,14 @@ input[type=checkbox]:checked + .input-label--small { .bootstrap-datetimepicker-widget td span { border-radius: 0 !important; } + +.visuallyhidden{ + position: absolute !important; + clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ + clip: rect(1px, 1px, 1px, 1px); + padding:0 !important; + border:0 !important; + height: 1px !important; + width: 1px !important; + overflow: hidden; +} diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index e9f4acd120..0a3807e7e6 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -102,11 +102,11 @@ div.umb-codeeditor { border: 1px solid @gray-8; } div.umb-codeeditor .umb-el-wrap { - padding: 0px; + padding: 0; } div.umb-codeeditor .umb-btn-toolbar { - padding: 0px; - margin: 0px; + padding: 0; + margin: 0; border-bottom: @gray-8 1px solid; background: @gray-10; } @@ -122,7 +122,7 @@ div.umb-codeeditor .umb-btn-toolbar { position: absolute; } } -.mce-tinymce{border: 1px solid @gray-8 !important; border-radius: 0px !important;} +.mce-tinymce{border: 1px solid @gray-8 !important; border-radius: 0 !important;} .mce-panel{background: @gray-10 !important; border-color: @gray-8 !important;} .mce-btn-group, .mce-btn{border: none !important; background: none !important;} .mce-ico{font-size: 12px !important; color: @gray-1 !important;} @@ -203,7 +203,7 @@ div.umb-codeeditor .umb-btn-toolbar { } label { - border: 1px solid #fff; + border: 1px solid @white; padding: 6px 10px; font-family: monospace; border: 1px solid #dfdfe1; @@ -213,6 +213,99 @@ div.umb-codeeditor .umb-btn-toolbar { } } +// +// Image Cropper +// -------------------------------------------------- + +.umb-prevalues-multivalues.umb-cropsizes{ + max-width: none; + width: 100%; + + .umb-overlay__form &{ + width: 100%; + } +} + +.umb-cropsizes{ + float: left; + + .control-group{ + label{ + display: block; + } + } + + &__add{ + display: flex; + align-items: center; + flex-wrap: wrap; + } + + &__sortable{ + max-width: 500px; + width: 100%; + min-width: 66.6%; + + @media (min-width: 1101px) and (max-width: 1300px), (max-width: 930px){ + max-width: none; + } + } + + &__controls{ + margin: 24px 0 0; + } + + &__input{ + margin: 0 15px 0 0; + width: ~"calc(100% - 15px)"; + + @media (min-width: 1101px) and (max-width: 1300px), (max-width: 930px){ + margin: 0; + width: 100%; + max-width: 220px; + } + + &--narrow{ + max-width: 95px; + width: 100%; + } + + &-wrap{ + position: relative; + max-width: 206px; + width: 100%; + + @media (min-width: 1101px) and (max-width: 1300px), (max-width: 930px){ + max-width: none; + flex: 1 1 100%; + margin: 0 0 20px; + } + + &--narrow{ + margin: 0 15px 0 0; + max-width: 95px; + width: 100%; + } + + &--icon{ + padding: 0 15px 0 0; + width: ~"calc(100% + 15px)"; // Use an escape string in order to make use of CSS native calc function instead of the one built into less + + &:after{ + content:"\00D7"; + position: absolute; + bottom: -9px; + top: 0; + margin: auto; + right: 0; + width: 5px; + height: 5px; + } + } + } + } +} + // // Media picker @@ -719,8 +812,8 @@ div.umb-codeeditor .umb-btn-toolbar { .umb-photo-folder .picrow div, .umb-photo-preview{ - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; border: none; display: inline-block; vertical-align: top; @@ -757,9 +850,9 @@ div.umb-codeeditor .umb-btn-toolbar { //this is a temp hack, to provide selectors in the dialog: .umb-photo-folder .pic:hover .selector-overlay { position: absolute; - bottom: 0px; - left: 0px; - right: 0px; + bottom: 0; + left: 0; + right: 0; padding: 5px; background: @black; z-index: 100; @@ -839,7 +932,7 @@ div.umb-codeeditor .umb-btn-toolbar { .umb-fileupload ul { list-style: none; vertical-align: middle; - margin-bottom: 0px; + margin-bottom: 0; } .umb-fileupload label { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.controller.js index 3a99c90a50..5a0b43d105 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.controller.js @@ -1,10 +1,13 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.CropSizesController", - function ($scope, $timeout) { + function ($scope) { if (!$scope.model.value) { $scope.model.value = []; } + $scope.editMode = false; + $scope.setFocus = false; + $scope.remove = function (item, evt) { evt.preventDefault(); $scope.model.value = _.reject($scope.model.value, function (x) { @@ -13,32 +16,57 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.CropSizesControlle }; $scope.edit = function (item, evt) { - evt.preventDefault(); + evt.preventDefault(); + $scope.editMode = true; + $scope.setFocus = false; + $scope.newItem = item; }; $scope.cancel = function (evt) { - evt.preventDefault(); + evt.preventDefault(); + $scope.editMode = false; + $scope.setFocus = true; + $scope.newItem = null; }; - $scope.add = function (evt) { - evt.preventDefault(); + $scope.change = function () { + // Listen to the change event and set focus 2 false + if($scope.setFocus){ + $scope.setFocus = false; + return; + } + } - if ($scope.newItem && $scope.newItem.alias && + $scope.add = function (evt) { + evt.preventDefault(); + + $scope.editMode = false; + + $scope.setFocus = true; + + if ($scope.newItem && $scope.newItem.alias && angular.isNumber($scope.newItem.width) && angular.isNumber($scope.newItem.height) && $scope.newItem.width > 0 && $scope.newItem.height > 0) { - var exists = _.find($scope.model.value, function (item) { return $scope.newItem.alias === item.alias; }); + var exists = _.find($scope.model.value, function (item) { return $scope.newItem.alias === item.alias; }); + if (!exists) { $scope.model.value.push($scope.newItem); $scope.newItem = {}; - $scope.hasError = false; + $scope.hasError = false; + $scope.cropAdded = false; return; - } + } + else{ + $scope.newItem = null; + $scope.hasError = false; + return; + } } //there was an error, do the highlight (will be set back by the directive) $scope.hasError = true; - }; - }); \ No newline at end of file + }; + }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.html index 62a5565d95..0be82ff52f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.html @@ -1,49 +1,74 @@ -
      +
      +
      -
      -
        -
      • - - +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + + Cancel +
        - {{node.alias}} -
        {{node.width}}px × {{node.height}}px -
      • -
      -
      -

      Define crop

      -

      - Give the crop an alias and it's default width and height. -

      - -
      - - +
      +
      + +
      +

      {{item.alias}} ({{item.width}}px × {{item.height}}px)

      +
      +
      + Edit + Remove +
      - -
      - - - × - -
      - -
      - - Cancel -
      -
      - -
      -
      diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index af8c302aff..5b14e03fae 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -1304,8 +1304,6 @@ To manage your website, simply open the Umbraco back office and start adding con Reset crop - Define crop - Give the crop an alias and its default width and height Save crop Add new crop Done 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 5355928f17..791fc315ee 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1302,8 +1302,6 @@ To manage your website, simply open the Umbraco back office and start adding con Reset crop - Define crop - Give the crop an alias and its default width and height Save crop Add new crop Done diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml index fed40e2d79..a41d17604b 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml @@ -1039,8 +1039,6 @@ Reiniciar - Definir corte - Da al corte un alias y su anchura y altura por defecto Guardar corte Añadir nuevo corte diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml index b3d5edf512..7d20714ab6 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml @@ -1286,7 +1286,6 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à Réinitialiser Définir le recadrage - Donnez un alias au recadrage ainsi que sa largeur et sa hauteur par défaut Sauvegarder le recadrage Ajouter un nouveau recadrage diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml index 98759d5851..9affa43727 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml @@ -1022,8 +1022,6 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb Resetuj - Zdefiniuj przycięcie - Ustaw alias dla przycięcia, a także jego domyślną szerokość i długość Zapisz przycięcie Dodaj nowe przycięcie diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index 8ebe8c0ef7..8e98566687 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -879,8 +879,6 @@ Сбросить - Задать рамку - Задайте рамке имя (алиас), а также ширину и высоту по-умолчанию Сохранить рамку Добавить новую рамку diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml index d011f7dadb..982f31e383 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml @@ -645,8 +645,6 @@ Återställ - Definiera beskräning - Ge beskärningen ett alias och dess standardbredd och -höjd spara beskärning Lägg till ny beskärning diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml index c2189ca928..a918b78f95 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml @@ -999,8 +999,6 @@ Reset - Define crop - Give the crop an alias and its default width and height Save crop Add new crop diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs index 5196fda0ee..3d6a1727e4 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs @@ -229,7 +229,7 @@ namespace Umbraco.Web.PropertyEditors internal class ImageCropperPreValueEditor : PreValueEditor { - [PreValueField("crops", "Crop sizes", "views/propertyeditors/imagecropper/imagecropper.prevalues.html")] + [PreValueField("crops", "Define crops", "views/propertyeditors/imagecropper/imagecropper.prevalues.html", Description = "Give the crop an alias and it's default width and height")] public string Crops { get; set; } } From 1053a349f6ea2ebcd7421dbd37af9cbdc8f715f6 Mon Sep 17 00:00:00 2001 From: agrath Date: Wed, 24 Oct 2018 03:48:19 +1300 Subject: [PATCH 03/16] #3231 RTE editor in grid collapsed on tab shown (#3232) --- .../components/grid/grid.rte.directive.js | 15 ++++++++++++--- .../directives/validation/valtab.directive.js | 17 +++++++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js index e18137085b..5a68d36bc1 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js @@ -1,5 +1,5 @@ angular.module("umbraco.directives") - .directive('gridRte', function (tinyMceService, stylesheetResource, angularHelper, assetsService, $q, $timeout) { + .directive('gridRte', function (tinyMceService, stylesheetResource, angularHelper, assetsService, $q, $timeout, eventsService) { return { scope: { uniqueId: '=', @@ -362,8 +362,16 @@ angular.module("umbraco.directives") // tinyMceEditor.fire('LoadContent', null); //}; + + var tabShownListener = eventsService.on("valTab.tabShown", function (e, args) { + //the tab has been shown, trigger the mceAutoResize (as it could have timed out before the tab was shown) + if (tinyMceEditor !== undefined && tinyMceEditor != null) { + tinyMceEditor.execCommand('mceAutoResize', false, null, null); + } + }); + //listen for formSubmitting event (the result is callback used to remove the event subscription) - var unsubscribe = scope.$on("formSubmitting", function () { + var formSubmittingListener = scope.$on("formSubmitting", function () { //TODO: Here we should parse out the macro rendered content so we can save on a lot of bytes in data xfer // we do parse it out on the server side but would be nice to do that on the client side before as well. scope.value = tinyMceEditor ? tinyMceEditor.getContent() : null; @@ -373,7 +381,8 @@ angular.module("umbraco.directives") // 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. scope.$on('$destroy', function () { - unsubscribe(); + formSubmittingListener(); + eventsService.unsubscribe(tabShownListener); if (tinyMceEditor !== undefined && tinyMceEditor != null) { tinyMceEditor.destroy() } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js index 8d1fc60083..c5d7cb6e58 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js @@ -6,15 +6,15 @@ * @description Used to show validation warnings for a tab to indicate that the tab content has validations errors in its data. * In order for this directive to work, the valFormManager directive must be placed on the containing form. **/ -function valTab() { +function valTab(eventsService) { return { require: ['^form', '^valFormManager'], restrict: "A", link: function (scope, element, attr, ctrs) { var valFormManager = ctrs[1]; - var tabId = "tab" + scope.tab.id; - scope.tabHasError = false; + var tabId = "tab" + scope.tab.id; + scope.tabHasError = false; //listen for form validation changes valFormManager.onValidationStatusChanged(function (evt, args) { @@ -31,8 +31,17 @@ function valTab() { scope.tabHasError = false; } }); + var tabShownFunc = function (e) { + var tabContent = element.closest(".umb-panel").find("#" + tabId); + eventsService.emit('valTab.tabShown', { originalEvent: e, tab: scope.tab, content: tabContent }); + }; + var anchorElement = element.find("a[data-toggle='tab']"); + anchorElement.on('shown.bs.tab', tabShownFunc); + scope.$on('$destroy', function () { + anchorElement.off('shown.bs.tab', tabShownFunc); + }); } }; } -angular.module('umbraco.directives.validation').directive("valTab", valTab); \ No newline at end of file +angular.module('umbraco.directives.validation').directive("valTab", valTab); From 20c215ef8ca6831b94c1aae08f83e31e9fad7b30 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Tue, 23 Oct 2018 16:52:57 +0200 Subject: [PATCH 04/16] #3211 - Add colorpicker prevalue editor (#3212) --- .../less/components/umb-color-swatches.less | 14 ++-- .../views/components/umb-color-swatches.html | 2 +- .../prevalueeditors/colorpicker.controller.js | 64 +++++++++++++++++++ .../views/prevalueeditors/colorpicker.html | 18 ++++++ 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js create mode 100644 src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.html diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less index 43e62780a3..26a735508e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less @@ -42,8 +42,8 @@ &.with-labels { .umb-color-box { - width: 120px; - height: 100%; + width: 130px; + height: auto; display: flex; flex-flow: row wrap; @@ -53,15 +53,21 @@ flex: 0 0 100%; max-width: 100%; min-height: 80px; - padding-top: 10px; + padding: 0; + + .check_circle { + margin: 15px auto; + } .umb-color-box__label { background: @white; font-size: 14px; display: flex; flex-flow: column wrap; - flex: 0 0 100%; + flex: 1 0 100%; + justify-content: flex-end; padding: 1px 5px; + min-height: 45px; max-width: 100%; margin-top: auto; margin-bottom: -3px; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html index 2bc7ce9622..3e92f5c18c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html @@ -6,7 +6,7 @@
      -
      {{ color.label }}
      +
      {{ color.label || color.value }}
      #{{ color.value }}
      diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js new file mode 100644 index 0000000000..c588893d7c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js @@ -0,0 +1,64 @@ +angular.module("umbraco").controller("Umbraco.PrevalueEditors.ColorPickerController", + function ($scope) { + + //setup the default config + var config = { + useLabel: false + }; + + //map the user config + angular.extend(config, $scope.model.config); + + //map back to the model + $scope.model.config = config; + + $scope.isConfigured = $scope.model.prevalues && _.keys($scope.model.prevalues).length > 0; + + $scope.model.items = []; + + // Make an array from the dictionary + var items = []; + + if (angular.isArray($scope.model.prevalues)) { + + for (var i in $scope.model.prevalues) { + var oldValue = $scope.model.prevalues[i]; + + if (!isValidHex(oldValue.value || oldValue)) + continue; + + if (oldValue.hasOwnProperty("value")) { + var hexCode = toFullHex(oldValue.value); + items.push({ + value: hexCode.substr(1, hexCode.length), + label: oldValue.label, + id: i + }); + } else { + var hexCode = toFullHex(oldValue); + items.push({ + value: hexCode.substr(1, hexCode.length), + label: oldValue, + id: i + }); + } + } + + // Now make the editor model the array + $scope.model.items = items; + } + + function toFullHex(hex) { + if (hex.length === 4 && hex.charAt(0) === "#") { + hex = "#" + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2) + hex.charAt(3) + hex.charAt(3); + } + return hex.toLowerCase(); + } + + function isValidHex(str) { + console.log("str", str); + console.log("test", /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(str)); + return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(str); + } + + }); diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.html new file mode 100644 index 0000000000..b5f77269b8 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.html @@ -0,0 +1,18 @@ +
      + +
      + You haven't defined any colors +
      + + + + + {{model.items | json}} +

      + {{model.value}} + + +
      From 9230de5383adc2c0bbd4af940d03abe887729c71 Mon Sep 17 00:00:00 2001 From: Jan Skovgaard Date: Tue, 23 Oct 2018 17:06:10 +0200 Subject: [PATCH 05/16] 3225 - Suggestion: Style the default browser radio button as a custom one to provide a nicer UI experience (#3226) --- src/Umbraco.Web.UI.Client/src/less/belle.less | 1 + .../components/umb-radiobuttons-list.less | 80 +++++++++++++++++++ .../radiobuttons/radiobuttons.html | 13 ++- 3 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/less/components/umb-radiobuttons-list.less diff --git a/src/Umbraco.Web.UI.Client/src/less/belle.less b/src/Umbraco.Web.UI.Client/src/less/belle.less index 7f10c3d4d7..9b9be85053 100644 --- a/src/Umbraco.Web.UI.Client/src/less/belle.less +++ b/src/Umbraco.Web.UI.Client/src/less/belle.less @@ -101,6 +101,7 @@ @import "components/umb-confirm-action.less"; @import "components/umb-keyboard-shortcuts-overview.less"; @import "components/umb-checkbox-list.less"; +@import "components/umb-radiobuttons-list.less"; @import "components/umb-locked-field.less"; @import "components/umb-tabs.less"; @import "components/umb-load-indicator.less"; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-radiobuttons-list.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-radiobuttons-list.less new file mode 100644 index 0000000000..2fe3487a8f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-radiobuttons-list.less @@ -0,0 +1,80 @@ +.umb-radiobuttons{ + &__label{ + position: relative; + padding: 0; + + &-text{ + margin: 0 0 0 32px; + position: relative; + top: 1px; + } + } + + &__input{ + position: absolute; + top: 0; + left: 0; + opacity: 0; + + &:focus ~ .umb-radiobuttons__state{ + box-shadow: 0 1px 3px fade(@black, 12%), 0 1px 2px fade(@black, 24%); + } + + &:focus:checked ~ .umb-radiobuttons__state{ + box-shadow: none; + } + + &:checked ~ .umb-radiobuttons__state{ + &:before{ + width: 100%; + height: 100%; + } + } + + &:checked ~ .umb-radiobuttons__state .umb-radiobuttons__icon{ + opacity: 1; + } + } + + &__state{ + display: flex; + flex-wrap: wrap; + border: 1px solid @gray-8; + border-radius: 100%; + width: 22px; + height: 22px; + position: relative; + + &:before{ + content: ""; + background: @green; + width: 0; + height: 0; + transition: .1s ease-out; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + border-radius: 100%; + } + } + + &__icon{ + color: @white; + text-align: center; + font-size: 15px; + opacity: 0; + transition: .3s ease-out; + + &:before{ + position: absolute; + top: 2px; + right: 0; + left: 0; + bottom: 0; + margin: auto; + } + } +} diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.html index cdb5a37ac8..7af6491641 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.html @@ -1,12 +1,17 @@ 
      • -
      -
      \ No newline at end of file +
      From 3e14da5e9db70b9fdf7c61209f71c94194874671 Mon Sep 17 00:00:00 2001 From: KimHolzmann Date: Tue, 23 Oct 2018 18:16:06 +0200 Subject: [PATCH 06/16] #2927 - Cannot use content templates in list views (#3173) --- .../listview/listview.controller.js | 44 +++++++++- .../propertyeditors/listview/listview.html | 82 +++++++++++++++---- 2 files changed, 109 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index 272627dc7b..b335354bc4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -58,6 +58,11 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie items: [] }; + $scope.createAllowedButtonSingle = false; + $scope.createAllowedButtonSingleWithBlueprints = false; + $scope.createAllowedButtonMultiWithBlueprints = false; + + //when this is null, we don't check permissions $scope.currentNodePermissions = null; @@ -598,7 +603,28 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie id = -1; } - $scope.listViewAllowedTypes = getContentTypesCallback(id); + //$scope.listViewAllowedTypes = getContentTypesCallback(id); + getContentTypesCallback(id).then(function (listViewAllowedTypes) { + var blueprints = false; + $scope.listViewAllowedTypes = listViewAllowedTypes; + + angular.forEach(listViewAllowedTypes, function (allowedType) { + angular.forEach(allowedType.blueprints, function (value, key) { + blueprints = true; + }); + }); + + if (listViewAllowedTypes.length === 1 && blueprints === false) { + $scope.createAllowedButtonSingle = true; + } + if (listViewAllowedTypes.length === 1 && blueprints === true) { + $scope.createAllowedButtonSingleWithBlueprints = true; + } + if (listViewAllowedTypes.length > 1) { + $scope.createAllowedButtonMultiWithBlueprints = true; + } + }); + $scope.contentId = id; $scope.isTrashed = id === "-20" || id === "-21"; @@ -650,6 +676,22 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie } } + + function createBlank(entityType,docTypeAlias) { + $location + .path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId) + .search("doctype=" + docTypeAlias + "&create=true"); + } + + function createFromBlueprint(entityType,docTypeAlias, blueprintId) { + $location + .path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId) + .search("doctype=" + docTypeAlias + "&create=true&blueprintId=" + blueprintId); + } + + $scope.createBlank = createBlank; + $scope.createFromBlueprint = createFromBlueprint; + //GO! initView(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html index 2683317dc1..cdd7e9cab2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html @@ -11,35 +11,85 @@ -
      + + + + + + - + + + + + + + + - + From ee3cbf08a254dfb7111caf7d65b2b6ce68cb6663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Kottal?= Date: Tue, 23 Oct 2018 22:43:46 +0200 Subject: [PATCH 07/16] #3215 Adds ability to create template from doctype editor (#3366) ### Prerequisites - [x] I have [created an issue](https://github.com/umbraco/Umbraco-CMS/issues) for the proposed changes in this PR, the link is: #3215 - [x] I have added steps to test this contribution in the description below ### Description I added a button for creating a new template in the template view of the doctype editor. The button uses the template resource to fetch a template scaffold, and then save a new template. After saving, the template gets selected as allowed, and if there is no default template selected, the new template will also be the default. https://i.imgur.com/KQbmjGH.gifv --- .../views/templates/templates.controller.js | 45 +++++++++++++++---- .../views/templates/templates.html | 5 +++ 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.controller.js index fe1b0f0e7e..3ce795b01e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.controller.js @@ -9,7 +9,7 @@ (function() { 'use strict'; - function TemplatesController($scope, entityResource, contentTypeHelper, $routeParams) { + function TemplatesController($scope, entityResource, contentTypeHelper, templateResource, $routeParams) { /* ----------- SCOPE VARIABLES ----------- */ @@ -21,24 +21,53 @@ /* ---------- INIT ---------- */ - init(); + init(function () { - function init() { + // update placeholder template information on new doc types + if (!$routeParams.notemplate && $scope.model.id === 0) { + vm.updateTemplatePlaceholder = true; + vm.availableTemplates = contentTypeHelper.insertTemplatePlaceholder(vm.availableTemplates); + } + }); + + function init(callback) { entityResource.getAll("Template").then(function(templates){ vm.availableTemplates = templates; - // update placeholder template information on new doc types - if (!$routeParams.notemplate && $scope.model.id === 0) { - vm.updateTemplatePlaceholder = true; - vm.availableTemplates = contentTypeHelper.insertTemplatePlaceholder(vm.availableTemplates); - } + callback(); }); } + vm.createTemplate = function () { + templateResource.getScaffold(-1).then(function (template) { + + template.alias = $scope.model.alias; + template.name = $scope.model.name; + + templateResource.save(template).then(function (savedTemplate) { + + init(function () { + + var newTemplate = vm.availableTemplates.filter(function (t) { return t.id === savedTemplate.id }); + if (newTemplate.length > 0) { + $scope.model.allowedTemplates.push(newTemplate[0]); + + if ($scope.model.defaultTemplate === null) { + $scope.model.defaultTemplate = newTemplate[0]; + } + } + + }); + + }); + + }); + } + } angular.module("umbraco").controller("Umbraco.Editors.DocumentType.TemplatesController", TemplatesController); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.html index a1385102e4..c02bb78de7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.html @@ -16,6 +16,11 @@ alias="model.alias" update-placeholder="vm.updateTemplatePlaceholder"> + +
      From 5f765967a6f9adf3b735c32fa8bac9f79558951d Mon Sep 17 00:00:00 2001 From: skoomasteve <43890114+skoomasteve@users.noreply.github.com> Date: Tue, 23 Oct 2018 15:47:14 -0500 Subject: [PATCH 08/16] Just a few spelling fixes. (#3405) --- build.bat | 2 +- src/umbraco.providers/members/UmbracoMembershipProvider.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.bat b/build.bat index 29a5e07a5a..3cab9283cf 100644 --- a/build.bat +++ b/build.bat @@ -9,6 +9,6 @@ IF ERRORLEVEL 1 ( :error ECHO. -ECHO Can not run build\build.ps1. +ECHO Cannot run build\build.ps1. ECHO If this is due to a SecurityError then please refer to BUILD.md for help! ECHO. diff --git a/src/umbraco.providers/members/UmbracoMembershipProvider.cs b/src/umbraco.providers/members/UmbracoMembershipProvider.cs index 648bf5a0d5..ff6895fe20 100644 --- a/src/umbraco.providers/members/UmbracoMembershipProvider.cs +++ b/src/umbraco.providers/members/UmbracoMembershipProvider.cs @@ -30,7 +30,7 @@ namespace umbraco.providers.members /// /// Custom Membership Provider for Umbraco Members (User authentication for Frontend applications NOT umbraco CMS) /// - [Obsolete("This has been superceded by Umbraco.Web.Security.Providers.MembersMembershipProvider")] + [Obsolete("This has been superseded by Umbraco.Web.Security.Providers.MembersMembershipProvider")] public class UmbracoMembershipProvider : UmbracoMembershipProviderBase, IUmbracoMemberTypeMembershipProvider { public UmbracoMembershipProvider() @@ -111,7 +111,7 @@ namespace umbraco.providers.members /// The name of the provider has a length of zero. public override void Initialize(string name, NameValueCollection config) { - // Intialize values from web.config + // Initialize values from web.config if (config == null) throw new ArgumentNullException("config"); if (string.IsNullOrEmpty(name)) name = Constants.Conventions.Member.UmbracoMemberProviderName; @@ -189,7 +189,7 @@ namespace umbraco.providers.members /// protected override bool PerformChangePassword(string username, string oldPassword, string newPassword) { - //NOTE: due to backwards compatibilty reasons, this provider doesn't care about the old password and + //NOTE: due to backwards compatibility reasons, this provider doesn't care about the old password and // allows simply setting the password manually so we don't really care about the old password. // This is allowed based on the overridden AllowManuallyChangingPassword option. From f69976852e6b8d19cfcfef44132004d7307b44df Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 23 Oct 2018 22:49:13 +0200 Subject: [PATCH 09/16] Disable move/copy button until a target node is selected (#3250) --- src/Umbraco.Web.UI.Client/src/views/content/copy.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/content/move.html | 6 +++--- src/Umbraco.Web.UI.Client/src/views/datatypes/move.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html | 4 ++-- .../src/views/media/media.move.controller.js | 4 +++- src/Umbraco.Web.UI.Client/src/views/media/move.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html | 4 ++-- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/copy.html b/src/Umbraco.Web.UI.Client/src/views/content/copy.html index e02855ea8f..62116a3e6e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/copy.html @@ -83,10 +83,10 @@
    diff --git a/src/Umbraco.Web.UI.Client/src/views/content/move.html b/src/Umbraco.Web.UI.Client/src/views/content/move.html index f7978e01a5..09116a2a6d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/move.html @@ -73,11 +73,11 @@ -
\ No newline at end of file +
diff --git a/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html b/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html index 0546cbff44..77746a5f42 100644 --- a/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html @@ -44,10 +44,10 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html index 97de821909..c9c4962da7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html @@ -44,10 +44,10 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html index 0af4cbfda7..58d897e91c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html @@ -44,10 +44,10 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js index 02cb3a363a..77e59cbbfa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js @@ -49,8 +49,10 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", $scope.dialogTreeEventHandler.bind("treeNodeExpanded", nodeExpandedHandler); $scope.move = function () { + $scope.busy = true; mediaResource.move({ parentId: $scope.target.id, id: node.id }) .then(function (path) { + $scope.busy = false; $scope.error = false; $scope.success = true; @@ -97,4 +99,4 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", $scope.miniListView = node; } - }); \ No newline at end of file + }); diff --git a/src/Umbraco.Web.UI.Client/src/views/media/move.html b/src/Umbraco.Web.UI.Client/src/views/media/move.html index b37b71b639..88c64f1992 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/move.html @@ -49,7 +49,7 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html b/src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html index 77f50358c3..ddb2559ba2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html @@ -44,10 +44,10 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html b/src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html index c240925a7d..5dbac09147 100644 --- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html @@ -44,10 +44,10 @@ From df1c4faeb96b5538ccae8cd8dbb6d2c7b14fad37 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 24 Oct 2018 08:26:13 +0200 Subject: [PATCH 10/16] Create doctype collections under the chosen parent --- .../Editors/ContentTypeController.cs | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index ac58b764f0..3f6df5c4b7 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -209,20 +209,6 @@ namespace Umbraco.Web.Editors public DocumentTypeCollectionDisplay PostCreateCollection(int parentId, string collectionName, bool collectionCreateTemplate, string collectionItemName, bool collectionItemCreateTemplate, string collectionIcon, string collectionItemIcon) { - var storeInContainer = false; - var allowUnderDocType = -1; - // check if it's a folder - if (Services.ContentTypeService.GetContentType(parentId) == null) - { - storeInContainer = true; - } else - { - // if it's not a container, we'll change the parentid to the root, - // and use the parent id as the doc type the collection should be allowed under - allowUnderDocType = parentId; - parentId = -1; - } - // create item doctype var itemDocType = new ContentType(parentId); itemDocType.Name = collectionItemName; @@ -260,20 +246,16 @@ namespace Umbraco.Web.Editors // save collection doctype Services.ContentTypeService.Save(collectionDocType); - // test if the parent id exist and then allow the collection underneath - if (storeInContainer == false && allowUnderDocType != -1) + // test if the parent exist and then allow the collection underneath + var parentCt = Services.ContentTypeService.GetContentType(parentId); + if (parentCt != null) { - var parentCt = Services.ContentTypeService.GetContentType(allowUnderDocType); - if (parentCt != null) - { - var allowedCts = parentCt.AllowedContentTypes.ToList(); - allowedCts.Add(new ContentTypeSort(collectionDocType.Id, allowedCts.Count())); - parentCt.AllowedContentTypes = allowedCts; - Services.ContentTypeService.Save(parentCt); - } + var allowedCts = parentCt.AllowedContentTypes.ToList(); + allowedCts.Add(new ContentTypeSort(collectionDocType.Id, allowedCts.Count())); + parentCt.AllowedContentTypes = allowedCts; + Services.ContentTypeService.Save(parentCt); } - return new DocumentTypeCollectionDisplay { CollectionId = collectionDocType.Id, From 05f5f2715baa519c6ee28ab7f7c9fe642913d3b7 Mon Sep 17 00:00:00 2001 From: Hemant Joshi Date: Wed, 24 Oct 2018 10:30:15 +0530 Subject: [PATCH 11/16] Added Correct Link of Getting Started with V8 --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6e421da5d7..6cbb764056 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,4 +1,4 @@ -_Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-CMS/blob/temp8/docs/CONTRIBUTING.md) to go to the v8 branch_ +_Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-CMS/blob/temp8/.github/V8_GETTING_STARTED.md) to go to the v8 branch_ # Contributing to Umbraco CMS 👍🎉 First off, thanks for taking the time to contribute! 🎉👍 From e7c55e6d702b728dc5618bb254c703f90a5dbda3 Mon Sep 17 00:00:00 2001 From: Joelvis Roman Date: Tue, 23 Oct 2018 23:07:35 +0100 Subject: [PATCH 12/16] Fix spelling mistake Fix spelling mistake --- .../src/common/services/navigation.service.js | 2 +- .../src/controllers/navigation.controller.js | 2 +- src/Umbraco.Web/Templates/TemplateRenderer.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index e617f62ed4..5b0706150c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -463,7 +463,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo //if it is not two parts long then this most likely means that it's a legacy action var js = action.metaData["jsAction"].replace("javascript:", ""); - //there's not really a different way to acheive this except for eval + //there's not really a different way to achieve this except for eval eval(js); } else { diff --git a/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js b/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js index 0c6bcf941a..e0330bd555 100644 --- a/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js +++ b/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js @@ -11,7 +11,7 @@ */ function NavigationController($scope, $rootScope, $location, $log, $routeParams, $timeout, appState, navigationService, keyboardService, dialogService, historyService, eventsService, sectionResource, angularHelper) { - //TODO: Need to think about this and an nicer way to acheive what this is doing. + //TODO: Need to think about this and an nicer way to achieve what this is doing. //the tree event handler i used to subscribe to the main tree click events $scope.treeEventHandler = $({}); navigationService.setupTreeEvents($scope.treeEventHandler); diff --git a/src/Umbraco.Web/Templates/TemplateRenderer.cs b/src/Umbraco.Web/Templates/TemplateRenderer.cs index d7d331d887..32b06880ec 100644 --- a/src/Umbraco.Web/Templates/TemplateRenderer.cs +++ b/src/Umbraco.Web/Templates/TemplateRenderer.cs @@ -169,7 +169,7 @@ namespace Umbraco.Web.Templates /// /// /// - /// To acheive this we temporarily change the output text writer of the current HttpResponse, then + /// To achieve this we temporarily change the output text writer of the current HttpResponse, then /// execute the controller via the handler which innevitably writes the result to the text writer /// that has been assigned to the response. Then we change the response textwriter back to the original /// before continuing . From fa2bd54f77147ce8afdaeb64855aa08fd0bf7652 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 24 Oct 2018 11:05:05 +0200 Subject: [PATCH 13/16] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6cbb764056..51f9b1dd68 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -72,7 +72,6 @@ The pull request team consists of a member of Umbraco HQ, [Sebastiaan](https://g - [Anders Bjerner](https://github.com/abjerner) - [Dave Woestenborghs](https://github.com/dawoe) - [Emma Burstow](https://github.com/emmaburstow) -- [Kyle Weems](https://github.com/cssquirrel) - [Poornima Nayar](https://github.com/poornimanayar) These wonderful volunteers will provide you with a first reply to your PR, review and test out your changes and might ask more questions. After that they'll let Umbraco HQ know if everything seems okay. From 82622695928e4b8b2fb38446dee8f6e512391b12 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Wed, 24 Oct 2018 11:51:07 +0200 Subject: [PATCH 14/16] Make sure indexes are created as unique when using .Unique() syntax builder (#3319) (#3363) --- .../DefinitionFactory.cs | 6 ++-- .../IndexDefinition.cs | 7 ++++- .../Syntax/Alter/Column/AlterColumnBuilder.cs | 9 ++++-- .../Syntax/Alter/Table/AlterTableBuilder.cs | 7 +++-- .../Create/Column/CreateColumnBuilder.cs | 7 +++-- .../Syntax/Create/Index/CreateIndexBuilder.cs | 28 ++++++------------- .../Syntax/Create/Table/CreateTableBuilder.cs | 7 +++-- .../SqlCeSyntaxProviderTests.cs | 4 +-- 8 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs index e3c35e01b4..5b38533c2b 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs @@ -158,9 +158,7 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions Name = indexName, IndexType = attribute.IndexType, ColumnName = columnName, - TableName = tableName, - IsClustered = attribute.IndexType == IndexTypes.Clustered, - IsUnique = attribute.IndexType == IndexTypes.UniqueNonClustered + TableName = tableName, }; if (string.IsNullOrEmpty(attribute.ForColumns) == false) @@ -174,4 +172,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions return definition; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs index ec46d35780..963e0a8ad6 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Umbraco.Core.Persistence.DatabaseAnnotations; @@ -14,9 +15,13 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public virtual string SchemaName { get; set; } public virtual string TableName { get; set; } public virtual string ColumnName { get; set; } + + [Obsolete("Use the IndexType property instead and set it to IndexTypes.UniqueNonClustered")] public virtual bool IsUnique { get; set; } + + [Obsolete("Use the IndexType property instead and set it to IndexTypes.Clustered")] public bool IsClustered { get; set; } public virtual ICollection Columns { get; set; } public IndexTypes IndexType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs index a7077f2d35..b2b2dfd17f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs @@ -1,4 +1,5 @@ using System.Data; +using Umbraco.Core.Persistence.DatabaseAnnotations; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions; using Umbraco.Core.Persistence.Migrations.Syntax.Expressions; @@ -139,10 +140,12 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column { Name = indexName, SchemaName = Expression.SchemaName, - TableName = Expression.TableName, - IsUnique = true + TableName = Expression.TableName, + IndexType = IndexTypes.UniqueNonClustered }); + + index.Index.Columns.Add(new IndexColumnDefinition { Name = Expression.Column.Name @@ -242,4 +245,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs index 7a6ab8d47a..ad72176089 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs @@ -1,4 +1,5 @@ using System.Data; +using Umbraco.Core.Persistence.DatabaseAnnotations; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions; using Umbraco.Core.Persistence.Migrations.Syntax.Expressions; @@ -124,8 +125,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Table { Name = indexName, SchemaName = Expression.SchemaName, - TableName = Expression.TableName, - IsUnique = true + TableName = Expression.TableName, + IndexType = IndexTypes.UniqueNonClustered }); index.Index.Columns.Add(new IndexColumnDefinition @@ -259,4 +260,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Table return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs index d004cd1176..dad72c54ef 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs @@ -1,4 +1,5 @@ using System.Data; +using Umbraco.Core.Persistence.DatabaseAnnotations; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Migrations.Syntax.Expressions; using Umbraco.Core.Persistence.SqlSyntax; @@ -114,8 +115,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Column { Name = indexName, SchemaName = Expression.SchemaName, - TableName = Expression.TableName, - IsUnique = true + TableName = Expression.TableName, + IndexType = IndexTypes.UniqueNonClustered }); index.Index.Columns.Add(new IndexColumnDefinition @@ -217,4 +218,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Column return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs index 4d1396ff79..2740014150 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs @@ -47,39 +47,27 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Index } ICreateIndexOnColumnSyntax ICreateIndexColumnOptionsSyntax.Unique() - { - Expression.Index.IsUnique = true; - //if it is Unique then it must be unique nonclustered and set the other flags - Expression.Index.IndexType = IndexTypes.UniqueNonClustered; - Expression.Index.IsClustered = false; + { + Expression.Index.IndexType = IndexTypes.UniqueNonClustered; return this; } public ICreateIndexOnColumnSyntax NonClustered() { - Expression.Index.IndexType = IndexTypes.NonClustered; - Expression.Index.IsClustered = false; - Expression.Index.IndexType = IndexTypes.NonClustered; - Expression.Index.IsUnique = false; + Expression.Index.IndexType = IndexTypes.NonClustered; return this; } public ICreateIndexOnColumnSyntax Clustered() - { - Expression.Index.IndexType = IndexTypes.Clustered; - Expression.Index.IsClustered = true; - //if it is clustered then we have to change the index type set the other flags - Expression.Index.IndexType = IndexTypes.Clustered; - Expression.Index.IsClustered = true; - Expression.Index.IsUnique = false; - return this; + { + Expression.Index.IndexType = IndexTypes.Clustered; + return this; } ICreateIndexOnColumnSyntax ICreateIndexOptionsSyntax.Unique() { - Expression.Index.IndexType = IndexTypes.UniqueNonClustered; - Expression.Index.IsUnique = true; + Expression.Index.IndexType = IndexTypes.UniqueNonClustered; return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs index 86760b71bc..5c19634321 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs @@ -1,4 +1,5 @@ using System.Data; +using Umbraco.Core.Persistence.DatabaseAnnotations; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Migrations.Syntax.Create.Expressions; using Umbraco.Core.Persistence.Migrations.Syntax.Expressions; @@ -164,8 +165,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table { Name = indexName, SchemaName = Expression.SchemaName, - TableName = Expression.TableName, - IsUnique = true + TableName = Expression.TableName, + IndexType = IndexTypes.UniqueNonClustered }); index.Index.Columns.Add(new IndexColumnDefinition @@ -267,4 +268,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs b/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs index 105b3d0c11..2043feafc4 100644 --- a/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs +++ b/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs @@ -89,7 +89,7 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine, var sqlSyntax = new SqlServerSyntaxProvider(); var indexDefinition = CreateIndexDefinition(); - indexDefinition.IsClustered = false; + indexDefinition.IndexType = IndexTypes.Clustered; var actual = sqlSyntax.Format(indexDefinition); Assert.AreEqual("CREATE CLUSTERED INDEX [IX_A] ON [TheTable] ([A])", actual); @@ -159,4 +159,4 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine, } } -} \ No newline at end of file +} From 0daf197066343212ea074ca70c6654543be6bcfe Mon Sep 17 00:00:00 2001 From: Jan van Helvoort Date: Thu, 25 Oct 2018 12:16:42 +0200 Subject: [PATCH 15/16] Unable to find suitable version for font-awesome (#3431) --- src/Umbraco.Web.UI.Client/bower.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/bower.json b/src/Umbraco.Web.UI.Client/bower.json index 5f94ecf629..6521ec301c 100644 --- a/src/Umbraco.Web.UI.Client/bower.json +++ b/src/Umbraco.Web.UI.Client/bower.json @@ -33,6 +33,9 @@ "clipboard": "1.7.1", "font-awesome": "~4.7" }, + "resolutions": { + "font-awesome": "~4.7" + }, "install": { "path": "lib-bower", "ignore": [ From db3ae6c27dd2b05ef887bf36ba4025e9971babf1 Mon Sep 17 00:00:00 2001 From: Shyam Jalan Date: Sat, 27 Oct 2018 11:10:24 +0530 Subject: [PATCH 16/16] Added hyphenation to README at desired places --- .github/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index e8a9889916..fc401ecfd2 100644 --- a/.github/README.md +++ b/.github/README.md @@ -30,7 +30,7 @@ As an Open Source platform, Umbraco is more than just a CMS. We are transparent ## Trying out Umbraco CMS -[Umbraco Cloud](https://umbraco.com/cloud) is the easiest and fastest way to use Umbraco yet with full support for all your custom .NET code and intergrations. You're up and running in less than a minute and your life will be made easier with automated upgrades and a built-in deployment engine. We offer a free 14 day trial, no credit card needed. +[Umbraco Cloud](https://umbraco.com/cloud) is the easiest and fastest way to use Umbraco yet with full support for all your custom .NET code and intergrations. You're up and running in less than a minute and your life will be made easier with automated upgrades and a built-in deployment engine. We offer a free 14-day trial, no credit card needed. If you want to DIY you can [download Umbraco](https://our.umbraco.com/download) either as a ZIP file or via NuGet. It's the same version of Umbraco CMS that powers Umbraco Cloud, but you'll need to find a place to host yourself and handling deployments and upgrades is all down to you. @@ -47,4 +47,4 @@ Umbraco is contribution focused and community driven. If you want to contribute Another way you can contribute to Umbraco is by providing issue reports. For information on how to submit an issue report refer to our [online guide for reporting issues](https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/.github/CONTRIBUTING.md). You can comment and report issues on the [github issue tracker](https://github.com/umbraco/Umbraco-CMS/issues). -Since [September 2018](https://umbraco.com/blog/a-second-take-on-umbraco-issue-tracker-hello-github-issues/) the old issue tracker is in read only mode, but can still be found at [http://issues.umbraco.org](http://issues.umbraco.org). +Since [September 2018](https://umbraco.com/blog/a-second-take-on-umbraco-issue-tracker-hello-github-issues/) the old issue tracker is in read-only mode, but can still be found at [http://issues.umbraco.org](http://issues.umbraco.org).