2018-09-12 00:52:29 +02:00
|
|
|
BlazeComponent.extendComponent({
|
|
|
|
|
onCreated() {
|
|
|
|
|
this.subscribe('allRules');
|
2018-09-14 16:49:06 +02:00
|
|
|
this.subscribe('allTriggers');
|
|
|
|
|
this.subscribe('allActions');
|
|
|
|
|
|
2018-09-12 00:52:29 +02:00
|
|
|
},
|
|
|
|
|
|
2018-09-14 17:39:37 +02:00
|
|
|
trigger() {
|
2018-09-14 16:49:06 +02:00
|
|
|
const ruleId = this.data().ruleId;
|
2018-09-14 17:39:37 +02:00
|
|
|
const rule = Rules.findOne({
|
|
|
|
|
_id: ruleId.get()
|
|
|
|
|
});
|
|
|
|
|
const trigger = Triggers.findOne({
|
|
|
|
|
_id: rule.triggerId
|
|
|
|
|
});
|
2018-09-14 16:49:06 +02:00
|
|
|
console.log(trigger);
|
|
|
|
|
return trigger.description();
|
2018-09-12 00:52:29 +02:00
|
|
|
},
|
2018-09-14 17:39:37 +02:00
|
|
|
action() {
|
2018-09-14 16:49:06 +02:00
|
|
|
const ruleId = this.data().ruleId;
|
2018-09-14 17:39:37 +02:00
|
|
|
const rule = Rules.findOne({
|
|
|
|
|
_id: ruleId.get()
|
|
|
|
|
});
|
|
|
|
|
const action = Actions.findOne({
|
|
|
|
|
_id: rule.actionId
|
|
|
|
|
});
|
2018-09-14 16:49:06 +02:00
|
|
|
console.log(action);
|
|
|
|
|
return action.description();
|
2018-09-12 00:52:29 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
events() {
|
2018-09-14 17:39:37 +02:00
|
|
|
return [{}];
|
2018-09-12 00:52:29 +02:00
|
|
|
},
|
|
|
|
|
|
2018-09-14 17:39:37 +02:00
|
|
|
}).register('ruleDetails');
|