FEATURE: Filter topic and post web hook events by tags (#6726)

* FEATURE: Filter topic and post web hook events by tags

* Add a spec test with unmatched tags
This commit is contained in:
Vinoth Kannan
2018-12-05 14:44:06 +05:30
committed by GitHub
parent 1a71f98d28
commit d33d031742
11 changed files with 72 additions and 0 deletions

View File

@ -63,6 +63,7 @@ export default RestModel.extend({
createProperties() {
const types = this.get("web_hook_event_types");
const categoryIds = this.get("categories").map(c => c.id);
const tagNames = this.get("tag_names");
// Hack as {{group-selector}} accepts a comma-separated string as data source, but
// we use an array to populate the datasource above.
@ -81,6 +82,7 @@ export default RestModel.extend({
? [null]
: types.map(type => type.id),
category_ids: Ember.isEmpty(categoryIds) ? [null] : categoryIds,
tag_names: Ember.isEmpty(tagNames) ? [null] : tagNames,
group_ids:
Ember.isEmpty(groupNames) || Ember.isEmpty(groupNames[0])
? [null]