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] Add Omnichannel Livechat Trigger option for when user opens the chat window #20030

Merged
merged 27 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
134c6c1
[NEW] Add Omnichannel Livechat Trigger option for when user opens the…
reda-alaoui Jan 3, 2021
814481e
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 4, 2021
d8db4eb
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 5, 2021
d539adb
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 8, 2021
b1a8ab1
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 12, 2021
43aafda
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 13, 2021
b2abead
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 15, 2021
adff4f1
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 20, 2021
08216cc
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 22, 2021
a8d78f3
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 25, 2021
b8bf40d
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 27, 2021
dce66e4
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 28, 2021
4cd6204
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 29, 2021
f4e8db4
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 30, 2021
d30bcac
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Jan 31, 2021
7ab3fca
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 1, 2021
97b2dc2
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 2, 2021
9e2c1f5
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 3, 2021
3b10162
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 5, 2021
b740a86
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 5, 2021
9fd3935
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 8, 2021
b2a2279
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 9, 2021
3c13c3a
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 11, 2021
e0c20a5
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 13, 2021
afc7c19
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Feb 17, 2021
c953433
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Mar 2, 2021
0b70eb2
Merge branch 'develop' into omnichat-chat-open-trigger
reda-alaoui Mar 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions client/views/omnichannel/triggers/TriggersForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,16 @@ const TriggersForm: FC<TriggersFormProps> = ({ values, handlers, className }) =>
const conditionOptions: SelectOptions = useMemo(() => [
['page-url', t('Visitor_page_URL')],
['time-on-site', t('Visitor_time_on_site')],
['chat-opened-by-visitor', t('Chat_opened_by_visitor')],
], [t]);

const conditionValuePlaceholders: {[conditionName: string]: string} = useMemo(() => ({
'page-url': t('Enter_a_regex'),
'time-on-site': t('Time_in_seconds'),
}), [t]);

const conditionValuePlaceholder = conditionValuePlaceholders[conditionName];

const senderOptions: SelectOptions = useMemo(() => [
['queue', t('Impersonate_next_agent_from_queue')],
['custom', t('Custom_agent')],
Expand Down Expand Up @@ -172,9 +180,9 @@ const TriggersForm: FC<TriggersFormProps> = ({ values, handlers, className }) =>
<Field.Row>
<Select options={conditionOptions} value={conditionName} onChange={handleConditionName}/>
</Field.Row>
<Field.Row>
<TextInput value={conditionValue} onChange={handleConditionValue} placeholder={conditionName === 'page-url' ? t('Enter_a_regex') : t('Time_in_seconds')}/>
</Field.Row>
{conditionValuePlaceholder && <Field.Row>
<TextInput value={conditionValue} onChange={handleConditionValue} placeholder={conditionValuePlaceholder}/>
</Field.Row>}
</Field>
<Field className={className}>
<Field.Label>{t('Action')}</Field.Label>
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4180,6 +4180,7 @@
"Visitor_Navigation": "Visitor Navigation",
"Visitor_page_URL": "Visitor page URL",
"Visitor_time_on_site": "Visitor time on site",
"Chat_opened_by_visitor": "Chat opened by the visitor",
"Wait_activation_warning": "Before you can login, your account must be manually activated by an administrator.",
"Waiting_queue": "Waiting queue",
"Waiting_queue_message": "Waiting queue message",
Expand Down