Fixes #8004 umbnodepreview setting contentType alias to null (#8109)

This commit is contained in:
Enkel Media
2020-05-27 14:39:03 +02:00
committed by GitHub
parent 30900c59ae
commit f2ad7bb631
4 changed files with 20 additions and 10 deletions

View File

@@ -16,10 +16,15 @@ angular.module("umbraco.directives")
replace: true,
templateUrl: 'views/components/property/umb-property.html',
link: function (scope) {
userService.getCurrentUser().then(function (u) {
var isAdmin = u.userGroups.indexOf('admin') !== -1;
scope.propertyAlias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? scope.property.alias : null;
});
scope.controlLabelTitle = null;
if(Umbraco.Sys.ServerVariables.isDebuggingEnabled) {
userService.getCurrentUser().then(function (u) {
if(u.allowedSections.indexOf("settings") !== -1 ? true : false) {
scope.controlLabelTitle = scope.property.alias;
}
});
}
},
//Define a controller for this directive to expose APIs to other directives
controller: function ($scope) {

View File

@@ -102,10 +102,15 @@
if (!scope.editLabelKey) {
scope.editLabelKey = "general_edit";
}
userService.getCurrentUser().then(function (u) {
var isAdmin = u.userGroups.indexOf('admin') !== -1;
scope.alias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? scope.alias : null;
});
scope.nodeNameTitle = null;
if(Umbraco.Sys.ServerVariables.isDebuggingEnabled) {
userService.getCurrentUser().then(function (u) {
if (u.allowedSections.indexOf("settings") !== -1 ? true : false) {
scope.nodeNameTitle = scope.alias;
}
});
}
}
var directive = {

View File

@@ -11,7 +11,7 @@
<localize key="contentTypeEditor_inheritedFrom"></localize> {{inheritsFrom}}
</small>
<label class="control-label" for="{{property.alias}}" ng-attr-title="{{propertyAlias}}">
<label class="control-label" for="{{property.alias}}" ng-attr-title="{{controlLabelTitle}}">
{{property.label}}

View File

@@ -3,7 +3,7 @@
<i ng-if="icon" class="umb-node-preview__icon {{ icon }}" aria-hidden="true"></i>
<div class="umb-node-preview__content">
<div class="umb-node-preview__name" ng-attr-title="{{alias}}">{{ name }}</div>
<div class="umb-node-preview__name" ng-attr-title="{{nodeNameTitle}}">{{ name }}</div>
<div class="umb-node-preview__description" ng-if="description">{{ description }}</div>
<div class="umb-user-group-preview__permissions" ng-if="permissions">