11import { GridModel } from '@xh/hoist/cmp/grid' ;
2- import { span } from '@xh/hoist/cmp/layout' ;
32import { Content , HoistModel , managed , TaskObserver , XH } from '@xh/hoist/core' ;
43import { DockContainerModel } from '@xh/hoist/desktop/cmp/dock' ;
54import { PanelModel } from '@xh/hoist/desktop/cmp/panel' ;
@@ -124,11 +123,14 @@ export class DocsPanelModel extends HoistModel {
124123 return this . docService . getDocsByCategory ( this . activeDoc . source , this . activeDoc . category ) ;
125124 }
126125
127- /** Categories for the active doc's source. */
126+ /** Categories for the active doc's source, filtered to those with at least one doc . */
128127 @computed
129128 get activeSourceCategories ( ) : DocCategory [ ] {
130129 if ( ! this . activeDoc ) return [ ] ;
131- return this . docService . getCategories ( this . activeDoc . source ) ;
130+ const { source} = this . activeDoc ;
131+ return this . docService
132+ . getCategories ( source )
133+ . filter ( cat => this . docService . getDocsByCategory ( source , cat . id ) . length > 0 ) ;
132134 }
133135
134136 /** H2-level sections parsed from the current document content. */
@@ -308,6 +310,7 @@ export class DocsPanelModel extends HoistModel {
308310 return new GridModel ( {
309311 selModel : 'single' ,
310312 treeMode : true ,
313+ clicksToExpand : 1 ,
311314 showHover : true ,
312315 expandLevel : 1 ,
313316 store : {
@@ -327,12 +330,7 @@ export class DocsPanelModel extends HoistModel {
327330 {
328331 field : 'title' ,
329332 flex : 1 ,
330- isTreeColumn : true ,
331- renderer : ( v , { record} ) => {
332- return record . data . isSource
333- ? span ( { style : { color : 'var(--xh-black)' } , item : v } )
334- : v ;
335- }
333+ isTreeColumn : true
336334 } ,
337335 {
338336 field : 'order' ,
@@ -484,40 +482,36 @@ export class DocsPanelModel extends HoistModel {
484482
485483 getCategoryIcon ( categoryId : string ) {
486484 switch ( categoryId ) {
487- // hoist-react categories
488- case 'overview' :
489- return Icon . home ( ) ;
490- case 'core' :
491- return Icon . gear ( ) ;
485+ case 'app-development' :
486+ return Icon . code ( ) ;
492487 case 'components' :
493488 return Icon . gridPanel ( ) ;
489+ case 'concepts' :
490+ return Icon . book ( ) ;
491+ case 'core' :
492+ return Icon . gear ( ) ;
493+ case 'core-features' :
494+ return Icon . boxFull ( ) ;
495+ case 'core-framework' :
496+ return Icon . gear ( ) ;
494497 case 'desktop' :
495498 return Icon . desktop ( ) ;
499+ case 'devops' :
500+ return Icon . server ( ) ;
501+ case 'grails-platform' :
502+ return Icon . database ( ) ;
503+ case 'infrastructure' :
504+ return Icon . server ( ) ;
496505 case 'mobile' :
497506 return Icon . mobile ( ) ;
498- case 'utilities' :
499- return Icon . wrench ( ) ;
500- case 'concepts' :
501- return Icon . book ( ) ;
507+ case 'overview' :
508+ return Icon . home ( ) ;
502509 case 'supporting' :
503510 return Icon . cube ( ) ;
504- case 'devops' :
505- return Icon . server ( ) ;
506511 case 'upgrade' :
507512 return Icon . arrowUp ( ) ;
508- // hoist-core categories
509- case 'core-framework' :
510- return Icon . gear ( ) ;
511- case 'core-features' :
512- return Icon . gears ( ) ;
513- case 'infrastructure' :
514- return Icon . server ( ) ;
515- case 'app-development' :
516- return Icon . code ( ) ;
517- case 'grails-platform' :
518- return Icon . database ( ) ;
519- case 'build' :
520- return Icon . boxFull ( ) ;
513+ case 'utilities' :
514+ return Icon . wrench ( ) ;
521515 default :
522516 return Icon . folder ( ) ;
523517 }
0 commit comments