-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCreateWikiWizardStepThree.vue
More file actions
141 lines (130 loc) · 3.8 KB
/
CreateWikiWizardStepThree.vue
File metadata and controls
141 lines (130 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<template>
<v-card class="elevation-12">
<v-toolbar dark color="primary">
<v-toolbar-title>{{ title }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn v-if="dismissable" icon @click="$emit('close-dialog')">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-toolbar>
<v-card-text>
<v-form ref="inputForm">
<h3>How long do you plan to use this Wikibase?</h3>
<v-radio-group
v-model="value.temporality"
:error-messages=error
:rules="[() => !!value.temporality || 'Please select an option.']"
>
<v-radio value="permanent" ref="test">
<template v-slot:label>
I would prefer to keep it on a permanent basis
</template>
</v-radio>
<v-radio value="temporary">
<template v-slot:label>
It is temporary/disposable. I will no longer need it after it served its purpose
</template>
</v-radio>
<v-radio value="other">
<template v-slot:label>
Other: <v-text-field
dense
counter="200"
class="pl-1 mt-n1 mb-n2"
v-model="value.otherTemporality"
:rules="
[
() => value.temporality !== 'other'
|| !! value.otherTemporality
|| 'Please provide a response.',
() => value.temporality !== 'other'
|| !! (value.otherTemporality && value.otherTemporality.length < 201)
|| 'Text must be 200 characters or less.'
]"
></v-text-field>
</template>
</v-radio>
<v-radio value="decide_later">
<template v-slot:label>
I will decide later
</template>
</v-radio>
</v-radio-group>
<h3 v-if="showTerms" class="mt-6">Terms of Use</h3>
<v-checkbox
v-model="value.terms"
:disabled="inFlight"
:rules="[() => !!value.terms || 'You must accept the Terms of Service.']"
v-if="showTerms"
>
<template v-slot:label>
<div>
I agree to the
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<a
target="_blank"
href="/terms-of-use"
@click.stop
v-on="on"
>
Terms of Use</a>
</template>
Opens in new window
</v-tooltip>.
</div>
</template>
</v-checkbox>
</v-form>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
type="button"
:disabled="inFlight"
@click="previousStep"
>
< Previous
</v-btn>
<v-btn
type="button"
color="primary"
:disabled="inFlight"
@click="submitWholeForm"
>
{{ submitButtonText }}
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
export default {
name: 'StepThreeCard',
props: {
title: String,
inFlight: Boolean,
value: Object,
error: Array,
dismissable: Boolean,
showTerms: Boolean,
submitButtonText: String
},
methods: {
previousStep () {
if (this.value.temporality !== 'other') {
this.value.otherTemporality = undefined
}
this.$emit('previous-step')
},
submitWholeForm () {
if (this.value.temporality !== 'other') {
this.value.otherTemporality = undefined
}
this.$refs.inputForm.validate()
if (this.$refs.inputForm.validate() === true) {
this.$emit('submit')
}
}
}
}
</script>