diff options
Diffstat (limited to 'client/components/rules/actions')
-rw-r--r-- | client/components/rules/actions/boardActions.jade | 24 | ||||
-rw-r--r-- | client/components/rules/actions/boardActions.js | 73 | ||||
-rw-r--r-- | client/components/rules/actions/cardActions.jade | 16 | ||||
-rw-r--r-- | client/components/rules/actions/cardActions.js | 23 | ||||
-rw-r--r-- | client/components/rules/actions/checklistActions.jade | 28 | ||||
-rw-r--r-- | client/components/rules/actions/checklistActions.js | 27 | ||||
-rw-r--r-- | client/components/rules/actions/mailActions.jade | 6 | ||||
-rw-r--r-- | client/components/rules/actions/mailActions.js | 5 |
8 files changed, 107 insertions, 95 deletions
diff --git a/client/components/rules/actions/boardActions.jade b/client/components/rules/actions/boardActions.jade index 81b2023d..dfeb3d84 100644 --- a/client/components/rules/actions/boardActions.jade +++ b/client/components/rules/actions/boardActions.jade @@ -2,28 +2,28 @@ template(name="boardActions") div.trigger-item div.trigger-content div.trigger-text - | Move card to + | {{{_'r-move-card-to'}}} div.trigger-dropdown select(id="move-gen-action") - option(value="top") Top of - option(value="bottom") Bottom of + option(value="top") {{{_'r-top-of'}}} + option(value="bottom") {{{_'r-bottom-of'}}} div.trigger-text - | its list + | {{{_'r-its-list'}}} div.trigger-button.js-add-gen-move-action.js-goto-rules i.fa.fa-plus div.trigger-item div.trigger-content div.trigger-text - | Move card to + | {{{_'r-move-card-to'}}} div.trigger-dropdown select(id="move-spec-action") - option(value="top") Top of - option(value="bottom") Bottom of + option(value="top") {{{_'r-top-of'}}} + option(value="bottom") {{{_'r-bottom-of'}}} div.trigger-text - | list + | {{{_'r-list'}}} div.trigger-dropdown - input(id="listName",type=text,placeholder="List Name") + input(id="listName",type=text,placeholder="{{{_'r-name'}}}") div.trigger-button.js-add-spec-move-action.js-goto-rules i.fa.fa-plus @@ -31,10 +31,10 @@ template(name="boardActions") div.trigger-content div.trigger-dropdown select(id="arch-action") - option(value="archive") Archive - option(value="unarchive") Unarchive + option(value="archive") {{{_'r-archive'}}} + option(value="unarchive") {{{_'r-unarchive'}}} div.trigger-text - | card + | {{{_'r-card'}}} div.trigger-button.js-add-arch-action.js-goto-rules i.fa.fa-plus diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js index 94c2778d..2b6fed57 100644 --- a/client/components/rules/actions/boardActions.js +++ b/client/components/rules/actions/boardActions.js @@ -12,48 +12,53 @@ BlazeComponent.extendComponent({ const trigger = this.data().triggerVar.get(); const actionSelected = this.find('#move-spec-action').value; const listTitle = this.find('#listName').value; + const boardId = Session.get('currentBoard'); + if(actionSelected == "top"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":listTitle}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":listTitle,"boardId":boardId}); + console.log("Action inserted"); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } if(actionSelected == "bottom"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":listTitle}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":listTitle,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, 'click .js-add-gen-move-action'(event) { - const ruleName = this.data().ruleName.get(); - const trigger = this.data().triggerVar.get(); - const actionSelected = this.find('#move-gen-action').value; - if(actionSelected == "top"){ - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":"*"}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); - } - if(actionSelected == "bottom"){ - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":"*"}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); - } - }, - 'click .js-add-arch-action'(event) { - const ruleName = this.data().ruleName.get(); - const trigger = this.data().triggerVar.get(); - const actionSelected = this.find('#arch-action').value; - if(actionSelected == "archive"){ - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "archive"}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); - } - if(actionSelected == "unarchive"){ - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "unarchive"}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); - } - }, - }]; + const boardId = Session.get('currentBoard'); + const ruleName = this.data().ruleName.get(); + const trigger = this.data().triggerVar.get(); + const actionSelected = this.find('#move-gen-action').value; + if(actionSelected == "top"){ + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":"*","boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); + } + if(actionSelected == "bottom"){ + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":"*","boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); + } + }, + 'click .js-add-arch-action'(event) { + const boardId = Session.get('currentBoard'); + const ruleName = this.data().ruleName.get(); + const trigger = this.data().triggerVar.get(); + const actionSelected = this.find('#arch-action').value; + if(actionSelected == "archive"){ + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({actionType: "archive"}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); + } + if(actionSelected == "unarchive"){ + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({actionType: "unarchive"}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); + } +}, +}]; }, }).register('boardActions');
\ No newline at end of file diff --git a/client/components/rules/actions/cardActions.jade b/client/components/rules/actions/cardActions.jade index 8d218a49..74ad9ab5 100644 --- a/client/components/rules/actions/cardActions.jade +++ b/client/components/rules/actions/cardActions.jade @@ -3,10 +3,10 @@ template(name="cardActions") div.trigger-content div.trigger-dropdown select(id="label-action") - option(value="add") Add - option(value="remove") Remove + option(value="add") {{{_'r-add'}}} + option(value="remove") {{{_'r-remove'}}} div.trigger-text - | label + | {{{_'r-label'}}} div.trigger-dropdown select(id="label-id") each labels @@ -19,19 +19,19 @@ template(name="cardActions") div.trigger-content div.trigger-dropdown select(id="member-action") - option(value="add") Add - option(value="remove") Removed + option(value="add") {{{_'r-add'}}} + option(value="remove") {{{_'r-remove'}}} div.trigger-text - | member + | {{{_'r-member'}}} div.trigger-dropdown - input(id="member-name",type=text,placeholder="Member name") + input(id="member-name",type=text,placeholder="{{{_'r-name'}}}") div.trigger-button.js-add-member-action.js-goto-rules i.fa.fa-plus div.trigger-item div.trigger-content div.trigger-text - | Remove all member from the card + | {{{_'r-remove-all'}}} div.trigger-button.js-add-removeall-action.js-goto-rules i.fa.fa-plus diff --git a/client/components/rules/actions/cardActions.js b/client/components/rules/actions/cardActions.js index 48120d91..571020a8 100644 --- a/client/components/rules/actions/cardActions.js +++ b/client/components/rules/actions/cardActions.js @@ -24,16 +24,17 @@ BlazeComponent.extendComponent({ const trigger = this.data().triggerVar.get(); const actionSelected = this.find('#label-action').value; const labelId = this.find('#label-id').value; + const boardId = Session.get('currentBoard'); if(actionSelected == "add"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "addLabel","labelId":labelId}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "addLabel","labelId":labelId,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } if(actionSelected == "remove"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "removeLabel","labelId":labelId}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "removeLabel","labelId":labelId,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, @@ -42,23 +43,25 @@ BlazeComponent.extendComponent({ const trigger = this.data().triggerVar.get(); const actionSelected = this.find('#member-action').value; const memberName = this.find('#member-name').value; + const boardId = Session.get('currentBoard'); if(actionSelected == "add"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "addMember","memberName":memberName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "addMember","memberName":memberName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } if(actionSelected == "remove"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "removeMember","memberName":memberName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "removeMember","memberName":memberName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, 'click .js-add-removeall-action'(event) { const ruleName = this.data().ruleName.get(); const trigger = this.data().triggerVar.get(); const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "removeMember","memberName":"*"}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const boardId = Session.get('currentBoard'); + const actionId = Actions.insert({actionType: "removeMember","memberName":"*","boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); }, }]; }, diff --git a/client/components/rules/actions/checklistActions.jade b/client/components/rules/actions/checklistActions.jade index c85ec078..8414a1a5 100644 --- a/client/components/rules/actions/checklistActions.jade +++ b/client/components/rules/actions/checklistActions.jade @@ -3,12 +3,12 @@ template(name="checklistActions") div.trigger-content div.trigger-dropdown select(id="check-action") - option(value="add") Add - option(value="remove") Remove + option(value="add") {{{_'r-add'}}} + option(value="remove") {{{_'r-remove'}}} div.trigger-text - | checklist + | {{{_'r-checklist'}}} div.trigger-dropdown - input(id="checklist-name",type=text,placeholder="name") + input(id="checklist-name",type=text,placeholder="{{{_'r-name'}}}") div.trigger-button.js-add-checklist-action.js-goto-rules i.fa.fa-plus @@ -16,12 +16,12 @@ template(name="checklistActions") div.trigger-content div.trigger-dropdown select(id="checkall-action") - option(value="check") Check all - option(value="uncheck") Unchek all + option(value="check") {{{_'r-check-all'}}} + option(value="uncheck") {{{_'r-uncheck-all'}}} div.trigger-text - | items of checklist + | {{{_'r-items-check'}}} div.trigger-dropdown - input(id="checklist-name2",type=text,placeholder="name") + input(id="checklist-name2",type=text,placeholder="{{{_'r-name'}}}") div.trigger-button.js-add-checkall-action.js-goto-rules i.fa.fa-plus @@ -30,16 +30,16 @@ template(name="checklistActions") div.trigger-content div.trigger-dropdown select(id="check-item-action") - option(value="check") Check - option(value="uncheck") Unchek + option(value="check") {{{_'r-check'}}} + option(value="uncheck") {{{_'r-uncheck'}}} div.trigger-text - | item + | {{{_'r-item'}}} div.trigger-dropdown - input(id="checkitem-name",type=text,placeholder="name") + input(id="checkitem-name",type=text,placeholder="{{{_'r-name'}}}") div.trigger-text - | of checklist + | {{{_'r-of-checklist'}}} div.trigger-dropdown - input(id="checklist-name3",type=text,placeholder="name") + input(id="checklist-name3",type=text,placeholder="{{{_'r-name'}}}") div.trigger-button.js-add-check-item-action.js-goto-rules i.fa.fa-plus diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js index 2a70ca7f..e6989fc6 100644 --- a/client/components/rules/actions/checklistActions.js +++ b/client/components/rules/actions/checklistActions.js @@ -9,16 +9,17 @@ BlazeComponent.extendComponent({ const trigger = this.data().triggerVar.get(); const actionSelected = this.find('#check-action').value; const checklistName = this.find('#checklist-name').value; + const boardId = Session.get('currentBoard'); if(actionSelected == "add"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } if(actionSelected == "remove"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, @@ -27,15 +28,16 @@ BlazeComponent.extendComponent({ const trigger = this.data().triggerVar.get(); const actionSelected = this.find('#checkall-action').value; const checklistName = this.find('#checklist-name2').value; + const boardId = Session.get('currentBoard'); if(actionSelected == "check"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } if(actionSelected == "uncheck"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, 'click .js-add-check-item-action'(event) { @@ -44,15 +46,16 @@ BlazeComponent.extendComponent({ const checkItemName = this.find("#checkitem-name"); const checklistName = this.find("#checklist-name3"); const actionSelected = this.find('#check-item-action').value; + const boardId = Session.get('currentBoard'); if(actionSelected == "check"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } if(actionSelected == "uncheck"){ const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, }]; diff --git a/client/components/rules/actions/mailActions.jade b/client/components/rules/actions/mailActions.jade index 5680d430..c10fb384 100644 --- a/client/components/rules/actions/mailActions.jade +++ b/client/components/rules/actions/mailActions.jade @@ -2,10 +2,10 @@ template(name="mailActions") div.trigger-item.trigger-item-mail div.trigger-content.trigger-content-mail div.trigger-text.trigger-text-email - | Send an email + | {{{_'r-send-email'}}} div.trigger-dropdown-mail - input(id="email-to",type=text,placeholder="to") - input(id="email-subject",type=text,placeholder="subject") + input(id="email-to",type=text,placeholder="{{{_'r-to'}}}") + input(id="email-subject",type=text,placeholder="{{{_'r-subject'}}}") textarea(id="email-msg") div.trigger-button.trigger-button-email.js-mail-action.js-goto-rules i.fa.fa-plus
\ No newline at end of file diff --git a/client/components/rules/actions/mailActions.js b/client/components/rules/actions/mailActions.js index 0e4b539e..74f6659b 100644 --- a/client/components/rules/actions/mailActions.js +++ b/client/components/rules/actions/mailActions.js @@ -12,8 +12,9 @@ BlazeComponent.extendComponent({ const trigger = this.data().triggerVar.get(); const ruleName = this.data().ruleName.get(); const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg}); - Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId}); + const boardId = Session.get('currentBoard'); + const actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg,"boardId":boardId}); + Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); }, }]; }, |