MT#58240 there is no possibility to delete phonebook entries

Change-Id: I4fe1064c890a3b4c2c74a39bb9d816fc3b109f80
mr12.0
Author: Nouhaila Idrissi Zouggari 2 years ago committed by Nouhaila Idrissi-Zouggari
parent 3aef140153
commit e10c3563d8

@ -10,6 +10,7 @@
"Add ACL": "Add ACL",
"Add Config": "Add Config",
"Add Group": "Add Group",
"Add Phonebook": "Add Phonebook",
"Add Seat": "Add Seat",
"Add Sound Set": "Add Sound Set",
"Add Speed Dial": "Add Speed Dial",
@ -36,6 +37,7 @@
"Allocated by {type} {name}": "Allocated by {type} {name}",
"Allow mail2fax destination only to this number.": "Allow mail2fax destination only to this number.",
"Allow mail2fax emails only to this IP (the IP or hostname is present in the \"Received\" header).": "Allow mail2fax emails only to this IP (the IP or hostname is present in the \"Received\" header).",
"Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).",
"Allowed extensions are between {min} and {max}": "Allowed extensions are between {min} and {max}",
"Always": "Always",
"An error occured while trying to assign the speed dial slot. Please try again": "An error occured while trying to assign the speed dial slot. Please try again",
@ -84,6 +86,7 @@
"Change Password": "Change Password",
"Change SIP Password": "Change SIP Password",
"Change Web Password": "Change Web Password",
"Change login Password": "Change login Password",
"Change login password": "Change login password",
"Change password": "Change password",
"Changed PIN successfully.": "Changed PIN successfully.",
@ -131,6 +134,7 @@
"Delete recording": "Delete recording",
"Delete registered device": "Delete registered device",
"Delete slot?": "Delete slot?",
"Delete subscriber phonebook": "Delete subscriber phonebook",
"Delete voicemail after email notification is delivered": "Delete voicemail after email notification is delivered",
"Deliver Incoming Faxes": "Deliver Incoming Faxes",
"Deliver Outgoing Faxes": "Deliver Outgoing Faxes",
@ -154,6 +158,8 @@
"Email": "Email",
"Enable": "Enable",
"Enable regex matching for \"Received from IP\" and \"Destination\" fields.": "Enable regex matching for \"Received from IP\" and \"Destination\" fields.",
"Enable regex matching for "Received from IP" and "Destination" fields.": "Enable regex matching for "Received from IP" and "Destination" fields.",
"Enable regex matching for \\\"Received from IP\\\" and \\\"Destination\\\" fields.": "Enable regex matching for \\\"Received from IP\\\" and \\\"Destination\\\" fields.",
"Enable strict mode that requires all mail2fax emails to have the secret key as the very first line of the email + an empty line. The key is removed from the email once matched.": "Enable strict mode that requires all mail2fax emails to have the secret key as the very first line of the email + an empty line. The key is removed from the email once matched.",
"End time": "End time",
"English": "English",
@ -257,6 +263,8 @@
"N/A": "N/A",
"Name": "Name",
"Name in Fax Header for Sendfax": "Name in Fax Header for Sendfax",
"Ncos": "Ncos",
"Ncos Set": "Ncos Set",
"Never": "Never",
"New SIP Password": "New SIP Password",
"New SIP Password confirm": "New SIP Password confirm",
@ -345,6 +353,7 @@
"Remove": "Remove",
"Remove ACL": "Remove ACL",
"Remove Destination": "Remove Destination",
"Remove Fax": "Remove Fax",
"Remove Voicemail": "Remove Voicemail",
"Remove call queue": "Remove call queue",
"Remove device": "Remove device",
@ -431,6 +440,7 @@
"Station name": "Station name",
"Su": "Su",
"Subscriber": "Subscriber",
"Subscriber Phonebook": "Subscriber Phonebook",
"Subscriber Sign In": "Subscriber Sign In",
"Sunday": "Sunday",
"Super": "Super",
@ -504,6 +514,7 @@
"You are about to delete slot {slot}": "You are about to delete slot {slot}",
"You are about to delete this destination": "You are about to delete this destination",
"You are about to delete this forwarding": "You are about to delete this forwarding",
"You are about to delete this phonebook": "You are about to delete this phonebook",
"You are about to delete this registered device": "You are about to delete this registered device",
"You are about to delete time range \"{from} - {to}\"": "You are about to delete time range \"{from} - {to}\"",
"You are about to remove ACL: From email <{from_email}>": "You are about to remove ACL: From email <{from_email}>",
@ -517,6 +528,7 @@
"You are about to remove sound set {soundSetName}": "You are about to remove sound set {soundSetName}",
"You are about to remove the number {number}": "You are about to remove the number {number}",
"You are about to remove the speed dial {slot}": "You are about to remove the speed dial {slot}",
"You are about to remove this Fax": "You are about to remove this Fax",
"You are about to remove this Voicemail": "You are about to remove this Voicemail",
"You are about to reset the custom {type} greeting sound to defaults": "You are about to reset the custom {type} greeting sound to defaults",
"You are now able to start and receive calls": "You are now able to start and receive calls",

@ -50,6 +50,7 @@
<td>
<q-toggle
:model-value="row.shared"
@update:model-value="toggleShared(row)"
/>
</td>
</template>
@ -68,6 +69,12 @@
:label="$t('Edit')"
@click="showPhonebookDetails(row)"
/>
<csc-popup-menu-item
icon="delete"
color="negative"
:label="$t('Delete')"
@click="deleteRow(row)"
/>
</csc-more-menu>
</td>
</template>
@ -159,7 +166,9 @@ export default {
},
methods: {
...mapWaitingActions('user', {
loadSubscriberPhonebook: 'loadSubscriberPhonebook'
loadSubscriberPhonebook: 'loadSubscriberPhonebook',
removeSubscriberPhonebook: 'removeSubscriberPhonebook',
updateValueShared: 'updateValueShared'
}),
async refresh () {
await this.fetchPaginatedRegistrations({
@ -188,6 +197,21 @@ export default {
path: '/user/home',
query: { number: row.number }
})
},
async deleteRow (row) {
this.$q.dialog({
title: this.$t('Delete subscriber phonebook'),
message: this.$t('You are about to delete this phonebook'),
color: 'negative',
cancel: true,
persistent: true
}).onOk(async data => {
await this.removeSubscriberPhonebook(row)
await this.refresh()
})
},
async toggleShared (row) {
await this.updateValueShared(row)
}
}
}

@ -297,6 +297,12 @@ export default {
},
setQrExpiringTime (state, qrExpiringTime) {
state.qrExpiringTime = qrExpiringTime
},
setPhonebookShared (state, { id, value }) {
const index = state.subscriberPhonebook.findIndex(row => row.id === id)
if (index > -1) {
state.subscriberPhonebook[index].shared = value
}
}
},
actions: {
@ -430,6 +436,9 @@ export default {
async removeSubscriberRegistration (context, row) {
await httpApi.delete('api/subscriberregistrations/' + row.id)
},
async removeSubscriberPhonebook (context, row) {
await httpApi.delete('api/phonebookentries/' + row.id)
},
async getNcosLevelsSubscriber () {
const ncosLevel = []
const list = await getNcosLevels()
@ -472,6 +481,10 @@ export default {
async getValueShared (context, options) {
await setValueShared(options.phonebookId, options.shared)
},
async updateValueShared (context, row) {
context.commit('setPhonebookShared', { id: row.id, value: !row.shared })
await setValueShared(row.id, row.shared)
},
async getValueName (context, options) {
await setValueName(options.phonebookId, options.name)
},

Loading…
Cancel
Save