mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 13:07:17 -04:00
Added swimlane trigger
This commit is contained in:
parent
b2f23d619d
commit
a2d756074f
8 changed files with 62 additions and 56 deletions
|
@ -3,10 +3,8 @@ template(name="boardTriggers")
|
|||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{_'r-when-a-card-is'}}
|
||||
div.trigger-dropdown
|
||||
select(id="gen-action")
|
||||
option(value="created") {{_'r-added-to'}}
|
||||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-added-to'}}
|
||||
div.trigger-text
|
||||
| {{_'r-the-board'}}
|
||||
div.trigger-button.trigger-button-person.js-show-user-field
|
||||
|
@ -15,7 +13,7 @@ template(name="boardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -23,21 +21,23 @@ template(name="boardTriggers")
|
|||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{_'r-when-a-card-is'}}
|
||||
div.trigger-dropdown
|
||||
select(id="create-action")
|
||||
option(value="created") {{_'r-added-to'}}
|
||||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-added-to'}}
|
||||
div.trigger-text
|
||||
| {{_'r-list'}}
|
||||
div.trigger-dropdown
|
||||
input(id="create-list-name",type=text,placeholder="{{_'r-list-name'}}")
|
||||
input(id="create-list-name",type=text,placeholder="{{_'r-list-name'}}")
|
||||
div.trigger-text
|
||||
| {{_'r-swimlane'}}
|
||||
div.trigger-dropdown
|
||||
input(id="create-swimlane-name",type=text,placeholder="{{_'r-swimlane-name'}}")
|
||||
div.trigger-button.trigger-button-person.js-show-user-field
|
||||
i.fa.fa-user
|
||||
div.user-details.hide-element
|
||||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-create-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -51,7 +51,7 @@ template(name="boardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-moved-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -66,14 +66,19 @@ template(name="boardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-list'}}
|
||||
div.trigger-dropdown
|
||||
input(id="move-list-name",type=text,placeholder="{{_'r-list-name'}}")
|
||||
input(id="move-list-name",type=text,placeholder="{{_'r-list-name'}}")
|
||||
div.trigger-text
|
||||
| {{_'r-swimlane'}}
|
||||
div.trigger-dropdown
|
||||
input(id="create-swimlane-name",type=text,placeholder="{{_'r-swimlane-name'}}")
|
||||
div.trigger-button.trigger-button-person.js-show-user-field
|
||||
div.trigger-button.trigger-button-person.js-show-user-field
|
||||
i.fa.fa-user
|
||||
div.user-details.hide-element
|
||||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-moved-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -91,7 +96,7 @@ template(name="boardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-arch-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
|
|
@ -8,60 +8,48 @@ BlazeComponent.extendComponent({
|
|||
'click .js-add-gen-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const datas = this.data();
|
||||
const actionSelected = this.find('#gen-action').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
if (actionSelected === 'created') {
|
||||
datas.triggerVar.set({
|
||||
datas.triggerVar.set({
|
||||
activityType: 'createCard',
|
||||
boardId,
|
||||
'listName': '*',
|
||||
desc,
|
||||
});
|
||||
}
|
||||
if (actionSelected === 'removed') {
|
||||
datas.triggerVar.set({
|
||||
activityType: 'removeCard',
|
||||
boardId,
|
||||
desc,
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-create-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const datas = this.data();
|
||||
const actionSelected = this.find('#create-action').value;
|
||||
const listName = this.find('#create-list-name').value;
|
||||
const swimlaneName = this.find('#create-swimlane-name').value;
|
||||
if(swimlaneName == undefined || swimlaneName == ""){
|
||||
swimlaneName = "*";
|
||||
}
|
||||
const boardId = Session.get('currentBoard');
|
||||
if (actionSelected === 'created') {
|
||||
datas.triggerVar.set({
|
||||
datas.triggerVar.set({
|
||||
activityType: 'createCard',
|
||||
boardId,
|
||||
swimlaneName,
|
||||
listName,
|
||||
desc,
|
||||
});
|
||||
}
|
||||
if (actionSelected === 'removed') {
|
||||
datas.triggerVar.set({
|
||||
activityType: 'removeCard',
|
||||
boardId,
|
||||
listName,
|
||||
desc,
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-moved-trigger' (event) {
|
||||
const datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
|
||||
const swimlaneName = this.find('#create-swimlane-name').value;
|
||||
const actionSelected = this.find('#move-action').value;
|
||||
const listName = this.find('#move-list-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
if(swimlaneName == undefined || swimlaneName == ""){
|
||||
swimlaneName = "*";
|
||||
}
|
||||
if (actionSelected === 'moved-to') {
|
||||
datas.triggerVar.set({
|
||||
activityType: 'moveCard',
|
||||
boardId,
|
||||
listName,
|
||||
swimlaneName,
|
||||
'oldListName': '*',
|
||||
desc,
|
||||
});
|
||||
|
@ -70,6 +58,7 @@ BlazeComponent.extendComponent({
|
|||
datas.triggerVar.set({
|
||||
activityType: 'moveCard',
|
||||
boardId,
|
||||
swimlaneName,
|
||||
'listName': '*',
|
||||
'oldListName': listName,
|
||||
desc,
|
||||
|
|
|
@ -15,7 +15,7 @@ template(name="cardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-label-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -42,7 +42,7 @@ template(name="cardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-spec-label-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -62,7 +62,7 @@ template(name="cardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-member-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -87,7 +87,7 @@ template(name="cardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-spec-member-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -109,6 +109,6 @@ template(name="cardTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-attachment-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
|
|
@ -15,7 +15,7 @@ template(name="checklistTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-check-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -40,7 +40,7 @@ template(name="checklistTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-spec-check-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -58,7 +58,7 @@ template(name="checklistTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-comp-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -80,7 +80,7 @@ template(name="checklistTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-spec-comp-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -98,7 +98,7 @@ template(name="checklistTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-gen-check-item-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -120,6 +120,6 @@ template(name="checklistTriggers")
|
|||
div.trigger-text
|
||||
| {{_'r-by'}}
|
||||
div.trigger-dropdown
|
||||
input(class="user-name",id="create-list-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
input(class="user-name",type=text,placeholder="{{_'r-user-name'}}")
|
||||
div.trigger-button.js-add-spec-check-item-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
|
|
@ -219,12 +219,19 @@ Utils = {
|
|||
if (element.hasClass('trigger-text')) {
|
||||
finalString += element.text().toLowerCase();
|
||||
} else if (element.hasClass('user-details')) {
|
||||
console.log(element);
|
||||
finalString += element.find('.trigger-text').text().toLowerCase()+ " " + element.find('input').val();
|
||||
let username = element.find('input').val();
|
||||
if(username == undefined || username == ""){
|
||||
username = "*";
|
||||
}
|
||||
finalString += element.find('.trigger-text').text().toLowerCase()+ " " + username ;
|
||||
} else if (element.find('select').length > 0) {
|
||||
finalString += element.find('select option:selected').text().toLowerCase();
|
||||
} else if (element.find('input').length > 0) {
|
||||
finalString += element.find('input').val();
|
||||
let inputvalue = element.find('input').val();
|
||||
if(inputvalue == undefined || inputvalue == ""){
|
||||
inputvalue = "*";
|
||||
}
|
||||
finalString += inputvalue;
|
||||
}
|
||||
// Add space
|
||||
if (i !== length - 1) {
|
||||
|
|
|
@ -549,7 +549,7 @@
|
|||
"r-a-card": "a card",
|
||||
"r-when-a-label-is": "When a label is",
|
||||
"r-when-the-label-is": "When the label is",
|
||||
"r-list-name": "List name",
|
||||
"r-list-name": "list name",
|
||||
"r-when-a-member": "When a member is",
|
||||
"r-when-the-member": "When the member",
|
||||
"r-name": "name",
|
||||
|
@ -611,7 +611,10 @@
|
|||
"r-d-add-checklist": "Add checklist",
|
||||
"r-d-remove-checklist": "Remove checklist",
|
||||
"r-by": "by",
|
||||
"r-swimlane": "in swimlane",
|
||||
"r-swimlane-name": "swimlane name",
|
||||
"r-user-name": "username",
|
||||
"r-added-to": "added to",
|
||||
"r-when-a-card-is-moved": "When a card is moved to another list",
|
||||
"ldap": "LDAP",
|
||||
"oauth2": "OAuth2",
|
||||
|
|
|
@ -1128,6 +1128,7 @@ function cardMove(userId, doc, fieldNames, oldListId, oldSwimlaneId) {
|
|||
listId: doc.listId,
|
||||
boardId: doc.boardId,
|
||||
cardId: doc._id,
|
||||
swimlaneName: Swimlanes.findOne(doc.swimlaneId).title,
|
||||
swimlaneId: doc.swimlaneId,
|
||||
oldSwimlaneId,
|
||||
});
|
||||
|
@ -1237,6 +1238,7 @@ function cardCreation(userId, doc) {
|
|||
listName: Lists.findOne(doc.listId).title,
|
||||
listId: doc.listId,
|
||||
cardId: doc._id,
|
||||
swimlaneName: Swimlanes.findOne(doc.swimlaneId).title,
|
||||
swimlaneId: doc.swimlaneId,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
TriggersDef = {
|
||||
createCard:{
|
||||
matchingFields: ['boardId', 'listName','userId'],
|
||||
matchingFields: ['boardId', 'listName','userId','swimlaneName'],
|
||||
},
|
||||
moveCard:{
|
||||
matchingFields: ['boardId', 'listName', 'oldListName','userId'],
|
||||
matchingFields: ['boardId', 'listName', 'oldListName','userId','swimlaneName'],
|
||||
},
|
||||
archivedCard:{
|
||||
matchingFields: ['boardId','userId'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue