Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored May 21, 2020
2 parents bbf38ca + c55d2c3 commit 7134744
Show file tree
Hide file tree
Showing 69 changed files with 790 additions and 515 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 1.5.0 - 2020-05-20
* [NEW] Support Registration Form custom fields (#407) …
* [NEW] Translated to Hebrew (#348)
* [NEW] Update es.json (#357)
* [NEW] Russian translation (#359)
* [FIX] Dutch translations (#391)
* [IMPROVE] Update ro.json (397)
* [FIX] Dutch translations

## 1.4.0 - 2020-03-19
* [NEW] Add new API method the set the default Agent before chatting (#383)
* [NEW] Keep trigger messages after the conversation starts. (#384)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "@rocket.chat/livechat",
"version": "1.4.0",
"version": "1.5.0",
"files": [
"/build"
],

"license": "MIT",
"repository": {
"type": "git",
Expand Down
11 changes: 11 additions & 0 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ import { parentCall } from '../../lib/parentCall';
import userPresence from '../../lib/userPresence';
import Connection from '../../lib/connection';

function isRTL(s) {
const rtlChars = '\u0591-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC';

This comment has been minimized.

Copy link
@homberger

homberger Aug 21, 2020

Owner

Livechat not opening in Edge browser RocketChat#427

const rtlDirCheck = new RegExp(`^[^${ rtlChars }]*?[${ rtlChars }]`);

return rtlDirCheck.test(s);
}

export class App extends Component {
state = {
initialized: false,
Expand Down Expand Up @@ -162,6 +169,10 @@ export class App extends Component {
this.finalize();
}

componentDidUpdate() {
document.dir = isRTL(I18n.t('Yes')) ? 'rtl' : 'auto';
}

render = ({
sound,
undocked,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Form/SelectInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class SelectInput extends Component {
onInput,
className,
style = {},
...props
}) => (
<div
className={createClassName(styles, 'select-input', {}, [className])}
Expand All @@ -55,6 +56,7 @@ export class SelectInput extends Component {
small,
placeholder: !this.state.value,
})}
{...props}
>
<option value="" disabled hidden>{placeholder}</option>
{Array.from(options).map(({ value, label }, key) => (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Form/TextInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const TextInput = memo(({
onInput,
className,
style = {},
...props
}) => (
multiline
? (
Expand All @@ -28,6 +29,7 @@ export const TextInput = memo(({
onInput={onInput}
className={createClassName(styles, 'text-input', { disabled, error, small, multiline }, [className])}
style={style}
{...props}
/>
)
: (
Expand All @@ -41,6 +43,7 @@ export const TextInput = memo(({
onInput={onInput}
className={createClassName(styles, 'text-input', { disabled, error, small }, [className])}
style={style}
{...props}
/>
)
));
7 changes: 5 additions & 2 deletions src/components/Form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ export class Form extends MemoizedComponent {
}

export const Validations = {
nonEmpty: (value) => (!value ? 'Field required' : undefined),
nonEmpty: ({ value }) => (!value ? I18n.t('Field required') : undefined),

email: (value) => (!/^\S+@\S+\.\S+/.test(String(value).toLowerCase()) ? 'Invalid email' : null),
email: ({ value }) => (!/^\S+@\S+\.\S+/.test(String(value).toLowerCase()) ? I18n.t('Invalid email') : null),

custom: ({ value, pattern }) => (new RegExp(pattern, 'i').test(String(value)) ? null : I18n.t('Invalid value')),
};


export { FormField } from './FormField';
export { TextInput } from './TextInput';
export { PasswordInput } from './PasswordInput';
Expand Down
4 changes: 4 additions & 0 deletions src/components/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ export const sortArrayByColumn = (array, column, inverted) => array.sort((a, b)
return 1;
});

export const parseOfflineMessage = (fields = {}) => {
const host = window.location.origin;
return Object.assign(fields, { host });
};
export const normalizeDOMRect = ({ left, top, right, bottom }) => ({ left, top, right, bottom });


Expand Down
6 changes: 4 additions & 2 deletions src/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/be_BY.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Fehler, lösche Nutzer Daten",
"error_starting_a_new_conversation_reason_a1b491a1": "Fehler starte eine neue Konversation: %{reason}",
"expand_chat_a0045dbd": "Chat vergrößern",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "Die Datei überschreitet die maximal erlaubte Größe von: %{size}.",
"fileupload_error_9eedee68": "Datei Upload Fehler",
"finish_this_chat_87b79542": "Diesen Chat beenden",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "Ich stimme zu",
"i_need_help_with_61054e21": "Ich brauche Hilfe mit...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "Falls Sie noch Fragen haben, drücken Sie einfach unten den Knopf, um einen neuen Chat zu beginnen.",
"insert_your_email_here_2e37fc94": "Tragen Sie hier Ihre Email Adresse ein...",
"insert_your_name_here_3a8f5f46": "Tragen Sie hier Ihren Namen ein...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Hinterlassen Sie eine Nachricht",
"livechat_connected_afee1c5b": "Livechat verbunden.",
"livechat_is_not_connected_b40328ca": "Livechat ist nicht verbunden.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/de_AT.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error_removing_user_data_ce507478": "Error removing user data.",
"error_starting_a_new_conversation_reason_a1b491a1": "Error starting a new conversation: %{reason}",
"expand_chat_a0045dbd": "Expand chat",
"field_required_fc5c6b05": "Field required",
"file_exceeds_allowed_size_of_size_bd65c389": "File exceeds allowed size of %{size}.",
"fileupload_error_9eedee68": "FileUpload Error",
"finish_this_chat_87b79542": "Finish this chat",
Expand All @@ -35,8 +36,9 @@
"i_agree_df2ecbd4": "I Agree",
"i_need_help_with_61054e21": "I need help with...",
"if_you_have_any_other_questions_just_press_the_but_ceaadfa0": "If you have any other questions, just press the button below to start a new chat.",
"insert_your_email_here_2e37fc94": "Insert your email here...",
"insert_your_name_here_3a8f5f46": "Insert your name here...",
"insert_your_field_here_d631e875": "Insert your %{field} here...",
"invalid_email_e82f3682": "Invalid email",
"invalid_value_12ca12c2": "Invalid value",
"leave_a_message_5b581048": "Leave a message",
"livechat_connected_afee1c5b": "Livechat connected.",
"livechat_is_not_connected_b40328ca": "Livechat is not connected.",
Expand Down
Loading

0 comments on commit 7134744

Please sign in to comment.