TT#44068 Single-step to add non-number destination

Change-Id: Idf2d7d72007a5e82c29a5915a5e9b7415f9b454c
changes/89/23389/3
raxelsen 7 years ago committed by Hans-Peter Herzog
parent f6795c77b0
commit 3ee331328d

@ -12,15 +12,15 @@
separator separator
link link
> >
<q-item @click="enableForm('number'), $refs.popover.close()"> <q-item @click="addDestinationByType('number'), $refs.popover.close()">
{{ $t('pages.callForward.buttons.addNumber') }} {{ $t('pages.callForward.buttons.addNumber') }}
</q-item> </q-item>
<q-item @click="enableForm('voicebox'), $refs.popover.close()"> <q-item @click="addDestinationByType('voicebox'), $refs.popover.close()">
{{ $t('pages.callForward.buttons.addVoicemail') }} {{ $t('pages.callForward.buttons.addVoicemail') }}
</q-item> </q-item>
<q-item <q-item
v-if="hasFaxCapability && hasSendFaxFeature" v-if="hasFaxCapability && hasSendFaxFeature"
@click="enableForm('fax2mail'), $refs.popover.close()" @click="addDestinationByType('fax2mail'), $refs.popover.close()"
> >
{{ $t('pages.callForward.buttons.addFax2Mail') }} {{ $t('pages.callForward.buttons.addFax2Mail') }}
</q-item> </q-item>
@ -49,12 +49,12 @@
:error-label="timeoutInputError" :error-label="timeoutInputError"
> >
<q-input <q-input
v-if="isFormTypeNumber"
:before="beforeIconTimeout" :before="beforeIconTimeout"
:float-label="$t('pages.callForward.timeout')" :float-label="$t('pages.callForward.timeout')"
type="number" type="number"
v-model="destinationForm.timeout" v-model="destinationForm.timeout"
suffix="seconds" suffix="seconds"
clearable
@input="$v.destinationForm.timeout.$touch" @input="$v.destinationForm.timeout.$touch"
@blur="$v.destinationForm.timeout.$touch" @blur="$v.destinationForm.timeout.$touch"
:error="$v.destinationForm.timeout.$error" :error="$v.destinationForm.timeout.$error"
@ -213,21 +213,24 @@
} }
}, },
methods: { methods: {
enableForm(type) { addDestinationByType(type) {
let lastDestination = _.findLast(this.destinations) || {};
this.formEnabled = true;
this.$store.commit('callForward/setFormType', type); this.$store.commit('callForward/setFormType', type);
this.$store.commit('callForward/setActiveForm', this.groupName); let lastDestination = _.findLast(this.destinations) || {};
this.$store.commit('callForward/setDestinationsetId', this.id); this.$store.commit('callForward/setDestinationsetId', this.id);
this.$store.commit('callForward/setGroupName', this.groupName); this.$store.commit('callForward/setGroupName', this.groupName);
this.$store.commit('callForward/setPriority', lastDestination.priority || 1); this.$store.commit('callForward/setPriority', lastDestination.priority || 1);
if (type === 'voicebox') { if (type === 'voicebox') {
this.destinationForm.destination = 'Voicemail'; this.destinationForm.destination = 'Voicemail';
this.addDestination();
} }
else if (type === 'fax2mail') { else if (type === 'fax2mail') {
this.destinationForm.destination = 'Fax2Mail'; this.destinationForm.destination = 'Fax2Mail';
this.addDestination();
} }
else { else {
this.$v.$reset();
this.formEnabled = true;
this.$store.commit('callForward/setActiveForm', this.groupName);
this.destinationForm.destination = ''; this.destinationForm.destination = '';
} }
}, },
@ -235,6 +238,7 @@
this.destinationForm.timeout = 300; this.destinationForm.timeout = 300;
this.destinationForm.destination = ''; this.destinationForm.destination = '';
this.formEnabled = false; this.formEnabled = false;
this.$v.$reset();
this.$store.commit('callForward/resetFormState'); this.$store.commit('callForward/resetFormState');
this.$store.commit('callForward/resetDestinationState'); this.$store.commit('callForward/resetDestinationState');
}, },

Loading…
Cancel
Save