From 7c0c54e0cc73e18f492e3cf84de836ca9fc189c7 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Wed, 29 May 2019 22:52:33 +0530 Subject: [PATCH 01/17] added method to get location of user --- src/api.js | 9 ++++++--- src/components/App/index.js | 4 +++- src/components/EmojiPicker/stories.js | 17 +++++++++++++++++ src/widget.js | 10 ++++------ yarn.lock | 1 + 5 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 src/components/EmojiPicker/stories.js diff --git a/src/api.js b/src/api.js index 85f731619..f8dc9f6cd 100644 --- a/src/api.js +++ b/src/api.js @@ -1,9 +1,12 @@ import queryString from 'query-string'; import LivechatClient from '@rocket.chat/sdk/lib/clients/Livechat'; -const host = window.SERVER_URL - || queryString.parse(window.location.search).serverUrl - || (process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : null); +const host = ( + window.SERVER_URL || + queryString.parse(window.location.search).serverUrl || + (process.env.NODE_ENV === 'development' ? 'https://e30b913c.ngrok.io' : null) +); + const useSsl = host && host.match(/^https:/) !== null; export const Livechat = new LivechatClient({ host, protocol: 'ddp', useSsl }); diff --git a/src/components/App/index.js b/src/components/App/index.js index 2f3822ce0..1afbbfed2 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -1,7 +1,9 @@ +/* eslint-disable no-mixed-spaces-and-tabs */ import { Component } from 'preact'; import { Router, route } from 'preact-router'; import queryString from 'query-string'; - +import axios from 'axios'; +import { Livechat } from '../../api'; import history from '../../history'; import Chat from '../../routes/Chat'; import LeaveMessage from '../../routes/LeaveMessage'; diff --git a/src/components/EmojiPicker/stories.js b/src/components/EmojiPicker/stories.js new file mode 100644 index 000000000..b89a006f7 --- /dev/null +++ b/src/components/EmojiPicker/stories.js @@ -0,0 +1,17 @@ +import { storiesOf } from '@storybook/react'; +import centered from '@storybook/addon-centered/react'; +import { + EmojiPicker, +} from '.'; +import { customEmojis } from '../../helpers.stories'; + + +storiesOf('Components|EmojiPicker', module) + .addDecorator(centered) + .add('Without custom Emoji', () => ( + + )) + .add('With custom Emoji', () => ( + + )); + diff --git a/src/widget.js b/src/widget.js index f8be30ebf..83c74b635 100644 --- a/src/widget.js +++ b/src/widget.js @@ -1,9 +1,8 @@ import EventEmitter from 'wolfy87-eventemitter'; - -const log = process.env.NODE_ENV === 'development' - ? (...args) => window.console.log('%cwidget%c', 'color: red', 'color: initial', ...args) - : () => {}; +const log = process.env.NODE_ENV === 'development' ? + (...args) => window.console.log('%cwidget%c', 'color: red', 'color: initial', ...args) : + () => { }; const WIDGET_OPEN_WIDTH = 365; @@ -308,13 +307,12 @@ const trackNavigation = () => { }, 800); }; -const init = (url) => { +const init = async(url) => { if (!url) { return; } config.url = url; - createWidget(url); attachMessageListener(); trackNavigation(); diff --git a/yarn.lock b/yarn.lock index cdb4296c7..f3ae3e42f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2979,6 +2979,7 @@ axe-core@^3.2.2: axios@^0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" + integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= dependencies: follow-redirects "^1.3.0" is-buffer "^1.1.5" From 55c34b987be975735f68ae26147e16e40aa43a67 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Sat, 8 Jun 2019 17:05:33 +0530 Subject: [PATCH 02/17] added new methods to save data to collection --- src/api.js | 4 ++-- src/components/App/index.js | 8 +++++++- src/components/EmojiPicker/stories.js | 17 ----------------- src/lib/main.js | 7 ++++++- src/widget.js | 6 ++++-- 5 files changed, 19 insertions(+), 23 deletions(-) delete mode 100644 src/components/EmojiPicker/stories.js diff --git a/src/api.js b/src/api.js index f8dc9f6cd..c6247ee3f 100644 --- a/src/api.js +++ b/src/api.js @@ -3,8 +3,8 @@ import LivechatClient from '@rocket.chat/sdk/lib/clients/Livechat'; const host = ( window.SERVER_URL || - queryString.parse(window.location.search).serverUrl || - (process.env.NODE_ENV === 'development' ? 'https://e30b913c.ngrok.io' : null) + queryString.parse(window.location.search).serverUrl || + (process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : null) ); const useSsl = host && host.match(/^https:/) !== null; diff --git a/src/components/App/index.js b/src/components/App/index.js index 1afbbfed2..67d0eea18 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -1,10 +1,16 @@ -/* eslint-disable no-mixed-spaces-and-tabs */ import { Component } from 'preact'; import { Router, route } from 'preact-router'; import queryString from 'query-string'; import axios from 'axios'; import { Livechat } from '../../api'; import history from '../../history'; +import { loadConfig, clearConnectionAlerts, getToken } from '../../lib/main'; +import CustomFields from '../../lib/customFields'; +import { setWidgetLanguage } from '../../lib/locale'; +import Triggers from '../../lib/triggers'; +import Hooks from '../../lib/hooks'; +import { parentCall } from '../../lib/parentCall'; +import userPresence from '../../lib/userPresence'; import Chat from '../../routes/Chat'; import LeaveMessage from '../../routes/LeaveMessage'; import ChatFinished from '../../routes/ChatFinished'; diff --git a/src/components/EmojiPicker/stories.js b/src/components/EmojiPicker/stories.js deleted file mode 100644 index b89a006f7..000000000 --- a/src/components/EmojiPicker/stories.js +++ /dev/null @@ -1,17 +0,0 @@ -import { storiesOf } from '@storybook/react'; -import centered from '@storybook/addon-centered/react'; -import { - EmojiPicker, -} from '.'; -import { customEmojis } from '../../helpers.stories'; - - -storiesOf('Components|EmojiPicker', module) - .addDecorator(centered) - .add('Without custom Emoji', () => ( - - )) - .add('With custom Emoji', () => ( - - )); - diff --git a/src/lib/main.js b/src/lib/main.js index 0a2b3c391..1f694b315 100644 --- a/src/lib/main.js +++ b/src/lib/main.js @@ -36,7 +36,12 @@ export const loadConfig = async () => { }); }; -export const processUnread = async () => { +export const getToken = () => { + const { token } = store.state; + return token; +}; + +export const processUnread = async() => { const { minimized, visible, messages } = store.state; if (minimized || !visible) { const { alerts, lastReadMessageId } = store.state; diff --git a/src/widget.js b/src/widget.js index 83c74b635..91e424975 100644 --- a/src/widget.js +++ b/src/widget.js @@ -1,8 +1,9 @@ import EventEmitter from 'wolfy87-eventemitter'; + const log = process.env.NODE_ENV === 'development' ? (...args) => window.console.log('%cwidget%c', 'color: red', 'color: initial', ...args) : - () => { }; + () => {}; const WIDGET_OPEN_WIDTH = 365; @@ -307,12 +308,13 @@ const trackNavigation = () => { }, 800); }; -const init = async(url) => { +const init = (url) => { if (!url) { return; } config.url = url; + createWidget(url); attachMessageListener(); trackNavigation(); From 65593b2566dd7f657757a26b62fcc0d16d6c21d4 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Sun, 16 Jun 2019 20:03:20 +0530 Subject: [PATCH 03/17] asking for user permission for location --- src/components/App/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/App/index.js b/src/components/App/index.js index 67d0eea18..8d2f9a1e6 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -1,7 +1,8 @@ +/* eslint-disable no-lonely-if */ +/* eslint-disable no-alert */ import { Component } from 'preact'; import { Router, route } from 'preact-router'; import queryString from 'query-string'; -import axios from 'axios'; import { Livechat } from '../../api'; import history from '../../history'; import { loadConfig, clearConnectionAlerts, getToken } from '../../lib/main'; @@ -17,7 +18,7 @@ import ChatFinished from '../../routes/ChatFinished'; import SwitchDepartment from '../../routes/SwitchDepartment'; import GDPRAgreement from '../../routes/GDPRAgreement'; import Register from '../../routes/Register'; -import { Provider as StoreProvider, Consumer as StoreConsumer } from '../../store'; +import store, { Provider as StoreProvider, Consumer as StoreConsumer } from '../../store'; import { visibility } from '../helpers'; import { setWidgetLanguage } from '../../lib/locale'; import CustomFields from '../../lib/customFields'; From 28675f9a1c9360dc9b8bad80ff68c89b3a01c718 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Sun, 23 Jun 2019 14:44:22 +0530 Subject: [PATCH 04/17] Code fix --- src/components/App/index.js | 7 ++- src/lib/location.js | 103 ++++++++++++++++++++++++++++++++++++ src/widget.js | 1 - 3 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 src/lib/location.js diff --git a/src/components/App/index.js b/src/components/App/index.js index 8d2f9a1e6..04a613794 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -1,13 +1,12 @@ -/* eslint-disable no-lonely-if */ -/* eslint-disable no-alert */ import { Component } from 'preact'; import { Router, route } from 'preact-router'; import queryString from 'query-string'; import { Livechat } from '../../api'; import history from '../../history'; -import { loadConfig, clearConnectionAlerts, getToken } from '../../lib/main'; +import { loadConfig, clearConnectionAlerts } from '../../lib/main'; import CustomFields from '../../lib/customFields'; import { setWidgetLanguage } from '../../lib/locale'; +import { locationUpdate } from '../../lib/location'; import Triggers from '../../lib/triggers'; import Hooks from '../../lib/hooks'; import { parentCall } from '../../lib/parentCall'; @@ -18,7 +17,7 @@ import ChatFinished from '../../routes/ChatFinished'; import SwitchDepartment from '../../routes/SwitchDepartment'; import GDPRAgreement from '../../routes/GDPRAgreement'; import Register from '../../routes/Register'; -import store, { Provider as StoreProvider, Consumer as StoreConsumer } from '../../store'; +import { Provider as StoreProvider, Consumer as StoreConsumer } from '../../store'; import { visibility } from '../helpers'; import { setWidgetLanguage } from '../../lib/locale'; import CustomFields from '../../lib/customFields'; diff --git a/src/lib/location.js b/src/lib/location.js new file mode 100644 index 000000000..d956ef623 --- /dev/null +++ b/src/lib/location.js @@ -0,0 +1,103 @@ +/* eslint-disable no-lonely-if */ +/* eslint-disable no-alert */ +import { getToken } from './main'; +import { Livechat } from '../api'; +import store from '../store'; + +/** + * This is used to convert location to a default type we want to send to server + * @param {Object} location + * @returns {Object} + */ +const convertLocationToSend = (location) => ( + { + countryName: location.country || location.country_name, + countryCode: location.country_code, + city: location.city || location.state, + latitude: location.latitude, + longitude: location.longitude, + }); + +/** + * This is used to get location details for user + * @param {Number} latitude + * @param {Number} longitude + * @returns {Object} + */ +const locationPrimary = async(latitude, longitude) => { + const { address } = await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${ latitude }&lon=${ longitude }`, { + mode: 'cors', + headers: { + 'Access-Control-Allow-Origin': '*', + }, + }).then((res) => (res.json())); + + const location = convertLocationToSend(address); + location.latitude = latitude; + location.longitude = longitude; + + const token = getToken(); + return { + location, + token, + }; +}; + +/** + * This is backup method to get location of user + * @returns {Object} + */ +const locationBackup = async() => { + const location = await fetch('https://api.ipdata.co?api-key=test', { + headers: { + Accept: 'application/json', + }, + }).then((res) => (res.json())); + + const token = getToken(); + return { + location: convertLocationToSend(location), + token, + }; +}; + +/** + * This function works in following way + * 1. Check user location already present or not + * 2. If not, asks for user location access + * 3. If not granted, sets locationAccess in store as false, so that we ask for access again, before starting chat + * 4. If granted, sets location of user info to DB + * 5. If location already present, increases the visit count for user + */ +export const locationUpdate = async() => { + const checkLocationUser = await Livechat.checkLocationUser(getToken()); + // check user location all ready there or not + if (checkLocationUser && !checkLocationUser._id) { + // Ask for permission for location + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(async(position) => { + const locationUser = await locationPrimary(position.coords.latitude, position.coords.longitude); + await Livechat.sendLocationData(locationUser); + }, (err) => { + // This means user has denied location access + // We need then to confirm location before starting the chat + // Save state of location access inside store. + if (err) { + store.setState({ + locationAccess: false, + }); + } + }); + } else { + // It means navigator is not supported in the browser, so ask + // for location access by backup API. + if (confirm('Please allow to access your location, for better assistance')) { + const locationUser = await locationBackup(); + await Livechat.sendLocationData(locationUser); + } + } + } else { + // Update visit count for user + Livechat.updateVisitCount(getToken()); + } +}; diff --git a/src/widget.js b/src/widget.js index 91e424975..295d42f31 100644 --- a/src/widget.js +++ b/src/widget.js @@ -314,7 +314,6 @@ const init = (url) => { } config.url = url; - createWidget(url); attachMessageListener(); trackNavigation(); From 8f37e070f908e1e67053f89e92c12282954e1c2c Mon Sep 17 00:00:00 2001 From: knrt10 Date: Mon, 8 Jul 2019 10:06:19 +0530 Subject: [PATCH 05/17] Added new feature --- src/api.js | 2 +- src/i18n/af.json | 1 + src/i18n/ar.json | 1 + src/i18n/az.json | 1 + src/i18n/be_BY.json | 1 + src/i18n/bg.json | 1 + src/i18n/bs.json | 1 + src/i18n/ca.json | 1 + src/i18n/cs.json | 1 + src/i18n/cy.json | 1 + src/i18n/da.json | 1 + src/i18n/de.json | 1 + src/i18n/de_AT.json | 1 + src/i18n/default.json | 1 + src/i18n/el.json | 1 + src/i18n/en.json | 1 + src/i18n/eo.json | 1 + src/i18n/es.json | 1 + src/i18n/et.json | 1 + src/i18n/eu.json | 1 + src/i18n/fa.json | 1 + src/i18n/fi.json | 1 + src/i18n/fr.json | 1 + src/i18n/he.json | 1 + src/i18n/hr.json | 1 + src/i18n/hu.json | 1 + src/i18n/id.json | 1 + src/i18n/it.json | 1 + src/i18n/ja.json | 1 + src/i18n/km.json | 1 + src/i18n/ko.json | 1 + src/i18n/ku.json | 1 + src/i18n/lo.json | 1 + src/i18n/lt.json | 1 + src/i18n/lv.json | 1 + src/i18n/mn.json | 1 + src/i18n/ms_MY.json | 1 + src/i18n/nl.json | 1 + src/i18n/no.json | 1 + src/i18n/pl.json | 1 + src/i18n/pt.json | 1 + src/i18n/pt_BR.json | 3 ++- src/i18n/ro.json | 1 + src/i18n/ru.json | 1 + src/i18n/sk_SK.json | 1 + src/i18n/sl_SI.json | 1 + src/i18n/sq.json | 1 + src/i18n/sr.json | 1 + src/i18n/sv.json | 1 + src/i18n/ta_IN.json | 1 + src/i18n/th_TH.json | 1 + src/i18n/tr.json | 1 + src/i18n/ug.json | 1 + src/i18n/uk.json | 1 + src/i18n/vi_VN.json | 1 + src/i18n/zh.json | 1 + src/i18n/zh_HK.json | 1 + src/i18n/zh_TW.json | 1 + src/lib/location.js | 3 +++ src/routes/Chat/container.js | 1 + src/routes/Register/container.js | 17 ++++++++++++++--- widget-demo.html | 12 ++++++++++++ 62 files changed, 89 insertions(+), 5 deletions(-) diff --git a/src/api.js b/src/api.js index c6247ee3f..b29a38324 100644 --- a/src/api.js +++ b/src/api.js @@ -1,5 +1,5 @@ import queryString from 'query-string'; -import LivechatClient from '@rocket.chat/sdk/lib/clients/Livechat'; +import LivechatClient from '/Users/knrt10/dev/openSource/RocketChat/Rocket.Chat.js.SDK/dist/lib/clients/Livechat'; const host = ( window.SERVER_URL || diff --git a/src/i18n/af.json b/src/i18n/af.json index b3c08fd0a..bb20ea716 100644 --- a/src/i18n/af.json +++ b/src/i18n/af.json @@ -50,6 +50,7 @@ "no_e16d9132": "Geen", "ok_c47544a2": "OK", "options_3ab0ea65": "opsies", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ar.json b/src/i18n/ar.json index 29e5d8a42..300989b3d 100644 --- a/src/i18n/ar.json +++ b/src/i18n/ar.json @@ -50,6 +50,7 @@ "no_e16d9132": "لا", "ok_c47544a2": "OK", "options_3ab0ea65": "خيارات", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/az.json b/src/i18n/az.json index 6393db6a5..1deace488 100644 --- a/src/i18n/az.json +++ b/src/i18n/az.json @@ -50,6 +50,7 @@ "no_e16d9132": "Yox", "ok_c47544a2": "OK", "options_3ab0ea65": "Seçimlər", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/be_BY.json b/src/i18n/be_BY.json index ebb43ff12..2afc34707 100644 --- a/src/i18n/be_BY.json +++ b/src/i18n/be_BY.json @@ -50,6 +50,7 @@ "no_e16d9132": "Няма", "ok_c47544a2": "OK", "options_3ab0ea65": "Опцыі", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/bg.json b/src/i18n/bg.json index 9381cd1f1..a56cfe198 100644 --- a/src/i18n/bg.json +++ b/src/i18n/bg.json @@ -50,6 +50,7 @@ "no_e16d9132": "Не", "ok_c47544a2": "OK", "options_3ab0ea65": "Настроики", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/bs.json b/src/i18n/bs.json index f71da607c..ca06a2b98 100644 --- a/src/i18n/bs.json +++ b/src/i18n/bs.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Options", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ca.json b/src/i18n/ca.json index d4a2dcf24..538d368de 100644 --- a/src/i18n/ca.json +++ b/src/i18n/ca.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Opcions", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/cs.json b/src/i18n/cs.json index fa41b5204..44b3ecd4f 100644 --- a/src/i18n/cs.json +++ b/src/i18n/cs.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ne", "ok_c47544a2": "OK", "options_3ab0ea65": "Volby", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/cy.json b/src/i18n/cy.json index 3d539f95e..15f46da17 100644 --- a/src/i18n/cy.json +++ b/src/i18n/cy.json @@ -50,6 +50,7 @@ "no_e16d9132": "Na", "ok_c47544a2": "OK", "options_3ab0ea65": "Dewisiadau", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/da.json b/src/i18n/da.json index 25fda5ad2..99f01b781 100644 --- a/src/i18n/da.json +++ b/src/i18n/da.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nej", "ok_c47544a2": "OK", "options_3ab0ea65": "Indstillinger", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/de.json b/src/i18n/de.json index 44e354411..72d40977a 100644 --- a/src/i18n/de.json +++ b/src/i18n/de.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nein", "ok_c47544a2": "OK", "options_3ab0ea65": "Optionen", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Bitte nennen Sie uns ein paar Informationen um den Chat zu beginnen", "please_wait_for_the_next_available_agent_b2a49c4c": "Bitte haben Sie etwas Geduld. Wir sind in Kürze für Sie da...", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/de_AT.json b/src/i18n/de_AT.json index 0b2576e65..2d2dd1057 100644 --- a/src/i18n/de_AT.json +++ b/src/i18n/de_AT.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nein", "ok_c47544a2": "OK", "options_3ab0ea65": "Optionen", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/default.json b/src/i18n/default.json index 3f6a12a35..a28d557ed 100644 --- a/src/i18n/default.json +++ b/src/i18n/default.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Options", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/el.json b/src/i18n/el.json index 1c1cad07d..585858eac 100644 --- a/src/i18n/el.json +++ b/src/i18n/el.json @@ -50,6 +50,7 @@ "no_e16d9132": "Όχι", "ok_c47544a2": "OK", "options_3ab0ea65": "Επιλογές", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/en.json b/src/i18n/en.json index 3f6a12a35..a28d557ed 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Options", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/eo.json b/src/i18n/eo.json index ed09ad8dd..d37ce86e2 100644 --- a/src/i18n/eo.json +++ b/src/i18n/eo.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ne", "ok_c47544a2": "OK", "options_3ab0ea65": "Opcioj", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/es.json b/src/i18n/es.json index 2db5763e1..75ecef17d 100644 --- a/src/i18n/es.json +++ b/src/i18n/es.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Opciones", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/et.json b/src/i18n/et.json index 070e6e36e..d4455fc02 100644 --- a/src/i18n/et.json +++ b/src/i18n/et.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ei", "ok_c47544a2": "OK", "options_3ab0ea65": "Valikud", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/eu.json b/src/i18n/eu.json index 906332040..a87bbfd06 100644 --- a/src/i18n/eu.json +++ b/src/i18n/eu.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ez", "ok_c47544a2": "OK", "options_3ab0ea65": "Aukerak", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/fa.json b/src/i18n/fa.json index 4d5a58b42..953cdf376 100644 --- a/src/i18n/fa.json +++ b/src/i18n/fa.json @@ -50,6 +50,7 @@ "no_e16d9132": "خیر", "ok_c47544a2": "OK", "options_3ab0ea65": "گزینه‌ها", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/fi.json b/src/i18n/fi.json index 47a6929c3..f2eea18c7 100644 --- a/src/i18n/fi.json +++ b/src/i18n/fi.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ei", "ok_c47544a2": "OK", "options_3ab0ea65": "Valinnat", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/fr.json b/src/i18n/fr.json index b0ae6f81e..79869d8c7 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -50,6 +50,7 @@ "no_e16d9132": "Non", "ok_c47544a2": "OK", "options_3ab0ea65": "Options", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Propulsé par Rocket.Chat", diff --git a/src/i18n/he.json b/src/i18n/he.json index ade243957..7f8c76e76 100644 --- a/src/i18n/he.json +++ b/src/i18n/he.json @@ -50,6 +50,7 @@ "no_e16d9132": "לא", "ok_c47544a2": "OK", "options_3ab0ea65": "אפשרויות", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/hr.json b/src/i18n/hr.json index 367569c71..8df368eec 100644 --- a/src/i18n/hr.json +++ b/src/i18n/hr.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ne", "ok_c47544a2": "OK", "options_3ab0ea65": "Opcije", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/hu.json b/src/i18n/hu.json index a73579b68..c3de231bf 100644 --- a/src/i18n/hu.json +++ b/src/i18n/hu.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nem", "ok_c47544a2": "OK", "options_3ab0ea65": "Beállítások", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/id.json b/src/i18n/id.json index a6bba6076..45fbc236f 100644 --- a/src/i18n/id.json +++ b/src/i18n/id.json @@ -50,6 +50,7 @@ "no_e16d9132": "Tidak", "ok_c47544a2": "OK", "options_3ab0ea65": "Pilihan", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/it.json b/src/i18n/it.json index 1433b6cfd..bafd739cb 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Opzioni", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ja.json b/src/i18n/ja.json index 9edd3bf53..bc917bb23 100644 --- a/src/i18n/ja.json +++ b/src/i18n/ja.json @@ -50,6 +50,7 @@ "no_e16d9132": "いいえ", "ok_c47544a2": "OK", "options_3ab0ea65": "オプション", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/km.json b/src/i18n/km.json index 420da7ef0..d86c070b3 100644 --- a/src/i18n/km.json +++ b/src/i18n/km.json @@ -50,6 +50,7 @@ "no_e16d9132": "ទេ", "ok_c47544a2": "OK", "options_3ab0ea65": "ជម្រើស", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ko.json b/src/i18n/ko.json index 84efffd16..b911c783c 100644 --- a/src/i18n/ko.json +++ b/src/i18n/ko.json @@ -50,6 +50,7 @@ "no_e16d9132": "아니오", "ok_c47544a2": "OK", "options_3ab0ea65": "옵션", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ku.json b/src/i18n/ku.json index 416585b34..d4768c740 100644 --- a/src/i18n/ku.json +++ b/src/i18n/ku.json @@ -50,6 +50,7 @@ "no_e16d9132": "Na", "ok_c47544a2": "OK", "options_3ab0ea65": "Vebijêrkên", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/lo.json b/src/i18n/lo.json index 19eb5f979..4a9a7b854 100644 --- a/src/i18n/lo.json +++ b/src/i18n/lo.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "ຕົວເລືອກ", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/lt.json b/src/i18n/lt.json index 1dd0bd45a..baaf36702 100644 --- a/src/i18n/lt.json +++ b/src/i18n/lt.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nėra", "ok_c47544a2": "OK", "options_3ab0ea65": "Galimybės", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/lv.json b/src/i18n/lv.json index 2a50b2fa3..85d741daa 100644 --- a/src/i18n/lv.json +++ b/src/i18n/lv.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nr.", "ok_c47544a2": "OK", "options_3ab0ea65": "Iespējas", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/mn.json b/src/i18n/mn.json index 8559bfc63..de9c8f03a 100644 --- a/src/i18n/mn.json +++ b/src/i18n/mn.json @@ -50,6 +50,7 @@ "no_e16d9132": "Үгүй", "ok_c47544a2": "OK", "options_3ab0ea65": "Сонголтууд", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ms_MY.json b/src/i18n/ms_MY.json index 557b607f0..53eff45d1 100644 --- a/src/i18n/ms_MY.json +++ b/src/i18n/ms_MY.json @@ -50,6 +50,7 @@ "no_e16d9132": "Tidak", "ok_c47544a2": "OK", "options_3ab0ea65": "Pilihan", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/nl.json b/src/i18n/nl.json index d72615ca6..32534f8ae 100644 --- a/src/i18n/nl.json +++ b/src/i18n/nl.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nee", "ok_c47544a2": "OK", "options_3ab0ea65": "Opties", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/no.json b/src/i18n/no.json index 0e6cbad44..ff8c3702f 100644 --- a/src/i18n/no.json +++ b/src/i18n/no.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nei", "ok_c47544a2": "OK", "options_3ab0ea65": "Egenskaper", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/pl.json b/src/i18n/pl.json index 7337676f4..457b7672a 100644 --- a/src/i18n/pl.json +++ b/src/i18n/pl.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nie", "ok_c47544a2": "OK", "options_3ab0ea65": "Opcje", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/pt.json b/src/i18n/pt.json index feaaf7832..fdfcf133a 100644 --- a/src/i18n/pt.json +++ b/src/i18n/pt.json @@ -50,6 +50,7 @@ "no_e16d9132": "Não", "ok_c47544a2": "OK", "options_3ab0ea65": "Opções", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/pt_BR.json b/src/i18n/pt_BR.json index 987b5cb4a..c913373ae 100644 --- a/src/i18n/pt_BR.json +++ b/src/i18n/pt_BR.json @@ -50,6 +50,7 @@ "no_e16d9132": "Não", "ok_c47544a2": "OK", "options_3ab0ea65": "Opções", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Por favor, nos passe algumas informações antes de iniciar o chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Por favor, aguarde o próximo agente disponível..", "powered_by_rocket_chat_4d7c2ab4": "Desenvolvido por Rocket.Chat", @@ -77,4 +78,4 @@ "your_spot_is_spot_a35cd288": "Seu lugar é #%{spot}", "your_spot_is_spot_estimated_wait_time_estimatedwai_d0ff46e0": "Seu lugar é #%{spot} (Tempo estimado: %{estimatedWaitTime})" } -} +} \ No newline at end of file diff --git a/src/i18n/ro.json b/src/i18n/ro.json index d1f9856b4..3c5fb1f15 100644 --- a/src/i18n/ro.json +++ b/src/i18n/ro.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nu", "ok_c47544a2": "OK", "options_3ab0ea65": "Opțiuni", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index b1c8aca7c..30b3529ee 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -50,6 +50,7 @@ "no_e16d9132": "Нет", "ok_c47544a2": "OK", "options_3ab0ea65": "Параметры", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/sk_SK.json b/src/i18n/sk_SK.json index d42f8e3f1..58542d907 100644 --- a/src/i18n/sk_SK.json +++ b/src/i18n/sk_SK.json @@ -50,6 +50,7 @@ "no_e16d9132": "Žiadny", "ok_c47544a2": "OK", "options_3ab0ea65": "Možnosti", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/sl_SI.json b/src/i18n/sl_SI.json index 4fefbf37c..2274c7a21 100644 --- a/src/i18n/sl_SI.json +++ b/src/i18n/sl_SI.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ne", "ok_c47544a2": "OK", "options_3ab0ea65": "Možnosti", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/sq.json b/src/i18n/sq.json index e364ddda2..fdee1518e 100644 --- a/src/i18n/sq.json +++ b/src/i18n/sq.json @@ -50,6 +50,7 @@ "no_e16d9132": "jo", "ok_c47544a2": "OK", "options_3ab0ea65": "Opsione", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/sr.json b/src/i18n/sr.json index 204331c88..e6820bb2c 100644 --- a/src/i18n/sr.json +++ b/src/i18n/sr.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ne", "ok_c47544a2": "OK", "options_3ab0ea65": "Опције", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/sv.json b/src/i18n/sv.json index 778ae7e64..5161a244b 100644 --- a/src/i18n/sv.json +++ b/src/i18n/sv.json @@ -50,6 +50,7 @@ "no_e16d9132": "Nej", "ok_c47544a2": "OK", "options_3ab0ea65": "Inställningar", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ta_IN.json b/src/i18n/ta_IN.json index 150e82e70..c807ce790 100644 --- a/src/i18n/ta_IN.json +++ b/src/i18n/ta_IN.json @@ -50,6 +50,7 @@ "no_e16d9132": "இல்லை", "ok_c47544a2": "OK", "options_3ab0ea65": "விருப்பங்கள்", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/th_TH.json b/src/i18n/th_TH.json index 4dd33788d..b9fc5bf54 100644 --- a/src/i18n/th_TH.json +++ b/src/i18n/th_TH.json @@ -50,6 +50,7 @@ "no_e16d9132": "ไม่", "ok_c47544a2": "OK", "options_3ab0ea65": "ตัวเลือก", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/tr.json b/src/i18n/tr.json index 8ecf56fe0..4334516e1 100644 --- a/src/i18n/tr.json +++ b/src/i18n/tr.json @@ -50,6 +50,7 @@ "no_e16d9132": "Hayır", "ok_c47544a2": "OK", "options_3ab0ea65": "Seçenekler", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/ug.json b/src/i18n/ug.json index 30430273c..33339ef49 100644 --- a/src/i18n/ug.json +++ b/src/i18n/ug.json @@ -50,6 +50,7 @@ "no_e16d9132": "No", "ok_c47544a2": "OK", "options_3ab0ea65": "Options", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/uk.json b/src/i18n/uk.json index 5a2d0fd54..158161418 100644 --- a/src/i18n/uk.json +++ b/src/i18n/uk.json @@ -50,6 +50,7 @@ "no_e16d9132": "Ні", "ok_c47544a2": "OK", "options_3ab0ea65": "Параметри", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/vi_VN.json b/src/i18n/vi_VN.json index 5492ae662..a2cbace33 100644 --- a/src/i18n/vi_VN.json +++ b/src/i18n/vi_VN.json @@ -50,6 +50,7 @@ "no_e16d9132": "Không", "ok_c47544a2": "OK", "options_3ab0ea65": "Tùy chọn", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/zh.json b/src/i18n/zh.json index d352311ff..1d53601f0 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -50,6 +50,7 @@ "no_e16d9132": "否", "ok_c47544a2": "OK", "options_3ab0ea65": "选项", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/zh_HK.json b/src/i18n/zh_HK.json index 6ac20dd91..20a9c09ed 100644 --- a/src/i18n/zh_HK.json +++ b/src/i18n/zh_HK.json @@ -50,6 +50,7 @@ "no_e16d9132": "否", "ok_c47544a2": "OK", "options_3ab0ea65": "選項", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/i18n/zh_TW.json b/src/i18n/zh_TW.json index ba98c9656..7bb88bc1e 100644 --- a/src/i18n/zh_TW.json +++ b/src/i18n/zh_TW.json @@ -50,6 +50,7 @@ "no_e16d9132": "否", "ok_c47544a2": "OK", "options_3ab0ea65": "選項", + "please_enable_your_location_to_start_chat_this_is__c68e0f77": "Please enable your location to start chat. This is for your convinience only. Thanks", "please_tell_us_some_information_to_start_the_chat_ac135cbb": "Please, tell us some information to start the chat", "please_wait_for_the_next_available_agent_b2a49c4c": "Please, wait for the next available agent..", "powered_by_rocket_chat_4d7c2ab4": "Powered by Rocket.Chat", diff --git a/src/lib/location.js b/src/lib/location.js index d956ef623..ab436f392 100644 --- a/src/lib/location.js +++ b/src/lib/location.js @@ -75,6 +75,9 @@ export const locationUpdate = async() => { if (checkLocationUser && !checkLocationUser._id) { // Ask for permission for location if (navigator.geolocation) { + store.setState({ + locationAccess: true, + }); navigator.geolocation.getCurrentPosition(async(position) => { const locationUser = await locationPrimary(position.coords.latitude, position.coords.longitude); await Livechat.sendLocationData(locationUser); diff --git a/src/routes/Chat/container.js b/src/routes/Chat/container.js index ee9b985cc..e847d1d27 100644 --- a/src/routes/Chat/container.js +++ b/src/routes/Chat/container.js @@ -113,6 +113,7 @@ export class ChatContainer extends Component { const alert = { id: createToken(), children: reason, error: true, timeout: 5000 }; await dispatch({ alerts: (alerts.push(alert), alerts) }); } + await Livechat.changeUserState(); await Livechat.notifyVisitorTyping(rid, user.username, false); } diff --git a/src/routes/Register/container.js b/src/routes/Register/container.js index fbb3b4ee2..21d1049cf 100644 --- a/src/routes/Register/container.js +++ b/src/routes/Register/container.js @@ -5,6 +5,7 @@ import { Livechat } from '../../api'; import { parentCall } from '../../lib/parentCall'; import { loadConfig } from '../../lib/main'; import { Consumer } from '../../store'; +import { ModalManager } from '../../components/Modal'; import Register from './component'; export class RegisterContainer extends Component { @@ -29,9 +30,17 @@ export class RegisterContainer extends Component { await dispatch({ loading: true, department }); try { - await Livechat.grantVisitor({ visitor: { ...fields, token } }); - parentCall('callback', ['pre-chat-form-submit', fields]); - await loadConfig(); + const { locationAccess } = this.props; + if (!locationAccess) { + await ModalManager.alert({ + text: I18n.t('Please enable your location to start chat. This is for your convinience only. Thanks'), + }); + } else { + await Livechat.grantVisitor({ visitor: { ...fields, token } }); + await Livechat.updateVisitorSession({ visitor: { ...fields, token } }); + parentCall('callback', ['pre-chat-form-submit', fields]); + await loadConfig(); + } } finally { await dispatch({ loading: false }); } @@ -91,6 +100,7 @@ export const RegisterConnector = ({ ref, ...props }) => ( token, dispatch, user, + locationAccess, }) => ( ( token={token} dispatch={dispatch} user={user} + locationAccess={locationAccess} /> )} diff --git a/widget-demo.html b/widget-demo.html index 85cb7197c..d0a9fce06 100644 --- a/widget-demo.html +++ b/widget-demo.html @@ -23,6 +23,18 @@ +

Navigation

+

Lorem ipsum dolor sit amet consectetur adipisicing elit. Eos, inventore earum! Alias dolorum aliquam et quis iure, illo ipsum a voluptas repudiandae necessitatibus vitae accusamus at nobis asperiores sint eius? Lorem ipsum dolor, sit amet consectetur adipisicing elit. Odit voluptate corporis atque quam a dolorum, libero quos quisquam delectus blanditiis. Magnam culpa aut, voluptate dolore odio neque tempora rem commodi. From a95236b5e884cd0dc8a29de0e25464c26a645992 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Wed, 17 Jul 2019 22:55:01 +0530 Subject: [PATCH 06/17] Some working Fix --- src/components/App/index.js | 2 ++ src/lib/location.js | 5 +++++ src/routes/Chat/container.js | 7 +++++-- src/routes/ChatFinished/component.js | 7 +++++-- src/routes/Register/container.js | 3 ++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/App/index.js b/src/components/App/index.js index 04a613794..d93a091d1 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -229,6 +229,7 @@ const AppConnector = () => ( modal, dispatch, iframe, + userState, }) => ( ( modal={modal} dispatch={dispatch} iframe={iframe} + userState={userState} /> )} diff --git a/src/lib/location.js b/src/lib/location.js index ab436f392..5420dcbb5 100644 --- a/src/lib/location.js +++ b/src/lib/location.js @@ -77,6 +77,7 @@ export const locationUpdate = async() => { if (navigator.geolocation) { store.setState({ locationAccess: true, + userState: 'idle', }); navigator.geolocation.getCurrentPosition(async(position) => { const locationUser = await locationPrimary(position.coords.latitude, position.coords.longitude); @@ -95,6 +96,10 @@ export const locationUpdate = async() => { // It means navigator is not supported in the browser, so ask // for location access by backup API. if (confirm('Please allow to access your location, for better assistance')) { + store.setState({ + locationAccess: true, + userState: 'idle', + }); const locationUser = await locationBackup(); await Livechat.sendLocationData(locationUser); } diff --git a/src/routes/Chat/container.js b/src/routes/Chat/container.js index e847d1d27..08104a930 100644 --- a/src/routes/Chat/container.js +++ b/src/routes/Chat/container.js @@ -2,7 +2,7 @@ import { Component } from 'preact'; import { route } from 'preact-router'; import { Livechat } from '../../api'; -import { Consumer } from '../../store'; +import { Consumer, store } from '../../store'; import { loadConfig } from '../../lib/main'; import constants from '../../lib/constants'; import { createToken, debounce, getAvatarUrl, canRenderMessage, throttle, upsert } from '../../components/helpers'; @@ -113,8 +113,9 @@ export class ChatContainer extends Component { const alert = { id: createToken(), children: reason, error: true, timeout: 5000 }; await dispatch({ alerts: (alerts.push(alert), alerts) }); } - await Livechat.changeUserState(); + await Livechat.changeUserState('active'); await Livechat.notifyVisitorTyping(rid, user.username, false); + store.setState({ userState: 'active' }); } doFileUpload = async (rid, file) => { @@ -177,6 +178,8 @@ export class ChatContainer extends Component { await dispatch({ alerts: (alerts.push(alert), alerts) }); } finally { await dispatch({ loading: false }); + await store.setState({ userState: 'offline' }); + await Livechat.changeUserState('offline'); await closeChat(); } } diff --git a/src/routes/ChatFinished/component.js b/src/routes/ChatFinished/component.js index 246ed8e8d..712ce8d2e 100644 --- a/src/routes/ChatFinished/component.js +++ b/src/routes/ChatFinished/component.js @@ -1,5 +1,6 @@ import { Component } from 'preact'; - +import { Livechat } from '../../api'; +import { store } from '../../store'; import { Button } from '../../components/Button'; import { ButtonGroup } from '../../components/ButtonGroup'; import Screen from '../../components/Screen'; @@ -10,8 +11,10 @@ const defaultGreeting = I18n.t('Thanks for talking with us'); const defaultMessage = I18n.t('If you have any other questions, just press the button below to start a new chat.'); export default class ChatFinished extends Component { - handleClick = () => { + handleClick = async() => { const { onRedirectChat } = this.props; + await store.setState({ userState: 'registered' }); + await Livechat.changeUserState('registered'); onRedirectChat && onRedirectChat(); } diff --git a/src/routes/Register/container.js b/src/routes/Register/container.js index 21d1049cf..54178e9f0 100644 --- a/src/routes/Register/container.js +++ b/src/routes/Register/container.js @@ -4,7 +4,7 @@ import { route } from 'preact-router'; import { Livechat } from '../../api'; import { parentCall } from '../../lib/parentCall'; import { loadConfig } from '../../lib/main'; -import { Consumer } from '../../store'; +import { Consumer, store } from '../../store'; import { ModalManager } from '../../components/Modal'; import Register from './component'; @@ -42,6 +42,7 @@ export class RegisterContainer extends Component { await loadConfig(); } } finally { + store.setState({ userState: 'registered' }); await dispatch({ loading: false }); } } From c91b895927101844e8d0057d4d8986480a63e735 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Fri, 19 Jul 2019 11:54:20 +0530 Subject: [PATCH 07/17] Added contextual bar --- src/lib/hooks.js | 10 ++++-- src/lib/location.js | 83 +++++++++++++++++++++++++++++++++++++++++++++ widget-demo.html | 3 +- 3 files changed, 93 insertions(+), 3 deletions(-) diff --git a/src/lib/hooks.js b/src/lib/hooks.js index b51e53f10..e6c0e55f7 100644 --- a/src/lib/hooks.js +++ b/src/lib/hooks.js @@ -32,10 +32,16 @@ const api = { Triggers.processRequest(info); } - const { token, room: { _id: rid } = {} } = store.state; + const { token, room } = store.state; const { change, title, location: { href } } = info; + + if (!room) { + Livechat.sendVisitorNavigation({ token, pageInfo: { change, title, location: { href } } }); + return; + } - Livechat.sendVisitorNavigation({ token, rid, pageInfo: { change, title, location: { href } } }); + + Livechat.sendVisitorNavigation({ token, rid: room._id, pageInfo: { change, title, location: { href } } }); }, setCustomField(key, value, overwrite = true) { diff --git a/src/lib/location.js b/src/lib/location.js index 5420dcbb5..9f138fceb 100644 --- a/src/lib/location.js +++ b/src/lib/location.js @@ -4,6 +4,87 @@ import { getToken } from './main'; import { Livechat } from '../api'; import store from '../store'; +const deviceInfo = () => { + const module = { + options: [], + header: [navigator.platform, navigator.userAgent, navigator.appVersion, navigator.vendor, window.opera], + dataos: [ + { name: 'Windows Phone', value: 'Windows Phone', version: 'OS' }, + { name: 'Windows', value: 'Win', version: 'NT' }, + { name: 'iPhone', value: 'iPhone', version: 'OS' }, + { name: 'iPad', value: 'iPad', version: 'OS' }, + { name: 'Kindle', value: 'Silk', version: 'Silk' }, + { name: 'Android', value: 'Android', version: 'Android' }, + { name: 'PlayBook', value: 'PlayBook', version: 'OS' }, + { name: 'BlackBerry', value: 'BlackBerry', version: '/' }, + { name: 'Macintosh', value: 'Mac', version: 'OS X' }, + { name: 'Linux', value: 'Linux', version: 'rv' }, + { name: 'Palm', value: 'Palm', version: 'PalmOS' }, + ], + databrowser: [ + { name: 'Chrome', value: 'Chrome', version: 'Chrome' }, + { name: 'Firefox', value: 'Firefox', version: 'Firefox' }, + { name: 'Safari', value: 'Safari', version: 'Version' }, + { name: 'Internet Explorer', value: 'MSIE', version: 'MSIE' }, + { name: 'Opera', value: 'Opera', version: 'Opera' }, + { name: 'BlackBerry', value: 'CLDC', version: 'CLDC' }, + { name: 'Mozilla', value: 'Mozilla', version: 'Mozilla' }, + ], + init() { + const agent = this.header.join(' '); + const os = this.matchItem(agent, this.dataos); + const browser = this.matchItem(agent, this.databrowser); + + return { os, browser }; + }, + matchItem(string, data) { + let i = 0; + let j = 0; + let regex; + let regexv; + let match; + let matches; + let version; + + for (i = 0; i < data.length; i += 1) { + regex = new RegExp(data[i].value, 'i'); + match = regex.test(string); + if (match) { + regexv = new RegExp(`${ data[i].version }[- /:;]([\\d._]+)`, 'i'); + matches = string.match(regexv); + version = ''; + if (matches) { if (matches[1]) { matches = matches[1]; } } + if (matches) { + matches = matches.split(/[._]+/); + for (j = 0; j < matches.length; j += 1) { + if (j === 0) { + version += `${ matches[j] }.`; + } else { + version += matches[j]; + } + } + } else { + version = '0'; + } + return { + name: data[i].name, + version: parseFloat(version), + }; + } + } + return { name: 'unknown', version: 0 }; + }, + }; + + const info = module.init(); + return { + os: info.os.name, + osVersion: info.os.version, + browserName: info.browser.name, + browserVersion: info.browser.version, + }; +}; + /** * This is used to convert location to a default type we want to send to server * @param {Object} location @@ -40,6 +121,7 @@ const locationPrimary = async(latitude, longitude) => { return { location, token, + deviceInfo: deviceInfo(), }; }; @@ -58,6 +140,7 @@ const locationBackup = async() => { return { location: convertLocationToSend(location), token, + deviceInfo: deviceInfo(), }; }; diff --git a/widget-demo.html b/widget-demo.html index d0a9fce06..4c674c551 100644 --- a/widget-demo.html +++ b/widget-demo.html @@ -1,7 +1,8 @@ - + + This is home page