Fallback value when setttings element type doesn't exists as it can have reference, but no available element type
This commit is contained in:
committed by
Matthew-Wise
parent
79d117026f
commit
c8efc30654
@@ -77,7 +77,7 @@
|
||||
vm.elementTypes = elementTypes;
|
||||
|
||||
vm.contentPreview = vm.getElementTypeByKey(vm.block.contentElementTypeKey);
|
||||
vm.settingsPreview = vm.getElementTypeByKey(vm.block.settingsElementTypeKey);
|
||||
vm.settingsPreview = vm.getElementTypeByKey(vm.block.settingsElementTypeKey) || { icon: "icon-science", name: "(Unavailable ElementType)" };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
vm.requestRemoveSettingsForBlock = function(block) {
|
||||
localizationService.localizeMany(["general_remove", "defaultdialogs_confirmremoveusageof"]).then(function (data) {
|
||||
|
||||
var settingsElementType = vm.getElementTypeByKey(block.settingsElementTypeKey);
|
||||
const settingsElementType = vm.getElementTypeByKey(block.settingsElementTypeKey);
|
||||
|
||||
overlayService.confirmRemove({
|
||||
title: data[0],
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
<label class="control-label"><localize key="blockEditor_labelContentElementType">Content ElementType</localize></label>
|
||||
<div class="controls">
|
||||
<div class="__settings-input --hasValue" ng-if="vm.block.contentElementTypeKey !== null" >
|
||||
<umb-node-preview icon="vm.contentPreview.icon" name="vm.contentPreview.name" alias="vm.contentPreview.alias"></umb-node-preview>
|
||||
<umb-node-preview
|
||||
icon="vm.contentPreview.icon"
|
||||
name="vm.contentPreview.name"
|
||||
alias="vm.contentPreview.alias">
|
||||
</umb-node-preview>
|
||||
<div class="__control-actions">
|
||||
<button type="button" class="btn-reset __control-actions-btn --open umb-outline" ng-click="vm.openElementType(vm.block.contentElementTypeKey)">
|
||||
<umb-icon icon="icon-edit" class="icon"></umb-icon>
|
||||
@@ -58,9 +62,13 @@
|
||||
<label class="control-label"><localize key="blockEditor_labelSettingsElementType">Settings Element Type</localize></label>
|
||||
<div class="controls">
|
||||
<div class="__settings-input --hasValue" ng-if="vm.block.settingsElementTypeKey !== null">
|
||||
<umb-node-preview icon="vm.settingsPreview.icon" name="vm.settingsPreview.name" alias="vm.settingsPreview.alias"></umb-node-preview>
|
||||
<umb-node-preview
|
||||
icon="vm.settingsPreview.icon"
|
||||
name="vm.settingsPreview.name"
|
||||
alias="vm.settingsPreview.alias">
|
||||
</umb-node-preview>
|
||||
<div class="__control-actions">
|
||||
<button type="button" class="btn-reset __control-actions-btn --open umb-outline" ng-click="vm.openElementType(vm.block.settingsElementTypeKey)">
|
||||
<button type="button" class="btn-reset __control-actions-btn --open umb-outline" ng-click="vm.openElementType(vm.block.settingsElementTypeKey)" ng-if="vm.settingsPreview && vm.settingsPreview.alias">
|
||||
<umb-icon icon="icon-edit" class="icon"></umb-icon>
|
||||
</button>
|
||||
<button type="button" class="btn-reset __control-actions-btn --remove umb-outline" ng-click="vm.requestRemoveSettingsForBlock(vm.block)">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
vm.elementTypes = elementTypes;
|
||||
|
||||
vm.contentPreview = vm.getElementTypeByKey(vm.block.contentElementTypeKey);
|
||||
vm.settingsPreview = vm.getElementTypeByKey(vm.block.settingsElementTypeKey);
|
||||
vm.settingsPreview = vm.getElementTypeByKey(vm.block.settingsElementTypeKey) || { icon: "icon-science", name: "(Unavailable ElementType)" };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
vm.requestRemoveSettingsForBlock = function(block) {
|
||||
localizationService.localizeMany(["general_remove", "defaultdialogs_confirmremoveusageof"]).then(function (data) {
|
||||
|
||||
var settingsElementType = vm.getElementTypeByKey(block.settingsElementTypeKey);
|
||||
const settingsElementType = vm.getElementTypeByKey(block.settingsElementTypeKey);
|
||||
|
||||
overlayService.confirmRemove({
|
||||
title: data[0],
|
||||
|
||||
@@ -110,7 +110,11 @@
|
||||
<label class="control-label" for="blockContentElemenType"><localize key="blockEditor_labelContentElementType">Content ElementType</localize></label>
|
||||
<div class="controls">
|
||||
<div class="__settings-input --hasValue" ng-if="vm.block.contentElementTypeKey !== null" >
|
||||
<umb-node-preview icon="vm.contentPreview.icon" name="vm.contentPreview.name" alias="vm.contentPreview.alias"></umb-node-preview>
|
||||
<umb-node-preview
|
||||
icon="vm.contentPreview.icon"
|
||||
name="vm.contentPreview.name"
|
||||
alias="vm.contentPreview.alias">
|
||||
</umb-node-preview>
|
||||
<div class="__control-actions">
|
||||
<button type="button" id="blockContentElemenType" class="btn-reset __control-actions-btn --open umb-outline" ng-click="vm.openElementType(vm.block.contentElementTypeKey)">
|
||||
<umb-icon icon="icon-edit" class="icon"></umb-icon>
|
||||
@@ -127,9 +131,13 @@
|
||||
<label class="control-label" for="blockSettingsElemenType"><localize key="blockEditor_labelSettingsElementType">Settings Element Type</localize></label>
|
||||
<div class="controls">
|
||||
<div class="__settings-input --hasValue" ng-if="vm.block.settingsElementTypeKey !== null">
|
||||
<umb-node-preview icon="vm.settingsPreview.icon" name="vm.settingsPreview.name" alias="vm.settingsPreview.alias"></umb-node-preview>
|
||||
<umb-node-preview
|
||||
icon="vm.settingsPreview.icon"
|
||||
name="vm.settingsPreview.name"
|
||||
alias="vm.settingsPreview.alias">
|
||||
</umb-node-preview>
|
||||
<div class="__control-actions">
|
||||
<button type="button" class="btn-reset __control-actions-btn --open umb-outline" ng-click="vm.openElementType(vm.block.settingsElementTypeKey)">
|
||||
<button type="button" class="btn-reset __control-actions-btn --open umb-outline" ng-click="vm.openElementType(vm.block.settingsElementTypeKey)" ng-if="vm.settingsPreview && vm.settingsPreview.alias">
|
||||
<umb-icon icon="icon-edit" class="icon"></umb-icon>
|
||||
</button>
|
||||
<button type="button" class="btn-reset __control-actions-btn --remove umb-outline" ng-click="vm.requestRemoveSettingsForBlock(vm.block)">
|
||||
|
||||
Reference in New Issue
Block a user