diff options
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/activities/activities.jade | 7 | ||||
-rw-r--r-- | client/components/activities/activities.js | 13 | ||||
-rw-r--r-- | client/components/boards/boardHeader.js | 2 | ||||
-rw-r--r-- | client/components/main/layouts.jade | 17 | ||||
-rw-r--r-- | client/components/main/layouts.styl | 17 | ||||
-rw-r--r-- | client/components/rules/rules.styl | 3 | ||||
-rw-r--r-- | client/components/rules/rulesTriggers.jade | 2 | ||||
-rw-r--r-- | client/components/rules/triggers/boardTriggers.jade | 36 | ||||
-rw-r--r-- | client/components/rules/triggers/boardTriggers.js | 66 | ||||
-rw-r--r-- | client/components/rules/triggers/cardTriggers.jade | 75 | ||||
-rw-r--r-- | client/components/rules/triggers/cardTriggers.js | 105 | ||||
-rw-r--r-- | client/components/rules/triggers/checklistTriggers.jade | 81 |
12 files changed, 396 insertions, 28 deletions
diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade index d3e3d5ba..735de57b 100644 --- a/client/components/activities/activities.jade +++ b/client/components/activities/activities.jade @@ -89,6 +89,13 @@ template(name="boardActivities") if($eq activityType 'restoredCard') | {{{_ 'activity-sent' cardLink boardLabel}}}. + if($eq activityType 'addedLabel') + | {{{_ 'activity-added-label' lastLabel cardLink}}}. + + if($eq activityType 'removedLabel') + | {{{_ 'activity-removed-label' lastLabel cardLink}}}. + + if($eq activityType 'unjoinMember') if($eq user._id member._id) | {{{_ 'activity-unjoined' cardLink}}}. diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index 95699961..93bbb469 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -58,6 +58,19 @@ BlazeComponent.extendComponent({ }, card.title)); }, + lastLabel(){ + const lastLabelId = this.currentData().labelId; + const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(lastLabelId); + console.log("LAST"); + console.log(lastLabel); + + if(lastLabel.name == undefined || lastLabel.name == ""){ + return lastLabel.color; + }else{ + return lastLabel.name; + } + }, + listLabel() { return this.currentData().list().title; }, diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index c4fc303f..89f686ab 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -109,7 +109,7 @@ BlazeComponent.extendComponent({ Sidebar.setView('search'); }, 'click .js-open-rules-view'() { - Modal.open('rulesMain'); + Modal.openWide('rulesMain'); }, 'click .js-multiselection-activate'() { const currentCard = Session.get('currentCard'); diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index 911f23f4..ff2d8d0a 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -35,11 +35,18 @@ template(name="defaultLayout") if (Modal.isOpen) #modal .overlay - .modal-content - a.modal-close-btn.js-close-modal - i.fa.fa-times-thin - +Template.dynamic(template=Modal.getHeaderName) - +Template.dynamic(template=Modal.getTemplateName) + if (Modal.isWide) + .modal-content-wide.modal-container + a.modal-close-btn.js-close-modal + i.fa.fa-times-thin + +Template.dynamic(template=Modal.getHeaderName) + +Template.dynamic(template=Modal.getTemplateName) + else + .modal-content.modal-container + a.modal-close-btn.js-close-modal + i.fa.fa-times-thin + +Template.dynamic(template=Modal.getHeaderName) + +Template.dynamic(template=Modal.getTemplateName) template(name="notFound") +message(label='page-not-found') diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl index a79ff337..109dcf7b 100644 --- a/client/components/main/layouts.styl +++ b/client/components/main/layouts.styl @@ -61,6 +61,23 @@ body display: block float: right font-size: 24px + + .modal-content-wide + width: 800px + min-height: 160px + margin: 42px auto + padding: 12px + border-radius: 4px + background: darken(white, 13%) + z-index: 110 + + h2 + margin-bottom: 25px + + .modal-close-btn + display: block + float: right + font-size: 24px h1 font-size: 22px diff --git a/client/components/rules/rules.styl b/client/components/rules/rules.styl index 35fbabb2..c9684709 100644 --- a/client/components/rules/rules.styl +++ b/client/components/rules/rules.styl @@ -138,6 +138,3 @@ transform: translate(-50%,-50%) &:hover, &.is-active box-shadow: 0 0 0 2px darken(white, 60%) inset - - - diff --git a/client/components/rules/rulesTriggers.jade b/client/components/rules/rulesTriggers.jade index 5ee563e0..2848ad33 100644 --- a/client/components/rules/rulesTriggers.jade +++ b/client/components/rules/rulesTriggers.jade @@ -1,7 +1,7 @@ template(name="rulesTriggers") h2 i.fa.fa-cutlery - | Rule "#{data.ruleName}" - Add trigger + | Rule "#{data.ruleName.get}" - Add trigger .triggers-content .triggers-body .triggers-side-menu diff --git a/client/components/rules/triggers/boardTriggers.jade b/client/components/rules/triggers/boardTriggers.jade index 8b0b9489..375f50ba 100644 --- a/client/components/rules/triggers/boardTriggers.jade +++ b/client/components/rules/triggers/boardTriggers.jade @@ -4,7 +4,7 @@ template(name="boardTriggers") div.trigger-text | When a card is div.trigger-dropdown - select(id="action") + select(id="gen-action") option(value="created") Added to option(value="removed") Removed from div.trigger-text @@ -17,13 +17,29 @@ template(name="boardTriggers") div.trigger-text | When a card is div.trigger-dropdown - select - option Moved to + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | list + div.trigger-dropdown + input(id="create-list-name",type=text,placeholder="List Name") + div.trigger-button.js-add-create-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When a card is + div.trigger-dropdown + select(id="move-action") + option(value="moved-to") Moved to + option(value="moved-from") Moved from div.trigger-text - | to list + | list div.trigger-dropdown - input(type=text,placeholder="List Name") - div.trigger-button.js-add-spec-trigger.js-goto-action + input(id="move-list-name",type=text,placeholder="List Name") + div.trigger-button.js-add-moved-trigger.js-goto-action i.fa.fa-plus div.trigger-item @@ -31,10 +47,10 @@ template(name="boardTriggers") div.trigger-text | When a card is div.trigger-dropdown - select - option Archived - option Unarchived - div.trigger-button.js-add-arc-trigger.js-goto-action + select(id="arch-action") + option(value="archived") Archived + option(value="unarchived") Unarchived + div.trigger-button.js-add-arch-trigger.js-goto-action i.fa.fa-plus diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js index 08274777..6ec1ec4e 100644 --- a/client/components/rules/triggers/boardTriggers.js +++ b/client/components/rules/triggers/boardTriggers.js @@ -8,7 +8,7 @@ BlazeComponent.extendComponent({ {'click .js-add-gen-trigger'(event) { let datas = this.data(); - const actionSelected = this.find('#action').value; + const actionSelected = this.find('#gen-action').value; const boardId = Session.get('currentBoard') if(actionSelected == "created"){ Triggers.insert({activityType: "createCard","boardId":boardId,"listId":"*"},function(error,id){ @@ -20,8 +20,72 @@ BlazeComponent.extendComponent({ datas.triggerIdVar.set(id); }); } + }, + 'click .js-add-create-trigger'(event) { + let datas = this.data(); + const actionSelected = this.find('#create-action').value; + const listName = this.find('#create-list-name').value; + const boardId = Session.get('currentBoard') + const list = Lists.findOne({title:listName}); + let listId; + if(list == undefined){ + listId = "*" + }else{ + listId = list._id; + } + if(actionSelected == "created"){ + Triggers.insert({activityType: "createCard","boardId":boardId,"listId":listId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "removed"){ + Triggers.insert({activityType: "removeCard","boardId":boardId,"listId":listId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } }, + 'click .js-add-moved-trigger'(event) { + let datas = this.data(); + const actionSelected = this.find('#move-action').value; + const listName = this.find('#move-list-name').value; + const boardId = Session.get('currentBoard') + const list = Lists.findOne({title:listName}); + console.log(list); + let listId; + if(list == undefined){ + listId = "*" + }else{ + listId = list._id; + } + console.log(listId); + if(actionSelected == "moved-to"){ + Triggers.insert({activityType: "moveCard","boardId":boardId,"listId":listId,"oldListId":"*"},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "moved-from"){ + Triggers.insert({activityType: "moveCard","boardId":boardId,"listId":"*","oldListId":listId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + }, + 'click .js-add-arc-trigger'(event) { + let datas = this.data(); + const actionSelected = this.find('#arch-action').value; + const boardId = Session.get('currentBoard') + if(actionSelected == "archived"){ + Triggers.insert({activityType: "archivedCard","boardId":boardId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "unarchived"){ + Triggers.insert({activityType: "restoredCard","boardId":boardId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + } + }]; }, diff --git a/client/components/rules/triggers/cardTriggers.jade b/client/components/rules/triggers/cardTriggers.jade index c1a42ab5..473ceb57 100644 --- a/client/components/rules/triggers/cardTriggers.jade +++ b/client/components/rules/triggers/cardTriggers.jade @@ -4,7 +4,76 @@ template(name="cardTriggers") div.trigger-text | When a label is div.trigger-dropdown - select - option Moved to - div.trigger-button + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-gen-label-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When the label + div.trigger-dropdown + select(id="label") + each labels + option + = name + div.trigger-text + | is + div.trigger-dropdown + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-label-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When a member is + div.trigger-dropdown + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-gen.member-trigger.js-goto-action + i.fa.fa-plus + + + div.trigger-item + div.trigger-content + div.trigger-text + | When the member + div.trigger-dropdown + input(id="create-list-name",type=text,placeholder="name") + div.trigger-text + | is + div.trigger-dropdown + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-member-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When an attachment + div.trigger-text + | is + div.trigger-dropdown + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-attachment-trigger.js-goto-action i.fa.fa-plus
\ No newline at end of file diff --git a/client/components/rules/triggers/cardTriggers.js b/client/components/rules/triggers/cardTriggers.js new file mode 100644 index 00000000..2529641e --- /dev/null +++ b/client/components/rules/triggers/cardTriggers.js @@ -0,0 +1,105 @@ +BlazeComponent.extendComponent({ + onCreated() { + this.subscribe('allRules'); + }, + + labels(){ + const labels = Boards.findOne(Session.get('currentBoard')).labels; + console.log(labels); + for(let i = 0;i<labels.length;i++){ + if(labels[i].name == "" || labels[i].name == undefined){ + labels[i].name = labels[i].color.toUpperCase(); + } + } + console.log(labels); + return labels; + }, + events() { + return [ + {'click .js-add-gen-trigger'(event) { + + let datas = this.data(); + const actionSelected = this.find('#gen-action').value; + const boardId = Session.get('currentBoard') + if(actionSelected == "created"){ + Triggers.insert({activityType: "createCard","boardId":boardId,"listId":"*"},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "removed"){ + Triggers.insert({activityType: "removeCard","boardId":boardId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + }, + 'click .js-add-create-trigger'(event) { + + let datas = this.data(); + const actionSelected = this.find('#create-action').value; + const listName = this.find('#create-list-name').value; + const boardId = Session.get('currentBoard') + const list = Lists.findOne({title:listName}); + let listId; + if(list == undefined){ + listId = "*" + }else{ + listId = list._id; + } + if(actionSelected == "created"){ + Triggers.insert({activityType: "createCard","boardId":boardId,"listId":listId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "removed"){ + Triggers.insert({activityType: "removeCard","boardId":boardId,"listId":listId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + }, + 'click .js-add-moved-trigger'(event) { + let datas = this.data(); + const actionSelected = this.find('#move-action').value; + const listName = this.find('#move-list-name').value; + const boardId = Session.get('currentBoard') + const list = Lists.findOne({title:listName}); + console.log(list); + let listId; + if(list == undefined){ + listId = "*" + }else{ + listId = list._id; + } + console.log(listId); + if(actionSelected == "moved-to"){ + Triggers.insert({activityType: "moveCard","boardId":boardId,"listId":listId,"oldListId":"*"},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "moved-from"){ + Triggers.insert({activityType: "moveCard","boardId":boardId,"listId":"*","oldListId":listId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + }, + 'click .js-add-arc-trigger'(event) { + let datas = this.data(); + const actionSelected = this.find('#arch-action').value; + const boardId = Session.get('currentBoard') + if(actionSelected == "archived"){ + Triggers.insert({activityType: "archivedCard","boardId":boardId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + if(actionSelected == "unarchived"){ + Triggers.insert({activityType: "restoredCard","boardId":boardId},function(error,id){ + datas.triggerIdVar.set(id); + }); + } + } + + }]; + }, + +}).register('cardTriggers'); + + diff --git a/client/components/rules/triggers/checklistTriggers.jade b/client/components/rules/triggers/checklistTriggers.jade index 7364bfa7..a34d89d0 100644 --- a/client/components/rules/triggers/checklistTriggers.jade +++ b/client/components/rules/triggers/checklistTriggers.jade @@ -2,9 +2,82 @@ template(name="checklistTriggers") div.trigger-item div.trigger-content div.trigger-text - | When a check is + | When a checklist is div.trigger-dropdown - select - option Checked - div.trigger-button + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-gen.member-trigger.js-goto-action + i.fa.fa-plus + + + div.trigger-item + div.trigger-content + div.trigger-text + | When the checklist + div.trigger-dropdown + input(id="create-list-name",type=text,placeholder="Name") + div.trigger-text + | is + div.trigger-dropdown + select(id="create-action") + option(value="created") Added to + option(value="removed") Removed from + div.trigger-text + | a card + div.trigger-button.js-add-checklist-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When a checklist is + div.trigger-dropdown + select(id="create-action") + option(value="created") Completed + option(value="removed") Made incomplete + div.trigger-button.js-add-gen.member-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When the checklist + div.trigger-dropdown + input(id="create-list-name",type=text,placeholder="Name") + div.trigger-text + | is + div.trigger-dropdown + select(id="create-action") + option(value="created") Completed + option(value="removed") Made incomplete + div.trigger-button.js-add-checklist-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When a checklist item is + div.trigger-dropdown + select(id="create-action") + option(value="created") Checked + option(value="removed") Unchecked + div.trigger-button.js-add-gen.member-trigger.js-goto-action + i.fa.fa-plus + + div.trigger-item + div.trigger-content + div.trigger-text + | When the checklist item + div.trigger-dropdown + input(id="create-list-name",type=text,placeholder="Name") + div.trigger-text + | is + div.trigger-dropdown + select(id="create-action") + option(value="created") Checked + option(value="removed") Unchecked + div.trigger-button.js-add-checklist-trigger.js-goto-action i.fa.fa-plus
\ No newline at end of file |