From 134c6c1c33921b38a06b558509fc50bafe229f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sun, 3 Jan 2021 21:44:17 +0100 Subject: [PATCH] [NEW] Add Omnichannel Livechat Trigger option for when user opens the chat window --- client/views/omnichannel/triggers/TriggersForm.tsx | 14 +++++++++++--- packages/rocketchat-i18n/i18n/en.i18n.json | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/views/omnichannel/triggers/TriggersForm.tsx b/client/views/omnichannel/triggers/TriggersForm.tsx index 0623b2d1cffdc..3aaa2057ca730 100644 --- a/client/views/omnichannel/triggers/TriggersForm.tsx +++ b/client/views/omnichannel/triggers/TriggersForm.tsx @@ -78,8 +78,16 @@ const TriggersForm: FC = ({ 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')], @@ -165,9 +173,9 @@ const TriggersForm: FC = ({ values, handlers, className }) =>