Skip to content

Commit

Permalink
feature: add router for slas, change locale, base store and component…
Browse files Browse the repository at this point in the history
… the-slas.vue[WTEL-4883]
  • Loading branch information
Lera24 committed Oct 31, 2024
1 parent 237b1cc commit 3fec01b
Show file tree
Hide file tree
Showing 17 changed files with 773 additions and 23 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"@vueuse/core": "^11.0.3",
"@webitel/ui-sdk": "^24.10.54",
"@webitel/ui-sdk": "^24.10.56",
"axios": "^1.7.7",
"deep-equal": "^2.2.1",
"dompurify": "^3.1.2",
Expand All @@ -27,7 +27,7 @@
"vue-i18n": "^9.13.1",
"vue-router": "^4.3.2",
"vuex": "^4.1.0",
"webitel-sdk": "^24.4.16"
"webitel-sdk": "^24.8.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "5.1.3",
Expand Down
3 changes: 2 additions & 1 deletion src/app/locale/en/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
name: 'Contacts',
text: 'In this section, you can work with your contacts: clients, customers etc.',
},
[CrmSections.CONFIGURATION]: {
configuration: {
name: 'Configuration',
text: 'In this section, you will set up the Case management process.',
},
Expand All @@ -103,6 +103,7 @@ export default {

slas: {
slas: 'SLA | SLAs',
calendar: 'Calendar',
},
[CrmSections.CONTACT_GROUPS]: 'Contact groups',
[CrmSections.STATUSES]: 'Statuses',
Expand Down
3 changes: 2 additions & 1 deletion src/app/locale/ru/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
name: 'Контакты',
text: 'В этом разделе вы можете работать с Контактами: клиентами, партнерами и т.д.',
},
[CrmSections.CONFIGURATION]: {
configuration: {
name: 'Конфигурация',
text: 'Здесь вы можете просматривать Обращения, зарегистрированные в системе.',
},
Expand All @@ -102,6 +102,7 @@ export default {

slas: {
slas: 'SLA | SLAs',
calendar: 'Календарь',
},
[CrmSections.CONTACT_GROUPS]: 'Группы контактов',
[CrmSections.STATUSES]: 'Статусы',
Expand Down
3 changes: 2 additions & 1 deletion src/app/locale/ua/ua.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
name: 'Контакти',
text: 'У цьому розділі ви можете працювати з Контактами: клієнтами, партнерами тощо.',
},
[CrmSections.CONFIGURATION]: {
configuration: {
name: 'Конфігурація',
text: 'Тут ви можете переглядати Звернення, зареєстровані у системі.',
},
Expand All @@ -102,6 +102,7 @@ export default {

slas: {
slas: 'SLA | SLAs',
calendar: 'Календар',
},

[CrmSections.CONTACT_GROUPS]: 'Групи контактів',
Expand Down
45 changes: 40 additions & 5 deletions src/app/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import AccessDenied from '../components/utils/access-denied-component.vue';
import TheStartPage
from '../../modules/start-page/components/the-start-page.vue';
import TheContacts from '../../modules/contacts/components/the-contacts.vue';

import TheSlas
from '../../modules/configuration/modules/lookups/modules/slas/components/the-slas.vue';

import store from '../store';
import TheConfiguration from '../../modules/configuration/components/the-configuration.vue';
import TheConfiguration
from '../../modules/configuration/components/the-configuration.vue';

const checkAppAccess = (to, from, next) => {
const hasReadAccess = store.getters['userinfo/CHECK_APP_ACCESS'](store.getters['userinfo/THIS_APP']);
Expand Down Expand Up @@ -56,10 +58,43 @@ const routes = [
},
{
path: 'configuration',
name: CrmSections.CONFIGURATION,
name: 'configuration',
component: TheConfiguration,
// beforeEnter: checkRouteAccess,
// redirect: { name: `the-start-page` },
// redirect: { name: 'the-start-page' },
},

{
path: 'lookups',
name: 'lookups',
redirect: { name: 'configuration' },
children: [
{
path: 'slas',
name: CrmSections.SLAS,
component: TheSlas,
// beforeEnter: checkRouteAccess,
},
// {
// path: 'slas/:id',
// name: `${CrmSections.SLAS}-card`,
// component: OpenedSlas,
// beforeEnter: checkRouteAccess,
// redirect: { name: `${CrmSections.SLAS}-general` },
// children: [
// {
// path: 'general',
// name: `${CrmSections.SLAS}-general`,
// component: SlasGeneral,
// },
// {
// path: 'conditions',
// name: `${CrmSections.SLAS}-conditions`,
// component: SlasConditions,
// },
// ],
// }
],
},
{
path: 'contacts',
Expand Down Expand Up @@ -136,7 +171,7 @@ const router = createRouter({

router.beforeEach((to, from, next) => {
if (!localStorage.getItem('access-token') && !to.query.accessToken) {
const desiredUrl = encodeURIComponent(window.location.href);
const desiredUrl = encodeURIComponent(window.location.href);
const authUrl = import.meta.env.VITE_AUTH_URL;
window.location.href = `${authUrl}?redirectTo=${desiredUrl}`;
} else if (to.query.accessToken) {
Expand Down
2 changes: 2 additions & 0 deletions src/app/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createStore } from 'vuex';
import contacts from '../../modules/contacts/store/contacts';
import userinfo from '../../modules/userinfo/store/userinfo';
import appearance from '../../modules/appearance/store/appearance';
import configuration from '../../modules/configuration/store/configuration';
import instance from '../api/instance';

export default createStore({
Expand All @@ -22,5 +23,6 @@ export default createStore({
contacts,
userinfo,
appearance,
configuration,
},
});
Loading

0 comments on commit 3fec01b

Please sign in to comment.