diff options
| author | Xavier Dubuc <xdu@odoo.com> | 2020-06-22 15:59:16 +0000 |
|---|---|---|
| committer | Xavier Dubuc <xdu@odoo.com> | 2020-06-25 10:37:11 +0000 |
| commit | 4c763e6bca864d710c98ce7510169772a2dea55b (patch) | |
| tree | 4452fd33276926e0af4e0db7e5b2464678603d70 /addons/mail/static/src/components/composer_text_input | |
| parent | a3530774527343db2de9445ad7d380888f731adc (diff) | |
[FIX] mail: clarify composer placeholder
Also moved isLog from composer component prop to composer model field.
task-2280159 & task-2250887
closes odoo/odoo#53645
X-original-commit: ba41b1de5edc2b3153a5b20a4f11778a3f724ade
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components/composer_text_input')
| -rw-r--r-- | addons/mail/static/src/components/composer_text_input/composer_text_input.js | 16 | ||||
| -rw-r--r-- | addons/mail/static/src/components/composer_text_input/composer_text_input.xml | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/addons/mail/static/src/components/composer_text_input/composer_text_input.js b/addons/mail/static/src/components/composer_text_input/composer_text_input.js index 1be0e77a98b..279d5a6ae93 100644 --- a/addons/mail/static/src/components/composer_text_input/composer_text_input.js +++ b/addons/mail/static/src/components/composer_text_input/composer_text_input.js @@ -65,6 +65,22 @@ class ComposerTextInput extends Component { return this.env.models['mail.composer'].get(this.props.composerLocalId); } + /** + * @returns {string} + */ + get textareaPlaceholder() { + if (!this.composer) { + return ""; + } + if (this.composer.thread && this.composer.thread.model !== 'mail.channel') { + if (this.composer.isLog) { + return this.env._t("Log an internal note..."); + } + return this.env._t("Send a message to followers..."); + } + return this.env._t("Write something..."); + } + focusout() { this.saveStateInStore(); this._textareaRef.el.blur(); diff --git a/addons/mail/static/src/components/composer_text_input/composer_text_input.xml b/addons/mail/static/src/components/composer_text_input/composer_text_input.xml index 949f1065a56..dfeae27fc61 100644 --- a/addons/mail/static/src/components/composer_text_input/composer_text_input.xml +++ b/addons/mail/static/src/components/composer_text_input/composer_text_input.xml @@ -36,7 +36,7 @@ </div> </div> </t> - <textarea class="o_ComposerTextInput_textarea" t-esc="composer.textInputContent" placeholder="Write something..." t-on-focusin="_onFocusinTextarea" t-on-focusout="_onFocusoutTextarea" t-on-keydown="_onKeydownTextarea" t-on-keyup="_onKeyupTextarea" t-on-input="_onInputTextarea" t-ref="textarea"/> + <textarea class="o_ComposerTextInput_textarea" t-esc="composer.textInputContent" t-att-placeholder="textareaPlaceholder" t-on-focusin="_onFocusinTextarea" t-on-focusout="_onFocusoutTextarea" t-on-keydown="_onKeydownTextarea" t-on-keyup="_onKeyupTextarea" t-on-input="_onInputTextarea" t-ref="textarea"/> </t> </div> </t> |
