Merge remote-tracking branch 'origin/v8/dev' into netcore/dev

# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/ConfigsExtensions.cs
#	src/Umbraco.Core/Configuration/GlobalSettings.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/Dashboards/ContentDashboard.cs
#	src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs
This commit is contained in:
Bjarke Berg
2021-04-06 07:53:17 +02:00
10 changed files with 57 additions and 71 deletions

View File

@@ -1,4 +1,5 @@
using Umbraco.Cms.Core.Composing;
using System;
using Umbraco.Cms.Core.Composing;
namespace Umbraco.Cms.Core.Dashboards
{
@@ -7,21 +8,10 @@ namespace Umbraco.Cms.Core.Dashboards
{
public string Alias => "contentIntro";
public string[] Sections => new [] { "content" };
public string[] Sections => new[] { "content" };
public string View => "views/dashboard/default/startupdashboardintro.html";
public IAccessRule[] AccessRules
{
get
{
var rules = new IAccessRule[]
{
new AccessRule {Type = AccessRuleType.Deny, Value = Constants.Security.TranslatorGroupAlias},
new AccessRule {Type = AccessRuleType.Grant, Value = Constants.Security.AdminGroupAlias}
};
return rules;
}
}
public IAccessRule[] AccessRules { get; } = Array.Empty<IAccessRule>();
}
}

View File

@@ -202,8 +202,8 @@ namespace Umbraco.Cms.Core.PropertyEditors
_richTextPropertyValueEditor.GetReferences(x.Value)))
yield return umbracoEntityReference;
foreach (var umbracoEntityReference in mediaValues.Where(x=>x.Value.HasValues).SelectMany(x =>
_mediaPickerPropertyValueEditor.GetReferences(x.Value["udi"])))
foreach (var umbracoEntityReference in mediaValues.Where(x=>x.Value.HasValues)
.SelectMany(x => _mediaPickerPropertyValueEditor.GetReferences(x.Value["udi"])))
yield return umbracoEntityReference;
}
}

View File

@@ -71,8 +71,9 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
var allowedSections = string.Join(",", user.AllowedSections);
var language = user.Language;
var version = _umbracoVersion.SemanticVersion.ToSemanticString();
var isAdmin = user.IsAdmin();
var url = string.Format(baseUrl + "{0}?section={0}&allowed={1}&lang={2}&version={3}", section, allowedSections, language, version);
var url = string.Format(baseUrl + "{0}?section={0}&allowed={1}&lang={2}&version={3}&admin={4}", section, allowedSections, language, version, isAdmin);
var key = "umbraco-dynamic-dashboard-" + language + allowedSections.Replace(",", "-") + section;
var content = _appCaches.RuntimeCache.GetCacheItem<JObject>(key);

View File

@@ -29,10 +29,6 @@
var defaultFocusedElement = getAutoFocusElement(focusableElements);
var firstFocusableElement = focusableElements[0];
var lastFocusableElement = focusableElements[focusableElements.length -1];
// We need to add the tabbing-active class in order to highlight the focused button since the default style is
// outline: none; set in the stylesheet specifically
bodyElement.classList.add('tabbing-active');
// If there is no default focused element put focus on the first focusable element in the nodelist
if(defaultFocusedElement === null ){

View File

@@ -572,13 +572,15 @@
* Method for opening an item in a list view for editing.
*
* @param {Object} item The item to edit
* @param {Object} scope The scope with options
*/
function editItem(item, scope) {
if (!item.editPath) {
return;
}
if (scope.options.useInfiniteEditor)
if (scope && scope.options && scope.options.useInfiniteEditor)
{
var editorModel = {
id: item.id,

View File

@@ -15,6 +15,7 @@
right: 0;
border-radius: 3px;
box-shadow: 0 0 2px 0px @ui-outline, inset 0 0 2px 2px @ui-outline;
pointer-events: none;
}
}

View File

@@ -308,7 +308,14 @@ select[size] {
input[type="file"],
input[type="radio"],
input[type="checkbox"] {
.umb-outline();
&:focus {
border-color: @inputBorderFocus;
outline: 0;
.tabbing-active & {
outline: 2px solid @ui-outline;
}
}
}

View File

@@ -1,8 +1,8 @@
(function () {
"use strict";
function UserPickerController($scope, usersResource, localizationService, eventsService) {
function UserPickerController($scope, entityResource, localizationService, eventsService) {
var vm = this;
vm.users = [];
@@ -102,17 +102,9 @@
vm.loading = true;
// Get users
usersResource.getPagedResults(vm.usersOptions).then(function (users) {
vm.users = users.items;
vm.usersOptions.pageNumber = users.pageNumber;
vm.usersOptions.pageSize = users.pageSize;
vm.usersOptions.totalItems = users.totalItems;
vm.usersOptions.totalPages = users.totalPages;
entityResource.getAll("User").then(function (data) {
vm.users = data;
preSelect($scope.model.selection, vm.users);
vm.loading = false;
});
}

View File

@@ -1,9 +1,9 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.Grid.MediaController",
function ($scope, userService, editorService, localizationService) {
$scope.thumbnailUrl = getThumbnailUrl();
function ($scope, userService, editorService, localizationService) {
$scope.thumbnailUrl = getThumbnailUrl();
if (!$scope.model.config.startNodeId) {
if ($scope.model.config.ignoreUserStartNodes === true) {
$scope.model.config.startNodeId = -1;
@@ -29,16 +29,16 @@ angular.module("umbraco")
onlyImages: true,
dataTypeKey: $scope.model.dataTypeKey,
submit: model => {
updateControlValue(model.selection[0]);
updateControlValue(model.selection[0]);
editorService.close();
},
close: () => editorService.close()
close: () => editorService.close()
};
editorService.mediaPicker(mediaPicker);
};
$scope.editImage = function() {
$scope.editImage = function() {
const mediaCropDetailsConfig = {
size: 'small',
@@ -47,17 +47,17 @@ angular.module("umbraco")
updateControlValue(model.target);
editorService.close();
},
close: () => editorService.close()
close: () => editorService.close()
};
localizationService.localize('defaultdialogs_editSelectedMedia').then(value => {
mediaCropDetailsConfig.title = value;
editorService.mediaCropDetails(mediaCropDetailsConfig);
});
});
}
/**
*
*
*/
function getThumbnailUrl() {
@@ -94,19 +94,15 @@ angular.module("umbraco")
return url;
}
return null;
}
/**
*
* @param {object} selectedImage
*
* @param {object} selectedImage
*/
function updateControlValue(selectedImage) {
const doGetThumbnail = $scope.control.value.focalPoint !== selectedImage.focalPoint
|| $scope.control.value.image !== selectedImage.image;
// we could apply selectedImage directly to $scope.control.value,
// but this allows excluding fields in future if needed
$scope.control.value = {
@@ -118,10 +114,6 @@ angular.module("umbraco")
caption: selectedImage.caption,
altText: selectedImage.altText
};
if (doGetThumbnail) {
$scope.thumbnailUrl = getThumbnailUrl();
}
}
$scope.thumbnailUrl = getThumbnailUrl();
}
});

View File

@@ -1,4 +1,4 @@
function userPickerController($scope, usersResource , iconHelper, editorService, overlayService){
function userPickerController($scope, iconHelper, editorService, overlayService, entityResource) {
function trim(str, chr) {
var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^' + chr + '+|' + chr + '+$', 'g');
@@ -92,17 +92,22 @@ function userPickerController($scope, usersResource , iconHelper, editorService,
unsubscribe();
});
//load user data
var modelIds = $scope.model.value ? $scope.model.value.split(',') : [];
// entityResource.getByIds doesn't support "User" and we would like to show avatars in umb-user-preview as well.
usersResource.getUsers(modelIds).then(function (data) {
_.each(data, function (item, i) {
// set default icon if it's missing
item.icon = item.icon ? iconHelper.convertFromLegacyIcon(item.icon) : "icon-user";
$scope.renderModel.push({ name: item.name, id: item.id, udi: item.udi, icon: item.icon, avatars: item.avatars });
});
});
//load user data - split to an array of ints (map)
const modelIds = $scope.model.value ? $scope.model.value.split(',').map(x => +x) : [];
if(modelIds.length !== 0) {
entityResource.getAll("User").then(function (users) {
const filteredUsers = users.filter(user => modelIds.indexOf(user.id) !== -1);
filteredUsers.forEach(item => {
$scope.renderModel.push({
name: item.name,
id: item.id,
udi: item.udi,
icon: item.icon = item.icon ? iconHelper.convertFromLegacyIcon(item.icon) : "icon-user",
avatars: item.avatars
});
});
});
}
}