TT#88205 CSC: As a PbxAdmin, I want to toggle visibility of the number towards the callee for each PbxSeat

√ Can toggle the setting "clir_intrapbx" by a Quasar toggle button
√ Can see a success toast for both cases (on/off)

Change-Id: I4c29d2cc59dade6b925403d9454bf589ef5ac674
mr9.0.1
Carlo Venusino 5 years ago
parent e5b8339f7e
commit 38e158ea14

@ -7,7 +7,8 @@ import {
setPbxExtension,
setPbxWebPassword,
setPbxGroupIds,
setSubscriberNumbers
setSubscriberNumbers,
setPreferenceIntraPbx
} from "./subscriber";
import _ from "lodash";
import {
@ -120,6 +121,7 @@ export function createSeat(seat) {
});
}).then(($subscriberId)=>{
subscriberId = $subscriberId;
setSeatIntraPbx(subscriberId, seat.clirIntrapbx);
if(seat.soundSet !== null && seat.soundSet !== void(0)) {
return getSoundSet(seat.soundSet);
}
@ -212,6 +214,14 @@ export function setSeatWebPassword(options) {
});
}
/**
* @param seatId
* @param clirIntrapbx
*/
export function setSeatIntraPbx(seatId, clirIntrapbx) {
return setPreferenceIntraPbx(seatId, clirIntrapbx);
}
/**
* @param options
* @param options.seatId

@ -310,6 +310,10 @@ export function setPbxGroupIds(id, ids) {
return setField(id, 'pbx_group_ids', ids);
}
export function setPreferenceIntraPbx(id, value) {
return setPreference(id, 'clir_intrapbx', value);
}
export function getSubscribers(options) {
return new Promise((resolve, reject)=>{
options = options || {};

@ -234,6 +234,16 @@
/>
</csc-fade>
</q-field>
<q-field
:labelWidth="labelWidth"
:label="$t('pbxConfig.toggleIntraPbx')"
dark
>
<q-toggle
v-model="changes.clirIntrapbx"
@change="changeIntraPbx"
/>
</q-field>
<q-field
v-if="hasCallQueue"
:labelWidth="labelWidth"
@ -268,7 +278,8 @@
QItemTile,
QTransition,
QList,
QSlideTransition
QSlideTransition,
QToggle
} from 'quasar-framework'
import CscListItem from "../../CscListItem";
import CscListItemTitle from "../../CscListItemTitle";
@ -284,6 +295,7 @@
name: 'csc-pbx-seat',
props: [
'seat',
'intraPbx',
'groups',
'soundSet',
'expanded',
@ -320,6 +332,7 @@
QItemTile,
QTransition,
QList,
QToggle,
CscFormSaveButton,
CscFormResetButton,
CscChangePasswordDialog
@ -370,6 +383,7 @@
extension: this.seat.pbx_extension,
aliasNumbers: this.getAliasNumberIds(),
webPassword: this.seat.webpassword,
clirIntrapbx: this.intraPbx,
groups: this.getGroupIds(),
soundSet: this.getSoundSetId()
};
@ -458,6 +472,12 @@
seatWebPassword: data.password
});
this.$refs.changePasswordDialog.close();
},
changeIntraPbx(){
this.$emit('save-intra-pbx', {
seatId: this.seat.id,
intraPbx: this.changes.clirIntrapbx
});
}
},
watch: {

@ -70,6 +70,14 @@
:options="soundSetOptions"
/>
</q-field>
<q-field>
<q-toggle
v-model="data.clirIntrapbx"
dense
:label="$t('pbxConfig.toggleIntraPbx')"
:disable="loading"
/>
</q-field>
<div class="csc-form-actions row justify-center">
<q-btn
flat
@ -111,6 +119,7 @@
QField,
QInput,
QSelect,
QToggle,
QIcon,
QTooltip
} from 'quasar-framework'
@ -133,6 +142,7 @@
QField,
QInput,
QSelect,
QToggle,
QIcon,
QTooltip
},
@ -214,7 +224,8 @@
webPassword: this.data.webPassword,
aliasNumbers: this.data.aliasNumbers,
groups: this.data.groups,
soundSet: this.data.soundSet
soundSet: this.data.soundSet,
clirIntrapbx: this.data.clirIntrapbx
}
}
},
@ -226,7 +237,8 @@
webPassword: '',
aliasNumbers: [],
groups: [],
soundSet: null
soundSet: null,
clirIntrapbx: false
}
},
cancel() {

@ -57,6 +57,7 @@
:key="seat.id"
:odd="(index % 2) === 0"
:seat="seat"
:intra-pbx="getIntraPbx(seat.id)"
:groups="groupMapById"
:expanded="isSeatExpanded(seat.id)"
:loading="isSeatLoading(seat.id)"
@ -74,6 +75,7 @@
@save-alias-numbers="setSeatNumbers"
@save-groups="setSeatGroups"
@save-sound-set="setSeatSoundSet"
@save-intra-pbx="setIntraPbx"
@jump-to-call-queue="jumpToCallQueue"
/>
</csc-fade>
@ -193,6 +195,7 @@
'isSeatRemoving',
'isSeatExpanded',
'isSeatLoading',
'getIntraPbx',
'getSoundSetBySeatId',
'getSeatCreatingName',
'getSeatUpdatingField',
@ -213,7 +216,8 @@
'setSeatExtension',
'setSeatGroups',
'setSeatNumbers',
'setSeatSoundSet'
'setSeatSoundSet',
'setIntraPbx'
]),
...mapMutations('pbxSeats', [
'enableSeatAddForm',

@ -577,7 +577,9 @@
"msConfigCreationToast": "Created manager secretary config for {msConfig} successfully",
"msConfigUpdateToast": "Updated {field} for manager secretary config {msConfig} successfully",
"msConfigRemovalToast": "Removed manager secretary config for {msConfig} successfully",
"noMsConfigs": "No manager secretary configuration created yet"
"noMsConfigs": "No manager secretary configuration created yet",
"toggleIntraPbx": "Hide number within own PBX",
"intraPbx": "the visibility of the number within own PBX"
},
"callBlocking": {
"privacyEnabledToast": "Your number is hidden to the callee",

@ -18,6 +18,7 @@ import {
setSeatGroups,
setSeatNumbers,
setSeatSoundSet,
setSeatIntraPbx,
setSeatWebPassword
} from "../api/pbx-seats";
@ -89,6 +90,12 @@ export default {
return null;
}
},
getIntraPbx(state) {
return (id)=>{
const seatPreferences = state.preferenceMapById[id];
return seatPreferences && seatPreferences.clir_intrapbx ? state.preferenceMapById[id].clir_intrapbx : false;
};
},
getSeatCreatingName(state) {
return _.get(state, 'seatCreating.name', '');
},
@ -387,6 +394,19 @@ export default {
}).catch((err)=>{
context.commit('seatUpdateFailed', err.message);
});
},
async setIntraPbx(context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: i18n.t('pbxConfig.intraPbx')
});
try{
const result = await setSeatIntraPbx(options.seatId, options.intraPbx);
context.commit('seatUpdateSucceeded', result);
}
catch(err){
context.commit('seatUpdateFailed', err.message);
}
}
}
};

Loading…
Cancel
Save