File tree Expand file tree Collapse file tree 11 files changed +62
-29
lines changed Expand file tree Collapse file tree 11 files changed +62
-29
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" prompt prompt-checkbox" >
2
+ <VueDisable
3
+ :disabled =" !prompt.enabled"
4
+ class =" prompt prompt-checkbox"
5
+ >
3
6
<div class =" prompt-content" >
4
7
<ListItemInfo
5
8
:name =" prompt.message"
20
23
</div >
21
24
22
25
<PromptError :error =" prompt.error" />
23
- </div >
26
+ </VueDisable >
24
27
</template >
25
28
26
29
<script >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" prompt prompt-confirm" >
2
+ <VueDisable
3
+ :disabled =" !prompt.enabled"
4
+ class =" prompt prompt-confirm"
5
+ >
3
6
<VueSwitch
4
7
:value =" value(prompt.value)"
5
8
class =" extend-left"
13
16
</VueSwitch >
14
17
15
18
<PromptError :error =" prompt.error" />
16
- </div >
19
+ </VueDisable >
17
20
</template >
18
21
19
22
<script >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" prompt prompt-input" >
2
+ <VueDisable
3
+ :disabled =" !prompt.enabled"
4
+ class =" prompt prompt-input"
5
+ >
3
6
<div class =" prompt-content" >
4
7
<ListItemInfo
5
8
:name =" prompt.message"
17
20
</div >
18
21
19
22
<PromptError :error =" prompt.error" />
20
- </div >
23
+ </VueDisable >
21
24
</template >
22
25
23
26
<script >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" prompt prompt-list" >
2
+ <VueDisable
3
+ :disabled =" !prompt.enabled"
4
+ class =" prompt prompt-list"
5
+ >
3
6
<div class =" prompt-content" >
4
7
<ListItemInfo
5
8
:name =" prompt.message"
23
26
</div >
24
27
25
28
<PromptError :error =" prompt.error" />
26
- </div >
29
+ </VueDisable >
27
30
</template >
28
31
29
32
<script >
Original file line number Diff line number Diff line change 3
3
<div class =" content" >
4
4
<component
5
5
v-for =" prompt of prompts"
6
- v-if =" prompt.enabled "
6
+ v-if =" prompt.visible "
7
7
:key =" prompt.id"
8
8
:is =" getModule(prompt)"
9
9
:prompt =" prompt"
Original file line number Diff line number Diff line change @@ -138,8 +138,9 @@ function removeAnswer (id) {
138
138
function generatePrompt ( data ) {
139
139
return {
140
140
id : data . name ,
141
- enabled : true ,
142
141
type : data . type ,
142
+ visible : true ,
143
+ enabled : true ,
143
144
name : data . short || null ,
144
145
message : data . message ,
145
146
description : data . description || null ,
@@ -154,15 +155,15 @@ function generatePrompt (data) {
154
155
155
156
function updatePrompts ( ) {
156
157
for ( const prompt of prompts ) {
157
- const oldEnabled = prompt . enabled
158
- prompt . enabled = getEnabled ( prompt . raw . when )
158
+ const oldVisible = prompt . visible
159
+ prompt . visible = getEnabled ( prompt . raw . when )
159
160
160
161
prompt . choices = getChoices ( prompt )
161
162
162
- if ( oldEnabled !== prompt . enabled && ! prompt . enabled ) {
163
+ if ( oldVisible !== prompt . visible && ! prompt . visible ) {
163
164
removeAnswer ( prompt . id )
164
165
prompt . valueChanged = false
165
- } else if ( prompt . enabled && ! prompt . valueChanged ) {
166
+ } else if ( prompt . visible && ! prompt . valueChanged ) {
166
167
let value = getDefaultValue ( prompt )
167
168
prompt . value = getDisplayedValue ( prompt , value )
168
169
setAnswer ( prompt . id , getValue ( prompt , value ) )
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ enum PackageManager {
21
21
yarn
22
22
}
23
23
24
+ interface DescribedEntity {
25
+ name: String
26
+ description: String
27
+ link: String
28
+ }
29
+
24
30
type Folder {
25
31
name: String!
26
32
path: String!
@@ -52,7 +58,7 @@ input ProjectImportInput {
52
58
path: String!
53
59
}
54
60
55
- type Preset {
61
+ type Preset implements DescribedEntity {
56
62
id: ID!
57
63
name: String
58
64
description: String
@@ -94,9 +100,9 @@ type PluginInstallation {
94
100
prompts: [Prompt]
95
101
}
96
102
97
- type Feature {
103
+ type Feature implements DescribedEntity {
98
104
id: ID!
99
- name: String!
105
+ name: String
100
106
description: String
101
107
link: String
102
108
enabled: Boolean!
@@ -125,10 +131,11 @@ type PromptError {
125
131
link: String
126
132
}
127
133
128
- type Prompt {
134
+ type Prompt implements DescribedEntity {
129
135
id: ID!
130
- enabled: Boolean!
131
136
type: PromptType!
137
+ visible: Boolean!
138
+ enabled: Boolean
132
139
name: String
133
140
message: String
134
141
description: String
@@ -154,12 +161,13 @@ type Progress {
154
161
args: [String]
155
162
}
156
163
157
- type Task {
164
+ type Task implements DescribedEntity {
158
165
id: ID!
159
166
status: TaskStatus!
160
- name: String!
167
+ name: String
161
168
command: String!
162
169
description: String
170
+ link: String
163
171
logs: [TaskLog]
164
172
}
165
173
@@ -182,6 +190,15 @@ enum TaskLogType {
182
190
stderr
183
191
}
184
192
193
+ type Configuration implements DescribedEntity {
194
+ id: ID!
195
+ name: String
196
+ description: String
197
+ link: String
198
+ icon: String
199
+ prompts: [Prompt]
200
+ }
201
+
185
202
type Query {
186
203
progress (id: ID!): Progress
187
204
cwd: String!
@@ -196,6 +213,8 @@ type Query {
196
213
plugin (id: ID!): Plugin
197
214
tasks: [Task]
198
215
task (id: ID!): Task
216
+ configurations: [Configuration]
217
+ configuration (id: ID!): Configuration
199
218
}
200
219
201
220
type Mutation {
Original file line number Diff line number Diff line change 3
3
4
4
fragment prompt on Prompt {
5
5
id
6
- enabled
7
6
type
7
+ visible
8
+ enabled
8
9
name
9
10
message
10
11
description
Original file line number Diff line number Diff line change @@ -8,20 +8,20 @@ export default function ({
8
8
return {
9
9
computed : {
10
10
configurationValid ( ) {
11
- return this . enabledPrompts . filter (
11
+ return this . visiblePrompts . filter (
12
12
p =>
13
13
p . error ||
14
14
p . value === null ||
15
15
JSON . parse ( p . value ) === ''
16
16
) . length === 0
17
17
} ,
18
18
19
- enabledPrompts ( ) {
19
+ visiblePrompts ( ) {
20
20
if ( ! this [ field ] ) {
21
21
return [ ]
22
22
}
23
23
return this [ field ] . prompts . filter (
24
- p => p . enabled
24
+ p => p . visible
25
25
)
26
26
}
27
27
} ,
Original file line number Diff line number Diff line change 201
201
/>
202
202
203
203
<VueButton
204
- v-if =" enabledPrompts .length"
204
+ v-if =" visiblePrompts .length"
205
205
icon-right =" arrow_forward"
206
206
:label =" $t('views.project-create.tabs.features.buttons.next')"
207
207
class =" big primary"
249
249
id =" config"
250
250
:label =" $t('views.project-create.tabs.configuration.title')"
251
251
icon =" settings_applications"
252
- :disabled =" !detailsValid || !presetValid || !manual || !enabledPrompts .length"
252
+ :disabled =" !detailsValid || !presetValid || !manual || !visiblePrompts .length"
253
253
lazy
254
254
>
255
255
<div class =" content vue-ui-disable-scroll" >
256
256
<PromptsList
257
- :prompts =" enabledPrompts "
257
+ :prompts =" visiblePrompts "
258
258
@answer =" answerPrompt"
259
259
/>
260
260
</div >
You can’t perform that action at this time.
0 commit comments