@@ -16,17 +16,17 @@ import { Command, CommandOption, CommandText } from '../odo/command';
16
16
import { Progress } from '../util/progress' ;
17
17
import { CliExitData } from '../cli' ;
18
18
import { Refs , Type } from '../util/refs' ;
19
- import { Delayer , wait } from '../util/async' ;
19
+ import { Delayer } from '../util/async' ;
20
20
import { Platform } from '../util/platform' ;
21
21
import { selectWorkspaceFolder } from '../util/workspace' ;
22
22
import { ToolsConfig } from '../tools' ;
23
23
import LogViewLoader from '../webview/log/LogViewLoader' ;
24
24
import DescribeViewLoader from '../webview/describe/describeViewLoader' ;
25
25
import { vsCommand , VsCommandError } from '../vscommand' ;
26
26
import { SourceType } from '../odo/config' ;
27
- import { ComponentKind , ComponentTypeAdapter , DevfileComponentType , ImageStreamTag , isDevfileComponent , isImageStreamTag } from '../odo/componentType' ;
27
+ import { ComponentKind , ComponentTypeAdapter , ComponentTypeDescription , DevfileComponentType , ImageStreamTag , isDevfileComponent , isImageStreamTag } from '../odo/componentType' ;
28
28
import { Url } from '../odo/url' ;
29
- import { ComponentDescription , StarterProjectDescription } from '../odo/catalog' ;
29
+ import { StarterProjectDescription } from '../odo/catalog' ;
30
30
import { isStarterProject , StarterProject } from '../odo/componentTypeDescription' ;
31
31
import path = require( 'path' ) ;
32
32
import globby = require( 'globby' ) ;
@@ -633,13 +633,12 @@ export class Component extends OpenShiftItem {
633
633
progressIndicator . busy = true ;
634
634
progressIndicator . placeholder = 'Loading available Component types' ;
635
635
progressIndicator . show ( ) ;
636
- await wait ( 5000 ) ;
637
636
const componentTypes = await Component . odo . getComponentTypes ( ) ;
638
637
if ( componentTypeName ) {
639
638
componentType = componentTypes . find ( type => type . name === componentTypeName && type . kind === componentKind && ( ! version || type . version === version ) ) ;
640
639
}
641
640
if ( ! componentType ) {
642
- componentType = await window . showQuickPick ( componentTypes , { placeHolder : 'Select Component type' , ignoreFocusOut : true } ) ;
641
+ componentType = await window . showQuickPick ( componentTypes . sort ( ( c1 , c2 ) => c1 . label . localeCompare ( c2 . label ) ) , { placeHolder : 'Select Component type' , ignoreFocusOut : true } ) ;
643
642
} else {
644
643
progressIndicator . hide ( ) ;
645
644
}
@@ -659,7 +658,10 @@ export class Component extends OpenShiftItem {
659
658
progressIndicator . placeholder = 'Loading Starter Projects for selected Component Type'
660
659
progressIndicator . show ( ) ;
661
660
const descr = await Component . odo . execute ( Command . describeCatalogComponent ( componentType . name ) ) ;
662
- const starterProjects : StarterProjectDescription [ ] = Component . odo . loadItems < StarterProjectDescription > ( descr , ( data :{ Data :ComponentDescription } ) => data . Data . starterProjects ) ;
661
+ const starterProjects : StarterProjectDescription [ ] = Component . odo . loadItems < StarterProjectDescription > ( descr , ( data :ComponentTypeDescription [ ] ) => {
662
+ const dfCompType = data . find ( ( comp ) => comp . RegistryName === componentType . registryName ) ;
663
+ return dfCompType . Devfile . starterProjects
664
+ } ) ;
663
665
progressIndicator . hide ( ) ;
664
666
if ( starterProjects ?. length && starterProjects ?. length > 0 ) {
665
667
const create = await window . showQuickPick ( [ 'Yes' , 'No' ] , { placeHolder : `Initialize Component using ${ starterProjects . length === 1 ? '\'' . concat ( starterProjects [ 0 ] . name . concat ( '\' ' ) ) : '' } Starter Project?` } ) ;
0 commit comments