Skip to content

Commit

Permalink
v22.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohvinov committed Dec 27, 2022
2 parents 8e2d1cf + 60e9da6 commit 6f9601c
Show file tree
Hide file tree
Showing 40 changed files with 940 additions and 331 deletions.
44 changes: 22 additions & 22 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-client",
"version": "22.09.2",
"version": "22.12.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@webitel/flow-ui-sdk": "^0.1.12",
"@webitel/ui-sdk": "^2.1.21",
"@webitel/ui-sdk": "^2.1.26",
"axios": "^0.27.1",
"clipboard-copy": "^4.0.1",
"core-js": "^3.6.4",
Expand All @@ -33,7 +33,7 @@
"vue2-dropzone": "^3.6.0",
"vuelidate": "^0.7.4",
"vuex": "^3.4.0",
"webitel-sdk": "^0.1.166"
"webitel-sdk": "^0.1.170"
},
"devDependencies": {
"@babel/eslint-parser": "^7.17.0",
Expand Down
9 changes: 8 additions & 1 deletion src/app/api/instance.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import axios from 'axios';
import defaultInterceptorsSetup from './interceptors/defaultInterceptorsSetup';

// config with specific properties which doesn't fit to axios config
export const config = {
errors: {
silent: false,
},
};

// global API configuration
// 'X-Webitel-Access' ~ 'X-Access-Token'
const instance = axios.create({
Expand All @@ -12,6 +19,6 @@ const instance = axios.create({
},
});

defaultInterceptorsSetup(instance);
defaultInterceptorsSetup({ instance, config });

export default instance;
2 changes: 1 addition & 1 deletion src/app/api/interceptors/apply.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import InterceptorType from './InterceptorType.enum';

const applyInterceptors = (instance, interceptors = []) => {
const applyInterceptors = ({ instance, interceptors = [] }) => {
interceptors.forEach(({ type, interceptor }) => {
if (type === InterceptorType.REQUEST
|| type === InterceptorType.RESPONSE) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/api/interceptors/defaultInterceptorsSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DO_NOT_CONVERT_KEYS = [
'errorIds',
];

const defaultInterceptorsSetup = (instance) => {
const defaultInterceptorsSetup = ({ instance, config }) => {
const interceptors = [
{
type: InterceptorType.REQUEST,
Expand All @@ -29,7 +29,7 @@ const defaultInterceptorsSetup = (instance) => {

{
type: InterceptorType.RESPONSE,
interceptor: errorEventBusNotificationResponse.default,
interceptor: errorEventBusNotificationResponse.setup(config),
},
{
type: InterceptorType.RESPONSE,
Expand All @@ -41,7 +41,7 @@ const defaultInterceptorsSetup = (instance) => {
},
];

applyInterceptors(instance, interceptors);
applyInterceptors({ instance, interceptors });
return instance;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ import eventBus from '@webitel/ui-sdk/src/scripts/eventBus';

const onFulfilled = (response) => response;

const onReject = (error) => {
eventBus.$emit('notification', {
type: 'error',
text: error.response.data.detail || error.response.data.message,
});
const onReject = (config) => (error) => {
if (!config.errors.silent) {
eventBus.$emit('notification', {
type: 'error',
text: error.response.data.detail || error.response.data.message,
});
}
return Promise.reject(error);
};

const setup = (config = {}) => [
onFulfilled,
onReject(config),
];

const errorEventBusNotificationResponse = {
setup,
default: [
onFulfilled,
onReject,
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/utils/object-utils/the-object-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
</template>
<template slot="actions">
<slot name="actions"></slot>
<wt-button
<slot name="primary-action">
<wt-button
v-if="!hidePrimary"
:disabled="primaryDisabled"
@click="primaryAction"
>
{{ primaryText || $t('objects.add') }}
</wt-button>
</slot>
<wt-button
v-if="!hideSecondary"
color="secondary"
Expand Down
31 changes: 31 additions & 0 deletions src/app/locale/en/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export default {
settings: 'Settings',
changePassword: 'Change password',
language: 'Language',
webPhone: 'WebPhone',
useWebPhone: 'Use WebPhone',
useStun: 'Use STUN',
},

validation: {
Expand Down Expand Up @@ -110,6 +113,7 @@ export default {
delete: 'Delete',
save: 'Save',
saved: 'Saved',
saveAs: 'Save as',
close: 'Close',
name: 'Name',
description: 'Description',
Expand Down Expand Up @@ -267,6 +271,8 @@ export default {
playbackRecordFile: 'Playback record file',
exportDataGrid: 'Export data grid',
viewCdrPhoneNumbers: 'View CDR phone numbers',
manageUserRoles: 'Manage user roles',
manageUserLicense: 'Manage user license',
addDescription: 'Grants permission to create any objects',
deleteDescription: 'Grants permission to remove any objects',
readDescription: 'Grants permission to select any objects',
Expand All @@ -275,6 +281,8 @@ export default {
playbackRecordFileDescription: 'Grants permission to playback call-record files',
exportDataGridDescription: 'Grants permission to export data grid to a file',
viewCdrPhoneNumbersDescription: 'View CDR phone numbers',
manageUserRolesDescription: 'Grants permission to manage a set of user roles',
manageUserLicenseDescription: 'Grants permission to manage a set of user license',
},
addPermission: 'Add role permission',
usage: 'Usage',
Expand Down Expand Up @@ -533,7 +541,19 @@ export default {
right: 'Right',
left: 'Left',
static: 'Static',
},
chat: {
chat: 'Chat',
openTimeout: 'Open Timeout',
openTimeoutSec: 'Open Timeout Sec',
},
appointment: {
appointment: 'Appointment',
days: 'Days',
availableAgents: 'Available agents',
showEmailField: 'Show email field',
showMessageField: 'Show message field',
successMessage: 'Success message',
},
alternativeChannels: {
alternativeChannels: 'Alternative Channels',
Expand Down Expand Up @@ -921,6 +941,17 @@ export default {
event: 'Event',
expression: 'Expression',
timeout: 'Timeout',
logs: {
logs: 'Running history',
startedAt: 'Start',
result: 'Result',
resultName: {
idle: 'Idle',
active: 'Active',
done: 'Done',
error: 'Error',
},
},
},
},

Expand Down
33 changes: 32 additions & 1 deletion src/app/locale/ru/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export default {
settings: 'Настройки',
changePassword: 'Изменить пароль',
language: 'Язык',
webPhone: 'Web-телефон',
useWebPhone: 'Использовать Web-телефон',
useStun: 'Использовать STUN',
},

validation: {
Expand Down Expand Up @@ -110,6 +113,7 @@ export default {
delete: 'Удалить',
save: 'Сохранить',
saved: 'Сохранено',
saveAs: 'Сохранить как нового',
close: 'Закрыть',
name: 'Имя',
description: 'Описание',
Expand Down Expand Up @@ -267,6 +271,8 @@ export default {
playbackRecordFile: 'Воспроизводить записи разговоров',
exportDataGrid: 'Экспортировать данные',
viewCdrPhoneNumbers: 'Просмотр незашифрованных номеров телефонов',
manageUserRoles: 'Управление ролями пользователей',
manageUserLicense: 'Управление лицензиями пользователей',
addDescription: 'Предоставляет разрешение на создание объектов',
deleteDescription: 'Предоставляет разрешение на удаление объектов',
readDescription: 'Предоставляет разрешение на выбор объектов',
Expand All @@ -275,6 +281,8 @@ export default {
playbackRecordFileDescription: 'Предоставляет разрешение на воспроизведение файлов с записями разговоров',
exportDataGridDescription: 'Предоставляет разрешение на экспорт данных',
viewCdrPhoneNumbersDescription: 'Предоставляет разрешение на отображение незашифрованных телефонных номеров',
manageUserRolesDescription: 'Предоставляет разрешение на управление набором ролей пользователей',
manageUserLicenseDescription: 'Предоставляет разрешение на управление набором пользовательских лицензий',
},
addPermission: 'Добавить право доступа для роли',
usage: 'Использование',
Expand Down Expand Up @@ -533,7 +541,19 @@ export default {
right: 'Справа',
left: 'Слева',
static: 'Статическая',
openTimeout: 'Задержка открытия',
},
chat: {
chat: 'Чат',
openTimeout: 'Включить задержку открытия',
openTimeoutSec: 'Время задержки открытия',
},
appointment: {
appointment: 'Заказ звонка',
days: 'Количество дней',
availableAgents: 'Свободные агенты',
showEmailField: 'Показать поле ввода почты',
showMessageField: 'Показать поле ввода сообщения',
successMessage: 'Сообщение об успехе',
},
alternativeChannels: {
alternativeChannels: 'Альтерантивные каналы',
Expand Down Expand Up @@ -919,6 +939,17 @@ export default {
event: 'Event',
expression: 'Выражение',
timeout: 'Задержка',
logs: {
logs: 'История запуска',
startedAt: 'Начало',
result: 'Результат',
resultName: {
idle: 'Неактивний',
active: 'Активний',
done: 'Завершенный',
error: 'Ошибка',
},
},
},
},
pagination: {
Expand Down
Loading

0 comments on commit 6f9601c

Please sign in to comment.