Fix problems highlighted by Codacy/PR Quality Review

This commit is contained in:
RJevnikar 2018-06-05 21:21:14 +00:00
parent 3ce3fa74b3
commit 78b9436f38
4 changed files with 13 additions and 2 deletions

View file

@ -129,6 +129,7 @@ template(name="boardMenuPopup")
ul.pop-over-list
li: a(href="{{exportUrl}}", download="{{exportFilename}}") {{_ 'export-board'}}
li: a.js-archive-board {{_ 'archive-board'}}
li: a.js-delete-board {{_ 'delete-board'}}
li: a.js-outgoing-webhooks {{_ 'outgoing-webhooks'}}
if isSandstorm
hr
@ -237,6 +238,10 @@ template(name="archiveBoardPopup")
p {{_ 'close-board-pop'}}
button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
template(name="deleteBoardPopup")
p {{_ 'delete-board-pop'}}
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
template(name="outgoingWebhooksPopup")
each integrations
form.integration-form

View file

@ -17,6 +17,12 @@ Template.boardMenuPopup.events({
// 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'),
});

View file

@ -156,7 +156,7 @@ BlazeComponent.extendComponent({
'submit .js-card-details-requester'(evt) {
evt.preventDefault();
const requester = this.currentComponent().getValue().trim();
if (requestor) {
if (requester) {
this.data().setRequestedBy(requester);
}
},

View file

@ -68,7 +68,7 @@ Cards.attachSchema(new SimpleSchema({
},
requestedBy: {
type: String,
optional: true
optional: true,
},
assignedBy: {
type: String,