|
|
@ -28,24 +28,13 @@
|
|
|
|
</q-popover>
|
|
|
|
</q-popover>
|
|
|
|
</q-btn>
|
|
|
|
</q-btn>
|
|
|
|
<div v-if="isFormEnabled">
|
|
|
|
<div v-if="isFormEnabled">
|
|
|
|
<q-field
|
|
|
|
<csc-call-input
|
|
|
|
:error-label="destinationInputError"
|
|
|
|
:label="$t('pages.callForward.destination')"
|
|
|
|
>
|
|
|
|
|
|
|
|
<q-input
|
|
|
|
|
|
|
|
dark
|
|
|
|
|
|
|
|
:before="beforeIconDestination"
|
|
|
|
|
|
|
|
:float-label="$t('pages.callForward.destination')"
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
v-model="destinationForm.destination"
|
|
|
|
v-model="destinationForm.destination"
|
|
|
|
@keyup.enter="addDestination()"
|
|
|
|
@submit="addDestination"
|
|
|
|
:clearable="isFormTypeNumber"
|
|
|
|
@error="error"
|
|
|
|
:autofocus="isFormTypeNumber"
|
|
|
|
:before="beforeIconDestination"
|
|
|
|
:disable="!isFormTypeNumber || addDestinationIsRequesting"
|
|
|
|
|
|
|
|
@input="$v.destinationForm.destination.$touch"
|
|
|
|
|
|
|
|
@blur="$v.destinationForm.destination.$touch"
|
|
|
|
|
|
|
|
:error="$v.destinationForm.destination.$error"
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</q-field>
|
|
|
|
|
|
|
|
<q-field
|
|
|
|
<q-field
|
|
|
|
:error-label="timeoutInputError"
|
|
|
|
:error-label="timeoutInputError"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -74,7 +63,7 @@
|
|
|
|
icon="check"
|
|
|
|
icon="check"
|
|
|
|
color="primary"
|
|
|
|
color="primary"
|
|
|
|
@click="addDestination()"
|
|
|
|
@click="addDestination()"
|
|
|
|
:disable="$v.destinationForm.destination.$error || $v.destinationForm.timeout.$error"
|
|
|
|
:disable="$v.destinationForm.timeout.$error || destinationError"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ $t('buttons.save') }}
|
|
|
|
{{ $t('buttons.save') }}
|
|
|
|
</q-btn>
|
|
|
|
</q-btn>
|
|
|
@ -84,6 +73,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import _ from 'lodash'
|
|
|
|
import _ from 'lodash'
|
|
|
|
|
|
|
|
import CscCallInput from '../../form/CscCallInput'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
startLoading,
|
|
|
|
startLoading,
|
|
|
|
showGlobalError
|
|
|
|
showGlobalError
|
|
|
@ -94,7 +84,6 @@
|
|
|
|
} from 'vuex'
|
|
|
|
} from 'vuex'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
required,
|
|
|
|
required,
|
|
|
|
maxLength,
|
|
|
|
|
|
|
|
minValue,
|
|
|
|
minValue,
|
|
|
|
numeric
|
|
|
|
numeric
|
|
|
|
} from 'vuelidate/lib/validators'
|
|
|
|
} from 'vuelidate/lib/validators'
|
|
|
@ -126,10 +115,12 @@
|
|
|
|
destinationForm: {
|
|
|
|
destinationForm: {
|
|
|
|
destination: '',
|
|
|
|
destination: '',
|
|
|
|
timeout: 300
|
|
|
|
timeout: 300
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
destinationError: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
|
|
|
|
CscCallInput,
|
|
|
|
QSelect,
|
|
|
|
QSelect,
|
|
|
|
QPopover,
|
|
|
|
QPopover,
|
|
|
|
QField,
|
|
|
|
QField,
|
|
|
@ -142,10 +133,6 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
validations: {
|
|
|
|
validations: {
|
|
|
|
destinationForm: {
|
|
|
|
destinationForm: {
|
|
|
|
destination: {
|
|
|
|
|
|
|
|
required,
|
|
|
|
|
|
|
|
maxLength: maxLength(64)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
timeout: {
|
|
|
|
timeout: {
|
|
|
|
required,
|
|
|
|
required,
|
|
|
|
minValue: minValue(1),
|
|
|
|
minValue: minValue(1),
|
|
|
@ -163,19 +150,6 @@
|
|
|
|
'hasSendFaxFeature',
|
|
|
|
'hasSendFaxFeature',
|
|
|
|
'hasFaxCapability'
|
|
|
|
'hasFaxCapability'
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
destinationInputError() {
|
|
|
|
|
|
|
|
if (!this.$v.destinationForm.destination.maxLength) {
|
|
|
|
|
|
|
|
return this.$t('validationErrors.maxLength', {
|
|
|
|
|
|
|
|
field: this.$t('pages.callForward.destination'),
|
|
|
|
|
|
|
|
maxLength: this.$v.destinationForm.destination.$params.maxLength.max
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!this.$v.destinationForm.destination.required) {
|
|
|
|
|
|
|
|
return this.$t('validationErrors.fieldRequired', {
|
|
|
|
|
|
|
|
field: this.$t('pages.callForward.destination')
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
timeoutInputError() {
|
|
|
|
timeoutInputError() {
|
|
|
|
if (!this.$v.destinationForm.timeout.required) {
|
|
|
|
if (!this.$v.destinationForm.timeout.required) {
|
|
|
|
return this.$t('validationErrors.fieldRequired', {
|
|
|
|
return this.$t('validationErrors.fieldRequired', {
|
|
|
@ -194,9 +168,6 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isFormTypeNumber() {
|
|
|
|
|
|
|
|
return this.formType === 'number';
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isFormEnabled() {
|
|
|
|
isFormEnabled() {
|
|
|
|
return this.activeForm === this.groupName && this.formEnabled;
|
|
|
|
return this.activeForm === this.groupName && this.formEnabled;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -252,8 +223,8 @@
|
|
|
|
this.$store.commit('callForward/resetDestinationState');
|
|
|
|
this.$store.commit('callForward/resetDestinationState');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addDestination() {
|
|
|
|
addDestination() {
|
|
|
|
if (this.$v.destinationForm.destination.$error ||
|
|
|
|
if (this.$v.destinationForm.timeout.$error ||
|
|
|
|
this.$v.destinationForm.timeout.$error) {
|
|
|
|
this.destinationError) {
|
|
|
|
showGlobalError(this.$t('validationErrors.generic'));
|
|
|
|
showGlobalError(this.$t('validationErrors.generic'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
@ -266,6 +237,9 @@
|
|
|
|
sourcesetId: this.sourcesetId
|
|
|
|
sourcesetId: this.sourcesetId
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error(state) {
|
|
|
|
|
|
|
|
this.destinationError = state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|