What has been done: - TT#31190, CallForwarding: Create store mutation unit test - TT#31188, CallForwarding: Implement API requests - TT#31189, CallForwarding: Implement store - TT#31174, CallForwarding: Implement vue component Change-Id: I79557be8c8cea4b8014e25afab213b8ab4d4acb8changes/20/18720/3
parent
cefb66b549
commit
fcbd7f64ef
@ -1,106 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<csc-page :title="$t('pages.callForward.titles.always')">
|
<csc-page :title="$t('pages.callForward.titles.always')">
|
||||||
<q-card class="dest-card">
|
<csc-call-forward timeset="null" :destinations="destinations">
|
||||||
<csc-destinations :title="$t('pages.callForward.whenOnline')"
|
</csc-call-forward>
|
||||||
:group="destinations.online"
|
|
||||||
group-name="cfu"
|
|
||||||
timeset="null"
|
|
||||||
icon="signal_wifi_4_bar">
|
|
||||||
</csc-destinations>
|
|
||||||
<csc-destinations :title="$t('pages.callForward.whenBusy')"
|
|
||||||
:group="destinations.busy"
|
|
||||||
group-name="cfb"
|
|
||||||
timeset="null"
|
|
||||||
icon="record_voice_over">
|
|
||||||
</csc-destinations>
|
|
||||||
<csc-destinations :title="$t('pages.callForward.whenOffline')"
|
|
||||||
:group="destinations.offline"
|
|
||||||
group-name="cfna"
|
|
||||||
timeset="null"
|
|
||||||
icon="signal_wifi_off">
|
|
||||||
</csc-destinations>
|
|
||||||
</q-card>
|
|
||||||
</csc-page>
|
</csc-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import numberFormat from '../../../filters/number-format'
|
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import { startLoading, stopLoading,
|
|
||||||
showGlobalError, showToast } from '../../../helpers/ui'
|
|
||||||
import CscPage from '../../CscPage'
|
import CscPage from '../../CscPage'
|
||||||
import CscDestinations from './CscDestinations'
|
import CscCallForward from './CscCallForward'
|
||||||
import { QCard } from 'quasar-framework'
|
|
||||||
export default {
|
export default {
|
||||||
created() {
|
|
||||||
this.$store.dispatch('callForward/loadAlwaysEverybodyDestinations');
|
|
||||||
},
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
QCard,
|
|
||||||
CscPage,
|
CscPage,
|
||||||
CscDestinations
|
CscCallForward
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.$store.dispatch('callForward/loadAlwaysEverybodyDestinations');
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('callForward', {
|
...mapState('callForward', {
|
||||||
removeDestinationState: 'removeDestinationState',
|
destinations: 'alwaysEverybodyDestinations'
|
||||||
addDestinationState: 'addDestinationState',
|
|
||||||
changeDestinationState: 'changeDestinationState',
|
|
||||||
destinations: 'alwaysEverybodyDestinations',
|
|
||||||
lastRemovedDestination: 'lastRemovedDestination',
|
|
||||||
lastAddedDestination: 'lastAddedDestination',
|
|
||||||
addDestinationError(state) {
|
|
||||||
return state.addDestinationError ||
|
|
||||||
this.$t('pages.callForward.addErrorMessage');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
removeDestinationState(state) {
|
|
||||||
if (state === 'requesting') {
|
|
||||||
startLoading();
|
|
||||||
} else if (state === 'failed') {
|
|
||||||
stopLoading();
|
|
||||||
showGlobalError(this.removeDestinationError);
|
|
||||||
} else if (state === 'succeeded') {
|
|
||||||
stopLoading();
|
|
||||||
showToast(this.$t('pages.callForward.removeSuccessMessage', {
|
|
||||||
destination: this.lastRemovedDestination
|
|
||||||
}));
|
|
||||||
this.$store.dispatch('callForward/loadAlwaysEverybodyDestinations');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addDestinationState(state) {
|
|
||||||
if (state === 'requesting') {
|
|
||||||
startLoading();
|
|
||||||
} else if (state === 'failed') {
|
|
||||||
stopLoading();
|
|
||||||
showGlobalError(this.addDestinationError);
|
|
||||||
} else if (state === 'succeeded') {
|
|
||||||
stopLoading();
|
|
||||||
showToast(this.$t('pages.callForward.addDestinationSuccessMessage', {
|
|
||||||
destination: this.lastAddedDestination
|
|
||||||
}));
|
|
||||||
this.$store.dispatch('callForward/loadAlwaysEverybodyDestinations');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeDestinationState(state) {
|
|
||||||
if (state === 'requesting') {
|
|
||||||
startLoading();
|
|
||||||
} else if (state === 'failed') {
|
|
||||||
stopLoading();
|
|
||||||
showGlobalError(this.changeDestinationError);
|
|
||||||
} else if (state === 'succeeded') {
|
|
||||||
stopLoading();
|
|
||||||
this.$store.dispatch('callForward/loadAlwaysEverybodyDestinations');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus">
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,106 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<csc-page :title="$t('pages.callForward.titles.companyHours')">
|
<csc-page :title="$t('pages.callForward.titles.companyHours')">
|
||||||
<q-card class="dest-card">
|
<csc-call-forward timeset="Company Hours" :destinations="destinations">
|
||||||
<csc-destinations :title="$t('pages.callForward.whenOnline')"
|
</csc-call-forward>
|
||||||
:group="destinations.online"
|
|
||||||
group-name="cfu"
|
|
||||||
timeset="Company Hours"
|
|
||||||
icon="signal_wifi_4_bar">
|
|
||||||
</csc-destinations>
|
|
||||||
<csc-destinations :title="$t('pages.callForward.whenBusy')"
|
|
||||||
:group="destinations.busy"
|
|
||||||
group-name="cfb"
|
|
||||||
timeset="Company Hours"
|
|
||||||
icon="record_voice_over">
|
|
||||||
</csc-destinations>
|
|
||||||
<csc-destinations :title="$t('pages.callForward.whenOffline')"
|
|
||||||
:group="destinations.offline"
|
|
||||||
group-name="cfna"
|
|
||||||
timeset="Company Hours"
|
|
||||||
icon="signal_wifi_off">
|
|
||||||
</csc-destinations>
|
|
||||||
</q-card>
|
|
||||||
</csc-page>
|
</csc-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import numberFormat from '../../../filters/number-format'
|
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import { startLoading, stopLoading,
|
|
||||||
showGlobalError, showToast } from '../../../helpers/ui'
|
|
||||||
import CscPage from '../../CscPage'
|
import CscPage from '../../CscPage'
|
||||||
import CscDestinations from './CscDestinations'
|
import CscCallForward from './CscCallForward'
|
||||||
import { QCard } from 'quasar-framework'
|
|
||||||
export default {
|
export default {
|
||||||
created() {
|
|
||||||
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
|
||||||
},
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
QCard,
|
|
||||||
CscPage,
|
CscPage,
|
||||||
CscDestinations
|
CscCallForward
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('callForward', {
|
...mapState('callForward', {
|
||||||
removeDestinationState: 'removeDestinationState',
|
destinations: 'companyHoursEverybodyDestinations'
|
||||||
addDestinationState: 'addDestinationState',
|
|
||||||
changeDestinationState: 'changeDestinationState',
|
|
||||||
destinations: 'companyHoursEverybodyDestinations',
|
|
||||||
lastRemovedDestination: 'lastRemovedDestination',
|
|
||||||
lastAddedDestination: 'lastAddedDestination',
|
|
||||||
addDestinationError(state) {
|
|
||||||
return state.addDestinationError ||
|
|
||||||
this.$t('pages.callForward.addErrorMessage');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
removeDestinationState(state) {
|
|
||||||
if (state === 'requesting') {
|
|
||||||
startLoading();
|
|
||||||
} else if (state === 'failed') {
|
|
||||||
stopLoading();
|
|
||||||
showGlobalError(this.removeDestinationError);
|
|
||||||
} else if (state === 'succeeded') {
|
|
||||||
stopLoading();
|
|
||||||
showToast(this.$t('pages.callForward.removeSuccessMessage', {
|
|
||||||
destination: this.lastRemovedDestination
|
|
||||||
}));
|
|
||||||
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addDestinationState(state) {
|
|
||||||
if (state === 'requesting') {
|
|
||||||
startLoading();
|
|
||||||
} else if (state === 'failed') {
|
|
||||||
stopLoading();
|
|
||||||
showGlobalError(this.addDestinationError);
|
|
||||||
} else if (state === 'succeeded') {
|
|
||||||
stopLoading();
|
|
||||||
showToast(this.$t('pages.callForward.addDestinationSuccessMessage', {
|
|
||||||
destination: this.lastAddedDestination
|
|
||||||
}));
|
|
||||||
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeDestinationState(state) {
|
|
||||||
if (state === 'requesting') {
|
|
||||||
startLoading();
|
|
||||||
} else if (state === 'failed') {
|
|
||||||
stopLoading();
|
|
||||||
showGlobalError(this.changeDestinationError);
|
|
||||||
} else if (state === 'succeeded') {
|
|
||||||
stopLoading();
|
|
||||||
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus">
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
@ -0,0 +1,114 @@
|
|||||||
|
<template>
|
||||||
|
<q-card class="dest-card">
|
||||||
|
<csc-destinations :title="$t('pages.callForward.whenOnline')"
|
||||||
|
:group="destinations.online"
|
||||||
|
group-name="cfu"
|
||||||
|
:timeset="timeset"
|
||||||
|
icon="signal_wifi_4_bar">
|
||||||
|
</csc-destinations>
|
||||||
|
<csc-destinations :title="$t('pages.callForward.whenBusy')"
|
||||||
|
:group="destinations.busy"
|
||||||
|
group-name="cfb"
|
||||||
|
:timeset="timeset"
|
||||||
|
icon="record_voice_over">
|
||||||
|
</csc-destinations>
|
||||||
|
<csc-destinations :title="$t('pages.callForward.whenOffline')"
|
||||||
|
:group="destinations.offline"
|
||||||
|
group-name="cfna"
|
||||||
|
:timeset="timeset"
|
||||||
|
icon="signal_wifi_off">
|
||||||
|
</csc-destinations>
|
||||||
|
</q-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import numberFormat from '../../../filters/number-format'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import { startLoading, stopLoading,
|
||||||
|
showGlobalError, showToast } from '../../../helpers/ui'
|
||||||
|
import CscDestinations from './CscDestinations'
|
||||||
|
import { QCard } from 'quasar-framework'
|
||||||
|
export default {
|
||||||
|
name: 'csc-call-forward',
|
||||||
|
props: [
|
||||||
|
'timeset',
|
||||||
|
'destinations'
|
||||||
|
],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
QCard,
|
||||||
|
CscDestinations
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState('callForward', {
|
||||||
|
removeDestinationState: 'removeDestinationState',
|
||||||
|
addDestinationState: 'addDestinationState',
|
||||||
|
changeDestinationState: 'changeDestinationState',
|
||||||
|
lastRemovedDestination: 'lastRemovedDestination',
|
||||||
|
lastAddedDestination: 'lastAddedDestination',
|
||||||
|
addDestinationError(state) {
|
||||||
|
return state.addDestinationError ||
|
||||||
|
this.$t('pages.callForward.addErrorMessage');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
reload(timeset) {
|
||||||
|
if (!timeset) {
|
||||||
|
this.$store.dispatch('callForward/loadAlwaysEverybodyDestinations');
|
||||||
|
} else if (timeset === 'Company Hours') {
|
||||||
|
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
||||||
|
} else if (timeset === 'After Hours') {
|
||||||
|
this.$store.dispatch('callForward/loadAfterHoursEverybodyDestinations');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
removeDestinationState(state) {
|
||||||
|
if (state === 'requesting') {
|
||||||
|
startLoading();
|
||||||
|
} else if (state === 'failed') {
|
||||||
|
stopLoading();
|
||||||
|
showGlobalError(this.removeDestinationError);
|
||||||
|
} else if (state === 'succeeded') {
|
||||||
|
stopLoading();
|
||||||
|
showToast(this.$t('pages.callForward.removeSuccessMessage', {
|
||||||
|
destination: this.lastRemovedDestination
|
||||||
|
}));
|
||||||
|
this.reload(this.timeset);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addDestinationState(state) {
|
||||||
|
if (state === 'requesting') {
|
||||||
|
startLoading();
|
||||||
|
} else if (state === 'failed') {
|
||||||
|
stopLoading();
|
||||||
|
showGlobalError(this.addDestinationError);
|
||||||
|
} else if (state === 'succeeded') {
|
||||||
|
stopLoading();
|
||||||
|
showToast(this.$t('pages.callForward.addDestinationSuccessMessage', {
|
||||||
|
destination: this.lastAddedDestination
|
||||||
|
}));
|
||||||
|
this.reload(this.timeset);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeDestinationState(state) {
|
||||||
|
if (state === 'requesting') {
|
||||||
|
startLoading();
|
||||||
|
} else if (state === 'failed') {
|
||||||
|
stopLoading();
|
||||||
|
showGlobalError(this.changeDestinationError);
|
||||||
|
} else if (state === 'succeeded') {
|
||||||
|
stopLoading();
|
||||||
|
this.reload(this.timeset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus">
|
||||||
|
</style>
|
Loading…
Reference in new issue