From 91dc4c129c9effe1d6c8365e92ddebf6ae3725b2 Mon Sep 17 00:00:00 2001 From: Volodymyr Dekhtyaruk Date: Mon, 18 Dec 2023 14:57:52 +0200 Subject: [PATCH 1/5] refactor: commenting all SSO functionality [WTEL-3717] --- src/app/locale/en/en.js | 16 +- src/app/locale/ru/ru.js | 16 +- src/app/locale/ua/ua.js | 16 +- .../_internals/NavigationPages.lookup.js | 13 +- src/app/router/_internals/RouteNames.enum.js | 3 +- src/app/router/router.js | 43 ++- .../single-sign-on/api/singleSignOn.js | 347 +++++++++--------- .../opened-single-sign-on-general.vue | 123 ++++--- .../components/opened-single-sign-on.vue | 171 ++++----- .../components/the-single-sign-on.vue | 293 +++++++-------- .../store/_internals/headers.js | 33 +- .../single-sign-on/store/single-sign-on.js | 47 +-- .../integrations/store/integrations.js | 6 +- .../_internals/lookups/ObjectsList.lookup.js | 11 +- 14 files changed, 578 insertions(+), 560 deletions(-) diff --git a/src/app/locale/en/en.js b/src/app/locale/en/en.js index 3540ad0dc..68c8fce09 100644 --- a/src/app/locale/en/en.js +++ b/src/app/locale/en/en.js @@ -968,13 +968,15 @@ export default { imapHost: 'IMAP Host', fetchInterval: 'Refresh interval', }, - singleSignOn: { - allTypes: 'All types', - singleSignOn: 'Single Sign-on', - clientId: 'Client id', - clientSecret: 'Client secret', - discoveryUrl: 'Discovery url', - }, + + // Note: commented out because of singleSignOn feature is not ready yet + // singleSignOn: { + // allTypes: 'All types', + // singleSignOn: 'Single Sign-on', + // clientId: 'Client id', + // clientSecret: 'Client secret', + // discoveryUrl: 'Discovery url', + // }, importCsv: { importCsv: 'Import CSV from file | Imports of CSV from file', diff --git a/src/app/locale/ru/ru.js b/src/app/locale/ru/ru.js index 34e0343cf..f5eca284c 100644 --- a/src/app/locale/ru/ru.js +++ b/src/app/locale/ru/ru.js @@ -967,14 +967,14 @@ export default { fetchInterval: 'Интервал обновления', }, - singleSignOn: { - allTypes: 'Все типы', - // TODO: add locale - singleSignOn: 'Single Sign-on', - clientId: 'Client id', - clientSecret: 'Client secret', - discoveryUrl: 'Discovery url', - }, + // Note: commented out because of singleSignOn feature is not ready yet + // singleSignOn: { + // allTypes: 'Все типы', + // singleSignOn: 'Single Sign-on', + // clientId: 'Client id', + // clientSecret: 'Client secret', + // discoveryUrl: 'Discovery url', + // }, importCsv: { importCsv: 'Импорт данных из CSV файла | Импорт данных из CSV файлов', diff --git a/src/app/locale/ua/ua.js b/src/app/locale/ua/ua.js index b5369d31f..df0f726a0 100644 --- a/src/app/locale/ua/ua.js +++ b/src/app/locale/ua/ua.js @@ -967,14 +967,14 @@ export default { imapHost: 'IMAP Хост', fetchInterval: 'Інтервал оновлення', }, - singleSignOn: { - allTypes: 'Всі типи', - // TODO: add locale - singleSignOn: 'Single Sign-on', - clientId: 'Client id', - clientSecret: 'Client secret', - discoveryUrl: 'Discovery url', - }, + // Note: commented out because of singleSignOn feature is not ready yet + // singleSignOn: { + // allTypes: 'Всі типи', + // singleSignOn: 'Single Sign-on', + // clientId: 'Client id', + // clientSecret: 'Client secret', + // discoveryUrl: 'Discovery url', + // }, importCsv: { importCsv: 'Імпорт даних з CSV файлу | Імпорт даних з CSV файлів', allImportsCsv: 'Всі імпорти даних з CSV файлів', diff --git a/src/app/router/_internals/NavigationPages.lookup.js b/src/app/router/_internals/NavigationPages.lookup.js index bb4cf2fec..d055da45f 100644 --- a/src/app/router/_internals/NavigationPages.lookup.js +++ b/src/app/router/_internals/NavigationPages.lookup.js @@ -134,11 +134,14 @@ const nav = Object.freeze([ value: AdminSections.EMAIL_PROFILES, locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`, route: 'email-profiles', - }, { - value: AdminSections.SINGLE_SIGN_ON, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, - route: 'single-sign-on', - }, { + }, + // Note: commented out because of singleSignOn feature is not ready yet + // { + // value: AdminSections.SINGLE_SIGN_ON, + // locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, + // route: 'single-sign-on', + // }, + { value: AdminSections.IMPORT_CSV, locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`, route: 'import-csv', diff --git a/src/app/router/_internals/RouteNames.enum.js b/src/app/router/_internals/RouteNames.enum.js index d4e5e0237..5258320fa 100644 --- a/src/app/router/_internals/RouteNames.enum.js +++ b/src/app/router/_internals/RouteNames.enum.js @@ -38,7 +38,8 @@ export default Object.freeze({ STORAGE: 'storage', COGNITIVE_PROFILES: 'cognitive-profiles', EMAIL_PROFILES: 'email-profiles', - SINGLE_SIGN_ON: 'single-sign-on', + // Note: commented out because of singleSignOn feature is not ready yet + // SINGLE_SIGN_ON: 'single-sign-on', IMPORT_CSV: 'import-csv', TRIGGERS: 'triggers', diff --git a/src/app/router/router.js b/src/app/router/router.js index 98edd11cc..05890bc22 100755 --- a/src/app/router/router.js +++ b/src/app/router/router.js @@ -59,12 +59,14 @@ const Storage = () => import('../../modules/integrations/modules/storage/compone const OpenedStorage = () => import('../../modules/integrations/modules/storage/components/opened-storage.vue'); const CognitiveProfiles = () => import('../../modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue'); const EmailProfiles = () => import('../../modules/integrations/modules/email-profiles/components/the-email-profiles.vue'); -const SingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue'); +// Note: commented out because of singleSignOn feature is not ready yet +// const SingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue'); const ImportCsv = () => import('../../modules/integrations/modules/import-csv/components/the-import-csv.vue'); const Triggers = () => import('../../modules/integrations/modules/triggers/components/the-triggers.vue'); const OpenedCognitiveProfile = () => import('../../modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue'); const OpenedEmailProfile = () => import('../../modules/integrations/modules/email-profiles/components/opened-email-profile.vue'); -const OpenedSingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue'); +// Note: commented out because of singleSignOn feature is not ready yet +// const OpenedSingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue'); const OpenedImportCsv = () => import('../../modules/integrations/modules/import-csv/components/opened-import-csv.vue'); const OpenedTrigger = () => import('../../modules/integrations/modules/triggers/components/opened-trigger.vue'); const Changelogs = () => import('../../modules/system/modules/changelogs/components/the-changelogs.vue'); @@ -600,24 +602,25 @@ const router = createRouter({ component: OpenedEmailProfile, beforeEnter: checkRouteAccess, }, - { - path: '/integrations/single-sign-on', - name: RouteNames.SINGLE_SIGN_ON, - component: SingleSignOn, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/single-sign-on/new', - name: `${RouteNames.SINGLE_SIGN_ON}-new`, - component: OpenedSingleSignOn, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/single-sign-on/:id', - name: `${RouteNames.SINGLE_SIGN_ON}-edit`, - component: OpenedSingleSignOn, - beforeEnter: checkRouteAccess, - }, + // Note: commented out because of singleSignOn feature is not ready yet + // { + // path: '/integrations/single-sign-on', + // name: RouteNames.SINGLE_SIGN_ON, + // component: SingleSignOn, + // beforeEnter: checkRouteAccess, + // }, + // { + // path: '/integrations/single-sign-on/new', + // name: `${RouteNames.SINGLE_SIGN_ON}-new`, + // component: OpenedSingleSignOn, + // beforeEnter: checkRouteAccess, + // }, + // { + // path: '/integrations/single-sign-on/:id', + // name: `${RouteNames.SINGLE_SIGN_ON}-edit`, + // component: OpenedSingleSignOn, + // beforeEnter: checkRouteAccess, + // }, { path: '/integrations/import-csv', name: RouteNames.IMPORT_CSV, diff --git a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js index 448683c07..942093a8f 100644 --- a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js +++ b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js @@ -1,173 +1,174 @@ -import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; -import applyTransform, { - camelToSnake, - generateUrl, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../app/api/instance'; - -const baseUrl = '/oauth/apps'; - -const getSingleSignOnList = async (params) => { - const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; - - const defaultObject = { - name: '', - type: '', - enabled: false, - }; - - const url = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(baseUrl), - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -}; - -const getSingleSignOn = async ({ itemId: id }) => { - const defaultObject = { - name: '', - type: '', - clientId: '', - clientSecret: '', - discoveryUrl: '', - enabled: false, - scopes: [], - }; - - const url = `${baseUrl}/${id}`; - - try { - const response = await instance.get(url); - console.log(response); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -}; - -const fieldsToSend = [ - 'name', - 'type', - 'id', - 'clientId', - 'clientSecret', - 'discoveryUrl', - 'enabled', - 'scopes', -]; - -const addSingleSignOn = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await instance.post(baseUrl, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -}; -const updateSingleSignOn = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - - const url = `${baseUrl}/${id}`; - try { - const response = await instance.put(url, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -}; - -const patchSingleSignOn = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - const url = `${baseUrl}/${id}`; - try { - const response = await instance.patch(url, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -}; - -const deleteSingleSignOn = async ({ id }) => { - const url = `${baseUrl}/${id}`; - try { - const response = await instance.delete(url); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -}; - -const getSingleSignOnsLookup = (params) => getSingleSignOnList({ - ...params, - fields: params.fields || ['id', 'name', 'type'], -}); - -const SingleSignOnAPI = { - getList: getSingleSignOnList, - get: getSingleSignOn, - add: addSingleSignOn, - patch: patchSingleSignOn, - update: updateSingleSignOn, - delete: deleteSingleSignOn, - getLookup: getSingleSignOnsLookup, -}; - -export default SingleSignOnAPI; +// Note: commented out because of singleSignOn feature is not ready yet +// import { +// getDefaultGetListResponse, +// getDefaultGetParams, +// } from '@webitel/ui-sdk/src/api/defaults'; +// import applyTransform, { +// camelToSnake, +// generateUrl, +// merge, +// mergeEach, +// notify, +// sanitize, +// snakeToCamel, +// starToSearch, +// } from '@webitel/ui-sdk/src/api/transformers'; +// import instance from '../../../../../app/api/instance'; +// +// const baseUrl = '/oauth/apps'; +// +// const getSingleSignOnList = async (params) => { +// const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; +// +// const defaultObject = { +// name: '', +// type: '', +// enabled: false, +// }; +// +// const url = applyTransform(params, [ +// merge(getDefaultGetParams()), +// starToSearch('search'), +// (params) => ({ ...params, q: params.search }), +// sanitize(fieldsToSend), +// camelToSnake(), +// generateUrl(baseUrl), +// ]); +// try { +// const response = await instance.get(url); +// const { items, next } = applyTransform(response.data, [ +// snakeToCamel(), +// merge(getDefaultGetListResponse()), +// ]); +// return { +// items: applyTransform(items, [ +// mergeEach(defaultObject), +// ]), +// next, +// }; +// } catch (err) { +// throw applyTransform(err, [ +// notify, +// ]); +// } +// }; +// +// const getSingleSignOn = async ({ itemId: id }) => { +// const defaultObject = { +// name: '', +// type: '', +// clientId: '', +// clientSecret: '', +// discoveryUrl: '', +// enabled: false, +// scopes: [], +// }; +// +// const url = `${baseUrl}/${id}`; +// +// try { +// const response = await instance.get(url); +// console.log(response); +// return applyTransform(response.data, [ +// snakeToCamel(), +// merge(defaultObject), +// ]); +// } catch (err) { +// throw applyTransform(err, [ +// notify, +// ]); +// } +// }; +// +// const fieldsToSend = [ +// 'name', +// 'type', +// 'id', +// 'clientId', +// 'clientSecret', +// 'discoveryUrl', +// 'enabled', +// 'scopes', +// ]; +// +// const addSingleSignOn = async ({ itemInstance }) => { +// const item = applyTransform(itemInstance, [ +// sanitize(fieldsToSend), +// camelToSnake(), +// ]); +// try { +// const response = await instance.post(baseUrl, item); +// return applyTransform(response.data, [ +// snakeToCamel(), +// ]); +// } catch (err) { +// throw applyTransform(err, [ +// notify, +// ]); +// } +// }; +// const updateSingleSignOn = async ({ itemInstance, itemId: id }) => { +// const item = applyTransform(itemInstance, [ +// sanitize(fieldsToSend), +// camelToSnake(), +// ]); +// +// const url = `${baseUrl}/${id}`; +// try { +// const response = await instance.put(url, item); +// return applyTransform(response.data, [ +// snakeToCamel(), +// ]); +// } catch (err) { +// throw applyTransform(err, [ +// notify, +// ]); +// } +// }; +// +// const patchSingleSignOn = async ({ changes, id }) => { +// const body = applyTransform(changes, [ +// sanitize(fieldsToSend), +// camelToSnake(), +// ]); +// const url = `${baseUrl}/${id}`; +// try { +// const response = await instance.patch(url, body); +// return applyTransform(response.data, [ +// snakeToCamel(), +// ]); +// } catch (err) { +// throw applyTransform(err, [ +// notify, +// ]); +// } +// }; +// +// const deleteSingleSignOn = async ({ id }) => { +// const url = `${baseUrl}/${id}`; +// try { +// const response = await instance.delete(url); +// return applyTransform(response.data, []); +// } catch (err) { +// throw applyTransform(err, [ +// notify, +// ]); +// } +// }; +// +// const getSingleSignOnsLookup = (params) => getSingleSignOnList({ +// ...params, +// fields: params.fields || ['id', 'name', 'type'], +// }); +// +// const SingleSignOnAPI = { +// getList: getSingleSignOnList, +// get: getSingleSignOn, +// add: addSingleSignOn, +// patch: patchSingleSignOn, +// update: updateSingleSignOn, +// delete: deleteSingleSignOn, +// getLookup: getSingleSignOnsLookup, +// }; +// +// export default SingleSignOnAPI; diff --git a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue index 291cef9c2..b2fbb36e6 100644 --- a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue +++ b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue @@ -1,65 +1,66 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - + diff --git a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue index 83cebb407..c839ef5c2 100644 --- a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue @@ -1,93 +1,94 @@ - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + diff --git a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue index ac3968ce8..b36f7c468 100644 --- a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue @@ -1,157 +1,158 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + diff --git a/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js b/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js index 710ee3830..20f238a6c 100644 --- a/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js +++ b/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js @@ -1,16 +1,17 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; - -export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, -]; +// Note: commented out because of singleSignOn feature is not ready yet +// import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +// +// export default [ +// { +// value: 'name', +// locale: 'objects.name', +// field: 'name', +// sort: SortSymbols.NONE, +// }, +// { +// value: 'state', +// locale: 'reusable.state', +// field: 'enabled', +// sort: SortSymbols.NONE, +// }, +// ]; diff --git a/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js b/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js index 964123e20..aee91325f 100644 --- a/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js +++ b/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js @@ -1,23 +1,24 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import SingleSignOnAPI from '../api/singleSignOn'; -import headers from './_internals/headers'; - -const resettableState = { - itemInstance: { - name: '', - type: '', - clientId: '', - clientSecret: '', - discoveryUrl: '', - enabled: true, - scopes: [], - }, -}; - -const singleSignOn = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(SingleSignOnAPI) -.generateAPIActions() -.getModule({}); - -export default singleSignOn; +// Note: commented out because of singleSignOn feature is not ready yet +// import ObjectStoreModule +// from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; +// import SingleSignOnAPI from '../api/singleSignOn'; +// import headers from './_internals/headers'; +// +// const resettableState = { +// itemInstance: { +// name: '', +// type: '', +// clientId: '', +// clientSecret: '', +// discoveryUrl: '', +// enabled: true, +// scopes: [], +// }, +// }; +// +// const singleSignOn = new ObjectStoreModule({ resettableState, headers }) +// .attachAPIModule(SingleSignOnAPI) +// .generateAPIActions() +// .getModule({}); +// +// export default singleSignOn; diff --git a/src/modules/integrations/store/integrations.js b/src/modules/integrations/store/integrations.js index 9654f1e49..3a0acb995 100644 --- a/src/modules/integrations/store/integrations.js +++ b/src/modules/integrations/store/integrations.js @@ -4,7 +4,8 @@ import emailProfiles from '../modules/email-profiles/store/email-profiles'; import importCsv from '../modules/import-csv/store/import-csv'; import storage from '../modules/storage/store/storage'; import triggers from '../modules/triggers/store/triggers'; -import singleSignOn from '../modules/single-sign-on/store/single-sign-on'; +// Note: commented out because of singleSignOn feature is not ready yet +// import singleSignOn from '../modules/single-sign-on/store/single-sign-on'; const modules = { storage, @@ -12,7 +13,8 @@ const modules = { emailProfiles, importCsv, triggers, - singleSignOn, + // Note: commented out because of singleSignOn feature is not ready yet + // singleSignOn, }; export default { diff --git a/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js b/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js index 265bdeb59..93427cfc6 100644 --- a/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js +++ b/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js @@ -94,11 +94,12 @@ export default Object.freeze([ name: AdminSections.EMAIL_PROFILES, route: RouteNames.EMAIL_PROFILES, }, - { - field: 'single_sign_on', - name: AdminSections.SINGLE_SIGN_ON, - route: RouteNames.SINGLE_SIGN_ON, - }, + // Note: commented out because of singleSignOn feature is not ready yet + // { + // field: 'single_sign_on', + // name: AdminSections.SINGLE_SIGN_ON, + // route: RouteNames.SINGLE_SIGN_ON, + // }, { field: 'import_template', name: AdminSections.IMPORT_CSV, From 048cce3889e92fe0c05ce661d84deef395518247 Mon Sep 17 00:00:00 2001 From: Volodymyr Dekhtyaruk Date: Mon, 18 Dec 2023 15:35:28 +0200 Subject: [PATCH 2/5] refactor: uncommenting all SSO functionality exept routing [WTEL-3717] --- src/app/locale/en/en.js | 15 +- src/app/locale/ru/ru.js | 15 +- src/app/locale/ua/ua.js | 15 +- src/app/router/_internals/RouteNames.enum.js | 3 +- .../single-sign-on/api/singleSignOn.js | 347 +++++++++--------- .../opened-single-sign-on-general.vue | 123 +++---- .../components/opened-single-sign-on.vue | 171 +++++---- .../components/the-single-sign-on.vue | 293 ++++++++------- .../store/_internals/headers.js | 33 +- .../single-sign-on/store/single-sign-on.js | 47 ++- .../integrations/store/integrations.js | 6 +- 11 files changed, 528 insertions(+), 540 deletions(-) diff --git a/src/app/locale/en/en.js b/src/app/locale/en/en.js index 68c8fce09..36402f287 100644 --- a/src/app/locale/en/en.js +++ b/src/app/locale/en/en.js @@ -969,14 +969,13 @@ export default { fetchInterval: 'Refresh interval', }, - // Note: commented out because of singleSignOn feature is not ready yet - // singleSignOn: { - // allTypes: 'All types', - // singleSignOn: 'Single Sign-on', - // clientId: 'Client id', - // clientSecret: 'Client secret', - // discoveryUrl: 'Discovery url', - // }, + singleSignOn: { + allTypes: 'All types', + singleSignOn: 'Single Sign-on', + clientId: 'Client id', + clientSecret: 'Client secret', + discoveryUrl: 'Discovery url', + }, importCsv: { importCsv: 'Import CSV from file | Imports of CSV from file', diff --git a/src/app/locale/ru/ru.js b/src/app/locale/ru/ru.js index f5eca284c..b9833e878 100644 --- a/src/app/locale/ru/ru.js +++ b/src/app/locale/ru/ru.js @@ -967,14 +967,13 @@ export default { fetchInterval: 'Интервал обновления', }, - // Note: commented out because of singleSignOn feature is not ready yet - // singleSignOn: { - // allTypes: 'Все типы', - // singleSignOn: 'Single Sign-on', - // clientId: 'Client id', - // clientSecret: 'Client secret', - // discoveryUrl: 'Discovery url', - // }, + singleSignOn: { + allTypes: 'Все типы', + singleSignOn: 'Single Sign-on', + clientId: 'Client id', + clientSecret: 'Client secret', + discoveryUrl: 'Discovery url', + }, importCsv: { importCsv: 'Импорт данных из CSV файла | Импорт данных из CSV файлов', diff --git a/src/app/locale/ua/ua.js b/src/app/locale/ua/ua.js index df0f726a0..2c17384c0 100644 --- a/src/app/locale/ua/ua.js +++ b/src/app/locale/ua/ua.js @@ -967,14 +967,13 @@ export default { imapHost: 'IMAP Хост', fetchInterval: 'Інтервал оновлення', }, - // Note: commented out because of singleSignOn feature is not ready yet - // singleSignOn: { - // allTypes: 'Всі типи', - // singleSignOn: 'Single Sign-on', - // clientId: 'Client id', - // clientSecret: 'Client secret', - // discoveryUrl: 'Discovery url', - // }, + singleSignOn: { + allTypes: 'Всі типи', + singleSignOn: 'Single Sign-on', + clientId: 'Client id', + clientSecret: 'Client secret', + discoveryUrl: 'Discovery url', + }, importCsv: { importCsv: 'Імпорт даних з CSV файлу | Імпорт даних з CSV файлів', allImportsCsv: 'Всі імпорти даних з CSV файлів', diff --git a/src/app/router/_internals/RouteNames.enum.js b/src/app/router/_internals/RouteNames.enum.js index 5258320fa..d4e5e0237 100644 --- a/src/app/router/_internals/RouteNames.enum.js +++ b/src/app/router/_internals/RouteNames.enum.js @@ -38,8 +38,7 @@ export default Object.freeze({ STORAGE: 'storage', COGNITIVE_PROFILES: 'cognitive-profiles', EMAIL_PROFILES: 'email-profiles', - // Note: commented out because of singleSignOn feature is not ready yet - // SINGLE_SIGN_ON: 'single-sign-on', + SINGLE_SIGN_ON: 'single-sign-on', IMPORT_CSV: 'import-csv', TRIGGERS: 'triggers', diff --git a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js index 942093a8f..448683c07 100644 --- a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js +++ b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js @@ -1,174 +1,173 @@ -// Note: commented out because of singleSignOn feature is not ready yet -// import { -// getDefaultGetListResponse, -// getDefaultGetParams, -// } from '@webitel/ui-sdk/src/api/defaults'; -// import applyTransform, { -// camelToSnake, -// generateUrl, -// merge, -// mergeEach, -// notify, -// sanitize, -// snakeToCamel, -// starToSearch, -// } from '@webitel/ui-sdk/src/api/transformers'; -// import instance from '../../../../../app/api/instance'; -// -// const baseUrl = '/oauth/apps'; -// -// const getSingleSignOnList = async (params) => { -// const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; -// -// const defaultObject = { -// name: '', -// type: '', -// enabled: false, -// }; -// -// const url = applyTransform(params, [ -// merge(getDefaultGetParams()), -// starToSearch('search'), -// (params) => ({ ...params, q: params.search }), -// sanitize(fieldsToSend), -// camelToSnake(), -// generateUrl(baseUrl), -// ]); -// try { -// const response = await instance.get(url); -// const { items, next } = applyTransform(response.data, [ -// snakeToCamel(), -// merge(getDefaultGetListResponse()), -// ]); -// return { -// items: applyTransform(items, [ -// mergeEach(defaultObject), -// ]), -// next, -// }; -// } catch (err) { -// throw applyTransform(err, [ -// notify, -// ]); -// } -// }; -// -// const getSingleSignOn = async ({ itemId: id }) => { -// const defaultObject = { -// name: '', -// type: '', -// clientId: '', -// clientSecret: '', -// discoveryUrl: '', -// enabled: false, -// scopes: [], -// }; -// -// const url = `${baseUrl}/${id}`; -// -// try { -// const response = await instance.get(url); -// console.log(response); -// return applyTransform(response.data, [ -// snakeToCamel(), -// merge(defaultObject), -// ]); -// } catch (err) { -// throw applyTransform(err, [ -// notify, -// ]); -// } -// }; -// -// const fieldsToSend = [ -// 'name', -// 'type', -// 'id', -// 'clientId', -// 'clientSecret', -// 'discoveryUrl', -// 'enabled', -// 'scopes', -// ]; -// -// const addSingleSignOn = async ({ itemInstance }) => { -// const item = applyTransform(itemInstance, [ -// sanitize(fieldsToSend), -// camelToSnake(), -// ]); -// try { -// const response = await instance.post(baseUrl, item); -// return applyTransform(response.data, [ -// snakeToCamel(), -// ]); -// } catch (err) { -// throw applyTransform(err, [ -// notify, -// ]); -// } -// }; -// const updateSingleSignOn = async ({ itemInstance, itemId: id }) => { -// const item = applyTransform(itemInstance, [ -// sanitize(fieldsToSend), -// camelToSnake(), -// ]); -// -// const url = `${baseUrl}/${id}`; -// try { -// const response = await instance.put(url, item); -// return applyTransform(response.data, [ -// snakeToCamel(), -// ]); -// } catch (err) { -// throw applyTransform(err, [ -// notify, -// ]); -// } -// }; -// -// const patchSingleSignOn = async ({ changes, id }) => { -// const body = applyTransform(changes, [ -// sanitize(fieldsToSend), -// camelToSnake(), -// ]); -// const url = `${baseUrl}/${id}`; -// try { -// const response = await instance.patch(url, body); -// return applyTransform(response.data, [ -// snakeToCamel(), -// ]); -// } catch (err) { -// throw applyTransform(err, [ -// notify, -// ]); -// } -// }; -// -// const deleteSingleSignOn = async ({ id }) => { -// const url = `${baseUrl}/${id}`; -// try { -// const response = await instance.delete(url); -// return applyTransform(response.data, []); -// } catch (err) { -// throw applyTransform(err, [ -// notify, -// ]); -// } -// }; -// -// const getSingleSignOnsLookup = (params) => getSingleSignOnList({ -// ...params, -// fields: params.fields || ['id', 'name', 'type'], -// }); -// -// const SingleSignOnAPI = { -// getList: getSingleSignOnList, -// get: getSingleSignOn, -// add: addSingleSignOn, -// patch: patchSingleSignOn, -// update: updateSingleSignOn, -// delete: deleteSingleSignOn, -// getLookup: getSingleSignOnsLookup, -// }; -// -// export default SingleSignOnAPI; +import { + getDefaultGetListResponse, + getDefaultGetParams, +} from '@webitel/ui-sdk/src/api/defaults'; +import applyTransform, { + camelToSnake, + generateUrl, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from '@webitel/ui-sdk/src/api/transformers'; +import instance from '../../../../../app/api/instance'; + +const baseUrl = '/oauth/apps'; + +const getSingleSignOnList = async (params) => { + const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; + + const defaultObject = { + name: '', + type: '', + enabled: false, + }; + + const url = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch('search'), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(baseUrl), + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [ + mergeEach(defaultObject), + ]), + next, + }; + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + +const getSingleSignOn = async ({ itemId: id }) => { + const defaultObject = { + name: '', + type: '', + clientId: '', + clientSecret: '', + discoveryUrl: '', + enabled: false, + scopes: [], + }; + + const url = `${baseUrl}/${id}`; + + try { + const response = await instance.get(url); + console.log(response); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + +const fieldsToSend = [ + 'name', + 'type', + 'id', + 'clientId', + 'clientSecret', + 'discoveryUrl', + 'enabled', + 'scopes', +]; + +const addSingleSignOn = async ({ itemInstance }) => { + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await instance.post(baseUrl, item); + return applyTransform(response.data, [ + snakeToCamel(), + ]); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; +const updateSingleSignOn = async ({ itemInstance, itemId: id }) => { + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + + const url = `${baseUrl}/${id}`; + try { + const response = await instance.put(url, item); + return applyTransform(response.data, [ + snakeToCamel(), + ]); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + +const patchSingleSignOn = async ({ changes, id }) => { + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + const url = `${baseUrl}/${id}`; + try { + const response = await instance.patch(url, body); + return applyTransform(response.data, [ + snakeToCamel(), + ]); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + +const deleteSingleSignOn = async ({ id }) => { + const url = `${baseUrl}/${id}`; + try { + const response = await instance.delete(url); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + +const getSingleSignOnsLookup = (params) => getSingleSignOnList({ + ...params, + fields: params.fields || ['id', 'name', 'type'], +}); + +const SingleSignOnAPI = { + getList: getSingleSignOnList, + get: getSingleSignOn, + add: addSingleSignOn, + patch: patchSingleSignOn, + update: updateSingleSignOn, + delete: deleteSingleSignOn, + getLookup: getSingleSignOnsLookup, +}; + +export default SingleSignOnAPI; diff --git a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue index b2fbb36e6..291cef9c2 100644 --- a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue +++ b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue @@ -1,66 +1,65 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - +--> +export default { + name: 'OpenedSingleSignOnGeneral', + mixins: [openedTabComponentMixin], + methods: { + loadFlows(params) { + return SingleSignOnAPI.getLookup(params); + }, + }, +}; + - +--> + diff --git a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue index c839ef5c2..83cebb407 100644 --- a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue @@ -1,94 +1,93 @@ - - - - - - - - - - - - - - + - - - - - +--> + path() { + const baseUrl = '/integrations/single-sign-on'; + return [ + { name: this.$t('objects.integrations.integrations') }, + { name: this.$t('objects.integrations.singleSignOn.singleSignOn'), route: baseUrl }, + { + name: this.id ? this.pathName : this.$t('objects.new'), + route: this.id ? `${baseUrl}/${this.id}` : `${baseUrl}/new`, + }, + ]; + }, + }, +}; + - +--> + diff --git a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue index b36f7c468..ac3968ce8 100644 --- a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue @@ -1,158 +1,157 @@ - - - - - - - - - - - + - - - - - - +--> + computed: { + path() { + return [ + { name: this.$t('objects.integrations.integrations') }, + { + name: this.$t('objects.integrations.singleSignOn.singleSignOn'), + route: '/integrations/single-sign-on', + }, + ]; + }, + }, +}; + - +--> + diff --git a/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js b/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js index 20f238a6c..710ee3830 100644 --- a/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js +++ b/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js @@ -1,17 +1,16 @@ -// Note: commented out because of singleSignOn feature is not ready yet -// import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; -// -// export default [ -// { -// value: 'name', -// locale: 'objects.name', -// field: 'name', -// sort: SortSymbols.NONE, -// }, -// { -// value: 'state', -// locale: 'reusable.state', -// field: 'enabled', -// sort: SortSymbols.NONE, -// }, -// ]; +import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; + +export default [ + { + value: 'name', + locale: 'objects.name', + field: 'name', + sort: SortSymbols.NONE, + }, + { + value: 'state', + locale: 'reusable.state', + field: 'enabled', + sort: SortSymbols.NONE, + }, +]; diff --git a/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js b/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js index aee91325f..964123e20 100644 --- a/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js +++ b/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js @@ -1,24 +1,23 @@ -// Note: commented out because of singleSignOn feature is not ready yet -// import ObjectStoreModule -// from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -// import SingleSignOnAPI from '../api/singleSignOn'; -// import headers from './_internals/headers'; -// -// const resettableState = { -// itemInstance: { -// name: '', -// type: '', -// clientId: '', -// clientSecret: '', -// discoveryUrl: '', -// enabled: true, -// scopes: [], -// }, -// }; -// -// const singleSignOn = new ObjectStoreModule({ resettableState, headers }) -// .attachAPIModule(SingleSignOnAPI) -// .generateAPIActions() -// .getModule({}); -// -// export default singleSignOn; +import ObjectStoreModule + from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; +import SingleSignOnAPI from '../api/singleSignOn'; +import headers from './_internals/headers'; + +const resettableState = { + itemInstance: { + name: '', + type: '', + clientId: '', + clientSecret: '', + discoveryUrl: '', + enabled: true, + scopes: [], + }, +}; + +const singleSignOn = new ObjectStoreModule({ resettableState, headers }) +.attachAPIModule(SingleSignOnAPI) +.generateAPIActions() +.getModule({}); + +export default singleSignOn; diff --git a/src/modules/integrations/store/integrations.js b/src/modules/integrations/store/integrations.js index 3a0acb995..9654f1e49 100644 --- a/src/modules/integrations/store/integrations.js +++ b/src/modules/integrations/store/integrations.js @@ -4,8 +4,7 @@ import emailProfiles from '../modules/email-profiles/store/email-profiles'; import importCsv from '../modules/import-csv/store/import-csv'; import storage from '../modules/storage/store/storage'; import triggers from '../modules/triggers/store/triggers'; -// Note: commented out because of singleSignOn feature is not ready yet -// import singleSignOn from '../modules/single-sign-on/store/single-sign-on'; +import singleSignOn from '../modules/single-sign-on/store/single-sign-on'; const modules = { storage, @@ -13,8 +12,7 @@ const modules = { emailProfiles, importCsv, triggers, - // Note: commented out because of singleSignOn feature is not ready yet - // singleSignOn, + singleSignOn, }; export default { From 0aa3f49b7d6f677c828aa4fe09ab3d292802e297 Mon Sep 17 00:00:00 2001 From: Volodymyr Dekhtyaruk Date: Mon, 18 Dec 2023 15:39:00 +0200 Subject: [PATCH 3/5] refactor: rollback locales [WTEL-3717] --- src/app/locale/en/en.js | 1 - src/app/locale/ru/ru.js | 1 + src/app/locale/ua/ua.js | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/locale/en/en.js b/src/app/locale/en/en.js index 36402f287..3540ad0dc 100644 --- a/src/app/locale/en/en.js +++ b/src/app/locale/en/en.js @@ -968,7 +968,6 @@ export default { imapHost: 'IMAP Host', fetchInterval: 'Refresh interval', }, - singleSignOn: { allTypes: 'All types', singleSignOn: 'Single Sign-on', diff --git a/src/app/locale/ru/ru.js b/src/app/locale/ru/ru.js index b9833e878..34e0343cf 100644 --- a/src/app/locale/ru/ru.js +++ b/src/app/locale/ru/ru.js @@ -969,6 +969,7 @@ export default { singleSignOn: { allTypes: 'Все типы', + // TODO: add locale singleSignOn: 'Single Sign-on', clientId: 'Client id', clientSecret: 'Client secret', diff --git a/src/app/locale/ua/ua.js b/src/app/locale/ua/ua.js index 2c17384c0..b5369d31f 100644 --- a/src/app/locale/ua/ua.js +++ b/src/app/locale/ua/ua.js @@ -969,6 +969,7 @@ export default { }, singleSignOn: { allTypes: 'Всі типи', + // TODO: add locale singleSignOn: 'Single Sign-on', clientId: 'Client id', clientSecret: 'Client secret', From 63816fe7c3bc0cf8725e8d0321e8e26a641e4244 Mon Sep 17 00:00:00 2001 From: Volodymyr Dekhtyaruk Date: Mon, 18 Dec 2023 15:44:34 +0200 Subject: [PATCH 4/5] refactor: rollback lookupss [WTEL-3717] --- src/app/router/_internals/NavigationPages.lookup.js | 11 +++++------ .../store/_internals/lookups/ObjectsList.lookup.js | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/app/router/_internals/NavigationPages.lookup.js b/src/app/router/_internals/NavigationPages.lookup.js index d055da45f..686147dba 100644 --- a/src/app/router/_internals/NavigationPages.lookup.js +++ b/src/app/router/_internals/NavigationPages.lookup.js @@ -135,12 +135,11 @@ const nav = Object.freeze([ locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`, route: 'email-profiles', }, - // Note: commented out because of singleSignOn feature is not ready yet - // { - // value: AdminSections.SINGLE_SIGN_ON, - // locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, - // route: 'single-sign-on', - // }, + { + value: AdminSections.SINGLE_SIGN_ON, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, + route: 'single-sign-on', + }, { value: AdminSections.IMPORT_CSV, locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`, diff --git a/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js b/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js index 93427cfc6..265bdeb59 100644 --- a/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js +++ b/src/modules/userinfo/store/_internals/lookups/ObjectsList.lookup.js @@ -94,12 +94,11 @@ export default Object.freeze([ name: AdminSections.EMAIL_PROFILES, route: RouteNames.EMAIL_PROFILES, }, - // Note: commented out because of singleSignOn feature is not ready yet - // { - // field: 'single_sign_on', - // name: AdminSections.SINGLE_SIGN_ON, - // route: RouteNames.SINGLE_SIGN_ON, - // }, + { + field: 'single_sign_on', + name: AdminSections.SINGLE_SIGN_ON, + route: RouteNames.SINGLE_SIGN_ON, + }, { field: 'import_template', name: AdminSections.IMPORT_CSV, From f97af3bf525c83c12369c7ce1846f32e930154d9 Mon Sep 17 00:00:00 2001 From: Volodymyr Dekhtyaruk Date: Mon, 18 Dec 2023 15:54:16 +0200 Subject: [PATCH 5/5] refactor: rollback routes [WTEL-3717] --- .../_internals/NavigationPages.lookup.js | 11 ++--- src/app/router/router.js | 43 +++++++++---------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/src/app/router/_internals/NavigationPages.lookup.js b/src/app/router/_internals/NavigationPages.lookup.js index 686147dba..d055da45f 100644 --- a/src/app/router/_internals/NavigationPages.lookup.js +++ b/src/app/router/_internals/NavigationPages.lookup.js @@ -135,11 +135,12 @@ const nav = Object.freeze([ locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`, route: 'email-profiles', }, - { - value: AdminSections.SINGLE_SIGN_ON, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, - route: 'single-sign-on', - }, + // Note: commented out because of singleSignOn feature is not ready yet + // { + // value: AdminSections.SINGLE_SIGN_ON, + // locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, + // route: 'single-sign-on', + // }, { value: AdminSections.IMPORT_CSV, locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`, diff --git a/src/app/router/router.js b/src/app/router/router.js index 05890bc22..98edd11cc 100755 --- a/src/app/router/router.js +++ b/src/app/router/router.js @@ -59,14 +59,12 @@ const Storage = () => import('../../modules/integrations/modules/storage/compone const OpenedStorage = () => import('../../modules/integrations/modules/storage/components/opened-storage.vue'); const CognitiveProfiles = () => import('../../modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue'); const EmailProfiles = () => import('../../modules/integrations/modules/email-profiles/components/the-email-profiles.vue'); -// Note: commented out because of singleSignOn feature is not ready yet -// const SingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue'); +const SingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue'); const ImportCsv = () => import('../../modules/integrations/modules/import-csv/components/the-import-csv.vue'); const Triggers = () => import('../../modules/integrations/modules/triggers/components/the-triggers.vue'); const OpenedCognitiveProfile = () => import('../../modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue'); const OpenedEmailProfile = () => import('../../modules/integrations/modules/email-profiles/components/opened-email-profile.vue'); -// Note: commented out because of singleSignOn feature is not ready yet -// const OpenedSingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue'); +const OpenedSingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue'); const OpenedImportCsv = () => import('../../modules/integrations/modules/import-csv/components/opened-import-csv.vue'); const OpenedTrigger = () => import('../../modules/integrations/modules/triggers/components/opened-trigger.vue'); const Changelogs = () => import('../../modules/system/modules/changelogs/components/the-changelogs.vue'); @@ -602,25 +600,24 @@ const router = createRouter({ component: OpenedEmailProfile, beforeEnter: checkRouteAccess, }, - // Note: commented out because of singleSignOn feature is not ready yet - // { - // path: '/integrations/single-sign-on', - // name: RouteNames.SINGLE_SIGN_ON, - // component: SingleSignOn, - // beforeEnter: checkRouteAccess, - // }, - // { - // path: '/integrations/single-sign-on/new', - // name: `${RouteNames.SINGLE_SIGN_ON}-new`, - // component: OpenedSingleSignOn, - // beforeEnter: checkRouteAccess, - // }, - // { - // path: '/integrations/single-sign-on/:id', - // name: `${RouteNames.SINGLE_SIGN_ON}-edit`, - // component: OpenedSingleSignOn, - // beforeEnter: checkRouteAccess, - // }, + { + path: '/integrations/single-sign-on', + name: RouteNames.SINGLE_SIGN_ON, + component: SingleSignOn, + beforeEnter: checkRouteAccess, + }, + { + path: '/integrations/single-sign-on/new', + name: `${RouteNames.SINGLE_SIGN_ON}-new`, + component: OpenedSingleSignOn, + beforeEnter: checkRouteAccess, + }, + { + path: '/integrations/single-sign-on/:id', + name: `${RouteNames.SINGLE_SIGN_ON}-edit`, + component: OpenedSingleSignOn, + beforeEnter: checkRouteAccess, + }, { path: '/integrations/import-csv', name: RouteNames.IMPORT_CSV,