@@ -506,6 +506,9 @@ export class Application {
506
506
if ( diffCrawledData . controllers . length > 0 ) {
507
507
actions . push ( ( ) => this . prepareControllers ( ) ) ;
508
508
}
509
+ if ( diffCrawledData . entities . length > 0 ) {
510
+ actions . push ( ( ) => this . prepareEntities ( ) ) ;
511
+ }
509
512
if ( diffCrawledData . modules . length > 0 ) {
510
513
actions . push ( ( ) => this . prepareModules ( ) ) ;
511
514
}
@@ -610,6 +613,9 @@ export class Application {
610
613
if ( DependenciesEngine . controllers . length > 0 ) {
611
614
logger . info ( `- controller : ${ DependenciesEngine . controllers . length } ` ) ;
612
615
}
616
+ if ( DependenciesEngine . entities . length > 0 ) {
617
+ logger . info ( `- entity : ${ DependenciesEngine . entities . length } ` ) ;
618
+ }
613
619
if ( DependenciesEngine . directives . length > 0 ) {
614
620
logger . info ( `- directive : ${ DependenciesEngine . directives . length } ` ) ;
615
621
}
@@ -659,6 +665,12 @@ export class Application {
659
665
} ) ;
660
666
}
661
667
668
+ if ( DependenciesEngine . entities . length > 0 ) {
669
+ actions . push ( ( ) => {
670
+ return this . prepareEntities ( ) ;
671
+ } ) ;
672
+ }
673
+
662
674
if ( DependenciesEngine . injectables . length > 0 ) {
663
675
actions . push ( ( ) => {
664
676
return this . prepareInjectables ( ) ;
@@ -1439,6 +1451,42 @@ at least one config for the 'info' or 'source' tab in --navTabConfig.`);
1439
1451
} ) ;
1440
1452
}
1441
1453
1454
+ public prepareEntities ( someEntities ?) {
1455
+ logger . info ( 'Prepare entities' ) ;
1456
+ Configuration . mainData . entities = someEntities
1457
+ ? someEntities
1458
+ : DependenciesEngine . getEntities ( ) ;
1459
+
1460
+ return new Promise ( ( resolve , reject ) => {
1461
+ let i = 0 ;
1462
+ const len = Configuration . mainData . entities . length ;
1463
+ const loop = ( ) => {
1464
+ if ( i < len ) {
1465
+ let entity = Configuration . mainData . entities [ i ] ;
1466
+ let page = {
1467
+ path : 'entities' ,
1468
+ name : entity . name ,
1469
+ id : entity . id ,
1470
+ navTabs : this . getNavTabs ( entity ) ,
1471
+ context : 'entity' ,
1472
+ entity : entity ,
1473
+ depth : 1 ,
1474
+ pageType : COMPODOC_DEFAULTS . PAGE_TYPES . INTERNAL
1475
+ } ;
1476
+ if ( entity . isDuplicate ) {
1477
+ page . name += '-' + entity . duplicateId ;
1478
+ }
1479
+ Configuration . addPage ( page ) ;
1480
+ i ++ ;
1481
+ loop ( ) ;
1482
+ } else {
1483
+ resolve ( true ) ;
1484
+ }
1485
+ } ;
1486
+ loop ( ) ;
1487
+ } ) ;
1488
+ }
1489
+
1442
1490
public prepareComponents ( someComponents ?) {
1443
1491
logger . info ( 'Prepare components' ) ;
1444
1492
Configuration . mainData . components = someComponents
@@ -1747,7 +1795,7 @@ at least one config for the 'info' or 'source' tab in --navTabConfig.`);
1747
1795
1748
1796
return new Promise ( ( resolve , reject ) => {
1749
1797
/*
1750
- * loop with components, directives, controllers, classes, injectables, interfaces, pipes, guards, misc functions variables
1798
+ * loop with components, directives, controllers, entities, classes, injectables, interfaces, pipes, guards, misc functions variables
1751
1799
*/
1752
1800
let files = [ ] ;
1753
1801
let totalProjectStatementDocumented = 0 ;
@@ -1764,9 +1812,9 @@ at least one config for the 'info' or 'source' tab in --navTabConfig.`);
1764
1812
}
1765
1813
return status ;
1766
1814
} ;
1767
- let processComponentsAndDirectivesAndControllers = list => {
1815
+ const processComponentsAndDirectivesAndControllersAndEntities = list => {
1768
1816
_ . forEach ( list , ( el : any ) => {
1769
- let element = ( Object as any ) . assign ( { } , el ) ;
1817
+ const element = ( Object as any ) . assign ( { } , el ) ;
1770
1818
if ( ! element . propertiesClass ) {
1771
1819
element . propertiesClass = [ ] ;
1772
1820
}
@@ -2046,9 +2094,18 @@ at least one config for the 'info' or 'source' tab in --navTabConfig.`);
2046
2094
} ) ;
2047
2095
} ;
2048
2096
2049
- processComponentsAndDirectivesAndControllers ( Configuration . mainData . components ) ;
2050
- processComponentsAndDirectivesAndControllers ( Configuration . mainData . directives ) ;
2051
- processComponentsAndDirectivesAndControllers ( Configuration . mainData . controllers ) ;
2097
+ processComponentsAndDirectivesAndControllersAndEntities (
2098
+ Configuration . mainData . components
2099
+ ) ;
2100
+ processComponentsAndDirectivesAndControllersAndEntities (
2101
+ Configuration . mainData . directives
2102
+ ) ;
2103
+ processComponentsAndDirectivesAndControllersAndEntities (
2104
+ Configuration . mainData . controllers
2105
+ ) ;
2106
+ processComponentsAndDirectivesAndControllersAndEntities (
2107
+ Configuration . mainData . entities
2108
+ ) ;
2052
2109
2053
2110
processClasses ( Configuration . mainData . classes , 'class' , 'classe' ) ;
2054
2111
processClasses ( Configuration . mainData . injectables , 'injectable' , 'injectable' ) ;
0 commit comments