diff options
| author | Sébastien Theys <seb@odoo.com> | 2020-02-10 12:38:52 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2020-02-10 13:05:04 +0000 |
| commit | 5018b01dc7e0e5f2c2198367f13ec41b1ed402c7 (patch) | |
| tree | 203d080acdde573908db7eff49030adbb924b4c7 /addons/mail/static/src | |
| parent | b7ade94c30cfb78dbb94d01b76be17f7175e1eb2 (diff) | |
[IMP] mail, test_mail, hr_holidays: remove obsolete out of office
The customizable "out of office" text was removed from the editable views as
part of task-2053585, but some places in the code were still using it, even
though it was never set anymore.
This commit removes the obsolete code.
Part of task-2171864
closes odoo/odoo#44968
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/models/threads/abstract_thread.js | 10 | ||||
| -rw-r--r-- | addons/mail/static/src/js/models/threads/dm_chat.js | 13 | ||||
| -rw-r--r-- | addons/mail/static/src/js/services/mail_status_manager.js | 1 | ||||
| -rw-r--r-- | addons/mail/static/src/js/thread_windows/thread_window.js | 25 | ||||
| -rw-r--r-- | addons/mail/static/src/js/user_menu.js | 22 | ||||
| -rw-r--r-- | addons/mail/static/src/scss/out_of_office.scss | 11 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/out_of_office.xml | 4 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/user_menu.xml | 11 |
8 files changed, 1 insertions, 96 deletions
diff --git a/addons/mail/static/src/js/models/threads/abstract_thread.js b/addons/mail/static/src/js/models/threads/abstract_thread.js index 6961ba48175..ed10e761d62 100644 --- a/addons/mail/static/src/js/models/threads/abstract_thread.js +++ b/addons/mail/static/src/js/models/threads/abstract_thread.js @@ -83,14 +83,6 @@ var AbstractThread = Class.extend(Mixins.EventDispatcherMixin, { return undefined; }, /** - * By default, threads do not have out-of-office feature - * - * @return {string|undefined} - */ - getOutOfOfficeMessage: function () { - return undefined; - }, - /** * Get the status of the thread (e.g. 'online', 'offline', etc.) * * @returns {string} @@ -122,7 +114,7 @@ var AbstractThread = Class.extend(Mixins.EventDispatcherMixin, { * @return {boolean} */ hasOutOfOffice() { - return !!(this.getOutOfOfficeMessage() || this.getOutOfOfficeInfo()); + return !!this.getOutOfOfficeInfo(); }, /** * States whether this thread is compatible with the 'seen' feature. diff --git a/addons/mail/static/src/js/models/threads/dm_chat.js b/addons/mail/static/src/js/models/threads/dm_chat.js index 6b56cd2c80d..b811b5a5cd5 100644 --- a/addons/mail/static/src/js/models/threads/dm_chat.js +++ b/addons/mail/static/src/js/models/threads/dm_chat.js @@ -23,7 +23,6 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, { * @param {integer} params.data.direct_partner[0].id * @param {string} params.data.direct_partner[0].im_status * @param {string} params.data.direct_partner[0].name - * @param {string} [params.data.direct_partner[0].out_of_office_message] * @param {string} [params.data.direct_partner[0].out_of_office_date_end] */ init: function (params) { @@ -34,7 +33,6 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, { this._directPartnerID = data.direct_partner[0].id; this._name = data.custom_channel_name || data.direct_partner[0].name; - this._outOfOfficeMessage = data.direct_partner[0].out_of_office_message; this._outOfOfficeDateEnd = data.direct_partner[0].out_of_office_date_end; this._type = 'dm_chat'; @@ -78,15 +76,6 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, { return _.str.sprintf(_t("Out of office until %s"), formattedDate); }, /** - * Get the out of office message of the thread - * - * @override {mail.model.AbstractThread} - * @returns {string} - */ - getOutOfOfficeMessage: function () { - return this._outOfOfficeMessage; - }, - /** * @override */ getPreview: function () { @@ -104,11 +93,9 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, { /** * @param {Object} data - * @param {string} data.outOfOfficeMessage * @param {string} data.outOfOfficeDateEnd */ updateOutOfOfficeInfo: function (data) { - this._outOfOfficeMessage = data.outOfOfficeMessage; this._outOfOfficeDateEnd = data.outOfOfficeDateEnd; this.call('mail_service', 'getMailBus').trigger('updated_out_of_office', { threadID: this.getID(), diff --git a/addons/mail/static/src/js/services/mail_status_manager.js b/addons/mail/static/src/js/services/mail_status_manager.js index a40299a02d5..184499e8bb4 100644 --- a/addons/mail/static/src/js/services/mail_status_manager.js +++ b/addons/mail/static/src/js/services/mail_status_manager.js @@ -87,7 +87,6 @@ MailManager.include({ return; } dmChat.updateOutOfOfficeInfo({ - outOfOfficeMessage: channelInfo.direct_partner[0].out_of_office_message, outOfOfficeDateEnd: channelInfo.direct_partner[0].out_of_office_date_end, }); }); diff --git a/addons/mail/static/src/js/thread_windows/thread_window.js b/addons/mail/static/src/js/thread_windows/thread_window.js index f7f0c23dd7b..4bd1e6c15ff 100644 --- a/addons/mail/static/src/js/thread_windows/thread_window.js +++ b/addons/mail/static/src/js/thread_windows/thread_window.js @@ -24,7 +24,6 @@ var ThreadWindow = AbstractThreadWindow.extend({ 'click .o_mail_thread': '_onThreadWindowFocus', 'click .o_thread_composer': '_onThreadWindowFocus', 'click .o_thread_window_expand': '_onClickExpand', - 'click .o_out_of_office_read_more_less_button': '_onClickOutOfOfficeReadMoreLess', }), /** * Version of thread window that supports {mail.model.Thread} @@ -92,8 +91,6 @@ var ThreadWindow = AbstractThreadWindow.extend({ self.$input = self.$('.o_composer_text_field'); }); } - this._updateOutOfOfficeReadMoreLessButton(); - return Promise.all([superDef, composerDef]); }, @@ -262,19 +259,6 @@ var ThreadWindow = AbstractThreadWindow.extend({ }) .focus(); }, - /** - * @private - */ - _updateOutOfOfficeReadMoreLessButton: function () { - var $readMore = this.$('.o_out_of_office_text'); - var isOverflowing = $readMore.prop('scrollWidth') > $readMore.width(); - var isOverflowShown = !$readMore.hasClass('o_text_wrap'); - if (isOverflowing || isOverflowShown) { - var $button = this.$('.o_out_of_office_read_more_less_button'); - $button.show(); - $button.text(isOverflowing ? _t('Read more') : _t('Read less')); - } - }, //-------------------------------------------------------------------------- // Handlers @@ -314,15 +298,6 @@ var ThreadWindow = AbstractThreadWindow.extend({ } }, 1000, true), /** - * @private - * @param {MouseEvent} ev - */ - _onClickOutOfOfficeReadMoreLess: function (ev) { - ev.preventDefault(); - this.$('.o_out_of_office_text').toggleClass('o_text_wrap'); - this._updateOutOfOfficeReadMoreLessButton(); - }, - /** * @override * @private * @param {KeyboardEvent} ev diff --git a/addons/mail/static/src/js/user_menu.js b/addons/mail/static/src/js/user_menu.js deleted file mode 100644 index 77235c1f166..00000000000 --- a/addons/mail/static/src/js/user_menu.js +++ /dev/null @@ -1,22 +0,0 @@ -odoo.define('mail.UserMenu', function (require) { -"use strict"; - -/** - * This file includes the UserMenu widget defined in Community to add or - * override actions only available in Enterprise. - */ - -var UserMenu = require('web.UserMenu'); - -UserMenu.include({ - /** - * @override - */ - init: function () { - this._super.apply(this, arguments); - var session = this.getSession(); - this.outOfOfficeMessage = session.out_of_office_message; - }, -}); - -}); diff --git a/addons/mail/static/src/scss/out_of_office.scss b/addons/mail/static/src/scss/out_of_office.scss index 7ddbdd5d355..bcdb3a182f7 100644 --- a/addons/mail/static/src/scss/out_of_office.scss +++ b/addons/mail/static/src/scss/out_of_office.scss @@ -5,15 +5,4 @@ .o_out_of_office_info { font-weight: bold; } - .o_out_of_office_text { - word-wrap: break-word; - overflow: hidden; - text-overflow: ellipsis; - } - .o_text_wrap { - white-space: nowrap; - } - .o_out_of_office_read_more_less_button { - display: none; - } } diff --git a/addons/mail/static/src/xml/out_of_office.xml b/addons/mail/static/src/xml/out_of_office.xml index 89723daf5dc..19fb2c341c6 100644 --- a/addons/mail/static/src/xml/out_of_office.xml +++ b/addons/mail/static/src/xml/out_of_office.xml @@ -5,9 +5,5 @@ --> <div class="o_out_of_office" t-name="mail.thread.OutOfOffice"> <div class="o_out_of_office_info" t-if="thread.getOutOfOfficeInfo()" t-esc="thread.getOutOfOfficeInfo()"/> - <div class="o_out_of_office_text o_text_wrap" t-if="thread.getOutOfOfficeMessage()"> - <t t-esc="thread.getOutOfOfficeMessage()"/> - <a href="#" class="o_out_of_office_read_more_less_button">Read more</a> - </div> </div> </templates> diff --git a/addons/mail/static/src/xml/user_menu.xml b/addons/mail/static/src/xml/user_menu.xml deleted file mode 100644 index 1240d4744fb..00000000000 --- a/addons/mail/static/src/xml/user_menu.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<templates xml:space="preserve"> - - <t t-extend="UserMenu"> - <t t-jquery=".oe_topbar_name" t-operation="before"> - <t t-if="widget.outOfOfficeMessage"> - <i class="o_mail_user_status o_user_idle fa fa-minus-circle" title="You have set a chat message."/> - </t> - </t> - </t> -</templates> |
