TT#123750 SubscriberProfiles - As Subscriber, I want to see the "VoiceMail"-Feature if I have the permission to do so

Change-Id: Ieba8d87ba5aec141e2fc22c36b73e17005c4184d
mr9.5.2
Carlo Venusino 4 years ago
parent 5388fe2128
commit 508205bbec

@ -25,8 +25,8 @@ module.exports = function (/* ctx */) {
'i18n', 'i18n',
// 'axios', // 'axios',
'vue-resource', 'vue-resource',
'routes',
'user', 'user',
'routes',
'components', 'components',
'vue-scrollto', 'vue-scrollto',
'constants', 'constants',

@ -35,7 +35,11 @@ export default ({ app, router, store }) => {
}) })
break break
default: default:
next() if (to.meta?.profileAttribute) {
app.store.getters['user/hasSubscriberProfileAttribute'](to.meta.profileAttribute) ? next() : next('/')
} else {
next()
}
} }
} }
}) })

@ -87,7 +87,7 @@ export default {
to: '/user/voicebox', to: '/user/voicebox',
icon: 'voicemail', icon: 'voicemail',
label: this.$t('Voicebox'), label: this.$t('Voicebox'),
visible: true visible: this.hasSubscriberProfileAttribute('voice_mail')
}, },
{ {
to: '/user/call-forwarding', to: '/user/call-forwarding',

@ -133,14 +133,8 @@ export default function routes (app) {
component: CscPageReminder, component: CscPageReminder,
meta: { meta: {
title: i18n.t('Reminder'), title: i18n.t('Reminder'),
subtitle: i18n.t('Set your personal alarm') subtitle: i18n.t('Set your personal alarm'),
}, profileAttribute: 'reminder'
async beforeEnter (routeTo, routeFrom, next) {
if (app.store.getters['user/hasSubscriberProfileAttribute']('reminder')) {
next()
} else {
next('/')
}
} }
}, },
{ {
@ -212,7 +206,8 @@ export default function routes (app) {
component: CscPageVoicebox, component: CscPageVoicebox,
meta: { meta: {
title: i18n.t('Voicebox'), title: i18n.t('Voicebox'),
subtitle: i18n.t('Set your voicebox settings') subtitle: i18n.t('Set your voicebox settings'),
profileAttribute: 'voice_mail'
} }
}, },
{ {

Loading…
Cancel
Save