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 11<template >
2-   <div  class =" prompt prompt-checkbox" 
2+   <VueDisable 
3+     :disabled =" !prompt.enabled" 
4+     class =" prompt prompt-checkbox" 
5+   >
36    <div  class =" prompt-content" 
47      <ListItemInfo 
58        :name =" prompt.message" 
2023    </div >
2124
2225    <PromptError  :error =" prompt.error" 
23-   </div >
26+   </VueDisable >
2427</template >
2528
2629<script >
Original file line number Diff line number Diff line change 11<template >
2-   <div  class =" prompt prompt-confirm" 
2+   <VueDisable 
3+     :disabled =" !prompt.enabled" 
4+     class =" prompt prompt-confirm" 
5+   >
36    <VueSwitch 
47      :value =" value(prompt.value)" 
58      class =" extend-left" 
1316    </VueSwitch >
1417
1518    <PromptError  :error =" prompt.error" 
16-   </div >
19+   </VueDisable >
1720</template >
1821
1922<script >
Original file line number Diff line number Diff line change 11<template >
2-   <div  class =" prompt prompt-input" 
2+   <VueDisable 
3+     :disabled =" !prompt.enabled" 
4+     class =" prompt prompt-input" 
5+   >
36    <div  class =" prompt-content" 
47      <ListItemInfo 
58        :name =" prompt.message" 
1720    </div >
1821
1922    <PromptError  :error =" prompt.error" 
20-   </div >
23+   </VueDisable >
2124</template >
2225
2326<script >
Original file line number Diff line number Diff line change 11<template >
2-   <div  class =" prompt prompt-list" 
2+   <VueDisable 
3+     :disabled =" !prompt.enabled" 
4+     class =" prompt prompt-list" 
5+   >
36    <div  class =" prompt-content" 
47      <ListItemInfo 
58        :name =" prompt.message" 
2326    </div >
2427
2528    <PromptError  :error =" prompt.error" 
26-   </div >
29+   </VueDisable >
2730</template >
2831
2932<script >
Original file line number Diff line number Diff line change 33    <div  class =" content" 
44      <component 
55        v-for =" prompt of prompts" 
6-         v-if =" prompt.enabled " 
6+         v-if =" prompt.visible " 
77        :key =" prompt.id" 
88        :is =" getModule(prompt)" 
99        :prompt =" prompt" 
Original file line number Diff line number Diff line change @@ -138,8 +138,9 @@ function removeAnswer (id) {
138138function  generatePrompt  ( data )  { 
139139  return  { 
140140    id : data . name , 
141-     enabled : true , 
142141    type : data . type , 
142+     visible : true , 
143+     enabled : true , 
143144    name : data . short  ||  null , 
144145    message : data . message , 
145146    description : data . description  ||  null , 
@@ -154,15 +155,15 @@ function generatePrompt (data) {
154155
155156function  updatePrompts  ( )  { 
156157  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 ) 
159160
160161    prompt . choices  =  getChoices ( prompt ) 
161162
162-     if  ( oldEnabled  !==  prompt . enabled  &&  ! prompt . enabled )  { 
163+     if  ( oldVisible  !==  prompt . visible  &&  ! prompt . visible )  { 
163164      removeAnswer ( prompt . id ) 
164165      prompt . valueChanged  =  false 
165-     }  else  if  ( prompt . enabled  &&  ! prompt . valueChanged )  { 
166+     }  else  if  ( prompt . visible  &&  ! prompt . valueChanged )  { 
166167      let  value  =  getDefaultValue ( prompt ) 
167168      prompt . value  =  getDisplayedValue ( prompt ,  value ) 
168169      setAnswer ( prompt . id ,  getValue ( prompt ,  value ) ) 
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ enum PackageManager {
2121  yarn 
2222} 
2323
24+ interface DescribedEntity { 
25+   name: String 
26+   description: String 
27+   link: String 
28+ } 
29+ 
2430type Folder { 
2531  name: String! 
2632  path: String! 
@@ -52,7 +58,7 @@ input ProjectImportInput {
5258  path: String! 
5359} 
5460
55- type Preset { 
61+ type Preset implements DescribedEntity  { 
5662  id: ID! 
5763  name: String 
5864  description: String 
@@ -94,9 +100,9 @@ type PluginInstallation {
94100  prompts: [Prompt] 
95101} 
96102
97- type Feature { 
103+ type Feature implements DescribedEntity  { 
98104  id: ID! 
99-   name: String!  
105+   name: String 
100106  description: String 
101107  link: String 
102108  enabled: Boolean! 
@@ -125,10 +131,11 @@ type PromptError {
125131  link: String 
126132} 
127133
128- type Prompt { 
134+ type Prompt implements DescribedEntity  { 
129135  id: ID! 
130-   enabled: Boolean! 
131136  type: PromptType! 
137+   visible: Boolean! 
138+   enabled: Boolean 
132139  name: String 
133140  message: String 
134141  description: String 
@@ -154,12 +161,13 @@ type Progress {
154161  args: [String] 
155162} 
156163
157- type Task { 
164+ type Task implements DescribedEntity  { 
158165  id: ID! 
159166  status: TaskStatus! 
160-   name: String!  
167+   name: String 
161168  command: String! 
162169  description: String 
170+   link: String 
163171  logs: [TaskLog] 
164172} 
165173
@@ -182,6 +190,15 @@ enum TaskLogType {
182190  stderr 
183191} 
184192
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+ 
185202type Query { 
186203  progress (id: ID!): Progress 
187204  cwd: String! 
@@ -196,6 +213,8 @@ type Query {
196213  plugin (id: ID!): Plugin 
197214  tasks: [Task] 
198215  task (id: ID!): Task 
216+   configurations: [Configuration] 
217+   configuration (id: ID!): Configuration 
199218} 
200219
201220type Mutation { 
Original file line number Diff line number Diff line change 33
44fragment  prompt  on  Prompt  {
55  id 
6-   enabled 
76  type 
7+   visible 
8+   enabled 
89  name 
910  message 
1011  description 
Original file line number Diff line number Diff line change @@ -8,20 +8,20 @@ export default function ({
88  return  { 
99    computed : { 
1010      configurationValid  ( )  { 
11-         return  this . enabledPrompts . filter ( 
11+         return  this . visiblePrompts . filter ( 
1212          p  => 
1313            p . error  || 
1414            p . value  ===  null  || 
1515            JSON . parse ( p . value )  ===  '' 
1616        ) . length  ===  0 
1717      } , 
1818
19-       enabledPrompts  ( )  { 
19+       visiblePrompts  ( )  { 
2020        if  ( ! this [ field ] )  { 
2121          return  [ ] 
2222        } 
2323        return  this [ field ] . prompts . filter ( 
24-           p  =>  p . enabled 
24+           p  =>  p . visible 
2525        ) 
2626      } 
2727    } , 
Original file line number Diff line number Diff line change 201201              />
202202
203203              <VueButton 
204-                 v-if =" enabledPrompts .length" 
204+                 v-if =" visiblePrompts .length" 
205205                icon-right =" arrow_forward" 
206206                :label =" $t('views.project-create.tabs.features.buttons.next')" 
207207                class =" big primary" 
249249            id =" config" 
250250            :label =" $t('views.project-create.tabs.configuration.title')" 
251251            icon =" settings_applications" 
252-             :disabled =" !detailsValid || !presetValid || !manual || !enabledPrompts .length" 
252+             :disabled =" !detailsValid || !presetValid || !manual || !visiblePrompts .length" 
253253            lazy 
254254          >
255255            <div  class =" content vue-ui-disable-scroll" 
256256              <PromptsList 
257-                 :prompts =" enabledPrompts " 
257+                 :prompts =" visiblePrompts " 
258258                @answer =" answerPrompt" 
259259              />
260260            </div >
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments