MT#61427 Remove access to the OLD Customer Details page

In case the CSC was configured to work in mixed mode
(www_admin.http_csc.csc_js_enable == 'mixed') then the
OLD CSC page of the customer details was displayed on
the new CSC for administrative subscribers.

This was added in commit 0354615428

The OLD CSC is not fully deprecated so also the access
to this page should be removed.

Change-Id: Ic791fb85c2039ce2c3e801b3ca826bee5a4c7e7c
mr13.4
Marco Capetta 5 months ago committed by Debora Crescenzo
parent dcfecc4327
commit 8fc8a99ff0

@ -4,7 +4,6 @@ import saveAs from 'file-saver'
import _ from 'lodash'
import { getJsonBody } from 'src/api/utils'
import { getJwt, hasJwt } from 'src/auth'
import { getCurrentLangAsV1Format } from 'src/i18n'
import { PATH_CHANGE_PASSWORD } from 'src/router/routes'
export const LIST_DEFAULT_PAGE = 1
export const LIST_DEFAULT_ROWS = 24
@ -69,12 +68,6 @@ export function initAPI ({ baseURL }) {
if (config.method === 'POST' && (config.data === undefined || config.data === null)) {
config.data = {}
}
if (!config.url?.includes('v2')) {
config.params = {
...config.params,
lang: getCurrentLangAsV1Format()
}
}
return config
}

@ -16,7 +16,6 @@ import {
getJwt,
hasJwt
} from 'src/auth'
import { getCurrentLangAsV1Format } from 'src/i18n'
export function getSoundSets (options) {
return new Promise((resolve, reject) => {
@ -204,10 +203,7 @@ export function uploadSoundFile (options) {
if (updatedConfig.method === 'POST' && (updatedConfig.data === undefined || updatedConfig.data === null)) {
updatedConfig.data = {}
}
updatedConfig.params = {
...updatedConfig.params,
lang: getCurrentLangAsV1Format()
}
return updatedConfig
})
httpApi.post('api/soundfiles/', formData, {

@ -45,12 +45,10 @@ export default {
},
computed: {
...mapGetters('user', [
'getCustomerId',
'hasFaxCapability',
'hasSubscriberProfileAttribute',
'hasSubscriberProfileAttributes',
'isLicenseActive',
'isOldCSCProxyingAllowed',
'isPbxEnabled',
'isSpCe'
]),
@ -260,12 +258,6 @@ export default {
icon: 'devices',
label: this.$t('Registered Devices'),
visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.registeredDevices)
},
{
to: `/customer/${this.getCustomerId}/details`,
icon: 'far fa-address-card',
label: this.$t('Customer Details'),
visible: this.isOldCSCProxyingAllowed
}
]
}

@ -139,7 +139,6 @@
"Custom Announcements": "Individuelle Ansagen",
"Custom sound": "Benutzerdefinierter Sound",
"Custom time set": "Benutzerdefinierte Zeiteinstellung",
"Customer Details": "Kunden-Details",
"Customer Phonebook": "Telefonbuch des Kunden",
"Customer Preferences": "Kundenpräferenzen",
"Daily": "Täglich",

@ -136,7 +136,6 @@
"Custom Announcements": "Custom Announcements",
"Custom sound": "Custom sound",
"Custom time set": "Custom time set",
"Customer Details": "Customer Details",
"Customer Phonebook": "Customer Phonebook",
"Customer Preferences": "Customer Preferences",
"Daily": "Daily",

@ -139,7 +139,6 @@
"Custom Announcements": "Anuncios Personalizados",
"Custom sound": "Sonido personalizado",
"Custom time set": "Intervalo de tiempo personalizado",
"Customer Details": "Detalles de cliente",
"Customer Phonebook": "Customer Phonebook",
"Customer Preferences": "Customer Preferences",
"Daily": "Diariamente",

@ -139,7 +139,6 @@
"Custom Announcements": "Annonces personnalisées",
"Custom sound": "Son personnalisé",
"Custom time set": "Intervalle de temps personnalisé",
"Customer Details": "Détails du client",
"Customer Phonebook": "Annuaire du client",
"Customer Preferences": "Préférences du client",
"Daily": "Quotidien",

@ -67,28 +67,6 @@ export async function setLanguage (locale) {
// Note: please extend "reloadLanguageRelatedData" action in the store if you are using language related API endpoints
}
/**
* It converts language code from V2 (new CSC) to V1 UI (old Panel CSC) format
* @param {string} lang
* @returns {string}
*/
export function convertLangV2toV1 (lang) {
return lang === 'en-US' ? 'en' : lang
}
/**
* It converts language code from V1 (old Panel CSC) to V2 UI (new CSC) format
* @param {string} lang
* @returns {string}
*/
export function convertLangV1toV2 (lang) {
return ['en', 'i-default'].includes(lang) ? 'en-US' : lang
}
export function getCurrentLangAsV1Format () {
return convertLangV2toV1(i18n.locale)
}
export function normalizeLocaleCode (locale) {
const shortLangCode = String(locale || 'en-US').substring(0, 2).toLowerCase()
const langCodeInV2Format = (shortLangCode === 'en') ? 'en-US' : shortLangCode

@ -137,7 +137,6 @@
"Custom Announcements": "Annunci personalizzati",
"Custom sound": "Audio personalizzato",
"Custom time set": "Intervallo di tempo personalizzato",
"Customer Details": "Dettagli cliente",
"Customer Phonebook": "Rubrica cliente",
"Customer Preferences": "Preferenze cliente",
"Daily": "Giornaliero",

@ -1,161 +0,0 @@
<template>
<div
class="proxy-iframe-wrapper flex flex-center"
>
<iframe
v-show="loaded"
ref="proxyIframe"
class="proxy-iframe"
:src="finalSrc"
@load="loadedEvent"
/>
<q-spinner
v-if="!loaded"
color="primary"
size="xl"
/>
</div>
</template>
<script>
import _ from 'lodash'
import { showGlobalError } from 'src/helpers/ui'
import { getCurrentLangAsV1Format } from 'src/i18n'
import {
mapActions,
mapState
} from 'vuex'
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'Proxy',
data () {
return {
loaded: false
}
},
computed: {
...mapState('user', [
'currentPathIframe'
]),
language () {
return getCurrentLangAsV1Format()
},
finalSrc () {
let url = null
if (_.isString(this.$appConfig.baseHttpUrl) && _.trim(this.$appConfig.baseHttpUrl) !== '') {
url = new URL(this.$appConfig.baseHttpUrl)
} else {
url = new URL(location.origin)
}
url.searchParams.set('framed', '1')
url.searchParams.set('lang', this.language)
if (this.$route?.meta?.proxyRewrite) {
return this.$route?.meta?.proxyRewrite({
route: this.$route,
url
}).toString()
}
url.pathname = this.$route.path
return url.toString()
}
},
watch: {
currentPathIframe (path) {
const routeData = this.$router.resolve(path)
if (!routeData?.meta?.proxy && !routeData?.meta?.proxyReverseInvisible) {
this.$router.push({
path
})
}
}
},
mounted () {
window.addEventListener('message', this.trackMessagesFromV1, false)
},
beforeUnmount () {
window.removeEventListener('message', this.trackMessagesFromV1, false)
},
methods: {
...mapActions('user', [
'logout'
]),
loadedEvent () {
try {
const domEl = this.$refs.proxyIframe?.contentWindow?.document?.getElementById('login_page_v1')
if (domEl !== null) {
this.logout()
return
}
this.injectDarkUITheme()
} catch (err) {
// eslint-disable-next-line no-console
console.debug('Session expiration detection is disabled')
// eslint-disable-next-line no-console
console.debug(err)
} finally {
this.loaded = true
}
},
injectDarkUITheme () {
const framedWindow = this.$refs.proxyIframe.contentWindow
const $ = framedWindow.$
const darkThemeCSS = `
body {
background: #3b3440; /* $darkBase */
color: white;
overflow: auto;
}
h1, h2, h3, h4, h5, h6 { color: white; }
.table-hover, .table-highlight { color: black; }
.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th { background: none; }
.table-highlight.table-bordered tbody tr td,
.table-highlight.table-bordered tbody tr th { background-color: #F0F3F7; }
.table-highlight.table-bordered thead tr,
table.ngcp-datatable tfoot tr { background: silver; }
.table-highlight.table-bordered thead th,
table.ngcp-datatable tfoot td {
text-shadow: none;
color: black;
border-left: 1px solid #F1F1F1;
border-right: 1px solid #CCC;
box-shadow: none;
}
.ngcp-modal,
.jquery-msgbox { color: #333; }
.modal-header { background: silver; border-color: white; }
.modal-header h3 { color: black; text-shadow: none; }
.accordion-inner { border-top: none; }
`
$(`<style>${darkThemeCSS}</style>`).appendTo(framedWindow.document.head)
},
trackMessagesFromV1 (event) {
if (event?.data?.origin === 'ngcp-panel') {
if (event?.data?.error) {
showGlobalError(event.data.error)
}
}
if (event?.data?.origin === 'ngcp-panel-beforeunload') {
this.loaded = false
}
}
}
}
</script>
<style lang="sass" rel="stylesheet/sass">
.proxy-iframe-wrapper
height: calc(100vh - 100px)
width: 100%
.proxy-iframe
border: none
height: calc(100vh - 100px)
width: 100%
</style>

@ -515,14 +515,6 @@ const routes = [
profileAttribute: PROFILE_ATTRIBUTE_MAP.registeredDevices
}
},
{
path: '/customer/:pathMatch(.*)',
component: () => import('pages/Proxy'),
meta: {
title: i18n.global.t('Customer Details'),
subtitle: i18n.global.t('Customer Details')
}
},
{
path: '*',
component: CscPageError404,

@ -204,9 +204,6 @@ export default {
: true
}
},
isOldCSCProxyingAllowed (state, getters) {
return getters.isAdmin && state.platformInfo?.csc_v2_mode === 'mixed' && !!getters.getCustomerId
},
isLicenseActive: (state) => {
return (license) => {
return state?.platformInfo.licenses.includes(license)

Loading…
Cancel
Save