mirror of
https://github.com/wekan/wekan.git
synced 2026-02-10 02:04:20 +01:00
Legacy Lists button at one board view to restore missing lists/cards.
Thanks to xet7 ! Fixes #5952
This commit is contained in:
parent
1658883b78
commit
951d2e4937
5 changed files with 233 additions and 14 deletions
|
|
@ -130,6 +130,11 @@ template(name="boardHeaderBar")
|
|||
a.board-header-btn-close.js-multiselection-reset(title="{{_ 'filter-clear'}}")
|
||||
| ❌
|
||||
|
||||
if currentUser.isBoardAdmin
|
||||
a.board-header-btn.js-restore-legacy-lists(title="{{_ 'restore-legacy-lists'}}")
|
||||
| 🔄
|
||||
| {{_ 'legacy-lists'}}
|
||||
|
||||
.separator
|
||||
a.board-header-btn.js-toggle-sidebar(title="{{_ 'sidebar-open'}} {{_ 'or'}} {{_ 'sidebar-close'}}")
|
||||
| ☰
|
||||
|
|
|
|||
|
|
@ -152,9 +152,32 @@ BlazeComponent.extendComponent({
|
|||
'click .js-log-in'() {
|
||||
FlowRouter.go('atSignIn');
|
||||
},
|
||||
'click .js-restore-legacy-lists'() {
|
||||
this.restoreLegacyLists();
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
restoreLegacyLists() {
|
||||
// Show confirmation dialog
|
||||
if (confirm('Are you sure you want to restore legacy lists to their original shared state? This will make them appear in all swimlanes.')) {
|
||||
// Call cron method to restore legacy lists
|
||||
Meteor.call('cron.triggerRestoreLegacyLists', (error, result) => {
|
||||
if (error) {
|
||||
console.error('Error restoring legacy lists:', error);
|
||||
alert(`Error: ${error.message}`);
|
||||
} else {
|
||||
console.log('Successfully triggered restore legacy lists migration:', result);
|
||||
alert(`Migration triggered successfully. Job ID: ${result.jobId}`);
|
||||
// Refresh the board to show the restored lists
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}).register('boardHeaderBar');
|
||||
|
||||
Template.boardHeaderBar.helpers({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue