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

Feature/widget call config #543

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

32 changes: 25 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@vuelidate/validators": "^2.0.0",
"@vueuse/core": "^10.3.0",
"@webitel/flow-ui-sdk": "^0.1.14",
"@webitel/ui-sdk": "^23.12.30",
"@webitel/ui-sdk": "^23.12.32",
"axios": "^0.27.1",
"clipboard-copy": "^4.0.1",
"cron-validator": "^1.3.1",
Expand All @@ -31,6 +31,7 @@
"path": "^0.12.7",
"query-string": "^7.1.1",
"sortablejs": "^1.10.2",
"uuid": "^9.0.1",
"vue": "^3.2.47",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.5",
Expand Down
6 changes: 6 additions & 0 deletions src/app/locale/en/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,15 @@ export default {
},
alternativeChannels: {
alternativeChannels: 'Alternative Channels',
title: 'Messaging channels',
email: 'Email',
whatsapp: 'WhatsApp',
telegram: 'Telegram',
messenger: 'Messenger',
},
call: {
title: 'Online call',
url: 'WebSocket Endpoint',
},
},
uri: 'URI',
Expand Down
6 changes: 6 additions & 0 deletions src/app/locale/ru/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,17 @@ export default {
subheadingText: 'Подзаголовок',
showDefaultHeading: 'Показать стандартный заголовок и подзаголовок на странице результата',
},
call: {
title: 'Онлайн-звонок',
url: 'WebSocket Endpoint',
},
alternativeChannels: {
alternativeChannels: 'Альтернативные каналы',
title: 'Текстовые каналы',
email: 'Электронная почта',
whatsapp: 'WhatsApp',
telegram: 'Telegram',
messenger: 'Messenger',
},
},
uri: 'URI',
Expand Down
6 changes: 6 additions & 0 deletions src/app/locale/ua/ua.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,17 @@ export default {
subheadingText: 'Підзаголовок',
showDefaultHeading: 'Показати стандартний заголовок та підзаголовок на сторінці результату',
},
call: {
title: 'Онлайн-дзвінок',
url: 'WebSocket Endpoint',
},
alternativeChannels: {
alternativeChannels: 'Альтернативні канали',
title: 'Текстові канали',
email: 'Електронна пошта',
whatsapp: 'WhatsApp',
telegram: 'Telegram',
messenger: 'Messenger',
},
},
uri: 'URI',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import deepCopy from 'deep-copy';
import set from 'lodash/set';

const state = {
itemId: 0,
Expand Down Expand Up @@ -35,8 +36,13 @@ const mutations = {
SET_ITEM_ID: (state, id) => {
state.itemId = id;
},
SET_ITEM_PROPERTY: (state, { prop, value }) => {
state.itemInstance[prop] = value;
SET_ITEM_PROPERTY: (state, { prop, value, path }) => {
if (path) {
set(state.itemInstance, path, value);
} else {
// DEPRECATED, LEGACY CODE
state.itemInstance[prop] = value;
}
},
SET_ITEM: (state, item) => {
state.itemInstance = item;
Expand Down
4 changes: 4 additions & 0 deletions src/modules/routing/modules/chat-gateways/api/chatGateways.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const webchatRequestConverter = (data) => {
data.metadata.chat = JSON.stringify(data.metadata.chat);
data.metadata.appointment = JSON.stringify(data.metadata.appointment);
data.metadata.alternativeChannels = JSON.stringify(data.metadata.alternativeChannels);
data.metadata.call = JSON.stringify(data.metadata.call);
data.metadata._btnCodeDirty = data.metadata._btnCodeDirty.toString();
return data;
};
Expand Down Expand Up @@ -105,6 +106,9 @@ const webChatResponseConverter = (data) => {
if (data.metadata.alternativeChannels) {
data.metadata.alternativeChannels = JSON.parse(data.metadata.alternativeChannels);
}
if (data.metadata.call) {
data.metadata.call = JSON.parse(data.metadata.call);
}
data.metadata._btnCodeDirty = (data.metadata._btnCodeDirty === 'true');

return deepmerge(webChatGateway(), data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<webchat-copy-code-button
v-if="isWebchat"
:item-instance="itemInstance"
:namespace="namespace"
@copied="handleWebchatCodeCopied"
/>
</template>
Expand Down Expand Up @@ -49,6 +50,7 @@
<script>
import { useVuelidate } from '@vuelidate/core';
import { maxValue, minLength, minValue, numeric, required, url } from '@vuelidate/validators';
import websocketValidator from '@webitel/ui-sdk/src/validators/websocketValidator/websocketValidator';
import { mapActions } from 'vuex';
import openedObjectMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin';
import ChatGatewayProvider from '../enum/ChatGatewayProvider.enum';
Expand Down Expand Up @@ -191,6 +193,10 @@ export default {
minValue: minValue(1),
},
} : {},
call: this.itemInstance.metadata.call.enabled ? {
url: { required, websocketValidator },
flow: { required },
} : {},
},
},
};
Expand Down
Loading