TT#40422 Fix issue with destinations list mobile

Change-Id: Ie3bbf96e303f42ff2cb8dabec2a84776364a9974
changes/60/22560/2
raxelsen 7 years ago
parent bb39aa1e4c
commit a691c1ce0a

@ -1,35 +1,78 @@
<template> <template>
<div class="add-destination-form"> <div class="add-destination-form">
<q-btn v-if="!isFormEnabled" flat color="primary" icon="fa-plus"> <q-btn
v-if="!isFormEnabled"
flat
color="primary"
icon="fa-plus"
>
{{ $t('pages.callForward.addDestinationButton') }} {{ $t('pages.callForward.addDestinationButton') }}
<q-popover ref="popover"> <q-popover ref="popover">
<q-list separator link> <q-list
separator
link
>
<q-item @click="enableForm('number'), $refs.popover.close()"> <q-item @click="enableForm('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="enableForm('voicebox'), $refs.popover.close()">
{{ $t('pages.callForward.buttons.addVoicemail') }} {{ $t('pages.callForward.buttons.addVoicemail') }}
</q-item> </q-item>
<q-item @click="enableForm('fax2mail'), $refs.popover.close()" v-if="hasFaxCapability"> <q-item
v-if="hasFaxCapability && hasSendFaxFeature"
@click="enableForm('fax2mail'), $refs.popover.close()"
>
{{ $t('pages.callForward.buttons.addFax2Mail') }} {{ $t('pages.callForward.buttons.addFax2Mail') }}
</q-item> </q-item>
</q-list> </q-list>
</q-popover> </q-popover>
</q-btn> </q-btn>
<div v-if="isFormEnabled"> <div v-if="isFormEnabled">
<q-field :error="addFormError" :error-label="$t('pages.callForward.addInputError')"> <q-field
<q-input :before="beforeIconDestination" :float-label="$t('pages.callForward.destination')" type="text" :error="addFormError"
v-model="destinationForm.destination" @keyup.enter="addDestination()" :error-label="$t('pages.callForward.addInputError')"
:clearable="isFormTypeNumber" :autofocus="isFormTypeNumber" >
:disable="!isFormTypeNumber || addDestinationIsRequesting" /> <q-input
:before="beforeIconDestination"
:float-label="$t('pages.callForward.destination')"
type="text"
v-model="destinationForm.destination"
@keyup.enter="addDestination()"
:clearable="isFormTypeNumber"
:autofocus="isFormTypeNumber"
:disable="!isFormTypeNumber || addDestinationIsRequesting"
/>
</q-field> </q-field>
<q-field :error="addFormError" :error-label="$t('pages.callForward.addInputError')"> <q-field
<q-input :before="beforeIconTimeout" :float-label="$t('pages.callForward.timeout')" :error="addFormError"
type="number" v-if="isFormTypeNumber" v-model="destinationForm.timeout" :error-label="$t('pages.callForward.addInputError')"
:min="0" :max="600" suffix="seconds" /> >
<q-input
v-if="isFormTypeNumber"
:before="beforeIconTimeout"
:float-label="$t('pages.callForward.timeout')"
type="number"
v-model="destinationForm.timeout"
:min="0"
:max="600"
suffix="seconds"
/>
</q-field> </q-field>
<q-btn flat dark @click="disableForm()">{{ $t('buttons.cancel') }}</q-btn> <q-btn
<q-btn flat color="primary" icon-right="fa-save" @click="addDestination()">{{ $t('buttons.save') }}</q-btn> flat
dark
@click="disableForm()"
>
{{ $t('buttons.cancel') }}
</q-btn>
<q-btn
flat
color="primary"
icon-right="fa-save"
@click="addDestination()"
>
{{ $t('buttons.save') }}
</q-btn>
</div> </div>
</div> </div>
</template> </template>
@ -77,9 +120,10 @@
...mapState('callForward', [ ...mapState('callForward', [
'activeForm', 'activeForm',
'formType', 'formType',
'addDestinationState' 'addDestinationState',
]), ]),
...mapGetters('callForward', [ ...mapGetters('user', [
'hasSendFaxFeature',
'hasFaxCapability' 'hasFaxCapability'
]), ]),
isFormTypeNumber() { isFormTypeNumber() {

@ -29,7 +29,7 @@
</div> </div>
<div v-if="$q.platform.is.mobile" class="dest-row" :class="{ terminated: destination.terminated, mobile: mobileClasses }"> <div v-if="$q.platform.is.mobile" class="dest-row" :class="{ terminated: destination.terminated, mobile: mobileClasses }">
<q-item-tile class="dest-values" label> <q-item-tile class="dest-values" label>
<span v-if="!isNumber(destination.destination)"> <span v-if="!isNonTerminating(destination.destination)">
<span v-if="index == 0"> <span v-if="index == 0">
{{ $t('pages.callForward.firstRing') }} {{ $t('pages.callForward.firstRing') }}
</span> </span>
@ -40,13 +40,13 @@
{{ destination.destination | destinationFormat }} {{ destination.destination | destinationFormat }}
</q-item-tile> </q-item-tile>
<q-item-tile class="dest-sublabel" sublabel> <q-item-tile class="dest-sublabel" sublabel>
<span v-if="index == 0 && isNumber(destination.destination)"> <span v-if="index == 0 && isNonTerminating(destination.destination)">
{{ $t('pages.callForward.firstRing') }} {{ $t('pages.callForward.firstRing') }}
</span> </span>
<span v-else-if="index > 0 && isNumber(destination.destination)"> <span v-else-if="index > 0 && isNonTerminating(destination.destination)">
{{ $t('pages.callForward.thenRing') }} {{ $t('pages.callForward.thenRing') }}
</span> </span>
<span v-if="isNumber(destination.destination)"> <span v-if="isNonTerminating(destination.destination)">
<span> <span>
{{ $t('pages.callForward.for') }} {{ $t('pages.callForward.for') }}
</span> </span>

Loading…
Cancel
Save