Skip to content

Commit

Permalink
fix: merge master[WTEL-4600]
Browse files Browse the repository at this point in the history
  • Loading branch information
Lera24 committed Jun 4, 2024
2 parents fb27437 + d2358a4 commit d1f4734
Show file tree
Hide file tree
Showing 63 changed files with 3,398 additions and 12,178 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pluginVue from 'eslint-plugin-vue';

export default [
...pluginVue.configs['flat/recommended'],
{
rules: {
'no-console': 'off',
'no-debugger': 'off',
'no-shadow': 'off',
'no-empty': 'off',
'no-underscore-dangle': 'off',
'max-len': 'off',
indent: 'off',
'no-param-reassign': ['error', { props: false }],
},
},
];
13,857 changes: 2,381 additions & 11,476 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,40 @@
"build": "vite build",
"serve": "vite preview",
"test:unit": "vitest",
"lint:fix": "eslint --fix --ext .js,.vue src"
"lint:fix": "eslint --fix src"
},
"type": "module",
"dependencies": {
"@vue/compat": "^3.4.25",
"@vuelidate/core": "^2.0.0",
"@vuelidate/validators": "^2.0.2",
"@vueuse/core": "^10.9.0",
"@webitel/ui-sdk": "=24.4.39",
"axios": "^1.6.8",
"@vue/compat": "^3.4.27",
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"@vueuse/core": "^10.10.0",
"@webitel/ui-sdk": "^24.6.37",
"axios": "^1.7.2",
"deep-equal": "^2.2.1",
"dompurify": "^3.1.2",
"linkify-html": "^4.1.3",
"linkifyjs": "^4.1.3",
"lodash": "^4.17.21",
"vue": "^3.4.25",
"vue": "^3.4.27",
"vue-i18n": "^9.13.1",
"vue-router": "^4.3.2",
"vuex": "^4.1.0",
"webitel-sdk": "^24.2.16"
"webitel-sdk": "^24.4.3"
},
"devDependencies": {
"@vitejs/plugin-vue": "5.0.3",
"@vitest/coverage-v8": "^1.1.3",
"@vue/test-utils": "^2.4.5",
"@vitejs/plugin-vue": "5.0.4",
"@vitest/coverage-v8": "^2.0.0-beta.3",
"@vue/test-utils": "^2.4.6",
"deep-copy": "^1.4.2",
"eslint": "^8.56.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-vue": "^9.20.0",
"happy-dom": "^13.0.0",
"sass": "^1.75.0",
"eslint": "^9.3.0",
"eslint-plugin-vue": "^9.26.0",
"happy-dom": "^14.11.1",
"sass": "^1.77.2",
"tslib": "^2.6.2",
"vite": "=5.1",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-plugin-svg-sprite": "^0.5.1",
"vitest": "^1.5.2"
"vite": "^5.2.11",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-svg-sprite": "^0.5.2",
"vitest": "^2.0.0-beta.3"
}
}
1 change: 1 addition & 0 deletions src/app/api/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import handleUnauthorizedInterceptor
from '@webitel/ui-sdk/src/api/interceptors/response/handleUnauthorized.interceptor';

export default generateInstance({
baseURL: import.meta.env.VITE_API_URL,
interceptors: {
request: [updateTokenInterceptor],
response: [handleUnauthorizedInterceptor],
Expand Down
6 changes: 3 additions & 3 deletions src/app/locale/en/en.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import ChatGatewayProvider
from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum';
from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
import { WebitelContactsTimelineEventType } from 'webitel-sdk';
import AccessMode
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum';
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum.js';
import TimelineTaskStatusEnum
from '../../../modules/contacts/modules/timeline/enums/TimelineTaskStatus.enum.js';
import { WebitelContactsTimelineEventType } from 'webitel-sdk';

export default {
crm: 'CRM',
Expand Down
8 changes: 4 additions & 4 deletions src/app/locale/i18n.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createI18n } from 'vue-i18n';
import en from './en/en';
import ru from './ru/ru';
import ua from './ua/ua';
import kz from './kz/kz';
import datetimeFormats from './datetimeFormats.js';
import en from './en/en.js';
import kz from './kz/kz.js';
import ru from './ru/ru.js';
import ua from './ua/ua.js';

const messages = {
en,
Expand Down
2 changes: 1 addition & 1 deletion src/app/locale/kz/kz.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AccessMode
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum';
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum.js';

export default {
crm: 'CRM',
Expand Down
8 changes: 4 additions & 4 deletions src/app/locale/ru/ru.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ChatGatewayProvider
from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum';
from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
import { WebitelContactsTimelineEventType } from 'webitel-sdk';
import AccessMode
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum';
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum.js';
import TimelineTaskStatusEnum
from '../../../modules/contacts/modules/timeline/enums/TimelineTaskStatus.enum.js';

Expand Down Expand Up @@ -37,8 +37,8 @@ export default {
destination: 'Назначение',
setAsPrimary: 'Установить как основной',
emails: {
addTitle: 'Добавить електронный адрес',
editTitle: 'Редактировать електронный адрес',
addTitle: 'Добавить электронный адрес',
editTitle: 'Редактировать электронный адрес',
dummy: 'Электронные адреса еще не добавлены',
},
phones: {
Expand Down
4 changes: 2 additions & 2 deletions src/app/locale/ua/ua.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ChatGatewayProvider
from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum';
from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
import { WebitelContactsTimelineEventType } from 'webitel-sdk';
import AccessMode
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum';
from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum.js';
import TimelineTaskStatusEnum
from '../../../modules/contacts/modules/timeline/enums/TimelineTaskStatus.enum.js';

Expand Down
15 changes: 7 additions & 8 deletions src/app/plugins/webitel-ui.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import WebitelUI from '@webitel/ui-sdk/dist/ui-sdk.umd';
import WebitelUIEn from '@webitel/ui-sdk/src/locale/en/en';
import WebitelUIRu from '@webitel/ui-sdk/src/locale/ru/ru';
import WebitelUIUa from '@webitel/ui-sdk/src/locale/ua/ua';
import WebitelUIKz from '@webitel/ui-sdk/src/locale/kz/kz';
import eventBus from '@webitel/ui-sdk/src/scripts/eventBus';
import i18n from '../locale/i18n';
import WebitelUI from '@webitel/ui-sdk/dist/ui-sdk.js';
import WebitelUIEn from '@webitel/ui-sdk/src/locale/en/en.js';
import WebitelUIKz from '@webitel/ui-sdk/src/locale/kz/kz.js';
import WebitelUIRu from '@webitel/ui-sdk/src/locale/ru/ru.js';
import WebitelUIUa from '@webitel/ui-sdk/src/locale/ua/ua.js';
import eventBus from '@webitel/ui-sdk/src/scripts/eventBus.js';
import i18n from '../locale/i18n.js';
import '@webitel/ui-sdk/dist/ui-sdk.css';
import '@webitel/ui-sdk/dist/img/sprite';

const globals = {
$baseURL: import.meta.env.BASE_URL,
Expand Down
12 changes: 6 additions & 6 deletions src/app/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const routes = [
},
{
path: 'contacts/:id',
name: `${CrmSections.CONTACTS}-edit`,
name: `${CrmSections.CONTACTS}-card`,
component: OpenedContact,
beforeEnter: checkRouteAccess,
redirect: { name: `${CrmSections.CONTACTS}-timeline` },
Expand All @@ -70,29 +70,29 @@ const routes = [
component: ContactCommunications,
children: [
{
path: 'phones',
path: 'phones/:commId?',
name: `${CrmSections.CONTACTS}-communications-phones`,
component: ContactCommunications,
},
{
path: 'messaging',
path: 'messaging/:commId?',
name: `${CrmSections.CONTACTS}-communications-messaging`,
component: ContactCommunications,
},
{
path: 'emails',
path: 'emails/:commId?',
name: `${CrmSections.CONTACTS}-communications-emails`,
component: ContactCommunications,
},
],
},
{
path: 'variables',
path: 'variables/:variableId?',
name: `${CrmSections.CONTACTS}-variables`,
component: ContactVariables,
},
{
path: 'permissions',
path: 'permissions/:permissionId?',
name: `${CrmSections.CONTACTS}-permissions`,
component: ContactPermissions,
},
Expand Down
8 changes: 8 additions & 0 deletions src/app/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ import appearance from '../../modules/appearance/store/appearance';
import instance from '../api/instance';

export default createStore({
state: {
router: null,
},
actions: {
OPEN_SESSION: async (context) => {
await context.dispatch('userinfo/OPEN_SESSION', { instance }, { root: true });
},
},
mutations: {
SET_ROUTER: (state, router) => {
state.router = router;
},
},
modules: {
contacts,
userinfo,
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const initApp = () => createApp(App)
try {
setTokenFromUrl();
config = await fetchConfig();
store.commit('SET_ROUTER', router);
await store.dispatch('OPEN_SESSION');
} catch (err) {
console.error('before app mount error:', err);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/contacts/api/ContactsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const getList = async (params) => {
size,
q,
sort || '+name',
fields,
['mode', ...fields],
id,
qin,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { shallowMount } from '@vue/test-utils';
import OpenedContactTabs from '../opened-contact-tabs.vue';

vi.mock('vue-router', () => ({
useRoute: vi.fn(() => ({})),
useRouter: vi.fn(() => ({
push: () => {}
}))
}))

describe('OpenedContactTabs', () => {

it('renders a component', () => {
Expand Down
8 changes: 6 additions & 2 deletions src/modules/contacts/components/contact-popup.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<wt-popup
class="contact-popup"
width="480"
v-bind="attrs"
size="sm"
@close="close"
>
<template #title>
Expand Down Expand Up @@ -65,7 +66,7 @@
</template>

<script setup>
import { computed, onMounted, ref, watch } from 'vue';
import { computed, onMounted, ref, useAttrs, watch } from 'vue';
import { useVuelidate } from '@vuelidate/core';
import { required } from '@vuelidate/validators';
import { useI18n } from 'vue-i18n';
Expand All @@ -81,8 +82,11 @@ const props = defineProps({
type: [String, null],
},
});
const emit = defineEmits(['saved', 'close']);
const attrs = useAttrs();
const { t } = useI18n();
const store = useStore();
Expand Down
Loading

0 comments on commit d1f4734

Please sign in to comment.