Skip to content

Commit

Permalink
[REF] mail,im_livechat,digest: rename 'chat_client_action' to 'Discuss'
Browse files Browse the repository at this point in the history
Revision on 02ec09c#diff-6d76770b1b7cf716d60a4d76a1555c1d

The commit above mostly renamed 'Client Action' to 'Discuss',
but there were some leftovers.
  • Loading branch information
alexkuhn committed Aug 17, 2018
1 parent 11b24b4 commit 6d53cd3
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion addons/digest/data/digest_data.xml
Expand Up @@ -23,7 +23,7 @@
<center>
<img src="/digest/static/src/img/notification.png" width="70%" height="100%"/><br/>
</center>
${', '.join(users.mapped('name'))} signed up. Say hello in the <a href="/web#action=mail.mail_channel_action_client_chat&amp;active_id=${channel_id}" style="color: #006d6b;">company's discussion channel.</a>
${', '.join(users.mapped('name'))} signed up. Say hello in the <a href="/web#action=mail.action_discuss&amp;active_id=${channel_id}" style="color: #006d6b;">company's discussion channel.</a>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions addons/mail/controllers/main.py
Expand Up @@ -22,7 +22,7 @@ class MailController(http.Controller):

@classmethod
def _redirect_to_messaging(cls):
url = '/web#%s' % url_encode({'action': 'mail.mail_channel_action_client_chat'})
url = '/web#%s' % url_encode({'action': 'mail.action_discuss'})
return werkzeug.utils.redirect(url)

@classmethod
Expand Down Expand Up @@ -244,7 +244,7 @@ def mail_init_messaging(self):
'commands': request.env['mail.channel'].get_mention_commands(),
'mention_partner_suggestions': request.env['res.partner'].get_static_mention_suggestions(),
'shortcodes': request.env['mail.shortcode'].sudo().search_read([], ['source', 'substitution', 'description']),
'menu_id': request.env['ir.model.data'].xmlid_to_res_id('mail.mail_channel_menu_root_chat'),
'menu_id': request.env['ir.model.data'].xmlid_to_res_id('mail.menu_root_discuss'),
'is_moderator': request.env.user.is_moderator,
'moderation_counter': request.env.user.moderation_counter,
'moderation_channel_ids': request.env.user.moderation_channel_ids.ids,
Expand Down
2 changes: 1 addition & 1 deletion addons/mail/data/mail_data.xml
Expand Up @@ -358,7 +358,7 @@
<p>Hello <t t-esc='record.name'/></p>
<p>You have messages to moderate, please go for the proceedings.</p><br/><br/>
<div style="text-align: center;">
<a href="/web#action=mail.mail_channel_action_client_chat&amp;active_id=mailbox_moderation" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">Moderate Messages</a>
<a href="/web#action=mail.action_discuss&amp;active_id=mailbox_moderation" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">Moderate Messages</a>
<br/><br/><br/>
</div>
<p>Thank you!</p>
Expand Down
2 changes: 1 addition & 1 deletion addons/mail/static/src/js/discuss.js
Expand Up @@ -1474,7 +1474,7 @@ var Discuss = AbstractAction.extend(ControlPanelMixin, {
},
});

core.action_registry.add('mail.chat.instant_messaging', Discuss);
core.action_registry.add('mail.discuss', Discuss);

return Discuss;

Expand Down
Expand Up @@ -113,7 +113,7 @@ var MessagingMenu = Widget.extend({
discussOptions.active_id = channelID;
}

this.do_action('mail.mail_channel_action_client_chat', discussOptions)
this.do_action('mail.action_discuss', discussOptions)
.then(function () {
// we cannot 'go back to previous page' otherwise
self.trigger_up('hide_home_menu');
Expand Down
2 changes: 1 addition & 1 deletion addons/mail/static/src/js/thread_field.js
Expand Up @@ -197,7 +197,7 @@ var ThreadField = AbstractField.extend({
var self = this;
this.call('mail_service', 'joinChannel', channelID).then(function () {
// Execute Discuss with 'channel' as default channel
self.do_action('mail.mail_channel_action_client_chat', { active_id: channelID });
self.do_action('mail.action_discuss', { active_id: channelID });
});
},
/**
Expand Down
2 changes: 1 addition & 1 deletion addons/mail/static/src/js/thread_windows/thread_window.js
Expand Up @@ -279,7 +279,7 @@ var ThreadWindow = AbstractThreadWindow.extend({
res_id: this._thread.getDocumentID(),
});
} else {
this.do_action('mail.mail_channel_action_client_chat', {
this.do_action('mail.action_discuss', {
clear_breadcrumbs: false,
active_id: this.hasThread() ? this._getThreadID() : undefined,
on_reverse_breadcrumb: function () {
Expand Down
Expand Up @@ -161,8 +161,7 @@ QUnit.test('messaging menu widget: no crash when clicking on inbox notification
},
intercepts: {
/**
* Simulate action 'mail.mail_channel_action_client_chat'
* successfully performed.
* Simulate action 'mail.action_discuss' successfully performed.
*
* @param {OdooEvent} ev
* @param {function} ev.data.on_success called when success action performed
Expand Down
12 changes: 6 additions & 6 deletions addons/mail/views/mail_channel_views.xml
Expand Up @@ -193,19 +193,19 @@



<record id="mail_channel_action_client_chat" model="ir.actions.client">
<field name="name">Chat</field>
<field name="tag">mail.chat.instant_messaging</field>
<record id="action_discuss" model="ir.actions.client">
<field name="name">Discuss</field>
<field name="tag">mail.discuss</field>
<field name="res_model">mail.channel</field>
<field name="params" eval="&quot;{
'default_active_id': 'mailbox_inbox'
}&quot;"/>
</record>

<menuitem
id="mail.mail_channel_menu_root_chat"
id="mail.menu_root_discuss"
name="Discuss"
action="mail_channel_action_client_chat"
action="action_discuss"
web_icon="mail,static/description/icon.png"
groups="base.group_user"
sequence="1"/>
Expand All @@ -216,7 +216,7 @@
-->
<record id="mail.mail_channel_integrations_menu" model="ir.ui.menu">
<field name="name">Integrations</field>
<field name="parent_id" ref="mail.mail_channel_menu_root_chat"></field>
<field name="parent_id" ref="mail.menu_root_discuss"></field>
<field name="active" eval="False"></field>
</record>

Expand Down

0 comments on commit 6d53cd3

Please sign in to comment.