better behaviour when editing

This commit is contained in:
ogerly 2022-11-09 14:36:11 +01:00
parent 9d4c68ea40
commit 106a72dd78
4 changed files with 23 additions and 2 deletions

View File

@ -8,7 +8,11 @@
header-class="text-center" header-class="text-center"
class="mt-5" class="mt-5"
> >
<b-button v-b-toggle.newContribution class="my-3 d-flex justify-content-left"> <b-button
v-if="!editContributionLink"
v-b-toggle.newContribution
class="my-3 d-flex justify-content-left"
>
{{ $t('math.plus') }} {{ $t('contributionLink.newContributionLink') }} {{ $t('math.plus') }} {{ $t('contributionLink.newContributionLink') }}
</b-button> </b-button>
@ -19,6 +23,7 @@
:contributionLinkData="contributionLinkData" :contributionLinkData="contributionLinkData"
:editContributionLink="editContributionLink" :editContributionLink="editContributionLink"
@get-contribution-links="$emit('get-contribution-links')" @get-contribution-links="$emit('get-contribution-links')"
@closeContributionForm="closeContributionForm"
/> />
</b-card> </b-card>
</b-collapse> </b-collapse>
@ -63,9 +68,18 @@ export default {
} }
}, },
methods: { methods: {
closeContributionForm() {
if (this.visible) {
this.$root.$emit('bv::toggle::collapse', 'newContribution')
this.editContributionLink = false
}
},
editContributionLinkData(data) { editContributionLinkData(data) {
if (!this.visible) this.$root.$emit('bv::toggle::collapse', 'newContribution') if (!this.visible) {
this.$root.$emit('bv::toggle::collapse', 'newContribution')
}
this.contributionLinkData = data this.contributionLinkData = data
console.log('contributionLinkData', this.contributionLinkData)
this.editContributionLink = true this.editContributionLink = true
}, },
}, },

View File

@ -6,6 +6,7 @@
<b-col> <b-col>
<b-form-group :label="$t('contributionLink.validFrom')"> <b-form-group :label="$t('contributionLink.validFrom')">
<b-form-datepicker <b-form-datepicker
reset-button
v-model="form.validFrom" v-model="form.validFrom"
size="lg" size="lg"
:min="min" :min="min"
@ -19,6 +20,7 @@
<b-col> <b-col>
<b-form-group :label="$t('contributionLink.validTo')"> <b-form-group :label="$t('contributionLink.validTo')">
<b-form-datepicker <b-form-datepicker
reset-button
v-model="form.validTo" v-model="form.validTo"
size="lg" size="lg"
:min="form.validFrom ? form.validFrom : min" :min="form.validFrom ? form.validFrom : min"
@ -110,6 +112,9 @@
<b-button type="reset" variant="danger" @click.prevent="onReset"> <b-button type="reset" variant="danger" @click.prevent="onReset">
{{ $t('contributionLink.clear') }} {{ $t('contributionLink.clear') }}
</b-button> </b-button>
<b-button @click.prevent="onReset(), $emit('closeContributionForm')">
{{ $t('contributionLink.close') }}
</b-button>
</div> </div>
</b-form> </b-form>
</div> </div>

View File

@ -5,6 +5,7 @@
"amount": "Betrag", "amount": "Betrag",
"changeSaved": "Änderungen gespeichert", "changeSaved": "Änderungen gespeichert",
"clear": "Löschen", "clear": "Löschen",
"close": "Schließen",
"contributionLinks": "Beitragslinks", "contributionLinks": "Beitragslinks",
"create": "Anlegen", "create": "Anlegen",
"cycle": "Zyklus", "cycle": "Zyklus",

View File

@ -5,6 +5,7 @@
"amount": "Amount", "amount": "Amount",
"changeSaved": "Changes saved", "changeSaved": "Changes saved",
"clear": "Clear", "clear": "Clear",
"close": "Close",
"contributionLinks": "Contribution Links", "contributionLinks": "Contribution Links",
"create": "Create", "create": "Create",
"cycle": "Cycle", "cycle": "Cycle",