added the confirm pop up before cloning or archiving a board

pull/5745/head
Zegden Rayen 2 months ago committed by GitHub
parent 1bdbfe86bb
commit 094f13934c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 55
      client/components/boards/boardsList.js

@ -239,34 +239,41 @@ BlazeComponent.extendComponent({
evt.preventDefault();
},
'click .js-clone-board'(evt) {
let title = getSlug(ReactiveCache.getBoard(this.currentData()._id).title) || 'cloned-board';
Meteor.call(
'copyBoard',
this.currentData()._id,
{
sort: ReactiveCache.getBoards({ archived: false }).length,
type: 'board',
title: ReactiveCache.getBoard(this.currentData()._id).title,
},
(err, res) => {
if (err) {
console.error(err);
} else {
Session.set('fromBoard', null);
subManager.subscribe('board', res, false);
FlowRouter.go('board', {
id: res,
slug: title,
});
}
},
);
evt.preventDefault();
if (confirm('Are you sure you want to clone this board?')) {
let title =
getSlug(ReactiveCache.getBoard(this.currentData()._id).title) ||
'cloned-board';
Meteor.call(
'copyBoard',
this.currentData()._id,
{
sort: ReactiveCache.getBoards({ archived: false }).length,
type: 'board',
title: ReactiveCache.getBoard(this.currentData()._id).title,
},
(err, res) => {
if (err) {
console.error(err);
} else {
Session.set('fromBoard', null);
subManager.subscribe('board', res, false);
FlowRouter.go('board', {
id: res,
slug: title,
});
}
},
);
evt.preventDefault();
}
},
'click .js-archive-board'(evt) {
const boardId = this.currentData()._id;
if (confirm('Are you sure you want to archive this board?'))
{
const boardId = this.currentData()._id;
Meteor.call('archiveBoard', boardId);
evt.preventDefault();
}
},
'click .js-accept-invite'() {
const boardId = this.currentData()._id;

Loading…
Cancel
Save