diff --git a/src/api/common.js b/src/api/common.js index 473c1f32..e8e99c6e 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -168,12 +168,15 @@ export async function getList (options) { function handleResponseError (err) { const code = _.get(err, 'response.data.code', null) - const message = _.get(err, 'response.data.message', null) + let message = _.get(err, 'response.data.message', null) + if (code === 403 && message === 'Invalid license') { + message = 'Invalid or expired license. Contact your administrator to activate this functionality' + } if (code !== null && message !== null) { - throw new ApiResponseError(err.response.data.code, err.response.data.message) - } else { - throw err + throw new ApiResponseError(code, message) } + + throw err } export async function get (options) { diff --git a/src/api/user.js b/src/api/user.js index e26ad8ae..e32484e5 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -51,26 +51,30 @@ export async function loginByExchangeToken (token) { } } -export function getUserData (id) { - return new Promise((resolve, reject) => { - return Promise.all([ - getSubscriberById(id), - getCapabilities(id), - getFaxServerSettings(id), - getResellerBranding(), - getPlatformInfo() - ]).then(([subscriber, capabilities, faxServerSettings, resellerBranding, platformInfo]) => { +export async function getUserData (id) { + const allPromise = Promise.all([ + getSubscriberById(id), + getCapabilities(id), + getResellerBranding(), + getPlatformInfo() + ]) + + try { + const [subscriber, capabilities, resellerBranding, platformInfo] = await allPromise + if (capabilities.faxserver && platformInfo.licenses.find((license) => license === 'fax')) { + const faxServerSettings = await getFaxServerSettings(id) capabilities.faxactive = faxServerSettings.active - resolve({ - subscriber, - capabilities, - resellerBranding: resellerBranding?.items[0] || null, - platformInfo - }) - }).catch((err) => { - reject(err) - }) - }) + } + + return { + subscriber, + capabilities, + resellerBranding: resellerBranding?.items[0] || null, + platformInfo + } + } catch (error) { + throw new Error(error.response.data.message) + } } export function getSubscriberById (id) { diff --git a/src/components/AuiMobileAppBadges.vue b/src/components/AuiMobileAppBadges.vue index 7fed6213..929f34b2 100644 --- a/src/components/AuiMobileAppBadges.vue +++ b/src/components/AuiMobileAppBadges.vue @@ -1,7 +1,7 @@ <template> <q-list - class="absolute-bottom" v-if="appUrlAndroid || appUrlApple" + class="absolute-bottom" dense > <q-item-label diff --git a/src/layouts/CscLayoutMain.vue b/src/layouts/CscLayoutMain.vue index b16458f3..d394ed6c 100644 --- a/src/layouts/CscLayoutMain.vue +++ b/src/layouts/CscLayoutMain.vue @@ -352,36 +352,12 @@ export default { showQrBtn () { return this.platformInfo?.app?.show_qr }, - hasCommunicationCapabilities () { - return (this.hasSmsCapability && this.hasSendSmsFeature) || - (this.hasFaxCapabilityAndFaxActive && this.hasSendFaxFeature) - }, isMenuClosed () { return !this.sideStates.left }, isFullView () { return this.isMenuClosed || this.isMobile || this.mobileMenu }, - layoutClasses () { - const classes = [] - if (this.isCalling) { - classes.push('csc-layout-call-active') - } - if (this.menuMinimized) { - classes.push('csc-menu-minimized') - } - return classes - }, - headerClasses () { - const classes = ['transition-generic'] - if (this.isMobile) { - classes.push('csc-header-mobile') - } - if (this.isMobile || this.isMenuClosed) { - classes.push('csc-header-full') - } - return classes - }, pinMenuButtonIcon () { if (!this.menuPinned) { return 'push_pin'