[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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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%;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user