Skip to content

Commit

Permalink
chore: add a property for toasts
Browse files Browse the repository at this point in the history
part of #7399

Signed-off-by: Florent Benoit <[email protected]>
  • Loading branch information
benoitf committed Oct 21, 2024
1 parent 529ff3f commit ffad59a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/api/src/tasks-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
export enum ExperimentalTasksSettings {
SectionName = 'tasks',
StatusBar = 'StatusBar',
Toast = 'Toast',
}
16 changes: 16 additions & 0 deletions packages/main/src/plugin/tasks/task-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ test('task manager init should register a configuration option', async () => {
const taskManager = new TaskManager(apiSender, statusBarRegistry, commandRegistry, configurationRegistry);
taskManager.init();
expect(configurationRegistry.registerConfigurations).toHaveBeenCalledOnce();
expect(configurationRegistry.registerConfigurations).toHaveBeenCalledWith(
expect.arrayContaining([expect.objectContaining({ id: 'preferences.experimental.tasks' })]),
);
expect(configurationRegistry.registerConfigurations).toHaveBeenCalledWith(
expect.arrayContaining([
expect.objectContaining({
properties: expect.objectContaining({
'tasks.Toast': {
type: 'boolean',
description: 'Display a notification toast when task is created',
default: false,
},
}),
}),
]),
);
});

test('create task with title', async () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/main/src/plugin/tasks/task-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export class TaskManager {
type: 'boolean',
default: false,
},
[`${ExperimentalTasksSettings.SectionName}.${ExperimentalTasksSettings.Toast}`]: {
description: 'Display a notification toast when task is created',
type: 'boolean',
default: false,
},
},
},
]);
Expand Down

0 comments on commit ffad59a

Please sign in to comment.