Skip to content

Commit 5ddf6a1

Browse files
authored
Merge pull request #11452 from umbraco/v9/feature/v8_merge_22_10_2021
Merge v8 into v9 22/10/2021
2 parents 884ce98 + 222a40a commit 5ddf6a1

File tree

32 files changed

+3902
-2175
lines changed

32 files changed

+3902
-2175
lines changed

src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -673,19 +673,6 @@ protected override void PersistUpdatedItem(IContent entity)
673673
edited = true;
674674
}
675675

676-
// To establish the new value of "edited" we compare all properties publishedValue to editedValue and look
677-
// for differences.
678-
//
679-
// If we SaveAndPublish but the publish fails (e.g. already scheduled for release)
680-
// we have lost the publishedValue on IContent (in memory vs database) so we cannot correctly make that comparison.
681-
//
682-
// This is a slight change to behaviour, historically a publish, followed by change & save, followed by undo change & save
683-
// would change edited back to false.
684-
if (!publishing && editedSnapshot)
685-
{
686-
edited = true;
687-
}
688-
689676
if (entity.ContentType.VariesByCulture())
690677
{
691678
// names also impact 'edited'

src/Umbraco.Web.BackOffice/Controllers/ContentTypeControllerBase.cs

Lines changed: 159 additions & 76 deletions
Large diffs are not rendered by default.

src/Umbraco.Web.BackOffice/Controllers/EntityController.cs

Lines changed: 429 additions & 324 deletions
Large diffs are not rendered by default.

src/Umbraco.Web.BackOffice/Controllers/MemberGroupController.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@
1212
using Umbraco.Cms.Web.Common.Attributes;
1313
using Umbraco.Cms.Web.Common.Authorization;
1414
using Umbraco.Extensions;
15-
using Constants = Umbraco.Cms.Core.Constants;
1615

1716
namespace Umbraco.Cms.Web.BackOffice.Controllers
1817
{
1918
/// <summary>
20-
/// An API controller used for dealing with member groups
19+
/// An API controller used for dealing with member groups
2120
/// </summary>
2221
[PluginController(Constants.Web.Mvc.BackOfficeApiArea)]
2322
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberGroups)]
2423
[ParameterSwapControllerActionSelector(nameof(GetById), "id", typeof(int), typeof(Guid), typeof(Udi))]
2524
public class MemberGroupController : UmbracoAuthorizedJsonController
2625
{
26+
private readonly ILocalizedTextService _localizedTextService;
2727
private readonly IMemberGroupService _memberGroupService;
2828
private readonly IUmbracoMapper _umbracoMapper;
29-
private readonly ILocalizedTextService _localizedTextService;
3029

3130
public MemberGroupController(
3231
IMemberGroupService memberGroupService,
@@ -35,11 +34,12 @@ public MemberGroupController(
3534
{
3635
_memberGroupService = memberGroupService ?? throw new ArgumentNullException(nameof(memberGroupService));
3736
_umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));
38-
_localizedTextService = localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
37+
_localizedTextService =
38+
localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
3939
}
4040

4141
/// <summary>
42-
/// Gets the member group json for the member group id
42+
/// Gets the member group json for the member group id
4343
/// </summary>
4444
/// <param name="id"></param>
4545
/// <returns></returns>
@@ -56,7 +56,7 @@ public ActionResult<MemberGroupDisplay> GetById(int id)
5656
}
5757

5858
/// <summary>
59-
/// Gets the member group json for the member group guid
59+
/// Gets the member group json for the member group guid
6060
/// </summary>
6161
/// <param name="id"></param>
6262
/// <returns></returns>
@@ -72,7 +72,7 @@ public ActionResult<MemberGroupDisplay> GetById(Guid id)
7272
}
7373

7474
/// <summary>
75-
/// Gets the member group json for the member group udi
75+
/// Gets the member group json for the member group udi
7676
/// </summary>
7777
/// <param name="id"></param>
7878
/// <returns></returns>
@@ -100,7 +100,7 @@ public IEnumerable<MemberGroupDisplay> GetByIds([FromQuery] int[] ids)
100100
[HttpPost]
101101
public IActionResult DeleteById(int id)
102102
{
103-
var memberGroup = _memberGroupService.GetById(id);
103+
IMemberGroup memberGroup = _memberGroupService.GetById(id);
104104
if (memberGroup == null)
105105
{
106106
return NotFound();
@@ -112,7 +112,7 @@ public IActionResult DeleteById(int id)
112112

113113
public IEnumerable<MemberGroupDisplay> GetAllGroups()
114114
=> _memberGroupService.GetAll()
115-
.Select(_umbracoMapper.Map<IMemberGroup, MemberGroupDisplay>);
115+
.Select(_umbracoMapper.Map<IMemberGroup, MemberGroupDisplay>);
116116

117117
public MemberGroupDisplay GetEmpty()
118118
{
@@ -123,18 +123,21 @@ public MemberGroupDisplay GetEmpty()
123123
public bool IsMemberGroupNameUnique(int id, string oldName, string newName)
124124
{
125125
if (newName == oldName)
126+
{
126127
return true; // name hasn't changed
128+
}
127129

128-
var memberGroup = _memberGroupService.GetByName(newName);
130+
IMemberGroup memberGroup = _memberGroupService.GetByName(newName);
129131
if (memberGroup == null)
132+
{
130133
return true; // no member group found
134+
}
131135

132136
return memberGroup.Id == id;
133137
}
134138

135139
public ActionResult<MemberGroupDisplay> PostSave(MemberGroupSave saveModel)
136140
{
137-
138141
var id = int.Parse(saveModel.Id.ToString(), CultureInfo.InvariantCulture);
139142
IMemberGroup memberGroup = id > 0 ? _memberGroupService.GetById(id) : new MemberGroup();
140143
if (memberGroup == null)
@@ -157,7 +160,7 @@ public ActionResult<MemberGroupDisplay> PostSave(MemberGroupSave saveModel)
157160
}
158161
else
159162
{
160-
var display = _umbracoMapper.Map<IMemberGroup, MemberGroupDisplay>(memberGroup);
163+
MemberGroupDisplay display = _umbracoMapper.Map<IMemberGroup, MemberGroupDisplay>(memberGroup);
161164
display.AddErrorNotification(
162165
_localizedTextService.Localize("speechBubbles", "memberGroupNameDuplicate"),
163166
string.Empty);

src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbfocuslock.directive.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
// List of elements that can be focusable within the focus lock
3636
var focusableElementsSelector = '[role="button"], a[href]:not([disabled]):not(.ng-hide), button:not([disabled]):not(.ng-hide), textarea:not([disabled]):not(.ng-hide), input:not([disabled]):not(.ng-hide), select:not([disabled]):not(.ng-hide)';
3737

38-
// Grab the body element so we can add the tabbing class on it when needed
39-
var bodyElement = document.querySelector('body');
40-
4138
function getDomNodes(){
4239
infiniteEditorsWrapper = document.querySelector('.umb-editors');
4340
if(infiniteEditorsWrapper) {
@@ -47,7 +44,10 @@
4744

4845
function getFocusableElements(targetElm) {
4946
var elm = targetElm ? targetElm : target;
50-
focusableElements = elm.querySelectorAll(focusableElementsSelector);
47+
48+
// Filter out elements that are children of parents with the .ng-hide class
49+
focusableElements = [...elm.querySelectorAll(focusableElementsSelector)].filter(elm => !elm.closest('.ng-hide'));
50+
5151
// Set first and last focusable elements
5252
firstFocusableElement = focusableElements[0];
5353
lastFocusableElement = focusableElements[focusableElements.length - 1];

src/Umbraco.Web.UI.Client/src/common/directives/components/umbchildselector.directive.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,38 @@ Use this directive to render a ui component for selecting child items to a paren
118118
(function() {
119119
'use strict';
120120

121-
function ChildSelectorDirective() {
121+
function ChildSelectorDirective(overlayService, localizationService) {
122122

123123
function link(scope, el, attr, ctrl) {
124124

125125
var eventBindings = [];
126126
scope.dialogModel = {};
127127
scope.showDialog = false;
128128

129-
scope.removeChild = (selectedChild, $index) => {
130-
if (scope.onRemove) {
131-
scope.onRemove(selectedChild, $index);
132-
}
129+
scope.removeChild = (selectedChild, $index, event) => {
130+
const dialog = {
131+
view: "views/components/overlays/umb-template-remove-confirm.html",
132+
layout: selectedChild,
133+
submitButtonLabelKey: "defaultdialogs_yesRemove",
134+
submitButtonStyle: "danger",
135+
submit: function () {
136+
if(scope.onRemove) {
137+
scope.onRemove(selectedChild, $index);
138+
overlayService.close();
139+
}
140+
},
141+
close: function () {
142+
overlayService.close();
143+
}
144+
};
145+
146+
localizationService.localize("general_delete").then(value => {
147+
dialog.title = value;
148+
overlayService.open(dialog);
149+
});
150+
151+
event.preventDefault();
152+
event.stopPropagation();
133153
};
134154

135155
scope.addChild = $event => {

src/Umbraco.Web.UI.Client/src/common/services/editor.service.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,14 @@ When building a custom infinite editor view you can use the same components as a
214214
* Method to tell editors that they are begin blurred.
215215
*/
216216
function blur() {
217-
218-
/* keyboard shortcuts will be overwritten by the new infinite editor
217+
if (isEnabled === true) {
218+
/* keyboard shortcuts will be overwritten by the new infinite editor
219219
so we need to store the shortcuts for the current editor so they can be rebound
220220
when the infinite editor closes
221221
*/
222-
unbindKeyboardShortcuts();
223-
isEnabled = false;
222+
unbindKeyboardShortcuts();
223+
isEnabled = false;
224+
}
224225
}
225226
/**
226227
* @ngdoc method

src/Umbraco.Web.UI.Client/src/less/gridview.less

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,6 @@
621621
}
622622

623623
.preview-rows {
624-
625624
display: inline-block;
626625
position: relative;
627626
box-sizing: border-box;
@@ -675,9 +674,9 @@
675674
}
676675

677676
.preview-rows.columns {
678-
min-height: 18px;
677+
min-height: 16px;
679678
line-height: 11px;
680-
padding: 1px;
679+
padding: 0 1px 1px 1px;
681680

682681
&.prevalues-rows {
683682
min-height: 30px;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div>
2+
3+
<div ng-if="model.layout" class="umb-alert umb-alert--warning mb2">
4+
<localize key="contentTypeEditor_removeChildNode">You are removing the child node</localize> <strong>{{model.layout.name}}</strong>.
5+
</div>
6+
7+
<p>
8+
<localize key="contentTypeEditor_removeChildNodeWarning">
9+
Removing a child node will limit the editors options to create different content types beneath a node.
10+
</localize>
11+
</p>
12+
13+
<localize key="defaultdialogs_confirmdelete">Are you sure you want to remove</localize>?
14+
15+
</div>

src/Umbraco.Web.UI.Client/src/views/components/umb-child-selector.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<span class="umb-child-selector__child-name">{{selectedChild.name}}</span>
2525
</div>
2626
<div class="umb-child-selector__child-actions">
27-
<button type="button" class="umb-child-selector__child-remove" ng-click="removeChild(selectedChild, $index)">
28-
<umb-icon icon="icon-trash"></umb-icon>
27+
<button type="button" class="umb-node-preview__action umb-node-preview__action--red umb-child-selector__child-remove" ng-click="removeChild(selectedChild, $index, $event)">
28+
<localize key="general_remove">Remove</localize>
2929
</button>
3030
</div>
3131
</div>

0 commit comments

Comments
 (0)