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({
|
2018-09-16 01:50:36 +03:00
|
|
|
_id: ruleId.get(),
|
2018-09-14 17:39:37 +02:00
|
|
|
});
|
|
|
|
|
const trigger = Triggers.findOne({
|
2018-09-16 01:50:36 +03:00
|
|
|
_id: rule.triggerId,
|
2018-09-14 17:39:37 +02:00
|
|
|
});
|
2018-10-07 17:55:24 +02:00
|
|
|
const desc = trigger.description();
|
|
|
|
|
const upperdesc = desc.charAt(0).toUpperCase() + desc.substr(1);
|
|
|
|
|
return upperdesc;
|
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({
|
2018-09-16 01:50:36 +03:00
|
|
|
_id: ruleId.get(),
|
2018-09-14 17:39:37 +02:00
|
|
|
});
|
|
|
|
|
const action = Actions.findOne({
|
2018-09-16 01:50:36 +03:00
|
|
|
_id: rule.actionId,
|
2018-09-14 17:39:37 +02:00
|
|
|
});
|
2018-10-07 17:55:24 +02:00
|
|
|
const desc = action.description();
|
|
|
|
|
const upperdesc = desc.charAt(0).toUpperCase() + desc.substr(1);
|
|
|
|
|
return upperdesc;
|
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-16 01:50:36 +03:00
|
|
|
}).register('ruleDetails');
|