@eui/tools 6.12.20 → 6.12.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.12.
|
|
1
|
+
6.12.21
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 6.12.21 (2023-06-26)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* disable non-existing route for playground - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([62f8497d](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/62f8497d3cdc4fbc5d558c28510aef639f7c8618))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
1
10
|
## 6.12.20 (2023-06-25)
|
|
2
11
|
|
|
3
12
|
##### Chores
|
package/package.json
CHANGED
|
@@ -496,6 +496,25 @@ const processRoutesConfig = (project, envTarget, build, routesFile, routesFileCo
|
|
|
496
496
|
return routeDef;
|
|
497
497
|
};
|
|
498
498
|
|
|
499
|
+
const getRouteDefFromMenuLink = (link) => {
|
|
500
|
+
let routeDef = null;
|
|
501
|
+
|
|
502
|
+
if (link.url) {
|
|
503
|
+
routeDefsBaseJSON.forEach((r) => {
|
|
504
|
+
if (r.menuLinkDefs && r.menuLinkDefs.length > 0) {
|
|
505
|
+
r.menuLinkDefs.forEach((md) => {
|
|
506
|
+
if (md.url === link.url) {
|
|
507
|
+
routeDef = r;
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return routeDef;
|
|
516
|
+
};
|
|
517
|
+
|
|
499
518
|
// inner method for checking based on the "allowedEnvs" option provided on the links definition if the link has to be added
|
|
500
519
|
// to the links list
|
|
501
520
|
|
|
@@ -567,7 +586,62 @@ const processRoutesConfig = (project, envTarget, build, routesFile, routesFileCo
|
|
|
567
586
|
|
|
568
587
|
tools.logInfo(`Links generated : ${linksGenerated.length} found`);
|
|
569
588
|
|
|
570
|
-
|
|
589
|
+
// checking if in playground route mode (local dev), in this case we mark the non-existing routes
|
|
590
|
+
// as disabled locally
|
|
591
|
+
let finalLinksGenerated = [];
|
|
592
|
+
if (project.externalRoutesSources.routesFilenameTemplate.indexOf('playground') > 0) {
|
|
593
|
+
tools.logInfo('Disabling non-active routes for playground');
|
|
594
|
+
|
|
595
|
+
linksGenerated.forEach((link) => {
|
|
596
|
+
let newLink = link;
|
|
597
|
+
|
|
598
|
+
if (link.parentId) {
|
|
599
|
+
let newLinkChildren = [];
|
|
600
|
+
|
|
601
|
+
link.children.forEach((subLink) => {
|
|
602
|
+
const defRoute = getRouteDefFromMenuLink(subLink);
|
|
603
|
+
|
|
604
|
+
if (defRoute) {
|
|
605
|
+
const routePathInInputRoutes = mergedRoutes.filter(r => r.path === defRoute.path)[0];
|
|
606
|
+
|
|
607
|
+
if (!routePathInInputRoutes) {
|
|
608
|
+
subLink.disabled = true;
|
|
609
|
+
|
|
610
|
+
} else {
|
|
611
|
+
tools.logInfo(`[${subLink.url}] --> route found in input routes - enabled`);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
newLinkChildren.push(subLink);
|
|
615
|
+
});
|
|
616
|
+
newLink.children = newLinkChildren;
|
|
617
|
+
|
|
618
|
+
const enabledChildren = newLink.children.filter(c => !c.disabled);
|
|
619
|
+
if (enabledChildren.length === 0) {
|
|
620
|
+
newLink.disabled = true;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
} else {
|
|
624
|
+
const defRoute = getRouteDefFromMenuLink(link);
|
|
625
|
+
|
|
626
|
+
if (defRoute) {
|
|
627
|
+
const routePathInInputRoutes = mergedRoutes.filter(r => r.path === defRoute.path)[0];
|
|
628
|
+
|
|
629
|
+
if (!routePathInInputRoutes) {
|
|
630
|
+
newLink.disabled = true;
|
|
631
|
+
} else {
|
|
632
|
+
tools.logInfo(`[${link.url}] --> route found in input routes - enabled`);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
finalLinksGenerated.push(newLink);
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
} else {
|
|
641
|
+
finalLinksGenerated = linksGenerated;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
tools.writeJsonFileSync(path.join(projectAssetsPath, 'route-defs-links.json'), finalLinksGenerated);
|
|
571
645
|
|
|
572
646
|
// getting routes content for replacement
|
|
573
647
|
|