mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Added triggers by username
This commit is contained in:
parent
ef6aa4e415
commit
9d1d66b0f5
7 changed files with 158 additions and 20 deletions
|
@ -10,7 +10,10 @@
|
|||
display: inline-block
|
||||
float: left
|
||||
margin: revert
|
||||
|
||||
.hide-element
|
||||
display:none !important
|
||||
.user-details
|
||||
display:inline-block
|
||||
.rules-btns-group
|
||||
position: absolute
|
||||
right: 0
|
||||
|
@ -160,6 +163,8 @@
|
|||
box-shadow: 0 0 0 2px darken(white, 60%) inset
|
||||
.trigger-button.trigger-button-email
|
||||
top:30px
|
||||
.trigger-button.trigger-button-person
|
||||
right:-40px
|
||||
.trigger-item.trigger-item-mail
|
||||
height:300px
|
||||
|
||||
|
|
|
@ -42,7 +42,26 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
'click .js-goto-action' (event) {
|
||||
event.preventDefault();
|
||||
// Add user to the trigger
|
||||
const username = $(event.currentTarget.offsetParent).find(".user-name").val();
|
||||
let trigger = this.triggerVar.get();
|
||||
const user = Users.findOne({"username":username});
|
||||
if(user != undefined){
|
||||
trigger["userId"] = user._id;
|
||||
}else{
|
||||
trigger["userId"] = "*";
|
||||
}
|
||||
this.triggerVar.set(trigger);
|
||||
this.setAction();
|
||||
},
|
||||
'click .js-show-user-field' (event) {
|
||||
event.preventDefault();
|
||||
console.log(event);
|
||||
console.log(event.currentTarget.offsetParent);
|
||||
console.log($(event.currentTarget.offsetParent));
|
||||
$(event.currentTarget.offsetParent).find(".user-details").removeClass("hide-element");
|
||||
|
||||
|
||||
},
|
||||
'click .js-goto-rules' (event) {
|
||||
event.preventDefault();
|
||||
|
|
|
@ -9,6 +9,13 @@ template(name="boardTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-the-board'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -23,7 +30,14 @@ template(name="boardTriggers")
|
|||
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-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'}}")
|
||||
div.trigger-button.js-add-create-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -31,6 +45,13 @@ template(name="boardTriggers")
|
|||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{_'r-when-a-card-is-moved'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-moved-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -46,6 +67,13 @@ template(name="boardTriggers")
|
|||
| {{_'r-list'}}
|
||||
div.trigger-dropdown
|
||||
input(id="move-list-name",type=text,placeholder="{{_'r-list-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'}}")
|
||||
div.trigger-button.js-add-moved-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -57,6 +85,13 @@ template(name="boardTriggers")
|
|||
select(id="arch-action")
|
||||
option(value="archived") {{_'r-archived'}}
|
||||
option(value="unarchived") {{_'r-unarchived'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-arch-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
|
|
@ -9,6 +9,13 @@ template(name="cardTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-label-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -29,6 +36,13 @@ template(name="cardTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-spec-label-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -42,6 +56,13 @@ template(name="cardTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-member-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -60,6 +81,13 @@ template(name="cardTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-spec-member-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -75,5 +103,12 @@ template(name="cardTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-attachment-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
|
|
@ -9,6 +9,13 @@ template(name="checklistTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-check-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -27,6 +34,13 @@ template(name="checklistTriggers")
|
|||
option(value="removed") {{_'r-removed-from'}}
|
||||
div.trigger-text
|
||||
| {{_'r-a-card'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-spec-check-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -38,6 +52,13 @@ template(name="checklistTriggers")
|
|||
select(id="gen-comp-check-action")
|
||||
option(value="completed") {{_'r-completed'}}
|
||||
option(value="uncompleted") {{_'r-made-incomplete'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-comp-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -53,6 +74,13 @@ template(name="checklistTriggers")
|
|||
select(id="spec-comp-check-action")
|
||||
option(value="completed") {{_'r-completed'}}
|
||||
option(value="uncompleted") {{_'r-made-incomplete'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-spec-comp-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -64,6 +92,13 @@ template(name="checklistTriggers")
|
|||
select(id="check-item-gen-action")
|
||||
option(value="checked") {{_'r-checked'}}
|
||||
option(value="unchecked") {{_'r-unchecked'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-gen-check-item-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
@ -79,5 +114,12 @@ template(name="checklistTriggers")
|
|||
select(id="check-item-spec-action")
|
||||
option(value="checked") {{_'r-checked'}}
|
||||
option(value="unchecked") {{_'r-unchecked'}}
|
||||
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'}}")
|
||||
div.trigger-button.js-add-spec-check-item-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
|
|
@ -610,6 +610,8 @@
|
|||
"r-d-check-of-list": "of checklist",
|
||||
"r-d-add-checklist": "Add checklist",
|
||||
"r-d-remove-checklist": "Remove checklist",
|
||||
"r-by": "by",
|
||||
"r-user-name": "username",
|
||||
"r-when-a-card-is-moved": "When a card is moved to another list",
|
||||
"ldap": "LDAP",
|
||||
"oauth2": "OAuth2",
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
TriggersDef = {
|
||||
createCard:{
|
||||
matchingFields: ['boardId', 'listName'],
|
||||
matchingFields: ['boardId', 'listName','userId'],
|
||||
},
|
||||
moveCard:{
|
||||
matchingFields: ['boardId', 'listName', 'oldListName'],
|
||||
matchingFields: ['boardId', 'listName', 'oldListName','userId'],
|
||||
},
|
||||
archivedCard:{
|
||||
matchingFields: ['boardId'],
|
||||
matchingFields: ['boardId','userId'],
|
||||
},
|
||||
restoredCard:{
|
||||
matchingFields: ['boardId'],
|
||||
matchingFields: ['boardId','userId'],
|
||||
},
|
||||
joinMember:{
|
||||
matchingFields: ['boardId', 'username'],
|
||||
matchingFields: ['boardId', 'username','userId'],
|
||||
},
|
||||
unjoinMember:{
|
||||
matchingFields: ['boardId', 'username'],
|
||||
matchingFields: ['boardId', 'username','userId'],
|
||||
},
|
||||
addChecklist:{
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
matchingFields: ['boardId', 'checklistName','userId'],
|
||||
},
|
||||
removeChecklist:{
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
matchingFields: ['boardId', 'checklistName','userId'],
|
||||
},
|
||||
completeChecklist:{
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
matchingFields: ['boardId', 'checklistName','userId'],
|
||||
},
|
||||
uncompleteChecklist:{
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
matchingFields: ['boardId', 'checklistName','userId'],
|
||||
},
|
||||
addedChecklistItem:{
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
matchingFields: ['boardId', 'checklistItemName','userId'],
|
||||
},
|
||||
removedChecklistItem:{
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
matchingFields: ['boardId', 'checklistItemName','userId'],
|
||||
},
|
||||
checkedItem:{
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
matchingFields: ['boardId', 'checklistItemName','userId'],
|
||||
},
|
||||
uncheckedItem:{
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
matchingFields: ['boardId', 'checklistItemName','userId'],
|
||||
},
|
||||
addAttachment:{
|
||||
matchingFields: ['boardId'],
|
||||
matchingFields: ['boardId','userId'],
|
||||
},
|
||||
deleteAttachment:{
|
||||
matchingFields: ['boardId'],
|
||||
matchingFields: ['boardId','userId'],
|
||||
},
|
||||
addedLabel:{
|
||||
matchingFields: ['boardId', 'labelId'],
|
||||
matchingFields: ['boardId', 'labelId','userId'],
|
||||
},
|
||||
removedLabel:{
|
||||
matchingFields: ['boardId', 'labelId'],
|
||||
matchingFields: ['boardId', 'labelId','userId'],
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue