diff --git a/src/api/subscriber.js b/src/api/subscriber.js
index 9db5c711..32fb9e58 100644
--- a/src/api/subscriber.js
+++ b/src/api/subscriber.js
@@ -547,3 +547,15 @@ export async function recoverPassword (data) {
}
return await Vue.http.post('api/passwordrecovery/', payLoad)
}
+
+export async function getBrandingLogo (subscriberId) {
+ const url = 'api/resellerbrandinglogos/?subscriber_id=' + subscriberId
+ try {
+ const res = await Vue.http.get(url, {
+ responseType: 'blob'
+ })
+ return URL.createObjectURL(res.body)
+ } catch (err) {
+ return null
+ }
+}
diff --git a/src/components/CscCustomLogo.vue b/src/components/CscCustomLogo.vue
new file mode 100644
index 00000000..c27cea36
--- /dev/null
+++ b/src/components/CscCustomLogo.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
diff --git a/src/components/CscLogo.vue b/src/components/CscLogo.vue
index 23851c80..8deb3838 100644
--- a/src/components/CscLogo.vue
+++ b/src/components/CscLogo.vue
@@ -123,9 +123,6 @@ export default {
default: 'light'
}
},
- data () {
- return {}
- },
computed: {
componentClasses () {
const classes = ['csc-logo']
diff --git a/src/css/quasar.variables.styl b/src/css/quasar.variables.styl
index 398f4061..9b98a504 100644
--- a/src/css/quasar.variables.styl
+++ b/src/css/quasar.variables.styl
@@ -54,6 +54,9 @@ $header-height-mobile = 60px
$logo-margin = $flex-gutter-sm
$logo-margin-mobile = $flex-gutter-xs
+$logo-min-width = 84px
+$logo-max-width = 100px
+$logo-max-height = $header-height
$csc-label = rgba(0,0,0,0.46)
diff --git a/src/layouts/CscLayoutMain.vue b/src/layouts/CscLayoutMain.vue
index 6e41b7bb..c419b2e1 100644
--- a/src/layouts/CscLayoutMain.vue
+++ b/src/layouts/CscLayoutMain.vue
@@ -72,9 +72,15 @@
+
{
this.$root.$emit('orientation-changed')
@@ -445,6 +456,7 @@ export default {
window.addEventListener('resize', () => {
this.$root.$emit('window-resized')
})
+ this.customLogo = await this.$store.dispatch('user/getCustomLogo')
},
methods: {
...mapActions('user', [
@@ -683,4 +695,10 @@ export default {
.csc-collapsible-menu
.q-icon
display none
+ #csc-default-logo
+ height 48px
+ #csc-custom-logo
+ min-width $logo-min-width
+ max-width $logo-max-width
+ max-height $logo-max-height
diff --git a/src/store/user.js b/src/store/user.js
index 1774fdd6..92fe9b11 100644
--- a/src/store/user.js
+++ b/src/store/user.js
@@ -13,7 +13,7 @@ import {
login,
getUserData
} from '../api/user'
-import { changePassword, resetPassword, recoverPassword } from '../api/subscriber'
+import { changePassword, resetPassword, recoverPassword, getBrandingLogo } from '../api/subscriber'
import { deleteJwt, getJwt, getSubscriberId, setJwt, setSubscriberId } from 'src/auth'
import { setSession } from 'src/storage'
@@ -42,7 +42,10 @@ export default {
languageLabels: [],
changePasswordState: RequestState.initiated,
changePasswordError: null,
- newPasswordRequesting: false
+ newPasswordRequesting: false,
+ logo: null,
+ logoRequesting: false,
+ logoRequested: false
},
getters: {
isLogged (state) {
@@ -160,6 +163,12 @@ export default {
return []
}
return state.subscriber.alias_numbers
+ },
+ isLogoRequesting (state) {
+ return state.logoRequesting
+ },
+ isLogoRequested (state) {
+ return state.logoRequested
}
},
mutations: {
@@ -250,8 +259,15 @@ export default {
newPasswordRequesting (state, isRequesting) {
state.newPasswordRequesting = isRequesting
},
+ updateLogo (state, value) {
+ state.logo = value
+ },
updateFaxActiveCapabilityState (state, value) {
state.capabilities.faxactive = value
+ },
+ updateLogoRequestState (state, isRequesting) {
+ state.logoRequesting = isRequesting
+ state.logoRequested = !isRequesting
}
},
actions: {
@@ -347,6 +363,14 @@ export default {
if (context.rootState.route.path === '/user/home' && !context.getters.isRtcEngineUiVisible) {
await router.push({ path: '/user/conversations' })
}
+ },
+ async getCustomLogo (context) {
+ if (!context.state.logo) {
+ context.commit('updateLogoRequestState', true)
+ context.commit('updateLogo', await getBrandingLogo(context.state.subscriberId))
+ context.commit('updateLogoRequestState', false)
+ }
+ return context.state.logo
}
}
}