Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW][Omnichannel] Ability to set character message limit on Livechat widget #18261

Merged

Conversation

ogustavo-pereira
Copy link
Contributor

Proposed changes

Implementing a new character limit field in the LiveChat Aparence.

Issue(s)

#17451

How to test or reproduce

  1. Open Livechat Aparence
  2. Edit Characther Limit input
  3. Save
  4. reload the page and check if the information has been saved

If you want test with Livechat, you will need this feature

Screenshots

image

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Changelog

additional setting in Admin panel for setting a character limit on livechat.

Further comments

app/livechat/client/views/app/livechatAppearance.html Outdated Show resolved Hide resolved
app/livechat/client/views/app/livechatAppearance.js Outdated Show resolved Hide resolved
app/livechat/client/views/app/livechatAppearance.js Outdated Show resolved Hide resolved
app/livechat/client/views/app/livechatAppearance.js Outdated Show resolved Hide resolved
app/livechat/client/views/app/livechatAppearance.js Outdated Show resolved Hide resolved
app/livechat/server/api/lib/livechat.js Outdated Show resolved Hide resolved
app/livechat/server/config.js Outdated Show resolved Hide resolved
app/livechat/server/lib/Livechat.js Outdated Show resolved Hide resolved
app/livechat/server/methods/getInitialData.js Outdated Show resolved Hide resolved
app/livechat/server/methods/saveAppearance.js Outdated Show resolved Hide resolved
Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another review.

ogustavo-pereira and others added 2 commits July 27, 2020 23:26
* Adding translation
* Changing label to Livechat_message_character_limit
* Removing unused function
@renatobecker renatobecker changed the title [FEAT] Configurable character limit on live chat [FEAT] Configurable message character limit on livechat Jul 28, 2020
@renatobecker renatobecker changed the title [FEAT] Configurable message character limit on livechat [NEW] Add a new setting to limit the message length on Livechat widget Jul 28, 2020
@renatobecker renatobecker added this to the 3.6.0 milestone Jul 28, 2020
Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oguhpereira Rocket.Chat already have a global setting to set the Message character limit for all channels. Since we're implementing a specific setting for Livechat, you need to check the other setting as well and pass its value to the livechat as a fallback configuration.
Screen Shot 2020-07-29 at 16 37 06

* adding new option to display character limit
* Validating if the limitTextLength is greater than Message_MaxAllowedSizeimport
* setting Message_MaxAllowedSizeimport as the default of limitTextLength
@ogustavo-pereira
Copy link
Contributor Author

@renatobecker I added a new option that allows to enable or disable the display of the character limit

image

It has also been configured so that it fetches the maximum message size setting. The Message Characther Limit field will be used to set a size smaller than the default for the maximum message size setting.

Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just left some comments, please take a look when you get a chance.

packages/rocketchat-i18n/i18n/en.i18n.json Outdated Show resolved Hide resolved
packages/rocketchat-i18n/i18n/pt-BR.i18n.json Outdated Show resolved Hide resolved
packages/rocketchat-i18n/i18n/pt.i18n.json Outdated Show resolved Hide resolved
app/livechat/client/views/app/livechatAppearance.js Outdated Show resolved Hide resolved
app/livechat/server/lib/Livechat.js Outdated Show resolved Hide resolved
app/livechat/server/config.js Outdated Show resolved Hide resolved
app/livechat/server/lib/Livechat.js Show resolved Hide resolved
app/livechat/server/api/lib/livechat.js Outdated Show resolved Hide resolved
app/livechat/server/api/lib/livechat.js Outdated Show resolved Hide resolved
app/livechat/server/api/lib/livechat.js Outdated Show resolved Hide resolved
app/livechat/server/config.js Outdated Show resolved Hide resolved
    * Review changes pull-request
    * Changing Livechat_show_message_character_limit to Livechat_enable_message_character_limit
    * Saving limitTextLength with parseInt
    * Adding checkbox options showLimitTextLength
    * changing translation showLimitTextLengthFormTrueChecked
@ogustavo-pereira
Copy link
Contributor Author

@renatobecker I changed the review requests but I was in doubt if it was to change the following items:

  • Name showLimitTextLength have to change for enableLimitTextLength in functions and variables?
  • In this function there was a condition that when the Livechat_message_character_limit is greater than Message_MaxAllowedSize. Is required this condition?

@renatobecker renatobecker changed the title [NEW] Add a new setting to limit the message length on Livechat widget [NEW] Add new setting to limit message length on Livechat widget Aug 2, 2020
@renatobecker renatobecker changed the title [NEW] Add new setting to limit message length on Livechat widget [NEW] Add the ability to set the character message limit on Livechat widget Aug 2, 2020
@renatobecker renatobecker merged commit f313db7 into RocketChat:develop Aug 2, 2020
gabriellsh added a commit that referenced this pull request Aug 10, 2020
…omni

* 'develop' of github.com:RocketChat/Rocket.Chat:
  [NEW] Add REST API endpoint to search Livechat visitors (#18514)
  LingoHub based on develop (#18516)
  Update README.md (#18503)
  [NEW] Channel avatar (#18443)
  [FIX] Sending notifications from senders without a name (#18479)
  [FIX] UserCard avatar cache (avatarETag) (#18466)
  [IMPROVE] Admin Info page requires permission (#18408)
  [FIX] Marking room as read with unread threads still (#18410)
  [FIX] Random generated password not matching the Password Policy (#18475)
  Typo in privacy agreement message (#18476)
  bugfix for uploading files from livechat (#18474)
  LingoHub based on develop (#18465)
  [NEW] Add the ability to set the character message limit on Livechat widget (#18261)
  [FIX] Migration 194 (#18457)
  [FIX] Omnichannel session monitor is not starting (#18412)
  [FIX] Invalid MIME type when uploading audio files (#18426)
  [FIX] Error when updating omnichannel department without agents parameter (#18428)
  [FIX] Omnichannel Take Inquiry endpoint checking wrong permission (#18446)
  [FIX] Multiple push notifications sent via native drivers (#18442)
  [FIX] Appending 'false' to Jitsi URL (#18430)
@@ -2168,6 +2170,7 @@
"Message_AudioRecorderEnabled_Description": "Requer arquivos 'audio / mp3' para ser um tipo de mídia aceito dentro das configurações 'Upload de arquivo'.",
"Message_BadWordsFilterList": "Adicione palavrões para a lista negra",
"Message_BadWordsFilterListDescription": "Adicione palavrões separados por vírgula para filtrar",
"Message_Characther_Limit": "Limite do caráter da mensagem",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI Characther -> Character, but its the same everywhere for this so it still functions fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @dlassalle. I'll fix this typo.

@rodrigok rodrigok changed the title [NEW] Add the ability to set the character message limit on Livechat widget [NEW] Ability to set character message limit on Livechat widget Aug 24, 2020
@rodrigok rodrigok changed the title [NEW] Ability to set character message limit on Livechat widget [NEW][Omnichannel] Ability to set character message limit on Livechat widget Aug 24, 2020
@sampaiodiego sampaiodiego mentioned this pull request Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants