From fb647ff60f25c29e2636d7720c70a0bc6b156232 Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Tue, 12 Dec 2023 23:50:13 +0200 Subject: [PATCH] fix: pause causes access permissions [WTEL-4015] --- .../_reusable/app-header/components/app-header.vue | 4 ---- src/modules/permissions/modules/roles/api/roles.js | 13 ++++++++----- .../store/_internals/scripts/convertScope.js | 3 +++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/modules/_reusable/app-header/components/app-header.vue b/src/modules/_reusable/app-header/components/app-header.vue index 19167852d..8412818f6 100644 --- a/src/modules/_reusable/app-header/components/app-header.vue +++ b/src/modules/_reusable/app-header/components/app-header.vue @@ -100,10 +100,6 @@ export default { // and throw user to auth page return router.replace('/auth'); }, - - toggleDarkTheme() { - document.documentElement.classList.toggle('theme--dark'); - }, }, }; diff --git a/src/modules/permissions/modules/roles/api/roles.js b/src/modules/permissions/modules/roles/api/roles.js index cd42659e5..344071f87 100644 --- a/src/modules/permissions/modules/roles/api/roles.js +++ b/src/modules/permissions/modules/roles/api/roles.js @@ -4,12 +4,16 @@ import { } from '@webitel/ui-sdk/src/api/defaults'; import applyTransform, { camelToSnake, - merge, notify, snakeToCamel, - starToSearch, log, sanitize, generateUrl, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, } from '@webitel/ui-sdk/src/api/transformers'; +import ApplicationsAccess + from '@webitel/ui-sdk/src/modules/Userinfo/classes/ApplicationsAccess'; import deepCopy from 'deep-copy'; -import ApplicationsAccess from '@webitel/ui-sdk/src/modules/Userinfo/classes/ApplicationsAccess'; import instance from '../../../../../app/api/instance'; const baseUrl = '/roles'; @@ -63,7 +67,7 @@ const getRole = async ({ itemId: id }) => { return copy; }; - const url = `${baseUrl}/${id}`; + const url = `${baseUrl}/${id}?fields=metadata&fields=permissions&fields=name&fields=description`; try { const response = await instance.get(url); @@ -128,7 +132,6 @@ const addRole = async ({ itemInstance }) => { const updateRole = async ({ itemInstance, itemId: id }) => { const item = applyTransform(itemInstance, [ preRequestHandler, - log, sanitize(fieldsToSend), camelToSnake(), ]); diff --git a/src/modules/userinfo/store/_internals/scripts/convertScope.js b/src/modules/userinfo/store/_internals/scripts/convertScope.js index 51a09aa81..405717543 100644 --- a/src/modules/userinfo/store/_internals/scripts/convertScope.js +++ b/src/modules/userinfo/store/_internals/scripts/convertScope.js @@ -23,9 +23,12 @@ const convertScope = (initialScope) => { const communications = ObjectsList.find((obj) => obj.name === AdminSections.COMMUNICATIONS); const skills = ObjectsList.find((obj) => obj.name === AdminSections.SKILLS); + const pauseCauses = ObjectsList.find((obj) => obj.name === + AdminSections.PAUSE_CAUSE); scope.flow = { ...flow, access: 'rxwd' }; scope.communications = { ...communications, access: 'rxwd' }; scope.skills = { ...skills, access: 'rxwd' }; + scope.pauseCauses = { ...pauseCauses, access: 'rxwd' }; return scope; };