diff --git a/addons/web/static/src/js/widgets/notification.js b/addons/web/static/src/js/widgets/notification.js index 0e9cdabe7ca..59044a19198 100644 --- a/addons/web/static/src/js/widgets/notification.js +++ b/addons/web/static/src/js/widgets/notification.js @@ -53,22 +53,14 @@ var Notification = Widget.extend({ this._closeCallback = params.onClose; if (this.type === 'danger') { - this.icon = 'fa-exclamation'; this.className += ' bg-danger'; } else if (this.type === 'warning') { - this.icon = 'fa-lightbulb-o'; this.className += ' bg-warning'; } else if (this.type === 'success') { - this.icon = 'fa-check'; this.className += ' bg-success'; } else if (this.type === 'info') { - this.icon = 'fa-info'; this.className += ' bg-info'; } - - if (this.buttons && this.buttons.length) { - this.icon = 'fa-question-circle-o'; - } }, /** * @override diff --git a/addons/web/static/src/scss/notification.scss b/addons/web/static/src/scss/notification.scss index 561f7ab0552..83007fb653b 100644 --- a/addons/web/static/src/scss/notification.scss +++ b/addons/web/static/src/scss/notification.scss @@ -14,7 +14,7 @@ width: 100%; .toast-body { - padding: 8px 10px; + padding: 0.75rem; .o_notification_close { height: 20px; diff --git a/addons/web/static/src/xml/notification.xml b/addons/web/static/src/xml/notification.xml index e23538d1e28..761c02f0eb1 100644 --- a/addons/web/static/src/xml/notification.xml +++ b/addons/web/static/src/xml/notification.xml @@ -4,30 +4,21 @@
- +
- -
- -
- -
-
- + class="o_notification_subtitle mb-2 font-weight-normal text-muted"/>
+ class="o_notification_content"/>
b
", + "
a
b
", "should display notification"); assert.containsOnce($notification, '.o_notification_close'); await waitCloseNotification(); @@ -80,7 +80,7 @@ QUnit.module('Services', { await testUtils.nextMicrotaskTick(); var $notification = $('body .o_notification_manager .o_notification'); assert.strictEqual($notification.html().trim().replace(/\s+/g, ' '), - "
a
b
", + "
a
b
", "should display notification"); view.destroy(); }); @@ -117,7 +117,7 @@ QUnit.module('Services', { await testUtils.nextTick(); const $notification = $('body .o_notification_manager .o_notification'); assert.containsNone($notification, '.toast-header .o_notification_title'); - assert.containsNone($notification, '.o_notification_icon'); + assert.containsOnce($notification, '.o_notification_content'); assert.containsOnce($notification, '.toast-body .o_notification_close'); view.destroy(); @@ -206,7 +206,7 @@ QUnit.module('Services', { assert.containsOnce($notification.eq(0), '.o_notification_close', "should display the close button in notification"); assert.strictEqual($notification.html().trim().replace(/\s+/g, ' '), - "
a0
b0
", + "
a0
b0
", "should display notification"); testUtils.dom.click($notification.find('.o_notification_buttons button:contains(accept0)'));