File tree Expand file tree Collapse file tree 5 files changed +27
-2
lines changed
Expand file tree Collapse file tree 5 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,21 @@ export class Workspace implements IPublicApiWorkspace {
3434 return new ShellWindow ( this [ workspaceSymbol ] . window ) ;
3535 }
3636
37+ get resourceTypeList ( ) {
38+ return Array . from ( this [ workspaceSymbol ] . resourceTypeMap . values ( ) ) . map ( ( d ) => {
39+ const { name : resourceName , type : resourceType } = d ;
40+ const {
41+ description,
42+ } = d . resourceTypeModel ( { } as any , { } ) ;
43+
44+ return {
45+ resourceName,
46+ resourceType,
47+ description,
48+ } ;
49+ } ) ;
50+ }
51+
3752 onWindowRendererReady ( fn : ( ) => void ) : IPublicTypeDisposable {
3853 return this [ workspaceSymbol ] . onWindowRendererReady ( fn ) ;
3954 }
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ export class Resource implements IPublicModelResource {
3737 return this [ resourceSymbol ] . category ;
3838 }
3939
40+ get description ( ) {
41+ return this [ resourceSymbol ] . description ;
42+ }
43+
4044 get children ( ) {
4145 return this [ resourceSymbol ] . children . map ( ( child ) => new Resource ( child ) ) ;
4246 }
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export interface IBaseModelResource<
1919
2020 get viewName ( ) : string | undefined ;
2121
22+ get description ( ) : string | undefined ;
23+
2224 get config ( ) : {
2325 disableBehaviors ?: ( 'copy' | 'remove' ) [ ] ;
2426 } | undefined ;
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ export interface IBaseResource<T> extends IBaseModelResource<T> {
1212
1313 skeleton : ISkeleton ;
1414
15+ description ?: string ;
16+
1517 get editorViews ( ) : IPublicTypeEditorView [ ] ;
1618
1719 get defaultViewType ( ) : string ;
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ export interface IWorkspace extends Omit<IPublicApiWorkspace<
3333
3434 plugins : ILowCodePluginManager ;
3535
36+ resourceTypeMap : Map < string , ResourceType > ;
37+
3638 getResourceList ( ) : IResource [ ] ;
3739
3840 getResourceType ( resourceName : string ) : IResourceType ;
@@ -55,12 +57,12 @@ export class Workspace implements IWorkspace {
5557
5658 enableAutoOpenFirstWindow : boolean ;
5759
60+ resourceTypeMap : Map < string , ResourceType > = new Map ( ) ;
61+
5862 private emitter : IEventBus = createModuleEventBus ( 'workspace' ) ;
5963
6064 private _isActive = false ;
6165
62- private resourceTypeMap : Map < string , ResourceType > = new Map ( ) ;
63-
6466 private resourceList : IResource [ ] = [ ] ;
6567
6668 get skeleton ( ) {
You can’t perform that action at this time.
0 commit comments