What has been done: - TT#31193, CallForwarding: Create store mutation unit test - TT#31191, CallForwarding: Implement API requests - TT#31192, CallForwarding: Implement store - TT#31175, CallForwarding: Implement vue component Change-Id: I971e06cea0b930f57ede43b7a56c6766a790e651changes/40/18640/9
parent
3463789805
commit
cefb66b549
@ -1,19 +1,106 @@
|
||||
<template>
|
||||
<csc-page :title="$t('pages.callForward.titles.companyHours')">
|
||||
<q-card class="dest-card">
|
||||
<csc-destinations :title="$t('pages.callForward.whenOnline')"
|
||||
: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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import numberFormat from '../../../filters/number-format'
|
||||
import { mapState } from 'vuex'
|
||||
import { startLoading, stopLoading,
|
||||
showGlobalError, showToast } from '../../../helpers/ui'
|
||||
import CscPage from '../../CscPage'
|
||||
import CscDestinations from './CscDestinations'
|
||||
import { QCard } from 'quasar-framework'
|
||||
export default {
|
||||
created() {
|
||||
this.$store.dispatch('callForward/loadCompanyHoursEverybodyDestinations');
|
||||
},
|
||||
data () {
|
||||
return {}
|
||||
return {
|
||||
}
|
||||
},
|
||||
components: {
|
||||
CscPage
|
||||
QCard,
|
||||
CscPage,
|
||||
CscDestinations
|
||||
},
|
||||
computed: {
|
||||
...mapState('callForward', {
|
||||
removeDestinationState: 'removeDestinationState',
|
||||
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>
|
||||
|
||||
<style>
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
|
Loading…
Reference in new issue