mirror of
https://github.com/wekan/wekan.git
synced 2025-12-22 18:30:13 +01:00
[Fix Adding Labels to cards is not possible anymore](https://github.com/wekan/wekan/issues/2223).
Thanks to xet7 ! Closes #2223
This commit is contained in:
parent
0b64a46bdc
commit
763cf81c97
5 changed files with 98 additions and 42 deletions
|
|
@ -133,6 +133,36 @@ template(name="boardVisibilityList")
|
||||||
i.fa.fa-check
|
i.fa.fa-check
|
||||||
span.sub-name {{_ 'public-desc'}}
|
span.sub-name {{_ 'public-desc'}}
|
||||||
|
|
||||||
|
template(name="boardChangeVisibilityPopup")
|
||||||
|
+boardVisibilityList
|
||||||
|
|
||||||
|
template(name="boardChangeWatchPopup")
|
||||||
|
ul.pop-over-list
|
||||||
|
li
|
||||||
|
with "watching"
|
||||||
|
a.js-select-watch
|
||||||
|
i.fa.fa-eye.colorful
|
||||||
|
| {{_ 'watching'}}
|
||||||
|
if watchCheck
|
||||||
|
i.fa.fa-check
|
||||||
|
span.sub-name {{_ 'watching-info'}}
|
||||||
|
li
|
||||||
|
with "tracking"
|
||||||
|
a.js-select-watch
|
||||||
|
i.fa.fa-bell.colorful
|
||||||
|
| {{_ 'tracking'}}
|
||||||
|
if watchCheck
|
||||||
|
i.fa.fa-check
|
||||||
|
span.sub-name {{_ 'tracking-info'}}
|
||||||
|
li
|
||||||
|
with "muted"
|
||||||
|
a.js-select-watch
|
||||||
|
i.fa.fa-bell-slash.colorful
|
||||||
|
| {{_ 'muted'}}
|
||||||
|
if watchCheck
|
||||||
|
i.fa.fa-check
|
||||||
|
span.sub-name {{_ 'muted-info'}}
|
||||||
|
|
||||||
template(name="createBoard")
|
template(name="createBoard")
|
||||||
form
|
form
|
||||||
label
|
label
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,49 @@
|
||||||
|
Template.boardMenuPopup.events({
|
||||||
|
'click .js-rename-board': Popup.open('boardChangeTitle'),
|
||||||
|
'click .js-custom-fields'() {
|
||||||
|
Sidebar.setView('customFields');
|
||||||
|
Popup.close();
|
||||||
|
},
|
||||||
|
'click .js-open-archives'() {
|
||||||
|
Sidebar.setView('archives');
|
||||||
|
Popup.close();
|
||||||
|
},
|
||||||
|
'click .js-change-board-color': Popup.open('boardChangeColor'),
|
||||||
|
'click .js-change-language': Popup.open('changeLanguage'),
|
||||||
|
'click .js-archive-board ': Popup.afterConfirm('archiveBoard', function() {
|
||||||
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
|
currentBoard.archive();
|
||||||
|
// XXX We should have some kind of notification on top of the page to
|
||||||
|
// confirm that the board was successfully archived.
|
||||||
|
FlowRouter.go('home');
|
||||||
|
}),
|
||||||
|
'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() {
|
||||||
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
|
Popup.close();
|
||||||
|
Boards.remove(currentBoard._id);
|
||||||
|
FlowRouter.go('home');
|
||||||
|
}),
|
||||||
|
'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'),
|
||||||
|
'click .js-import-board': Popup.open('chooseBoardSource'),
|
||||||
|
'click .js-subtask-settings': Popup.open('boardSubtaskSettings'),
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.boardMenuPopup.helpers({
|
||||||
|
exportUrl() {
|
||||||
|
const params = {
|
||||||
|
boardId: Session.get('currentBoard'),
|
||||||
|
};
|
||||||
|
const queryParams = {
|
||||||
|
authToken: Accounts._storedLoginToken(),
|
||||||
|
};
|
||||||
|
return FlowRouter.path('/api/boards/:boardId/export', params, queryParams);
|
||||||
|
},
|
||||||
|
exportFilename() {
|
||||||
|
const boardId = Session.get('currentBoard');
|
||||||
|
return `wekan-export-board-${boardId}.json`;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.boardChangeTitlePopup.events({
|
Template.boardChangeTitlePopup.events({
|
||||||
submit(evt, tpl) {
|
submit(evt, tpl) {
|
||||||
const newTitle = tpl.$('.js-board-name').val().trim();
|
const newTitle = tpl.$('.js-board-name').val().trim();
|
||||||
|
|
@ -35,8 +81,12 @@ BlazeComponent.extendComponent({
|
||||||
'click .js-star-board'() {
|
'click .js-star-board'() {
|
||||||
Meteor.user().toggleBoardStar(Session.get('currentBoard'));
|
Meteor.user().toggleBoardStar(Session.get('currentBoard'));
|
||||||
},
|
},
|
||||||
|
'click .js-open-board-menu': Popup.open('boardMenu'),
|
||||||
'click .js-change-visibility': Popup.open('boardChangeVisibility'),
|
'click .js-change-visibility': Popup.open('boardChangeVisibility'),
|
||||||
'click .js-watch-board': Popup.open('boardChangeWatch'),
|
'click .js-watch-board': Popup.open('boardChangeWatch'),
|
||||||
|
'click .js-open-archived-board'() {
|
||||||
|
Modal.open('archivedBoards');
|
||||||
|
},
|
||||||
'click .js-toggle-board-view'() {
|
'click .js-toggle-board-view'() {
|
||||||
const currentUser = Meteor.user();
|
const currentUser = Meteor.user();
|
||||||
if (currentUser.profile.boardView === 'board-view-swimlanes') {
|
if (currentUser.profile.boardView === 'board-view-swimlanes') {
|
||||||
|
|
@ -136,6 +186,9 @@ const CreateBoard = BlazeComponent.extendComponent({
|
||||||
this.setVisibility(this.currentData());
|
this.setVisibility(this.currentData());
|
||||||
},
|
},
|
||||||
'click .js-change-visibility': this.toggleVisibilityMenu,
|
'click .js-change-visibility': this.toggleVisibilityMenu,
|
||||||
|
'click .js-import': Popup.open('boardImportBoard'),
|
||||||
|
submit: this.onSubmit,
|
||||||
|
'click .js-import-board': Popup.open('chooseBoardSource'),
|
||||||
'click .js-board-template': Popup.open('searchElement'),
|
'click .js-board-template': Popup.open('searchElement'),
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -56,36 +56,6 @@ template(name="membersWidget")
|
||||||
button.js-member-invite-accept.primary {{_ 'accept'}}
|
button.js-member-invite-accept.primary {{_ 'accept'}}
|
||||||
button.js-member-invite-decline {{_ 'decline'}}
|
button.js-member-invite-decline {{_ 'decline'}}
|
||||||
|
|
||||||
template(name="boardChangeVisibilityPopup")
|
|
||||||
+boardVisibilityList
|
|
||||||
|
|
||||||
template(name="boardChangeWatchPopup")
|
|
||||||
ul.pop-over-list
|
|
||||||
li
|
|
||||||
with "watching"
|
|
||||||
a.js-select-watch
|
|
||||||
i.fa.fa-eye.colorful
|
|
||||||
| {{_ 'watching'}}
|
|
||||||
if watchCheck
|
|
||||||
i.fa.fa-check
|
|
||||||
span.sub-name {{_ 'watching-info'}}
|
|
||||||
li
|
|
||||||
with "tracking"
|
|
||||||
a.js-select-watch
|
|
||||||
i.fa.fa-bell.colorful
|
|
||||||
| {{_ 'tracking'}}
|
|
||||||
if watchCheck
|
|
||||||
i.fa.fa-check
|
|
||||||
span.sub-name {{_ 'tracking-info'}}
|
|
||||||
li
|
|
||||||
with "muted"
|
|
||||||
a.js-select-watch
|
|
||||||
i.fa.fa-bell-slash.colorful
|
|
||||||
| {{_ 'muted'}}
|
|
||||||
if watchCheck
|
|
||||||
i.fa.fa-check
|
|
||||||
span.sub-name {{_ 'muted-info'}}
|
|
||||||
|
|
||||||
template(name="boardChangeColorPopup")
|
template(name="boardChangeColorPopup")
|
||||||
.board-backgrounds-list.clearfix
|
.board-backgrounds-list.clearfix
|
||||||
each backgroundColors
|
each backgroundColors
|
||||||
|
|
|
||||||
|
|
@ -56,23 +56,22 @@ Activities.helpers({
|
||||||
customField() {
|
customField() {
|
||||||
return CustomFields.findOne(this.customFieldId);
|
return CustomFields.findOne(this.customFieldId);
|
||||||
},
|
},
|
||||||
label() {
|
// Label activity did not work yet, unable to edit labels when tried this.
|
||||||
return Labels.findOne(this.labelId);
|
//label() {
|
||||||
},
|
// return Cards.findOne(this.labelId);
|
||||||
|
//},
|
||||||
});
|
});
|
||||||
|
|
||||||
Activities.before.insert((userId, doc) => {
|
Activities.before.insert((userId, doc) => {
|
||||||
doc.createdAt = new Date();
|
doc.createdAt = new Date();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Activities.after.insert((userId, doc) => {
|
Activities.after.insert((userId, doc) => {
|
||||||
const activity = Activities._transform(doc);
|
const activity = Activities._transform(doc);
|
||||||
RulesHelper.executeRules(activity);
|
RulesHelper.executeRules(activity);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
// For efficiency create indexes on the date of creation, and on the date of
|
// For efficiency create indexes on the date of creation, and on the date of
|
||||||
// creation in conjunction with the card or board id, as corresponding views
|
// creation in conjunction with the card or board id, as corresponding views
|
||||||
|
|
@ -84,7 +83,9 @@ if (Meteor.isServer) {
|
||||||
Activities._collection._ensureIndex({ commentId: 1 }, { partialFilterExpression: { commentId: { $exists: true } } });
|
Activities._collection._ensureIndex({ commentId: 1 }, { partialFilterExpression: { commentId: { $exists: true } } });
|
||||||
Activities._collection._ensureIndex({ attachmentId: 1 }, { partialFilterExpression: { attachmentId: { $exists: true } } });
|
Activities._collection._ensureIndex({ attachmentId: 1 }, { partialFilterExpression: { attachmentId: { $exists: true } } });
|
||||||
Activities._collection._ensureIndex({ customFieldId: 1 }, { partialFilterExpression: { customFieldId: { $exists: true } } });
|
Activities._collection._ensureIndex({ customFieldId: 1 }, { partialFilterExpression: { customFieldId: { $exists: true } } });
|
||||||
Activities._collection._ensureIndex({ labelId: 1 }, { partialFilterExpression: { labelId: { $exists: true } } });
|
// Label activity did not work yet, unable to edit labels when tried this.
|
||||||
|
//Activities._collection._dropIndex({ labelId: 1 }, { "indexKey": -1 });
|
||||||
|
//Activities._collection._dropIndex({ labelId: 1 }, { partialFilterExpression: { labelId: { $exists: true } } });
|
||||||
});
|
});
|
||||||
|
|
||||||
Activities.after.insert((userId, doc) => {
|
Activities.after.insert((userId, doc) => {
|
||||||
|
|
@ -173,11 +174,12 @@ if (Meteor.isServer) {
|
||||||
const customField = activity.customField();
|
const customField = activity.customField();
|
||||||
params.customField = customField.name;
|
params.customField = customField.name;
|
||||||
}
|
}
|
||||||
if (activity.labelId) {
|
// Label activity did not work yet, unable to edit labels when tried this.
|
||||||
const label = activity.label();
|
//if (activity.labelId) {
|
||||||
params.label = label.name;
|
// const label = activity.label();
|
||||||
params.labelId = activity.labelId;
|
// params.label = label.name;
|
||||||
}
|
// params.labelId = activity.labelId;
|
||||||
|
//}
|
||||||
if (board) {
|
if (board) {
|
||||||
const watchingUsers = _.pluck(_.where(board.watchers, {level: 'watching'}), 'userId');
|
const watchingUsers = _.pluck(_.where(board.watchers, {level: 'watching'}), 'userId');
|
||||||
const trackingUsers = _.pluck(_.where(board.watchers, {level: 'tracking'}), 'userId');
|
const trackingUsers = _.pluck(_.where(board.watchers, {level: 'tracking'}), 'userId');
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,9 @@ Meteor.methods({
|
||||||
check(description, String);
|
check(description, String);
|
||||||
check(params, Object);
|
check(params, Object);
|
||||||
|
|
||||||
|
// label activity did not work yet, see wekan/models/activities.js
|
||||||
const quoteParams = _.clone(params);
|
const quoteParams = _.clone(params);
|
||||||
['card', 'list', 'oldList', 'board', 'oldBoard', 'comment', 'checklist', 'label', 'swimlane', 'oldSwimlane'].forEach((key) => {
|
['card', 'list', 'oldList', 'board', 'oldBoard', 'comment', 'checklist', 'swimlane', 'oldSwimlane'].forEach((key) => {
|
||||||
if (quoteParams[key]) quoteParams[key] = `"${params[key]}"`;
|
if (quoteParams[key]) quoteParams[key] = `"${params[key]}"`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue