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',
'vue-resource',
'routes',
'user',
'components',
'vue-scrollto',
'constants',

@ -13,7 +13,6 @@ import {
patchRemove,
patchReplaceFull,
patchAddFull
} from './common'
import {
@ -625,3 +624,10 @@ export async function getRecordingStream (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', [
'isRtcEngineUiVisible',
'isPbxEnabled',
'hasFaxCapability'
'hasFaxCapability',
'hasSubscriberProfileAttribute'
]),
items () {
return [
@ -122,7 +123,7 @@ export default {
to: '/user/reminder',
icon: 'notification_important',
label: this.$t('Reminder'),
visible: true
visible: this.hasSubscriberProfileAttribute('reminder')
},
{
to: '/user/recordings',

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

@ -146,6 +146,7 @@
"Conference": "Conference",
"Conference name": "Conference name",
"Confirm": "Confirm",
"Contact": "Contact",
"Content": "Content",
"Control your calls": "Control your calls",
"Conversations": "Conversations",
@ -230,6 +231,7 @@
"Established": "Established",
"Every caller": "Every caller",
"Exit": "Exit",
"Expires": "Expires",
"Extension": "Extension",
"Fax": "Fax",
"Fax File": "Fax File",
@ -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": "List of registered devices for the subscriber",
"Load Files": "Load Files",
"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",
"Private": "Private",
"Q-Value": "Q-Value",
"Quality": "Quality",
"Queue Length": "Queue Length",
"Random Ringing": "Random Ringing",
@ -414,6 +418,7 @@
"Recording successfully deleted": "Recording successfully deleted",
"Recordings": "Recordings",
"Recover password": "Recover password",
"Registered Devices": "Registered Devices",
"Reloading conversation items failed": "Reloading conversation items failed",
"Reminder": "Reminder",
"Reminder is disabled": "Reminder is disabled",
@ -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 Agent",
"User settings": "User settings",
"Username": "Username",
"Video Call": "Video Call",
@ -715,4 +721,4 @@
"{field} must have at most {maxLength} letters": "{field} must have at most {maxLength} letters",
"{mode} of sources": "{mode} of sources",
"{mode} own phone": "{mode} own phone"
}
}

@ -146,6 +146,7 @@
"Conference": "",
"Conference name": "Nombre de la conferencia",
"Confirm": "Confirmar",
"Contact": "",
"Content": "Contenido",
"Control your calls": "Controla tus llamadas",
"Conversations": "Conversaciones",
@ -230,6 +231,7 @@
"Established": "Establecida",
"Every caller": "",
"Exit": "Salir",
"Expires": "",
"Extension": "Extensión",
"Fax": "Fax",
"Fax File": "Archivo de fax",
@ -312,6 +314,7 @@
"Leave conference": "Salir de conferencia",
"Leave current conference now!": "¡Salir de la conferencia actual ahora!",
"List name": "",
"List of registered devices for the subscriber": "",
"Load Files": "Cargar Archivos",
"Logged in as": "Conectado como",
"Login": "",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "",
"Privacy": "Privacidad",
"Private": "Privado",
"Q-Value": "",
"Quality": "Calidad",
"Queue Length": "Longitud de la cola",
"Random Ringing": "Llamada aleatoria",
@ -414,6 +418,7 @@
"Recording successfully deleted": "",
"Recordings": "",
"Recover password": "",
"Registered Devices": "",
"Reloading conversation items failed": "Falló la recarga de elementos de conversación",
"Reminder": "Recordatorio",
"Reminder is disabled": "El recordatorio está deshabilitado",
@ -593,6 +598,7 @@
"Use RegExp": "",
"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",
"User Agent": "",
"User settings": "",
"Username": "Nombre de usuario",
"Video Call": "Videollamada",
@ -715,4 +721,4 @@
"{field} must have at most {maxLength} letters": "{field} debe tener como máximo {maxLength} letras",
"{mode} of sources": "{mode} de fuentes",
"{mode} own phone": "{mode} teléfono propio"
}
}

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

@ -146,6 +146,7 @@
"Conference": "",
"Conference name": "Nome conferenza",
"Confirm": "Conferma",
"Contact": "",
"Content": "Contenuto",
"Control your calls": "Controlla le tue chiamate",
"Conversations": "Conversazioni",
@ -230,6 +231,7 @@
"Established": "Stabilita",
"Every caller": "",
"Exit": "Esci",
"Expires": "",
"Extension": "Numero dell'interno",
"Fax": "Fax",
"Fax File": "File Fax",
@ -312,6 +314,7 @@
"Leave conference": "Abbandona la conferenza",
"Leave current conference now!": "Abbandona ora la conferenza!",
"List name": "",
"List of registered devices for the subscriber": "",
"Load Files": "Carica Files",
"Logged in as": "Logged in as",
"Login": "",
@ -406,6 +409,7 @@
"Primary number {number} rings before forwarded if the user is available": "",
"Privacy": "Privacy",
"Private": "Privato",
"Q-Value": "",
"Quality": "Qualità",
"Queue Length": "Lunghezza Coda",
"Random Ringing": "Squillo Casuale",
@ -414,6 +418,7 @@
"Recording successfully deleted": "",
"Recordings": "",
"Recover password": "",
"Registered Devices": "",
"Reloading conversation items failed": "Caricamento dell'elenco conversazioni fallito",
"Reminder": "Promemoria",
"Reminder is disabled": "Promemoria disabilitato",
@ -593,6 +598,7 @@
"Use RegExp": "",
"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",
"User Agent": "",
"User settings": "",
"Username": "Nome Utente",
"Video Call": "Video Chiamata",
@ -715,4 +721,4 @@
"{field} must have at most {maxLength} letters": "Il campo {field} può contenere al massimo {maxLength} lettere",
"{mode} of sources": "{mode} dei pattern sorgente",
"{mode} own phone": "{mode} proprio telefono"
}
}

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

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

@ -134,6 +134,13 @@ export default function routes (app) {
meta: {
title: i18n.t('Reminder'),
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')
},
async beforeEnter (routeTo, routeFrom, next) {
await app.store.dispatch('user/initUser')
if (app.store.getters['user/hasFaxCapability']) {
next()
} else {

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

Loading…
Cancel
Save