change form and cycle values

This commit is contained in:
ogerly 2022-06-13 22:53:36 +02:00
parent 46bbe625a2
commit 6f6d801fb6
3 changed files with 12 additions and 4 deletions

View File

@ -72,6 +72,7 @@
<b-form-select <b-form-select
v-model="form.cycle" v-model="form.cycle"
:options="cycle" :options="cycle"
:disabled="disabled"
class="mb-3" class="mb-3"
size="lg" size="lg"
></b-form-select> ></b-form-select>
@ -82,6 +83,7 @@
<b-form-select <b-form-select
v-model="form.repetition" v-model="form.repetition"
:options="repetition" :options="repetition"
:disabled="disabled"
class="mb-3" class="mb-3"
size="lg" size="lg"
></b-form-select> ></b-form-select>
@ -93,6 +95,7 @@
<b-form-input <b-form-input
v-model="form.maxAmount" v-model="form.maxAmount"
size="lg" size="lg"
:disabled="disabled"
type="number" type="number"
placeholder="0" placeholder="0"
></b-form-input> ></b-form-input>
@ -109,6 +112,7 @@
</template> </template>
<script> <script>
import { createContributionLink } from '@/graphql/createContributionLink.js' import { createContributionLink } from '@/graphql/createContributionLink.js'
import { throwServerError } from 'apollo-link-http-common'
export default { export default {
name: 'ContributionLinkForm', name: 'ContributionLinkForm',
props: { props: {
@ -127,13 +131,13 @@ export default {
amount: null, amount: null,
startDate: null, startDate: null,
endDate: null, endDate: null,
cycle: null, cycle: 'once',
repetition: null, repetition: null,
maxAmount: null, maxAmount: null,
}, },
min: new Date(), min: new Date(),
cycle: [ cycle: [
{ value: null, text: this.$t('contributionLink.options.cycle.null') }, { value: 'once', text: this.$t('contributionLink.options.cycle.once') },
{ value: 'hourly', text: this.$t('contributionLink.options.cycle.hourly') }, { value: 'hourly', text: this.$t('contributionLink.options.cycle.hourly') },
{ value: 'daily', text: this.$t('contributionLink.options.cycle.daily') }, { value: 'daily', text: this.$t('contributionLink.options.cycle.daily') },
{ value: 'weekly', text: this.$t('contributionLink.options.cycle.weekly') }, { value: 'weekly', text: this.$t('contributionLink.options.cycle.weekly') },
@ -188,6 +192,10 @@ export default {
updateData() { updateData() {
return this.contributionLinkData return this.contributionLinkData
}, },
disabled() {
if (this.form.cycle === 'once') return true
return false
},
}, },
watch: { watch: {
contributionLinkData() { contributionLinkData() {

View File

@ -21,7 +21,7 @@
"daily": "täglich", "daily": "täglich",
"hourly": "stündlich", "hourly": "stündlich",
"monthly": "monatlich", "monthly": "monatlich",
"null": "Bitter wähle einen Zyklus", "once": "einmalig",
"weekly": "wöchentlich", "weekly": "wöchentlich",
"yearly": "jährlich" "yearly": "jährlich"
}, },

View File

@ -21,7 +21,7 @@
"daily": "daily", "daily": "daily",
"hourly": "hourly", "hourly": "hourly",
"monthly": "monthly", "monthly": "monthly",
"null": "please select a cycle", "once": "unique",
"weekly": "weekly", "weekly": "weekly",
"yearly": "yearly" "yearly": "yearly"
}, },