summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorAngelo Gallarello <angelo.gallarell@gmail.com>2018-08-16 23:37:29 +0200
committerAngelo Gallarello <angelo.gallarell@gmail.com>2018-08-16 23:37:29 +0200
commit2f24dcfc7d2f1b426e83459ed5328529a440955d (patch)
treea54bccef26dfe20d924e9d4b4e103978f0c2f563 /client/components
parentfda4e954eb7202b4c1ed0d30812e3b9156dfd5c9 (diff)
downloadwekan-2f24dcfc7d2f1b426e83459ed5328529a440955d.tar.gz
wekan-2f24dcfc7d2f1b426e83459ed5328529a440955d.tar.bz2
wekan-2f24dcfc7d2f1b426e83459ed5328529a440955d.zip
Progress on triggers UI
Diffstat (limited to 'client/components')
-rw-r--r--client/components/activities/activities.jade5
-rw-r--r--client/components/rules/rulesActions.jade2
-rw-r--r--client/components/rules/triggers/cardTriggers.jade32
-rw-r--r--client/components/rules/triggers/cardTriggers.js83
4 files changed, 62 insertions, 60 deletions
diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade
index f5ac2d0e..bddc4dad 100644
--- a/client/components/activities/activities.jade
+++ b/client/components/activities/activities.jade
@@ -34,7 +34,7 @@ template(name="boardActivities")
.activity-checklist(href="{{ card.absoluteUrl }}")
+viewer
= checklist.title
- if($eq activityType 'removedChecklist')
+ if($eq activityType 'removeChecklist')
| {{{_ 'activity-checklist-removed' cardLink}}}.
if($eq activityType 'checkedItem')
@@ -151,6 +151,9 @@ template(name="cardActivities")
if($eq activityType 'removedLabel')
| {{{_ 'activity-removed-label-card' lastLabel }}}.
+ if($eq activityType 'removeChecklist')
+ | {{{_ 'activity-checklist-removed' cardLabel}}}.
+
if($eq activityType 'checkedItem')
| {{{_ 'activity-checked-item-card' checkItem checklist.title }}}.
diff --git a/client/components/rules/rulesActions.jade b/client/components/rules/rulesActions.jade
index 0e207495..35b070fc 100644
--- a/client/components/rules/rulesActions.jade
+++ b/client/components/rules/rulesActions.jade
@@ -1,7 +1,7 @@
template(name="rulesActions")
h2
i.fa.fa-cutlery
- | Rule "#{data.ruleName}" - Add action
+ | Rule "#{data.ruleName.get}" - Add action
.triggers-content
.triggers-body
.triggers-side-menu
diff --git a/client/components/rules/triggers/cardTriggers.jade b/client/components/rules/triggers/cardTriggers.jade
index 473ceb57..9675324f 100644
--- a/client/components/rules/triggers/cardTriggers.jade
+++ b/client/components/rules/triggers/cardTriggers.jade
@@ -4,8 +4,8 @@ template(name="cardTriggers")
div.trigger-text
| When a label is
div.trigger-dropdown
- select(id="create-action")
- option(value="created") Added to
+ select(id="label-action")
+ option(value="added") Added to
option(value="removed") Removed from
div.trigger-text
| a card
@@ -17,19 +17,19 @@ template(name="cardTriggers")
div.trigger-text
| When the label
div.trigger-dropdown
- select(id="label")
+ select(id="spec-label")
each labels
- option
+ option(value="#{_id}")
= name
div.trigger-text
| is
div.trigger-dropdown
- select(id="create-action")
- option(value="created") Added to
+ select(id="spec-label-action")
+ option(value="added") Added to
option(value="removed") Removed from
div.trigger-text
| a card
- div.trigger-button.js-add-label-trigger.js-goto-action
+ div.trigger-button.js-add-spec-label-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
@@ -37,12 +37,12 @@ template(name="cardTriggers")
div.trigger-text
| When a member is
div.trigger-dropdown
- select(id="create-action")
- option(value="created") Added to
+ select(id="gen-member-action")
+ option(value="added") Added to
option(value="removed") Removed from
div.trigger-text
| a card
- div.trigger-button.js-add-gen.member-trigger.js-goto-action
+ div.trigger-button.js-add-gen-member-trigger.js-goto-action
i.fa.fa-plus
@@ -51,16 +51,16 @@ template(name="cardTriggers")
div.trigger-text
| When the member
div.trigger-dropdown
- input(id="create-list-name",type=text,placeholder="name")
+ input(id="spec-member",type=text,placeholder="name")
div.trigger-text
| is
div.trigger-dropdown
- select(id="create-action")
- option(value="created") Added to
+ select(id="spec-member-action")
+ option(value="added") Added to
option(value="removed") Removed from
div.trigger-text
| a card
- div.trigger-button.js-add-member-trigger.js-goto-action
+ div.trigger-button.js-add-spec-member-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
@@ -70,8 +70,8 @@ template(name="cardTriggers")
div.trigger-text
| is
div.trigger-dropdown
- select(id="create-action")
- option(value="created") Added to
+ select(id="attach-action")
+ option(value="added") Added to
option(value="removed") Removed from
div.trigger-text
| a card
diff --git a/client/components/rules/triggers/cardTriggers.js b/client/components/rules/triggers/cardTriggers.js
index 2529641e..a9940e07 100644
--- a/client/components/rules/triggers/cardTriggers.js
+++ b/client/components/rules/triggers/cardTriggers.js
@@ -16,87 +16,86 @@ BlazeComponent.extendComponent({
},
events() {
return [
- {'click .js-add-gen-trigger'(event) {
+ {'click .js-add-gen-label-trigger'(event) {
let datas = this.data();
- const actionSelected = this.find('#gen-action').value;
+ const actionSelected = this.find('#label-action').value;
const boardId = Session.get('currentBoard')
- if(actionSelected == "created"){
- Triggers.insert({activityType: "createCard","boardId":boardId,"listId":"*"},function(error,id){
+ if(actionSelected == "added"){
+ Triggers.insert({activityType: "addedLabel","boardId":boardId,"labelId":"*"},function(error,id){
datas.triggerIdVar.set(id);
});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removeCard","boardId":boardId},function(error,id){
+ Triggers.insert({activityType: "removedLabel","boardId":boardId,"labelId":"*"},function(error,id){
datas.triggerIdVar.set(id);
});
}
},
- 'click .js-add-create-trigger'(event) {
-
+ 'click .js-add-spec-label-trigger'(event) {
let datas = this.data();
- const actionSelected = this.find('#create-action').value;
- const listName = this.find('#create-list-name').value;
+ const actionSelected = this.find('#spec-label-action').value;
+ const labelId = this.find('#spec-label').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){
+ if(actionSelected == "added"){
+ Triggers.insert({activityType: "addedLabel","boardId":boardId,"labelId":labelId},function(error,id){
datas.triggerIdVar.set(id);
});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removeCard","boardId":boardId,"listId":listId},function(error,id){
+ Triggers.insert({activityType: "removedLabel","boardId":boardId,"labelId":labelId},function(error,id){
datas.triggerIdVar.set(id);
});
}
},
- 'click .js-add-moved-trigger'(event) {
+ 'click .js-add-gen-member-trigger'(event) {
+
let datas = this.data();
- const actionSelected = this.find('#move-action').value;
- const listName = this.find('#move-list-name').value;
+ const actionSelected = this.find('#gen-member-action').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){
+ if(actionSelected == "added"){
+ Triggers.insert({activityType: "joinMember","boardId":boardId,"memberId":"*"},function(error,id){
datas.triggerIdVar.set(id);
});
}
- if(actionSelected == "moved-from"){
- Triggers.insert({activityType: "moveCard","boardId":boardId,"listId":"*","oldListId":listId},function(error,id){
+ if(actionSelected == "removed"){
+ Triggers.insert({activityType: "unjoinMember","boardId":boardId,"memberId":"*"},function(error,id){
datas.triggerIdVar.set(id);
});
}
},
- 'click .js-add-arc-trigger'(event) {
+ 'click .js-add-spec-member-trigger'(event) {
let datas = this.data();
- const actionSelected = this.find('#arch-action').value;
+ const actionSelected = this.find('#spec-member-action').value;
+ const memberId = this.find('#spec-member').value;
const boardId = Session.get('currentBoard')
- if(actionSelected == "archived"){
- Triggers.insert({activityType: "archivedCard","boardId":boardId},function(error,id){
+ if(actionSelected == "added"){
+ Triggers.insert({activityType: "joinMember","boardId":boardId,"memberId":memberId},function(error,id){
datas.triggerIdVar.set(id);
});
}
- if(actionSelected == "unarchived"){
- Triggers.insert({activityType: "restoredCard","boardId":boardId},function(error,id){
+ if(actionSelected == "removed"){
+ Triggers.insert({activityType: "unjoinMember","boardId":boardId,"memberId":memberId},function(error,id){
datas.triggerIdVar.set(id);
});
}
- }
+ },
+ 'click .js-add-attachment-trigger'(event) {
+ let datas = this.data();
+ const actionSelected = this.find('#attach-action').value;
+ const boardId = Session.get('currentBoard')
+ if(actionSelected == "added"){
+ Triggers.insert({activityType: "addAttachment","boardId":boardId},function(error,id){
+ datas.triggerIdVar.set(id);
+ });
+ }
+ if(actionSelected == "removed"){
+ Triggers.insert({activityType: "deleteAttachment","boardId":boardId},function(error,id){
+ datas.triggerIdVar.set(id);
+ });
+ }
+ },
}];
},