handle revert of ldap user and group search fields

This commit is contained in:
John Mitchell 2017-07-14 13:07:24 -04:00
parent 3e25ad5ffc
commit 5955691f41
2 changed files with 14 additions and 4 deletions

View File

@ -313,6 +313,15 @@ export default [
populateTacacsProtocol(false);
});
$scope.$on('codeMirror_populated', function() {
let tab = $stateParams.currentTab;
if (tab === 'auth') {
startCodeMirrors();
codeInputInitialized = true;
}
});
angular.extend(authVm, {
activeForm: activeForm,
activeAuthForm: activeAuthForm,

View File

@ -310,11 +310,12 @@ export default [
else if($scope[key + '_field'].reset === "CUSTOM_LOGO"){
$scope.$broadcast(key+'_reverted');
}
else if($scope[key + '_field'].type === "textarea" && _.isArray($scope.configDataResolve[key].default)){
$scope[key] = ConfigurationUtils.arrayToList($scope[key], key);
}
else if($scope[key + '_field'].hasOwnProperty('codeMirror')){
$scope[key] = '{}';
if (key === "AUTH_LDAP_USER_SEARCH" || key === "AUTH_LDAP_GROUP_SEARCH") {
$scope[key] = '[]';
} else {
$scope[key] = '{}';
}
$scope.$broadcast('codeMirror_populated', key);
}
loginUpdate();