TT#122200 SubscriberProfiles - As Subscriber, I want to see the "Reminder"-Feature, if I have the permission according to the SubscriberProfile, to do so

NOTE

- You need to install backend PPA if not yet merged ngcp-ppa gerrit_TT122001_review49995
- For AR testing the feature, in adminUI you have to:
  1. create a Subscriber profile set
  2. add two profiles, one with reminder attribute checked
  3. go to Subscriber > Details > Master Data > Edit and select the newly created profileset and the profile with Reminder attribute checked
  4. login with the edited subscriber and check that you are able to access Reminder module either from left menu and via url
  5. change the created subscriber profile set selecting the second profile (the one without reminder attribute)
  6. refresh CSC and check if Reminder is gone in left menu, and if trying to access the route via url you are redirected to /
  7. try to unassign the profile set from the subscriber, reload CSC and check that scenario of previous point happens

Change-Id: I6a09e6764a8a1cd9abd31ad7cb3d1df11d1b5953
mr9.5.2
Carlo Venusino 4 years ago
parent be03c7fa73
commit 5388fe2128

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

@ -13,7 +13,6 @@ import {
patchRemove, patchRemove,
patchReplaceFull, patchReplaceFull,
patchAddFull patchAddFull
} from './common' } from './common'
import { import {
@ -625,3 +624,10 @@ export async function getRecordingStream (fileId) {
path: 'api/callrecordingfiles/' + fileId path: 'api/callrecordingfiles/' + fileId
}) })
} }
export async function getSubscriberProfile (id) {
const profile = await get({
path: `api/subscriberprofiles/${id}`
})
return profile
}

@ -0,0 +1,7 @@
import { hasJwt } from 'src/auth'
export default async ({ store }) => {
if (hasJwt()) {
await store.dispatch('user/initUser')
}
}

@ -47,7 +47,8 @@ export default {
...mapGetters('user', [ ...mapGetters('user', [
'isRtcEngineUiVisible', 'isRtcEngineUiVisible',
'isPbxEnabled', 'isPbxEnabled',
'hasFaxCapability' 'hasFaxCapability',
'hasSubscriberProfileAttribute'
]), ]),
items () { items () {
return [ return [
@ -122,7 +123,7 @@ export default {
to: '/user/reminder', to: '/user/reminder',
icon: 'notification_important', icon: 'notification_important',
label: this.$t('Reminder'), label: this.$t('Reminder'),
visible: true visible: this.hasSubscriberProfileAttribute('reminder')
}, },
{ {
to: '/user/recordings', to: '/user/recordings',

@ -146,6 +146,7 @@
"Conference": "", "Conference": "",
"Conference name": "Konferenzname", "Conference name": "Konferenzname",
"Confirm": "Bestätigen", "Confirm": "Bestätigen",
"Contact": "",
"Content": "Inhalt", "Content": "Inhalt",
"Control your calls": "Anrufe steuern", "Control your calls": "Anrufe steuern",
"Conversations": "Konversationen", "Conversations": "Konversationen",
@ -230,6 +231,7 @@
"Established": "Verbunden", "Established": "Verbunden",
"Every caller": "Alle Anrufer", "Every caller": "Alle Anrufer",
"Exit": "Beenden", "Exit": "Beenden",
"Expires": "",
"Extension": "Rufnummernerweiterung", "Extension": "Rufnummernerweiterung",
"Fax": "Fax", "Fax": "Fax",
"Fax File": "Fax-Datei", "Fax File": "Fax-Datei",
@ -312,6 +314,7 @@
"Leave conference": "Konferenz verlassen", "Leave conference": "Konferenz verlassen",
"Leave current conference now!": "Aktuelle Konferenz jetzt verlassen", "Leave current conference now!": "Aktuelle Konferenz jetzt verlassen",
"List name": "", "List name": "",
"List of registered devices for the subscriber": "",
"Load Files": "Sounds laden", "Load Files": "Sounds laden",
"Logged in as": "Angemeldet als", "Logged in as": "Angemeldet als",
"Login": "", "Login": "",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "", "Primary number {number} rings before forwarded if the user is available": "",
"Privacy": "Datenschutz", "Privacy": "Datenschutz",
"Private": "Private", "Private": "Private",
"Q-Value": "",
"Quality": "Qualität", "Quality": "Qualität",
"Queue Length": "Anzahl der Anrufe", "Queue Length": "Anzahl der Anrufe",
"Random Ringing": "Zufälliges Klingeln", "Random Ringing": "Zufälliges Klingeln",
@ -414,6 +418,7 @@
"Recording successfully deleted": "", "Recording successfully deleted": "",
"Recordings": "", "Recordings": "",
"Recover password": "", "Recover password": "",
"Registered Devices": "",
"Reloading conversation items failed": "Das Laden der Konversationen ist fehlgeschlagen.", "Reloading conversation items failed": "Das Laden der Konversationen ist fehlgeschlagen.",
"Reminder": "Erinnerung", "Reminder": "Erinnerung",
"Reminder is disabled": "Erinnerung ist deaktiviert", "Reminder is disabled": "Erinnerung ist deaktiviert",
@ -593,6 +598,7 @@
"Use RegExp": "", "Use RegExp": "",
"Use as default for all seats and groups": "Standard für alle Seats und Gruppen", "Use as default for all seats and groups": "Standard für alle Seats und Gruppen",
"Use language specific preset": "Sprachspezifische Voreinstellungen verwenden", "Use language specific preset": "Sprachspezifische Voreinstellungen verwenden",
"User Agent": "",
"User settings": "", "User settings": "",
"Username": "Benutzername", "Username": "Benutzername",
"Video Call": "Videoanruf", "Video Call": "Videoanruf",

@ -146,6 +146,7 @@
"Conference": "Conference", "Conference": "Conference",
"Conference name": "Conference name", "Conference name": "Conference name",
"Confirm": "Confirm", "Confirm": "Confirm",
"Contact": "Contact",
"Content": "Content", "Content": "Content",
"Control your calls": "Control your calls", "Control your calls": "Control your calls",
"Conversations": "Conversations", "Conversations": "Conversations",
@ -230,6 +231,7 @@
"Established": "Established", "Established": "Established",
"Every caller": "Every caller", "Every caller": "Every caller",
"Exit": "Exit", "Exit": "Exit",
"Expires": "Expires",
"Extension": "Extension", "Extension": "Extension",
"Fax": "Fax", "Fax": "Fax",
"Fax File": "Fax File", "Fax File": "Fax File",
@ -312,6 +314,7 @@
"Leave conference": "Leave conference", "Leave conference": "Leave conference",
"Leave current conference now!": "Leave current conference now!", "Leave current conference now!": "Leave current conference now!",
"List name": "List name", "List name": "List name",
"List of registered devices for the subscriber": "List of registered devices for the subscriber",
"Load Files": "Load Files", "Load Files": "Load Files",
"Logged in as": "Logged in as", "Logged in as": "Logged in as",
"Login": "Login", "Login": "Login",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "Primary number {number} rings before forwarded if the user is available", "Primary number {number} rings before forwarded if the user is available": "Primary number {number} rings before forwarded if the user is available",
"Privacy": "Privacy", "Privacy": "Privacy",
"Private": "Private", "Private": "Private",
"Q-Value": "Q-Value",
"Quality": "Quality", "Quality": "Quality",
"Queue Length": "Queue Length", "Queue Length": "Queue Length",
"Random Ringing": "Random Ringing", "Random Ringing": "Random Ringing",
@ -414,6 +418,7 @@
"Recording successfully deleted": "Recording successfully deleted", "Recording successfully deleted": "Recording successfully deleted",
"Recordings": "Recordings", "Recordings": "Recordings",
"Recover password": "Recover password", "Recover password": "Recover password",
"Registered Devices": "Registered Devices",
"Reloading conversation items failed": "Reloading conversation items failed", "Reloading conversation items failed": "Reloading conversation items failed",
"Reminder": "Reminder", "Reminder": "Reminder",
"Reminder is disabled": "Reminder is disabled", "Reminder is disabled": "Reminder is disabled",
@ -593,6 +598,7 @@
"Use RegExp": "Use RegExp", "Use RegExp": "Use RegExp",
"Use as default for all seats and groups": "Use as default for all seats and groups", "Use as default for all seats and groups": "Use as default for all seats and groups",
"Use language specific preset": "Use language specific preset", "Use language specific preset": "Use language specific preset",
"User Agent": "User Agent",
"User settings": "User settings", "User settings": "User settings",
"Username": "Username", "Username": "Username",
"Video Call": "Video Call", "Video Call": "Video Call",

@ -146,6 +146,7 @@
"Conference": "", "Conference": "",
"Conference name": "Nombre de la conferencia", "Conference name": "Nombre de la conferencia",
"Confirm": "Confirmar", "Confirm": "Confirmar",
"Contact": "",
"Content": "Contenido", "Content": "Contenido",
"Control your calls": "Controla tus llamadas", "Control your calls": "Controla tus llamadas",
"Conversations": "Conversaciones", "Conversations": "Conversaciones",
@ -230,6 +231,7 @@
"Established": "Establecida", "Established": "Establecida",
"Every caller": "", "Every caller": "",
"Exit": "Salir", "Exit": "Salir",
"Expires": "",
"Extension": "Extensión", "Extension": "Extensión",
"Fax": "Fax", "Fax": "Fax",
"Fax File": "Archivo de fax", "Fax File": "Archivo de fax",
@ -312,6 +314,7 @@
"Leave conference": "Salir de conferencia", "Leave conference": "Salir de conferencia",
"Leave current conference now!": "¡Salir de la conferencia actual ahora!", "Leave current conference now!": "¡Salir de la conferencia actual ahora!",
"List name": "", "List name": "",
"List of registered devices for the subscriber": "",
"Load Files": "Cargar Archivos", "Load Files": "Cargar Archivos",
"Logged in as": "Conectado como", "Logged in as": "Conectado como",
"Login": "", "Login": "",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "", "Primary number {number} rings before forwarded if the user is available": "",
"Privacy": "Privacidad", "Privacy": "Privacidad",
"Private": "Privado", "Private": "Privado",
"Q-Value": "",
"Quality": "Calidad", "Quality": "Calidad",
"Queue Length": "Longitud de la cola", "Queue Length": "Longitud de la cola",
"Random Ringing": "Llamada aleatoria", "Random Ringing": "Llamada aleatoria",
@ -414,6 +418,7 @@
"Recording successfully deleted": "", "Recording successfully deleted": "",
"Recordings": "", "Recordings": "",
"Recover password": "", "Recover password": "",
"Registered Devices": "",
"Reloading conversation items failed": "Falló la recarga de elementos de conversación", "Reloading conversation items failed": "Falló la recarga de elementos de conversación",
"Reminder": "Recordatorio", "Reminder": "Recordatorio",
"Reminder is disabled": "El recordatorio está deshabilitado", "Reminder is disabled": "El recordatorio está deshabilitado",
@ -593,6 +598,7 @@
"Use RegExp": "", "Use RegExp": "",
"Use as default for all seats and groups": "Usar por defecto para todos los asientos y grupos", "Use as default for all seats and groups": "Usar por defecto para todos los asientos y grupos",
"Use language specific preset": "Usar un preajuste específico de idioma", "Use language specific preset": "Usar un preajuste específico de idioma",
"User Agent": "",
"User settings": "", "User settings": "",
"Username": "Nombre de usuario", "Username": "Nombre de usuario",
"Video Call": "Videollamada", "Video Call": "Videollamada",

@ -146,6 +146,7 @@
"Conference": "", "Conference": "",
"Conference name": "", "Conference name": "",
"Confirm": "", "Confirm": "",
"Contact": "",
"Content": "Contenu", "Content": "Contenu",
"Control your calls": "Contrôlez vos appels", "Control your calls": "Contrôlez vos appels",
"Conversations": "Conversations", "Conversations": "Conversations",
@ -230,6 +231,7 @@
"Established": "Établi", "Established": "Établi",
"Every caller": "", "Every caller": "",
"Exit": "", "Exit": "",
"Expires": "",
"Extension": "Extension", "Extension": "Extension",
"Fax": "Fax", "Fax": "Fax",
"Fax File": "Fax", "Fax File": "Fax",
@ -312,6 +314,7 @@
"Leave conference": "", "Leave conference": "",
"Leave current conference now!": "", "Leave current conference now!": "",
"List name": "", "List name": "",
"List of registered devices for the subscriber": "",
"Load Files": "", "Load Files": "",
"Logged in as": "Connecté en tant que", "Logged in as": "Connecté en tant que",
"Login": "", "Login": "",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "", "Primary number {number} rings before forwarded if the user is available": "",
"Privacy": "Confidentialité", "Privacy": "Confidentialité",
"Private": "Privé", "Private": "Privé",
"Q-Value": "",
"Quality": "Qualité", "Quality": "Qualité",
"Queue Length": "Longueur de la file dattente", "Queue Length": "Longueur de la file dattente",
"Random Ringing": "Sonnerie aléatoire", "Random Ringing": "Sonnerie aléatoire",
@ -414,6 +418,7 @@
"Recording successfully deleted": "", "Recording successfully deleted": "",
"Recordings": "", "Recordings": "",
"Recover password": "", "Recover password": "",
"Registered Devices": "",
"Reloading conversation items failed": "Le rechargement des conversations a échoué", "Reloading conversation items failed": "Le rechargement des conversations a échoué",
"Reminder": "Rappel", "Reminder": "Rappel",
"Reminder is disabled": "Rappel désactivé", "Reminder is disabled": "Rappel désactivé",
@ -593,6 +598,7 @@
"Use RegExp": "", "Use RegExp": "",
"Use as default for all seats and groups": "", "Use as default for all seats and groups": "",
"Use language specific preset": "", "Use language specific preset": "",
"User Agent": "",
"User settings": "", "User settings": "",
"Username": "Identifiant", "Username": "Identifiant",
"Video Call": "Appel vidéo", "Video Call": "Appel vidéo",

@ -146,6 +146,7 @@
"Conference": "", "Conference": "",
"Conference name": "Nome conferenza", "Conference name": "Nome conferenza",
"Confirm": "Conferma", "Confirm": "Conferma",
"Contact": "",
"Content": "Contenuto", "Content": "Contenuto",
"Control your calls": "Controlla le tue chiamate", "Control your calls": "Controlla le tue chiamate",
"Conversations": "Conversazioni", "Conversations": "Conversazioni",
@ -230,6 +231,7 @@
"Established": "Stabilita", "Established": "Stabilita",
"Every caller": "", "Every caller": "",
"Exit": "Esci", "Exit": "Esci",
"Expires": "",
"Extension": "Numero dell'interno", "Extension": "Numero dell'interno",
"Fax": "Fax", "Fax": "Fax",
"Fax File": "File Fax", "Fax File": "File Fax",
@ -312,6 +314,7 @@
"Leave conference": "Abbandona la conferenza", "Leave conference": "Abbandona la conferenza",
"Leave current conference now!": "Abbandona ora la conferenza!", "Leave current conference now!": "Abbandona ora la conferenza!",
"List name": "", "List name": "",
"List of registered devices for the subscriber": "",
"Load Files": "Carica Files", "Load Files": "Carica Files",
"Logged in as": "Logged in as", "Logged in as": "Logged in as",
"Login": "", "Login": "",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "", "Primary number {number} rings before forwarded if the user is available": "",
"Privacy": "Privacy", "Privacy": "Privacy",
"Private": "Privato", "Private": "Privato",
"Q-Value": "",
"Quality": "Qualità", "Quality": "Qualità",
"Queue Length": "Lunghezza Coda", "Queue Length": "Lunghezza Coda",
"Random Ringing": "Squillo Casuale", "Random Ringing": "Squillo Casuale",
@ -414,6 +418,7 @@
"Recording successfully deleted": "", "Recording successfully deleted": "",
"Recordings": "", "Recordings": "",
"Recover password": "", "Recover password": "",
"Registered Devices": "",
"Reloading conversation items failed": "Caricamento dell'elenco conversazioni fallito", "Reloading conversation items failed": "Caricamento dell'elenco conversazioni fallito",
"Reminder": "Promemoria", "Reminder": "Promemoria",
"Reminder is disabled": "Promemoria disabilitato", "Reminder is disabled": "Promemoria disabilitato",
@ -593,6 +598,7 @@
"Use RegExp": "", "Use RegExp": "",
"Use as default for all seats and groups": "Configura come predefinito per tutte le postazioni e gruppi", "Use as default for all seats and groups": "Configura come predefinito per tutte le postazioni e gruppi",
"Use language specific preset": "Usa i valori preimpostati della lingua", "Use language specific preset": "Usa i valori preimpostati della lingua",
"User Agent": "",
"User settings": "", "User settings": "",
"Username": "Nome Utente", "Username": "Nome Utente",
"Video Call": "Video Chiamata", "Video Call": "Video Chiamata",

@ -290,9 +290,6 @@ export default {
} }
} }
}, },
mounted () {
this.$store.dispatch('user/initUser')
},
methods: { methods: {
...mapActions('conference', [ ...mapActions('conference', [
'leave' 'leave'

@ -456,7 +456,6 @@ export default {
} }
}, },
async mounted () { async mounted () {
await this.$store.dispatch('user/initUser')
window.addEventListener('orientationchange', () => { window.addEventListener('orientationchange', () => {
this.$root.$emit('orientation-changed') this.$root.$emit('orientation-changed')
}) })

@ -134,6 +134,13 @@ export default function routes (app) {
meta: { meta: {
title: i18n.t('Reminder'), title: i18n.t('Reminder'),
subtitle: i18n.t('Set your personal alarm') subtitle: i18n.t('Set your personal alarm')
},
async beforeEnter (routeTo, routeFrom, next) {
if (app.store.getters['user/hasSubscriberProfileAttribute']('reminder')) {
next()
} else {
next('/')
}
} }
}, },
{ {
@ -216,7 +223,6 @@ export default function routes (app) {
subtitle: i18n.t('Set your fax settings') subtitle: i18n.t('Set your fax settings')
}, },
async beforeEnter (routeTo, routeFrom, next) { async beforeEnter (routeTo, routeFrom, next) {
await app.store.dispatch('user/initUser')
if (app.store.getters['user/hasFaxCapability']) { if (app.store.getters['user/hasFaxCapability']) {
next() next()
} else { } else {

@ -18,7 +18,8 @@ import {
resetPassword, resetPassword,
recoverPassword, recoverPassword,
getBrandingLogo, getBrandingLogo,
getSubscriberRegistrations getSubscriberRegistrations,
getSubscriberProfile
} from '../api/subscriber' } from '../api/subscriber'
import { deleteJwt, getJwt, getSubscriberId, setJwt, setSubscriberId } from 'src/auth' import { deleteJwt, getJwt, getSubscriberId, setJwt, setSubscriberId } from 'src/auth'
import { setSession } from 'src/storage' import { setSession } from 'src/storage'
@ -30,6 +31,7 @@ export default {
subscriberId: null, subscriberId: null,
subscriber: null, subscriber: null,
capabilities: null, capabilities: null,
profile: null,
features: { features: {
sendFax: true, sendFax: true,
sendSms: false sendSms: false
@ -182,6 +184,9 @@ export default {
}, },
isLogoRequested (state) { isLogoRequested (state) {
return state.logoRequested return state.logoRequested
},
hasSubscriberProfileAttribute: (state) => (attribute) => {
return state.profile?.attributes.includes(attribute) || false
} }
}, },
mutations: { mutations: {
@ -291,6 +296,9 @@ export default {
}, },
setSubscriberRegistrations (state, value) { setSubscriberRegistrations (state, value) {
state.subscriberRegistrations = value state.subscriberRegistrations = value
},
setProfile (state, value) {
state.profile = value
} }
}, },
actions: { actions: {
@ -336,6 +344,10 @@ export default {
context.commit('rtcEngineInitFailed', err.message) context.commit('rtcEngineInitFailed', err.message)
} }
} }
if (userData.subscriber.profile_id) {
const profile = await getSubscriberProfile(userData.subscriber.profile_id)
context.commit('setProfile', profile)
}
await context.dispatch('forwardHome') await context.dispatch('forwardHome')
} catch (err) { } catch (err) {
console.debug(err) console.debug(err)

Loading…
Cancel
Save