MT#32998 Customer admin user should be able to open seats configuration in a separated page

Change-Id: I3a7b8c31e8d6bb37f810eee8b374dd0acf54daed
pull/17/head
CORP\franci11 3 years ago committed by Hugo Zigha
parent bd8a150825
commit 63a00992fb

@ -309,7 +309,15 @@ export function setSeatNumbers (options) {
assignedNumbers: options.assignedNumbers,
unassignedNumbers: options.unassignedNumbers
}).then((result) => {
resolve(result)
if (result.subscriber !== null && result.preferences !== null) {
return result
}
return getSubscriberAndPreferences(options.seatId)
}).then((result) => {
resolve({
seat: result.subscriber,
preferences: result.preferences
})
}).catch((err) => {
reject(err)
})

@ -15,6 +15,11 @@
name="header"
/>
</div>
<div class="row q-ml-sm q-mb-sm">
<slot
name="header-align-left"
/>
</div>
<q-separator />
<div
class="col-12"

@ -1,279 +1,122 @@
<template>
<q-expansion-item
group="seats"
header-class="q-pa-sm"
active-class="csc-item-odd"
dense-toggle
<q-item
class="cursor-pointer"
@click.native="showSeatDetails"
>
<template
slot="header"
<q-item-section
side
top
no-wrap
>
<q-item-section
side
top
no-wrap
<q-icon
name="person"
color="white"
/>
</q-item-section>
<q-item-section>
<q-item-label
class="text-subtitle1"
>
<q-icon
name="person"
color="white"
/>
</q-item-section>
<q-item-section>
<q-item-label
class="text-subtitle1"
>
{{ seat | seatName }}
</q-item-label>
<q-item-label
caption
>
{{ $t('Login') }}: <strong>{{ seat.webusername }}</strong>
</q-item-label>
<q-item-label
caption
>
{{ $t('Extension') }}: <strong>{{ seat.pbx_extension }}</strong>
</q-item-label>
<q-item-label
caption
{{ seat | seatName }}
</q-item-label>
<q-item-label
caption
>
{{ $t('Login') }}: <strong>{{ seat.webusername }}</strong>
</q-item-label>
<q-item-label
caption
>
{{ $t('Extension') }}: <strong>{{ seat.pbx_extension }}</strong>
</q-item-label>
<q-item-label
caption
>
<span
v-if="seat.pbx_group_ids.length > 0"
>
{{ $t('Groups') }}:
<span
v-if="seat.pbx_group_ids.length > 0"
>
{{ $t('Groups') }}:
<span
v-for="groupId in seat.pbx_group_ids"
:key="groupId"
class="csc-list-item-title-keyword"
>
<q-icon
name="group"
size="16px"
/>
{{ groups[groupId] | groupName }}
</span>
</span>
<span
v-else
v-for="groupId in seat.pbx_group_ids"
:key="groupId"
class="csc-list-item-title-keyword"
>
<q-icon
class="self-center"
name="group"
size="16px"
/>
{{ $t('No groups') }}
{{ groups[groupId] | groupName }}
</span>
</q-item-label>
</q-item-section>
<q-item-section
side
top
>
<csc-more-menu>
<csc-popup-menu-item
icon="vpn_key"
color="primary"
:label="$t('Change Password')"
@click="showPasswordDialog"
/>
<csc-popup-menu-item
icon="vpn_key"
color="primary"
:label="$t('Change SIP Password')"
@click="showSIPPasswordDialog"
/>
<csc-popup-menu-item-delete
@click="deleteSeat"
/>
<q-separator />
<q-item
class="no-padding"
>
<q-item-section>
<q-toggle
v-model="changes.clirIntrapbx"
class="q-pa-sm"
:label="$t('Hide number within own PBX')"
:disable="loading"
@input="changeIntraPbx"
/>
</q-item-section>
</q-item>
<q-item
class="no-padding"
>
<q-item-section>
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
:label="$t('Music on hold')"
:disable="loading"
@input="changeMusicOnHold"
/>
</q-item-section>
</q-item>
</csc-more-menu>
</q-item-section>
</template>
<div
class="q-pa-md"
>
<csc-change-password-dialog
ref="changePasswordDialog"
:loading="false"
@change-password="changeWebPassword({ password: $event.password })"
/>
<q-input
v-model="changes.name"
:label="$t('Name')"
:disable="loading"
@keyup.enter="save"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasNameChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasNameChanged"
@click.stop="resetName"
/>
</template>
</q-input>
<q-input
v-model="changes.extension"
hide-hint
:error="$v.changes.extension.$error"
:error-message="extensionErrorMessage"
:label="$t('Extension')"
:disable="loading"
:hint="getExtensionHint"
@keyup.enter="save"
@input="$v.changes.extension.$touch"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasExtensionChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasExtensionChanged"
@click.stop="resetExtension"
/>
</template>
</q-input>
<q-input
readonly
disable
:label="$t('Primary Number')"
:value="getPrimaryNumber"
/>
<q-select
v-model="changes.aliasNumbers"
use-chips
multiple
emit-value
map-options
:options="aliasNumberOptions"
:label="$t('Alias Numbers')"
:disable="loading"
>
<template
v-slot:append
</span>
<span
v-else
>
<csc-input-button-save
v-if="hasAliasNumbersChanged"
@click.stop="save"
<q-icon
class="self-center"
name="group"
size="16px"
/>
<csc-input-button-reset
v-if="hasAliasNumbersChanged"
@click.stop="resetAliasNumbers"
/>
</template>
</q-select>
<q-select
v-model="changes.groups"
use-chips
multiple
emit-value
map-options
:options="groupOptions"
:label="$t('Groups')"
:disable="loading"
>
<template
v-slot:append
{{ $t('No groups') }}
</span>
</q-item-label>
</q-item-section>
<q-item-section
side
top
>
<csc-more-menu>
<csc-popup-menu-item
icon="vpn_key"
color="primary"
:label="$t('Change Password')"
@click="showPasswordDialog"
/>
<csc-popup-menu-item
icon="vpn_key"
color="primary"
:label="$t('Change SIP Password')"
@click="showSIPPasswordDialog"
/>
<csc-popup-menu-item-delete
@click="deleteSeat"
/>
<q-separator />
<q-item
class="no-padding"
>
<csc-input-button-save
v-if="hasGroupsChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasGroupsChanged"
@click.stop="resetGroups"
/>
</template>
</q-select>
<q-select
v-model="changes.soundSet"
radio
emit-value
map-options
:options="internalSoundSetOptions"
:label="$t('Sound Set')"
:disable="loading"
>
<template
v-slot:append
<q-item-section>
<q-toggle
v-model="changes.clirIntrapbx"
class="q-pa-sm"
:label="$t('Hide number within own PBX')"
:disable="loading"
@input="changeIntraPbx"
/>
</q-item-section>
</q-item>
<q-item
class="no-padding"
>
<csc-input-button-save
v-if="hasSoundSetChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasSoundSetChanged"
@click.stop="resetSoundSet"
/>
</template>
</q-select>
<q-toggle
v-model="changes.clirIntrapbx"
class="q-pa-sm"
:label="$t('Hide number within own PBX')"
:disable="loading"
@input="changeIntraPbx"
/>
<q-btn
v-if="hasCallQueue"
icon="filter_none"
flat
color="primary"
:label="$t('Call Queue')"
:disable="loading"
@click="jumpToCallQueue"
/>
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
:label="$t('Music on hold')"
:disable="loading"
@input="changeMusicOnHold"
/>
</div>
</q-expansion-item>
<q-item-section>
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
:label="$t('Music on hold')"
:disable="loading"
@input="changeMusicOnHold"
/>
</q-item-section>
</q-item>
</csc-more-menu>
</q-item-section>
</q-item>
</template>
<script>
import _ from 'lodash'
import { mapGetters } from 'vuex'
import { between } from 'vuelidate/lib/validators'
import { inRange } from 'src/helpers/validation'
import CscChangePasswordDialog from '../../CscChangePasswordDialog'
import numberFilter from '../../../filters/number'
import CscInputButtonSave from 'components/form/CscInputButtonSave'
import CscInputButtonReset from 'components/form/CscInputButtonReset'
import CscMoreMenu from 'components/CscMoreMenu'
@ -303,42 +146,10 @@ export default {
type: Object,
default: undefined
},
soundSet: {
type: Object,
default: undefined
},
expanded: {
type: Boolean,
default: undefined
},
loading: {
type: Boolean,
default: undefined
},
aliasNumberOptions: {
type: Array,
default: undefined
},
groupOptions: {
type: Array,
default: undefined
},
soundSetOptions: {
type: Array,
default: undefined
},
odd: {
type: Boolean,
default: undefined
},
labelWidth: {
type: Number,
default: undefined
},
hasCallQueue: {
type: Boolean,
default: undefined
},
musicOnHold: {
type: Boolean,
default: undefined
@ -349,176 +160,31 @@ export default {
changes: this.getSeatData()
}
},
validations: {
changes: {
extension: {
isInRange: function (value) {
return inRange(value, this.getMinAllowedExtension, this.getMaxAllowedExtension, between)
}
}
}
},
computed: {
...mapGetters('pbx', [
'getExtensionHint',
'getMinAllowedExtension',
'getMaxAllowedExtension'
]),
getPrimaryNumber () {
return numberFilter(this.seat.primary_number)
},
hasNameChanged () {
return this.changes.name !== this.seat.display_name
},
hasExtensionChanged () {
return this.changes.extension !== this.seat.pbx_extension
},
hasWebPasswordChanged () {
return this.changes.webPassword !== this.seat.webpassword
},
hasAliasNumbersChanged () {
return !_.isEqual(_.cloneDeep(this.changes.aliasNumbers).sort(), this.getAliasNumberIds().sort())
},
hasGroupsChanged () {
return !_.isEqual(_.cloneDeep(this.changes.groups).sort(), _.cloneDeep(this.seat.pbx_group_ids).sort())
},
hasSoundSetChanged () {
return this.changes.soundSet !== this.getSoundSetId()
},
extensionErrorMessage () {
if (!this.$v.changes.extension.isInRange) {
return this.getExtensionHint
} else {
return ''
}
},
internalSoundSetOptions () {
const items = []
if (this.soundSet) {
items.push({
label: this.soundSet.name,
value: this.soundSet.id
})
}
if (_.isArray(this.soundSetOptions)) {
this.soundSetOptions.forEach((soundSet) => {
if (this.soundSet && this.soundSet.id !== soundSet.value) {
items.push(soundSet)
} else if (!this.soundSet) {
items.push(soundSet)
}
})
}
return items
}
},
watch: {
seat () {
this.changes = this.getSeatData()
}
},
methods: {
getAliasNumberIds () {
const numberIds = []
this.seat.alias_numbers.forEach((number) => {
numberIds.push(number.number_id)
})
return numberIds
},
getGroupIds () {
return _.clone(this.seat.pbx_group_ids)
},
getSoundSetId () {
if (this.soundSet !== null) {
return this.soundSet.id
}
return null
},
getSeatData () {
return {
name: this.seat.display_name,
extension: this.seat.pbx_extension,
aliasNumbers: this.getAliasNumberIds(),
webPassword: this.seat.webpassword,
clirIntrapbx: this.intraPbx,
musicOnHold: this.musicOnHold,
groups: this.getGroupIds(),
soundSet: this.getSoundSetId()
}
},
toggle () {
if (this.expanded) {
this.$emit('collapse')
} else {
this.$emit('expand')
groups: this.getGroupIds()
}
},
resetName () {
this.changes.name = this.seat.display_name
},
resetExtension () {
this.changes.extension = this.seat.pbx_extension
},
resetWebPassword () {
this.changes.webPassword = this.seat.webpassword
},
resetAliasNumbers () {
this.changes.aliasNumbers = this.getAliasNumberIds()
},
resetGroups () {
this.changes.groups = this.getGroupIds()
},
resetSoundSet () {
this.changes.soundSet = this.getSoundSetId()
},
deleteSeat () {
if (this.$refs.listItem) {
this.$refs.listItem.closePopoverMenu()
}
this.$emit('remove')
},
jumpToCallQueue () {
this.$emit('jump-to-call-queue', this.seat)
},
save () {
if (this.hasNameChanged) {
this.$emit('save-name', {
seatId: this.seat.id,
seatName: this.changes.name
})
}
if (this.hasExtensionChanged) {
this.$emit('save-extension', {
seatId: this.seat.id,
seatExtension: this.changes.extension
})
}
if (this.hasWebPasswordChanged) {
this.$emit('save-webpassword', {
seatId: this.seat.id,
seatWebPassword: this.changes.webpassword
})
}
if (this.hasAliasNumbersChanged) {
this.$emit('save-alias-numbers', {
seatId: this.seat.id,
assignedNumbers: _.difference(this.changes.aliasNumbers, this.getAliasNumberIds()),
unassignedNumbers: _.difference(this.getAliasNumberIds(), this.changes.aliasNumbers)
})
}
if (this.hasGroupsChanged) {
this.$emit('save-groups', {
seatId: this.seat.id,
groupIds: this.changes.groups
})
}
if (this.hasSoundSetChanged) {
this.$emit('save-sound-set', {
seatId: this.seat.id,
soundSetId: this.changes.soundSet
})
}
},
showPasswordDialog () {
this.$q.dialog({
component: CscDialogChangePassword,
@ -561,6 +227,9 @@ export default {
seatId: this.seat.id,
musicOnHold: this.changes.musicOnHold
})
},
showSeatDetails () {
this.$router.push('/user/pbx-configuration/seat/'+this.seat.id)
}
}
}

@ -0,0 +1,443 @@
<template>
<csc-page-sticky
id="csc-page-pbx-seats-details"
class="row q-pa-lg"
>
<template
v-slot:header-align-left
>
<q-breadcrumbs
v-if="seatSelected"
class="text-weight-light q-mr-md"
active-color="primary"
separator-color="primary"
>
<q-breadcrumbs-el
key="seats"
class="cursor-pointer"
to="/user/pbx-configuration/seats"
:label="$t('Seats')"
icon="person"
/>
<q-breadcrumbs-el
key="seat"
:label="seatSelected.display_name"
/>
</q-breadcrumbs>
</template>
<q-item
class="col col-xs-12 col-md-6"
>
<q-list
v-if="changes"
class="col"
side
top
no-wrap
>
<csc-change-password-dialog
ref="changePasswordDialog"
@change-password="changeWebPassword({ password: $event.password })"
/>
<q-input
v-model="changes.name"
:label="$t('Name')"
:disable="isLoading"
@keyup.enter="save"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasNameChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasNameChanged"
@click.stop="resetName"
/>
</template>
</q-input>
<q-input
v-model="changes.extension"
hide-hint
:error="$v.changes.extension.$error"
:error-message="extensionErrorMessage"
:label="$t('Extension')"
:hint="getExtensionHint"
:disable="isLoading"
@keyup.enter="save"
@input="$v.changes.extension.$touch"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasExtensionChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasExtensionChanged"
@click.stop="resetExtension"
/>
</template>
</q-input>
<q-input
readonly
disable
:label="$t('Primary Number')"
:value="getPrimaryNumber"
/>
<q-select
v-model="changes.aliasNumbers"
use-chips
multiple
emit-value
map-options
:options="getNumberOptions"
:disable="isLoading"
:label="$t('Alias Numbers')"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasAliasNumbersChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasAliasNumbersChanged"
@click.stop="resetAliasNumbers"
/>
</template>
</q-select>
<q-select
v-model="changes.groups"
use-chips
multiple
emit-value
map-options
:disable="isLoading"
:options="getGroupOptions"
:label="$t('Groups')"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasGroupsChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasGroupsChanged"
@click.stop="resetGroups"
/>
</template>
</q-select>
<q-select
v-model="changes.soundSet"
radio
emit-value
map-options
:disable="isLoading"
:options="internalSoundSetOptions"
:label="$t('Sound Set')"
>
<template
v-slot:append
>
<csc-input-button-save
v-if="hasSoundSetChanged"
@click.stop="save"
/>
<csc-input-button-reset
v-if="hasSoundSetChanged"
@click.stop="resetSoundSet"
/>
</template>
</q-select>
<q-toggle
v-model="changes.clirIntrapbx"
class="q-pa-sm"
:label="$t('Hide number within own PBX')"
:disable="isLoading"
@input="changeIntraPbx"
/>
<q-btn
v-if="hasCallQueue(seatSelected.id)"
icon="filter_none"
flat
color="primary"
:label="$t('Call Queue')"
:disable="isLoading"
@click="goToCallQueue"
/>
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
:label="$t('Music on hold')"
:disable="isLoading"
@input="changeMusicOnHold"
/>
</q-list>
</q-item>
</csc-page-sticky>
</template>
<script>
import _ from 'lodash'
import {
showGlobalError,
showToast
} from 'src/helpers/ui'
import {
RequestState
} from 'src/store/common'
import {
mapMutations,
mapState,
mapGetters,
mapActions
} from 'vuex'
import CscInputButtonSave from 'components/form/CscInputButtonSave'
import CscInputButtonReset from 'components/form/CscInputButtonReset'
import CscChangePasswordDialog from 'src/components/CscChangePasswordDialog'
import CscPageSticky from 'src/components/CscPageSticky'
import { between } from 'vuelidate/lib/validators'
import { inRange } from 'src/helpers/validation'
import numberFilter from '../filters/number'
export default {
name: 'CscPagePbxSeatDetails',
components: {
CscInputButtonReset,
CscInputButtonSave,
CscChangePasswordDialog,
CscPageSticky
},
props: {
},
data () {
return {
changes: null,
id: this.$route.params.id,
soundSet: null
}
},
validations: {
changes: {
extension: {
isInRange: function (value) {
return inRange(value, this.getMinAllowedExtension, this.getMaxAllowedExtension, between)
}
}
}
},
computed: {
...mapState('pbxSeats', [
'seatSelected',
'seatUpdateState',
'seatUpdateError'
]),
...mapGetters('pbxSeats', [
'getSoundSetBySeatId',
'hasCallQueue',
'getMusicOnHold',
'getIntraPbx',
'getSeatUpdateToastMessage',
'isSeatLoading'
]),
...mapGetters('pbx', [
'getExtensionHint',
'getMinAllowedExtension',
'getMaxAllowedExtension',
'getSoundSetOptions',
'getGroupOptions',
'getNumberOptions'
]),
getPrimaryNumber () {
return numberFilter(this.seatSelected.primary_number)
},
hasNameChanged () {
return this.changes.name !== this.seatSelected.display_name
},
hasExtensionChanged () {
return this.changes.extension !== this.seatSelected.pbx_extension
},
hasAliasNumbersChanged () {
return !_.isEqual(_.cloneDeep(this.changes.aliasNumbers).sort(), this.getAliasNumberIds().sort())
},
hasGroupsChanged () {
return !_.isEqual(_.cloneDeep(this.changes.groups).sort(), _.cloneDeep(this.seatSelected.pbx_group_ids).sort())
},
hasSoundSetChanged () {
return this.changes.soundSet !== this.getSoundSetId()
},
extensionErrorMessage () {
if (!this.$v.changes.extension.isInRange) {
return this.getExtensionHint
} else {
return ''
}
},
internalSoundSetOptions () {
const items = []
if (this.soundSet) {
items.push({
label: this.soundSet.name,
value: this.soundSet.id
})
}
if (_.isArray(this.getSoundSetOptions)) {
this.getSoundSetOptions.forEach((soundSet) => {
if (this.soundSet && this.soundSet.id !== soundSet.value) {
items.push(soundSet)
} else if (!this.soundSet) {
items.push(soundSet)
}
})
}
return items
},
isLoading () {
return this.isSeatLoading(this.seatSelected.id)
}
},
watch: {
seatSelected () {
this.changes = this.getSeatData()
this.soundSet = this.getSoundSetBySeatId(this.seatSelected.id)
},
seatUpdateState (state) {
if (state === RequestState.succeeded) {
showToast(this.getSeatUpdateToastMessage)
} else if (state === RequestState.failed) {
showGlobalError(this.seatUpdateError, 5000)
}
}
},
mounted () {
this.selectSeat(this.id)
},
beforeDestroy () {
this.resetSelectedSeat()
},
methods: {
...mapActions('pbxSeats', [
'setSeatName',
'setSeatExtension',
'setSeatNumbers',
'setSeatGroups',
'setIntraPbx',
'setMusicOnHold',
'setSeatSoundSet'
]),
...mapActions('pbxCallQueues', [
'jumpToCallQueue'
]),
...mapMutations('pbxSeats', [
'selectSeat',
'resetSelectedSeat'
]),
getAliasNumberIds () {
const numberIds = []
this.seatSelected.alias_numbers.forEach((number) => {
numberIds.push(number.number_id)
})
return numberIds
},
getGroupIds () {
return _.clone(this.seatSelected.pbx_group_ids)
},
getSoundSetId () {
const soundSet = this.getSoundSetBySeatId(this.seatSelected.id)
if (soundSet) {
return soundSet.id
}
return null
},
getSeatData () {
return (this.seatSelected) ? {
name: this.seatSelected.display_name,
extension: this.seatSelected.pbx_extension,
aliasNumbers: this.getAliasNumberIds(),
webPassword: this.seatSelected.webpassword,
clirIntrapbx: this.getIntraPbx(this.seatSelected.id),
musicOnHold: this.getMusicOnHold(this.seatSelected.id),
groups: this.getGroupIds(),
soundSet: this.getSoundSetId()
} : null
},
resetName () {
this.changes.name = this.seatSelected.display_name
},
resetExtension () {
this.changes.extension = this.seatSelected.pbx_extension
},
resetAliasNumbers () {
this.changes.aliasNumbers = this.getAliasNumberIds()
},
resetGroups () {
this.changes.groups = this.getGroupIds()
},
resetSoundSet () {
this.changes.soundSet = this.getSoundSetId()
},
save () {
if (this.hasNameChanged) {
this.setSeatName({
seatId: this.seatSelected.id,
seatName: this.changes.name
})
}
if (this.hasExtensionChanged) {
this.setSeatExtension({
seatId: this.seatSelected.id,
seatExtension: this.changes.extension
})
}
if (this.hasAliasNumbersChanged) {
this.setSeatNumbers({
seatId: this.seatSelected.id,
assignedNumbers: _.difference(this.changes.aliasNumbers, this.getAliasNumberIds()),
unassignedNumbers: _.difference(this.getAliasNumberIds(), this.changes.aliasNumbers)
})
}
if (this.hasGroupsChanged) {
this.setSeatGroups({
seatId: this.seatSelected.id,
groupIds: this.changes.groups
})
}
if (this.hasSoundSetChanged) {
this.setSeatSoundSet({
seatId: this.seatSelected.id,
soundSetId: this.changes.soundSet
})
}
},
changeIntraPbx () {
this.setIntraPbx( {
seatId: this.seatSelected.id,
intraPbx: this.changes.clirIntrapbx
})
},
async changeMusicOnHold () {
try {
this.setMusicOnHold({
seatId: this.seatSelected.id,
musicOnHold: this.changes.musicOnHold
})
} catch (err) {
showGlobalError(err?.message || this.$t('Unknown error'))
this.changes.musicOnHold = !this.changes.musicOnHold
}
},
goToCallQueue () {
this.jumpToCallQueue(this.seatSelected)
},
}
}
</script>

@ -79,25 +79,10 @@
:intra-pbx="getIntraPbx(seat.id)"
:music-on-hold="getMusicOnHold(seat.id)"
:groups="groupMapById"
:expanded="isSeatExpanded(seat.id)"
:loading="isSeatLoading(seat.id)"
:alias-number-options="getNumberOptions"
:group-options="getGroupOptions"
:sound-set-options="getSoundSetOptions"
:sound-set="getSoundSetBySeatId(seat.id)"
:label-width="4"
:has-call-queue="hasCallQueue(seat.id)"
@expand="expandSeat(seat.id)"
@collapse="collapseSeat(seat.id)"
@remove="openSeatRemovalDialog(seat.id)"
@save-name="setSeatName"
@save-extension="setSeatExtension"
@save-alias-numbers="setSeatNumbers"
@save-groups="setSeatGroups"
@save-sound-set="setSeatSoundSet"
@save-intra-pbx="setIntraPbx"
@save-music-on-hold="setMusicOnHold"
@jump-to-call-queue="jumpToCallQueue"
/>
</q-list>
<div
@ -188,19 +173,13 @@ export default {
'isSeatCreating',
'isSeatUpdating',
'isSeatRemoving',
'isSeatExpanded',
'isSeatLoading',
'getIntraPbx',
'getMusicOnHold',
'getSoundSetBySeatId',
'getSeatCreatingName',
'getSeatUpdatingField',
'getSeatRemovingName',
'getSeatRemoveDialogMessage',
'getSeatCreationToastMessage',
'getSeatUpdateToastMessage',
'getSeatRemovalToastMessage',
'hasCallQueue'
'getSeatUpdateToastMessage'
])
},
watch: {
@ -239,25 +218,15 @@ export default {
'loadSeatListItems',
'createSeat',
'removeSeat',
'setSeatName',
'setSeatExtension',
'setSeatGroups',
'setSeatNumbers',
'setSeatSoundSet',
'setIntraPbx',
'setMusicOnHold'
]),
...mapMutations('pbxSeats', [
'enableSeatAddForm',
'disableSeatAddForm',
'expandSeat',
'collapseSeat',
'seatRemovalRequesting',
'seatRemovalCanceled'
]),
...mapActions('pbxCallQueues', [
'jumpToCallQueue'
]),
resetSeatAddForm () {
if (this.$refs.addForm) {
this.$refs.addForm.reset()

@ -14,6 +14,7 @@ import CscPageReminder from 'src/pages/CscPageReminder'
import CscPageSpeedDial from 'src/pages/CscPageSpeedDial'
import CscPagePbxGroups from 'src/pages/CscPagePbxGroups'
import CscPagePbxSeats from 'src/pages/CscPagePbxSeats'
import CscPagePbxSeatDetails from 'src/pages/CscPagePbxSeatDetails'
import CscPagePbxDevices from 'src/pages/CscPagePbxDevices'
import CscPagePbxCallQueues from 'src/pages/CscPagePbxCallQueues'
import CscPagePbxSoundSets from 'src/pages/CscPagePbxSoundSets'
@ -189,6 +190,18 @@ export default function routes (app) {
}
}
},
{
path: 'pbx-configuration/seat/:id',
component: CscPagePbxSeatDetails,
meta: {
get title () {
return i18n.t('PBX Configuration')
},
get subtitle () {
return i18n.t('Seats')
}
}
},
{
path: 'pbx-configuration/devices',
component: CscPagePbxDevices,

@ -66,11 +66,6 @@ export default {
isSeatCreating (state) {
return state.seatCreationState === CreationState.creating
},
isSeatExpanded (state) {
return (id) => {
return state.seatSelected !== null && state.seatSelected.id === id
}
},
isSeatRemoving (state) {
return state.seatRemovalState === RequestState.requesting
},
@ -240,10 +235,10 @@ export default {
state.seatRemovalState = RequestState.failed
state.seatRemovalError = err
},
expandSeat (state, seatId) {
selectSeat (state, seatId) {
state.seatSelected = state.seatMapById[seatId]
},
collapseSeat (state) {
resetSelectedSeat (state) {
state.seatSelected = null
},
enableSeatAddForm (state) {
@ -399,13 +394,7 @@ export default {
assignedNumbers: options.assignedNumbers,
unassignedNumbers: options.unassignedNumbers
}).then((result) => {
if (options.assignedNumbers.length > 0) {
return context.dispatch('loadSeatListItems', {
clearList: false
})
} else {
return Promise.resolve(result)
}
return Promise.resolve(result)
}).then((result) => {
context.commit('seatUpdateSucceeded', result)
}).catch((err) => {

Loading…
Cancel
Save