Fixed 10144: Prevalue alias not set (#10163)

* Fixed 10144: Prevalue alias not set

* Remove console.log

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
This commit is contained in:
patrickdemooij9
2021-05-28 01:14:07 +02:00
committed by GitHub
parent 7d25439b09
commit 3440cbbac9
3 changed files with 6 additions and 15 deletions

View File

@@ -18,7 +18,8 @@ function dataTypeHelper() {
description: preVals[i].description,
label: preVals[i].label,
view: preVals[i].view,
value: preVals[i].value
value: preVals[i].value,
config: preVals[i].config
});
}
@@ -52,4 +53,4 @@ function dataTypeHelper() {
return dataTypeHelperService;
}
angular.module('umbraco.services').factory('dataTypeHelper', dataTypeHelper);
angular.module('umbraco.services').factory('dataTypeHelper', dataTypeHelper);

View File

@@ -76,7 +76,7 @@
// get pre values
dataTypeResource.getPreValues(newDataType.selectedEditor).then(function(preValues) {
newDataType.preValues = preValues;
newDataType.preValues = dataTypeHelper.createPreValueProps(preValues);
vm.dataType = newDataType;
vm.loadingDataType = false;
});
@@ -88,6 +88,7 @@
function getDataType() {
vm.loadingDataType = true;
dataTypeResource.getById($scope.model.id).then(function (dataType) {
dataType.preValues = dataTypeHelper.createPreValueProps(dataType.preValues);
vm.dataType = dataType;
vm.loadingDataType = false;
});

View File

@@ -37,18 +37,7 @@ function DataTypeEditController($scope, $routeParams, appState, navigationServic
//method used to configure the pre-values when we retrieve them from the server
function createPreValueProps(preVals) {
vm.preValues = [];
for (var i = 0; i < preVals.length; i++) {
vm.preValues.push({
hideLabel: preVals[i].hideLabel,
alias: preVals[i].key,
description: preVals[i].description,
label: preVals[i].label,
view: preVals[i].view,
value: preVals[i].value,
config: preVals[i].config
});
}
vm.preValues = dataTypeHelper.createPreValueProps(preVals);
}