13
13
</el-tooltip >
14
14
</el-button-group >
15
15
<span v-if =" !this.guidedProperties.tourStarted" >
16
- <el-tooltip v-if = " editorTypeDocumentation " :content =" editorDocumentation ? $t('hide task documentation') : $t('show task documentation')" :persistent =" false" transition =" " :hide-after =" 0" >
16
+ <el-tooltip :content =" editorDocumentation ? $t('hide task documentation') : $t('show task documentation')" :persistent =" false" transition =" " :hide-after =" 0" >
17
17
<el-button type =" info" :icon =" editorDocumentation ? icon.Close : icon.BookMultipleOutline" circle style =" float : right " size =" small" @click =" setShowDocumentation" />
18
18
</el-tooltip >
19
- <el-tooltip v-else :content =" $t('Click on a task to show documentation')" :persistent =" false" transition =" " :hide-after =" 0" >
20
- <el-button type =" info" :icon =" icon.Help" circle style =" float : right " size =" small" @click =" setShowDocumentation" />
21
- </el-tooltip >
22
19
</span >
23
20
</nav >
24
21
45
42
{{ placeholder }}
46
43
</div >
47
44
</div >
48
- <div v-if =" !this.guidedProperties.tourStarted" :class =" [editorTypeDocumentation && plugin && editorDocumentation ? 'plugin-doc-active' : '','plugin-doc']" >
45
+ <div v-if =" !this.guidedProperties.tourStarted" :class =" [editorDocumentation ? 'plugin-doc-active' : '','plugin-doc']" >
49
46
<markdown v-if =" plugin" :source =" plugin.markdown" />
47
+ <div v-else >
48
+ <div class =" img get-started" />
49
+ <el-alert type =" info" :title =" $t('focus task')" show-icon :closable =" false" />
50
+ </div >
50
51
</div >
51
52
</div >
52
53
</div >
100
101
Close: shallowRef (Close)
101
102
},
102
103
oldDecorations: [],
103
- editorDocumentation: undefined
104
+ editorDocumentation: undefined ,
105
+ plugin: undefined ,
106
+ taskType: undefined
104
107
};
105
108
},
106
109
computed: {
107
- ... mapState (" plugin" , [" plugin " , " pluginSingleList" ," editorTypeDocumentation " ]),
110
+ ... mapState (" plugin" , [" pluginSingleList" ," pluginsDocumentation " ]),
108
111
... mapGetters (" core" , [" guidedProperties" ]),
109
112
themeComputed () {
110
113
const darkTheme = document .getElementsByTagName (" html" )[0 ].className .indexOf (" dark" ) >= 0 ;
317
320
let model = this .editor .getModel ();
318
321
const taskType = yamlUtils .getTaskType (model .getValue (),position)
319
322
if (taskType && this .pluginSingleList .includes (taskType)) {
320
- if ( localStorage . getItem ( " editorDocumentation " ) !== " false " ) {
323
+ if ( ! this . pluginsDocumentation [taskType] ) {
321
324
this .$store
322
325
.dispatch (" plugin/load" , {cls: taskType})
326
+ .then (plugin => {
327
+ this .$store .commit (" plugin/setPluginsDocumentation" , {... this .pluginsDocumentation , [taskType]: plugin});
328
+ this .plugin = plugin;
329
+ });
330
+ } else if (this .pluginsDocumentation [taskType]) {
331
+ this .plugin = this .pluginsDocumentation [taskType];
323
332
}
324
- this .$store . commit ( " plugin/setEditorTypeDocumentation " , taskType) ;
333
+ this .taskType = taskType;
325
334
} else {
326
- this .$store .commit (" plugin/setEditorTypeDocumentation" , undefined );
335
+ this .plugin = undefined ;
336
+ this .taskType = undefined ;
327
337
}
328
338
});
329
339
},
358
368
setShowDocumentation () {
359
369
this .editorDocumentation = ! this .editorDocumentation ;
360
370
localStorage .setItem (" editorDocumentation" , (this .editorDocumentation ).toString ());
361
- if (this .editorTypeDocumentation ) {
362
- this .$store
363
- .dispatch (" plugin/load" , {cls: this .editorTypeDocumentation })
371
+ if (this .taskType ) {
372
+ if (! this .pluginsDocumentation [this .taskType ]) {
373
+ this .$store
374
+ .dispatch (" plugin/load" , {cls: this .taskType })
375
+ .then (plugin => {
376
+ this .$store .commit (" plugin/setPluginsDocumentation" , {... this .pluginsDocumentation , [this .taskType ]: plugin});
377
+ this .plugin = plugin;
378
+ });
379
+ } else if (this .pluginsDocumentation [this .taskType ]) {
380
+ this .plugin = this .pluginsDocumentation [this .taskType ];
381
+ }
364
382
}
365
383
}
366
384
},
486
504
padding : calc (var (--spacer )* 1.5 );
487
505
}
488
506
507
+ div .img {
508
+ min-height : 130px ;
509
+ height : 100% ;
510
+
511
+ & .get-started {
512
+ background : url (" ../../assets/onboarding/onboarding-started-light.svg" ) no-repeat center ;
513
+
514
+ html .dark & {
515
+ background : url (" ../../assets/onboarding/onboarding-started-dark.svg" ) no-repeat center ;
516
+ }
517
+ }
518
+ }
519
+
489
520
</style >
0 commit comments