From 0a3d08c44311d6f6b9455d3fd3937ddb5a31e06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Thu, 30 Aug 2018 17:35:03 +0200 Subject: [PATCH] [REM] mail: no push notifications permission request in Discuss This has been replaced with "OdooBot has a request" in the systray messaging menu (see https://github.com/odoo/odoo/commit/f80bbb4b2a1230ba543e97d3da01c7b2c52d24cc). Task-ID 1877502 --- addons/mail/static/src/js/discuss.js | 33 ------------------------ addons/mail/static/src/scss/discuss.scss | 29 --------------------- addons/mail/static/src/xml/discuss.xml | 6 ----- 3 files changed, 68 deletions(-) diff --git a/addons/mail/static/src/js/discuss.js b/addons/mail/static/src/js/discuss.js index 258b5a32c0a..d1b954a0453 100644 --- a/addons/mail/static/src/js/discuss.js +++ b/addons/mail/static/src/js/discuss.js @@ -185,11 +185,9 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, { 'click .o_mail_sidebar_title .o_add': '_onAddThread', 'blur .o_mail_add_thread input': '_onAddThreadBlur', 'click .o_mail_channel_settings': '_onChannelSettingsClicked', - 'click .o_mail_annoying_notification_bar .fa-close': '_onCloseNotificationBar', 'click .o_mail_discuss_item': '_onDiscussItemClicked', 'keydown': '_onKeydown', 'click .o_mail_open_channels': '_onPublicChannelsClick', - 'click .o_mail_request_permission': '_onRequestNotificationPermission', 'click .o_mail_partner_unpin': '_onUnpinChannel', }, @@ -203,10 +201,6 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, { this.action = action; this.action_manager = parent; this.dataset = new data.DataSetSearch(this, 'mail.message'); - this.displayNotificationBar = ( - window.Notification && - window.Notification.permission === 'default' - ); this.domain = []; this.options = options || {}; @@ -1162,12 +1156,6 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, { target: 'current' }); }, - /** - * @private - */ - _onCloseNotificationBar: function () { - this.$('.o_mail_annoying_notification_bar').slideUp(); - }, /** * @private */ @@ -1364,27 +1352,6 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, { on_reverse_breadcrumb: this.on_reverse_breadcrumb, }); }, - /** - * @private - * @param {MouseEvent} ev - */ - _onRequestNotificationPermission: function (ev) { - var self = this; - ev.preventDefault(); - this.$('.o_mail_annoying_notification_bar').slideUp(); - var def = window.Notification && window.Notification.requestPermission(); - if (def) { - def.then(function (value) { - if (value !== 'granted') { - self.call('bus_service', 'sendNotification', _t("Permission denied"), - _t("Odoo will not have the permission to send native notifications on this device.")); - } else { - self.call('bus_service', 'sendNotification', _t("Permission granted"), - _t("Odoo has now the permission to send you native notifications on this device.")); - } - }); - } - }, /** * @private * @param {OdooEvent} ev diff --git a/addons/mail/static/src/scss/discuss.scss b/addons/mail/static/src/scss/discuss.scss index 9548a91c737..245b715ed21 100644 --- a/addons/mail/static/src/scss/discuss.scss +++ b/addons/mail/static/src/scss/discuss.scss @@ -7,35 +7,6 @@ height: 100%; overflow: hidden; - .o_mail_annoying_notification_bar { - height: 40px; - background-color: #DFA941; - color: white; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25); - display: flex; - border-bottom: 1px solid $o-main-color-muted; - - .o_mail_request_permission { - display: flex; - justify-content: center; - flex: 1 1 auto; - } - > span { - font-size: 16px; - line-height: 40px; - > a { - color: white; - margin-left: 5px; - text-decoration: underline; - } - - &.fa-close { - margin-right: 10px; - cursor: pointer; - } - } - } - .o_mail_discuss_sidebar { width: $o-mail-chat-sidebar-width; height: 100%; diff --git a/addons/mail/static/src/xml/discuss.xml b/addons/mail/static/src/xml/discuss.xml index eb03e3c0c55..5d35ca8b7cd 100644 --- a/addons/mail/static/src/xml/discuss.xml +++ b/addons/mail/static/src/xml/discuss.xml @@ -10,12 +10,6 @@
- -
- Odoo needs your permission to enable desktop notifications. - -
-