Update saved objects client usage to attributes instead of _source. Also, fixing an improper "safe" apply usage. (#13223)

This commit is contained in:
Chris Roberson 2017-07-31 14:42:08 -04:00
parent 64e3756160
commit 31aba72787

View file

@ -152,7 +152,7 @@ uiModules.get('apps/management')
$scope.aceInvalidEditors = _.without($scope.aceInvalidEditors, fieldName);
}
if ($rootScope.$$phase) $scope.$apply();
if (!$rootScope.$$phase) $scope.$apply();
});
};
@ -185,7 +185,7 @@ uiModules.get('apps/management')
};
$scope.submit = function () {
const source = _.cloneDeep($scope.obj._source);
const source = _.cloneDeep($scope.obj.attributes);
_.each($scope.fields, function (field) {
let value = field.value;
@ -209,7 +209,7 @@ uiModules.get('apps/management')
};
function redirectHandler(action) {
const msg = 'You successfully ' + action + ' the "' + $scope.obj._source.title + '" ' + $scope.title.toLowerCase() + ' object';
const msg = 'You successfully ' + action + ' the "' + $scope.obj.attributes.title + '" ' + $scope.title.toLowerCase() + ' object';
$location.path('/management/kibana/objects').search({
_a: rison.encode({