summaryrefslogtreecommitdiffstats
path: root/client/components/rules/triggers/boardTriggers.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/rules/triggers/boardTriggers.js')
-rw-r--r--client/components/rules/triggers/boardTriggers.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js
new file mode 100644
index 00000000..4c8594d3
--- /dev/null
+++ b/client/components/rules/triggers/boardTriggers.js
@@ -0,0 +1,28 @@
+BlazeComponent.extendComponent({
+ onCreated() {
+
+ },
+
+ events() {
+ return [
+ {'click .js-add-gen-trigger'(event) {
+
+ let datas = this.data();
+ const actionSelected = this.find('#action').value;
+ const boardId = Session.get('currentBoard')
+ if(actionSelected == "created"){
+ Triggers.insert({activityType: "createCard","boardId":boardId},function(error,id){
+ datas.triggerIdVar.set(id);
+ });
+ }
+ if(actionSelected == "removed"){
+ Triggers.insert({activityType: "removeCard","boardId":boardId},function(error,id){
+ datas.triggerIdVar.set(id);
+ });
+ }
+
+ },
+ }];
+ },
+
+}).register('boardTriggers'); \ No newline at end of file