|
|
@ -25,6 +25,7 @@ export default {
|
|
|
|
group.customerId = context.state.pilot.customer_id;
|
|
|
|
group.customerId = context.state.pilot.customer_id;
|
|
|
|
group.domainId = context.state.pilot.domain_id;
|
|
|
|
group.domainId = context.state.pilot.domain_id;
|
|
|
|
context.commit('addItemRequesting', group);
|
|
|
|
context.commit('addItemRequesting', group);
|
|
|
|
|
|
|
|
context.commit('lastAddedGroup', group.name);
|
|
|
|
addGroup(group).then(()=>{
|
|
|
|
addGroup(group).then(()=>{
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
@ -35,6 +36,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setGroupName(context, group) {
|
|
|
|
setGroupName(context, group) {
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
|
|
|
|
context.commit('lastUpdatedField', {name: group.name, type: 'group name'});
|
|
|
|
setGroupName(group.id, group.name).then(() => {
|
|
|
|
setGroupName(group.id, group.name).then(() => {
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
@ -45,6 +47,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setGroupExtension(context, group) {
|
|
|
|
setGroupExtension(context, group) {
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
|
|
|
|
context.commit('lastUpdatedField', {name: group.extension, type: 'group extension'});
|
|
|
|
setGroupExtension(group.id, group.extension).then(()=>{
|
|
|
|
setGroupExtension(group.id, group.extension).then(()=>{
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
@ -55,6 +58,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setGroupHuntPolicy(context, group) {
|
|
|
|
setGroupHuntPolicy(context, group) {
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
|
|
|
|
context.commit('lastUpdatedField', {name: group.huntPolicy + " ringing", type: 'group hunt policy'});
|
|
|
|
setGroupHuntPolicy(group.id, group.huntPolicy).then(() => {
|
|
|
|
setGroupHuntPolicy(group.id, group.huntPolicy).then(() => {
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
@ -65,6 +69,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setGroupHuntTimeout(context, group) {
|
|
|
|
setGroupHuntTimeout(context, group) {
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
|
|
|
|
context.commit('lastUpdatedField', {name: group.huntTimeout + " seconds", type: 'group hunt timeout'});
|
|
|
|
setGroupHuntTimeout(group.id, group.huntTimeout).then(()=>{
|
|
|
|
setGroupHuntTimeout(group.id, group.huntTimeout).then(()=>{
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
@ -74,30 +79,31 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
updateAliasNumbers(context, data) {
|
|
|
|
updateAliasNumbers(context, data) {
|
|
|
|
context.commit('updateItemRequesting', data.item);
|
|
|
|
context.commit('updateAliasNumbersRequesting', data.item);
|
|
|
|
Promise.all([
|
|
|
|
Promise.all([
|
|
|
|
assignNumbers(data.add, data.item.id),
|
|
|
|
assignNumbers(data.add, data.item.id),
|
|
|
|
assignNumbers(data.remove, context.getters.pilotId)
|
|
|
|
assignNumbers(data.remove, context.getters.pilotId)
|
|
|
|
]).then(()=>{
|
|
|
|
]).then(()=>{
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
|
context.commit('updateItemSucceeded');
|
|
|
|
context.commit('updateAliasNumbersSucceeded');
|
|
|
|
}).catch((err)=>{
|
|
|
|
}).catch((err)=>{
|
|
|
|
context.commit('updateItemFailed', err.message);
|
|
|
|
context.commit('updateAliasNumbersFailed', err.message);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
updateSeats(context, group) {
|
|
|
|
updateSeats(context, group) {
|
|
|
|
context.commit('updateItemRequesting', group);
|
|
|
|
context.commit('updateGroupsAndSeatsRequesting', group);
|
|
|
|
updateGroupSeats(group.id, group.seats).then(()=>{
|
|
|
|
updateGroupSeats(group.id, group.seats).then(()=>{
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
context.commit('updateItemSucceeded');
|
|
|
|
context.commit('updateGroupsAndSeatsSucceeded');
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
context.commit('updateItemFailed', err.message);
|
|
|
|
context.commit('updateGroupsAndSeatsFailed', err.message);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removeGroup(context, group) {
|
|
|
|
removeGroup(context, group) {
|
|
|
|
context.commit('removeItemRequesting', group);
|
|
|
|
context.commit('removeItemRequesting', group);
|
|
|
|
|
|
|
|
context.commit('lastRemovedGroup', group.name);
|
|
|
|
removeGroup(group.id).then(()=>{
|
|
|
|
removeGroup(group.id).then(()=>{
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
return context.dispatch('listGroups', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
@ -124,6 +130,7 @@ export default {
|
|
|
|
seat.customerId = context.state.pilot.customer_id;
|
|
|
|
seat.customerId = context.state.pilot.customer_id;
|
|
|
|
seat.domainId = context.state.pilot.domain_id;
|
|
|
|
seat.domainId = context.state.pilot.domain_id;
|
|
|
|
context.commit('addItemRequesting', seat);
|
|
|
|
context.commit('addItemRequesting', seat);
|
|
|
|
|
|
|
|
context.commit('lastAddedSeat', seat.name);
|
|
|
|
addSeat(seat).then(()=>{
|
|
|
|
addSeat(seat).then(()=>{
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
@ -134,6 +141,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setSeatName(context, seat) {
|
|
|
|
setSeatName(context, seat) {
|
|
|
|
context.commit('updateItemRequesting', seat);
|
|
|
|
context.commit('updateItemRequesting', seat);
|
|
|
|
|
|
|
|
context.commit('lastUpdatedField', {name: seat.name, type: 'seat name'});
|
|
|
|
setSeatName(seat.id, seat.name).then(() => {
|
|
|
|
setSeatName(seat.id, seat.name).then(() => {
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
@ -144,6 +152,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setSeatExtension(context, seat) {
|
|
|
|
setSeatExtension(context, seat) {
|
|
|
|
context.commit('updateItemRequesting', seat);
|
|
|
|
context.commit('updateItemRequesting', seat);
|
|
|
|
|
|
|
|
context.commit('lastUpdatedField', {name: seat.extension, type: 'seat extension'});
|
|
|
|
setSeatExtension(seat.id, seat.extension).then(()=>{
|
|
|
|
setSeatExtension(seat.id, seat.extension).then(()=>{
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
@ -153,17 +162,18 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
updateGroups(context, seat) {
|
|
|
|
updateGroups(context, seat) {
|
|
|
|
context.commit('updateItemRequesting', seat);
|
|
|
|
context.commit('updateGroupsAndSeatsRequesting', seat);
|
|
|
|
updateSeatGroups(seat.id, seat.groups).then(()=>{
|
|
|
|
updateSeatGroups(seat.id, seat.groups).then(()=>{
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
context.commit('updateItemSucceeded');
|
|
|
|
context.commit('updateGroupsAndSeatsSucceeded');
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
context.commit('updateItemFailed', err.message);
|
|
|
|
context.commit('updateGroupsAndSeatsFailed', err.message);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removeSeat(context, seat) {
|
|
|
|
removeSeat(context, seat) {
|
|
|
|
context.commit('removeItemRequesting', seat);
|
|
|
|
context.commit('removeItemRequesting', seat);
|
|
|
|
|
|
|
|
context.commit('lastRemovedSeat', seat.name);
|
|
|
|
removeSeat(seat.id).then(()=>{
|
|
|
|
removeSeat(seat.id).then(()=>{
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
return context.dispatch('listSeats', true);
|
|
|
|
}).then(()=>{
|
|
|
|
}).then(()=>{
|
|
|
|