What has been done: - TT#36187, Create a custom UI form component - TT#36190, Implement success toast, error handling and loading animation - TT#36183, Implement api layer methods, plus corresponding store actions and mutations Change-Id: Icb31af6456fafeb98ac4a7ca16f1fb83ce79d0a4changes/13/21113/4
parent
bcc3fa40c0
commit
afbe0a031e
@ -0,0 +1,74 @@
|
|||||||
|
<template>
|
||||||
|
<div class="add-source-form">
|
||||||
|
<q-field>
|
||||||
|
<q-input
|
||||||
|
autofocus
|
||||||
|
v-model="source"
|
||||||
|
:float-label="$t('pages.callForward.sources.source')"
|
||||||
|
color="primary"
|
||||||
|
@keyup.enter="addSource()" />
|
||||||
|
</q-field>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
dark
|
||||||
|
@click="disableForm()"
|
||||||
|
>
|
||||||
|
{{ $t('buttons.cancel') }}
|
||||||
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
color="primary"
|
||||||
|
icon-right="fa-save"
|
||||||
|
@click="addSource()"
|
||||||
|
:disable="!isValid"
|
||||||
|
>
|
||||||
|
{{ $t('buttons.save') }}
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
QBtn,
|
||||||
|
QField,
|
||||||
|
QInput
|
||||||
|
} from 'quasar-framework'
|
||||||
|
export default {
|
||||||
|
name: 'csc-sourcesets-form',
|
||||||
|
props: {
|
||||||
|
sourcesetId: String
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
source: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
QBtn,
|
||||||
|
QField,
|
||||||
|
QInput
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isValid() {
|
||||||
|
return this.source.length > 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
disableForm() {
|
||||||
|
this.$emit('source-form-close');
|
||||||
|
},
|
||||||
|
addSource() {
|
||||||
|
this.$emit('add-source', {
|
||||||
|
source: [{ source: this.source}],
|
||||||
|
id: this.sourcesetId
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.source = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
Loading…
Reference in new issue