summaryrefslogtreecommitdiffstats
path: root/client/components/rules/ruleDetails.js
blob: 386b2b48b5e305bbbe5914a85ae5d660344960e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
BlazeComponent.extendComponent({
  onCreated() {
    this.subscribe('allRules');
    this.subscribe('allTriggers');
    this.subscribe('allActions');

  },

  trigger() {
    const ruleId = this.data().ruleId;
    const rule = Rules.findOne({
      _id: ruleId.get(),
    });
    const trigger = Triggers.findOne({
      _id: rule.triggerId,
    });
    return trigger.description();
  },
  action() {
    const ruleId = this.data().ruleId;
    const rule = Rules.findOne({
      _id: ruleId.get(),
    });
    const action = Actions.findOne({
      _id: rule.actionId,
    });
    return action.description();
  },

  events() {
    return [{}];
  },

}).register('ruleDetails');