-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1670 Add taxonomy tags selection in case and observable createion di…
…alog + case template edition
- Loading branch information
Showing
10 changed files
with
219 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
frontend/app/scripts/controllers/misc/TaxonomySelectionModalCtrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('theHiveDirectives') | ||
.controller('TaxonomySelectionModalCtrl', function($uibModalInstance, taxonomies) { | ||
var self = this; | ||
|
||
this.taxonomies = angular.copy(taxonomies); | ||
|
||
this.formData = { | ||
selectedTaxonomy: null, | ||
selectedTags: null | ||
}; | ||
|
||
this.addSelectedTags = function() { | ||
if (!self.formData.selectedTaxonomy) { | ||
return; | ||
} | ||
|
||
var selection = _.filter(self.formData.selectedTaxonomy.tags, function(tag) { | ||
return tag.selected; | ||
}); | ||
|
||
if (selection.length === 0) { | ||
return; | ||
} | ||
|
||
$uibModalInstance.close(selection); | ||
}; | ||
|
||
this.cancel = function() { | ||
$uibModalInstance.dismiss(); | ||
}; | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.