Add configuration options to show or hide task notifications

This commit is contained in:
Gordon 2021-04-14 12:49:53 +01:00
parent 9c9155e18e
commit 14b512bb12
3 changed files with 11 additions and 5 deletions

View File

@ -147,7 +147,7 @@ export default class KanbnBoardPanel {
// Open a burndown chart
case 'kanbn.burndown':
// TODO open a burndown chart webview panel
vscode.window.showInformationMessage('opening burndown chart...');
vscode.window.showErrorMessage('Not implemented yet!');
return;
}
}, null, this._disposables);

View File

@ -161,7 +161,9 @@ export default class KanbnTaskPanel {
KanbnTaskPanel.panels[message.panelUuid]._taskId = message.taskData.id;
KanbnTaskPanel.panels[message.panelUuid]._columnName = message.taskData.column;
KanbnTaskPanel.panels[message.panelUuid].update();
// vscode.window.showInformationMessage(`Created task '${message.taskData.name}'.`);
if (vscode.workspace.getConfiguration('vscode-kanbn').get('showTaskNotifications')) {
vscode.window.showInformationMessage(`Created task '${message.taskData.name}'.`);
}
return;
// Update a task
@ -170,7 +172,9 @@ export default class KanbnTaskPanel {
KanbnTaskPanel.panels[message.panelUuid]._taskId = message.taskData.id;
KanbnTaskPanel.panels[message.panelUuid]._columnName = message.taskData.column;
KanbnTaskPanel.panels[message.panelUuid].update();
// vscode.window.showInformationMessage(`Updated task '${message.taskData.name}'.`);
if (vscode.workspace.getConfiguration('vscode-kanbn').get('showTaskNotifications')) {
vscode.window.showInformationMessage(`Updated task '${message.taskData.name}'.`);
}
return;
// Delete a task and close the webview panel
@ -181,7 +185,9 @@ export default class KanbnTaskPanel {
await this._kanbn.deleteTask(message.taskId, true);
KanbnTaskPanel.panels[message.panelUuid].dispose();
delete KanbnTaskPanel.panels[message.panelUuid];
// vscode.window.showInformationMessage(`Deleted task '${message.taskData.name}'.`);
if (vscode.workspace.getConfiguration('vscode-kanbn').get('showTaskNotifications')) {
vscode.window.showInformationMessage(`Deleted task '${message.taskData.name}'.`);
}
}
}
);

View File

@ -69,7 +69,7 @@
"default": true,
"description": "Show the status bar item in workspaces where Kanbn has not yet been initialised."
},
"vscode-kanbn.showNotifications": {
"vscode-kanbn.showTaskNotifications": {
"type": "boolean",
"default": true,
"description": "Show notifications when a task is created, updated or deleted."