summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-08-30 17:35:03 +0200
committerAlexandre Kühn <aku@odoo.com>2018-08-31 10:22:56 +0200
commit0a3d08c44311d6f6b9455d3fd3937ddb5a31e06a (patch)
tree41f878acbf768bab67113a9a5a8ac5fbe68bf27a
parent2e78aa4f56e6dd5f85a1f8de37b47e30d112b2db (diff)
[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
-rw-r--r--addons/mail/static/src/js/discuss.js33
-rw-r--r--addons/mail/static/src/scss/discuss.scss29
-rw-r--r--addons/mail/static/src/xml/discuss.xml6
3 files changed, 0 insertions, 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 || {};
@@ -1165,12 +1159,6 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, {
/**
* @private
*/
- _onCloseNotificationBar: function () {
- this.$('.o_mail_annoying_notification_bar').slideUp();
- },
- /**
- * @private
- */
_onComposerFocused: function () {
var composer = this._thread.isMassMailing() ? this._extendedComposer : this._basicComposer;
var commands = this._thread.getCommands();
@@ -1366,27 +1354,6 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, {
},
/**
* @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
*/
_onSearch: function (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 @@
<div class="o_mail_discuss">
<div class="o_mail_discuss_sidebar"/>
<div class="o_mail_discuss_content">
- <t t-if="widget.displayNotificationBar">
- <div class="o_mail_annoying_notification_bar">
- <span class="o_mail_request_permission">Odoo needs your permission to <a href="#"> enable desktop notifications</a>.</span>
- <span class="fa fa-close" role="button" aria-label="Close" title="Close"></span>
- </div>
- </t>
</div>
</div>
</t>