Merge pull request #1182 from wazuh/fix-show-hide-editor

Emit event for success
This commit is contained in:
Jesús Ángel 2019-01-28 12:00:43 +01:00 committed by GitHub
commit c1fd75da98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -295,6 +295,11 @@ export function GroupsController(
$scope.$broadcast('saveXmlFile', { group: $scope.currentGroup.name });
};
$scope.$on('configurationSuccess',() => {
$scope.editingFile = false;
if(!$scope.$$phase) $scope.$digest();
});
$scope.reload = async (element, searchTerm, addOffset, start) => {
if (element === 'left') {
if (!$scope.availableAgents.loadedAll) {

View File

@ -150,11 +150,13 @@ app.directive('wzXmlFileEditor', function() {
const xml = replaceIllegalXML(text);
await groupHandler.sendConfiguration(params.group, xml);
errorHandler.info('Success. Group has been updated', '');
$scope.$emit('configurationSuccess')
} catch (error) {
errorHandler.handle(error, 'Send file error');
}
return;
};
$scope.xmlCodeBox = CodeMirror.fromTextArea(
$document[0].getElementById('xml_box'),
{