mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
notificationFilter.ERROR
This commit is contained in:
parent
671fc8f654
commit
00de15d765
|
@ -238,7 +238,12 @@ export enum NotificationsFilter {
|
|||
* All notifications are configured as silent. See
|
||||
* `INotificationProperties.silent` for more info.
|
||||
*/
|
||||
SILENT
|
||||
SILENT,
|
||||
|
||||
/**
|
||||
* All notifications are silent except error notifications.
|
||||
*/
|
||||
ERROR
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -685,7 +685,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
|||
|
||||
this.state.zenMode.setNotificationsFilter = config.silentNotifications;
|
||||
if (config.silentNotifications) {
|
||||
this.notificationService.setFilter(NotificationsFilter.SILENT);
|
||||
this.notificationService.setFilter(NotificationsFilter.ERROR);
|
||||
}
|
||||
|
||||
if (config.centerLayout) {
|
||||
|
|
|
@ -95,7 +95,7 @@ export class NotificationsToasts extends Themable {
|
|||
|
||||
// Filter
|
||||
this._register(this.model.onDidFilterChange(filter => {
|
||||
if (filter === NotificationsFilter.SILENT) {
|
||||
if (filter === NotificationsFilter.SILENT || filter === NotificationsFilter.ERROR) {
|
||||
this.hide();
|
||||
}
|
||||
}));
|
||||
|
|
|
@ -438,7 +438,7 @@ export class NotificationViewItem extends Disposable implements INotificationVie
|
|||
actions = { primary: notification.message.actions };
|
||||
}
|
||||
|
||||
return new NotificationViewItem(severity, notification.sticky, notification.silent || filter === NotificationsFilter.SILENT, message, notification.source, actions);
|
||||
return new NotificationViewItem(severity, notification.sticky, notification.silent || filter === NotificationsFilter.SILENT || (filter === NotificationsFilter.ERROR && notification.severity !== Severity.Error), message, notification.source, actions);
|
||||
}
|
||||
|
||||
private static parseNotificationMessage(input: NotificationMessage): INotificationMessage | undefined {
|
||||
|
|
|
@ -134,6 +134,12 @@ suite('Notifications', () => {
|
|||
|
||||
let item9 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' }, NotificationsFilter.OFF)!;
|
||||
assert.equal(item9.silent, false);
|
||||
|
||||
let item10 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' }, NotificationsFilter.ERROR)!;
|
||||
assert.equal(item10.silent, false);
|
||||
|
||||
let item11 = NotificationViewItem.create({ severity: Severity.Warning, message: 'Error Message' }, NotificationsFilter.ERROR)!;
|
||||
assert.equal(item11.silent, true);
|
||||
});
|
||||
|
||||
test('Model', () => {
|
||||
|
|
Loading…
Reference in a new issue