aril 1.1.96 → 1.2.0
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/boot/base/index.d.ts +1 -0
- package/boot/base/src/create-base-app-config.d.ts +12 -0
- package/boot/bridge/index.d.ts +2 -0
- package/boot/bridge/src/mfe-bridge.d.ts +33 -0
- package/boot/bridge/src/provide-mfe-bridge.d.ts +1 -0
- package/boot/config/api/index.d.ts +1 -0
- package/boot/config/api/src/api.service.d.ts +2 -2
- package/boot/config/api/src/interfaces.d.ts +1 -19
- package/boot/config/apps/src/apps.service.d.ts +7 -4
- package/boot/config/plugins/src/getNgZone.d.ts +1 -1
- package/boot/config/plugins/src/interfaces.d.ts +0 -37
- package/boot/host/src/app.component.d.ts +5 -3
- package/boot/mfe/src/app.component.d.ts +4 -2
- package/esm2022/boot/base/aril-boot-base.mjs +5 -0
- package/esm2022/boot/base/index.mjs +2 -0
- package/esm2022/boot/base/src/create-base-app-config.mjs +30 -0
- package/esm2022/boot/bridge/aril-boot-bridge.mjs +5 -0
- package/esm2022/boot/bridge/index.mjs +3 -0
- package/esm2022/boot/bridge/src/mfe-bridge.mjs +59 -0
- package/esm2022/boot/bridge/src/provide-mfe-bridge.mjs +6 -0
- package/esm2022/boot/config/api/index.mjs +1 -1
- package/esm2022/boot/config/api/src/api.service.mjs +14 -9
- package/esm2022/boot/config/api/src/interfaces.mjs +2 -21
- package/esm2022/boot/config/apps/src/apps.service.mjs +13 -16
- package/esm2022/boot/config/plugins/src/getNgZone.mjs +4 -3
- package/esm2022/boot/config/plugins/src/interfaces.mjs +1 -60
- package/esm2022/boot/config/plugins/src/plugins.service.mjs +9 -21
- package/esm2022/boot/host/src/app.component.mjs +11 -10
- package/esm2022/boot/host/src/bootstrap.mjs +9 -22
- package/esm2022/boot/mfe/src/app.component.mjs +20 -17
- package/esm2022/boot/mfe/src/bootstrap.mjs +13 -31
- package/esm2022/boot/pages/aril-boot-pages.mjs +5 -0
- package/esm2022/boot/pages/index.mjs +3 -0
- package/esm2022/{util/custom_pages → boot/pages}/src/forbidden.component.mjs +1 -1
- package/esm2022/{util/custom_pages → boot/pages}/src/notFound.component.mjs +1 -1
- package/esm2022/keycloak/src/auth.interceptor.mjs +15 -78
- package/esm2022/provider/src/prodiveHost.mjs +5 -8
- package/esm2022/provider/src/prodiveHostRouter.mjs +4 -3
- package/esm2022/provider/src/provideHostKeycloak.mjs +10 -2
- package/esm2022/theme/layout/app/breadcrumb/app.breadcrumb.component.mjs +4 -3
- package/esm2022/theme/layout/app/expandableMenu/expandable-menu.component.mjs +3 -4
- package/esm2022/theme/layout/app/general-search/general-search.component.mjs +3 -2
- package/esm2022/theme/layout/app/history/history.service.mjs +3 -2
- package/esm2022/theme/layout/app/layout/app.layout.component.mjs +1 -2
- package/esm2022/theme/layout/app/site-map/site-map-sidebar.component.mjs +5 -4
- package/esm2022/theme/layout/app/static-sidebar/static-sidebar.component.mjs +3 -4
- package/esm2022/theme/layout/app/topbar/app.topbar.component.mjs +7 -4
- package/esm2022/ui/form/src/form.component.mjs +22 -4
- package/esm2022/ui-business/assetPicker/src/asset-picker.component.mjs +14 -2
- package/esm2022/util/directives/src/detail-page-customization/detail-page-customization.directive.mjs +4 -3
- package/esm2022/util/pipes/src/translate-json/translate-json.pipe.mjs +3 -4
- package/esm2022/util/sync-active-tab-route/src/sync-active-tab-route.directive.mjs +1 -1
- package/fesm2022/{aril-app.component-hxaLgwmC.mjs → aril-app.component-wxP3y8dg.mjs} +22 -22
- package/fesm2022/aril-app.component-wxP3y8dg.mjs.map +1 -0
- package/fesm2022/aril-boot-base.mjs +37 -0
- package/fesm2022/aril-boot-base.mjs.map +1 -0
- package/fesm2022/aril-boot-bridge.mjs +70 -0
- package/fesm2022/aril-boot-bridge.mjs.map +1 -0
- package/fesm2022/aril-boot-config-api.mjs +12 -27
- package/fesm2022/aril-boot-config-api.mjs.map +1 -1
- package/fesm2022/aril-boot-config-apps.mjs +12 -15
- package/fesm2022/aril-boot-config-apps.mjs.map +1 -1
- package/fesm2022/aril-boot-config-plugins.mjs +10 -81
- package/fesm2022/aril-boot-config-plugins.mjs.map +1 -1
- package/fesm2022/aril-boot-host.mjs +17 -29
- package/fesm2022/aril-boot-host.mjs.map +1 -1
- package/fesm2022/{aril-boot-mfe-app.component-s1a-tkOD.mjs → aril-boot-mfe-app.component-7IjAmjz0.mjs} +22 -22
- package/fesm2022/aril-boot-mfe-app.component-7IjAmjz0.mjs.map +1 -0
- package/fesm2022/{aril-boot-mfe-aril-boot-mfe-wLTqwDtz.mjs → aril-boot-mfe-aril-boot-mfe-KXDpUyv7.mjs} +15 -69
- package/fesm2022/aril-boot-mfe-aril-boot-mfe-KXDpUyv7.mjs.map +1 -0
- package/fesm2022/aril-boot-mfe.mjs +3 -6
- package/fesm2022/aril-boot-mfe.mjs.map +1 -1
- package/fesm2022/{aril-util-custom_pages.mjs → aril-boot-pages.mjs} +1 -1
- package/fesm2022/aril-boot-pages.mjs.map +1 -0
- package/fesm2022/aril-keycloak.mjs +14 -77
- package/fesm2022/aril-keycloak.mjs.map +1 -1
- package/fesm2022/aril-provider.mjs +15 -10
- package/fesm2022/aril-provider.mjs.map +1 -1
- package/fesm2022/aril-theme-layout.mjs +15 -17
- package/fesm2022/aril-theme-layout.mjs.map +1 -1
- package/fesm2022/aril-ui-business-assetPicker.mjs +13 -1
- package/fesm2022/aril-ui-business-assetPicker.mjs.map +1 -1
- package/fesm2022/aril-ui-form.mjs +20 -3
- package/fesm2022/aril-ui-form.mjs.map +1 -1
- package/fesm2022/aril-util-directives.mjs +3 -2
- package/fesm2022/aril-util-directives.mjs.map +1 -1
- package/fesm2022/aril-util-pipes.mjs +2 -3
- package/fesm2022/aril-util-pipes.mjs.map +1 -1
- package/fesm2022/aril-util-sync-active-tab-route.mjs.map +1 -1
- package/fesm2022/aril.mjs +24 -87
- package/fesm2022/aril.mjs.map +1 -1
- package/package.json +111 -105
- package/provider/src/prodiveHost.d.ts +2 -2
- package/theme/layout/app/breadcrumb/app.breadcrumb.component.ts +3 -2
- package/theme/layout/app/expandableMenu/expandable-menu.component.d.ts +0 -2
- package/theme/layout/app/expandableMenu/expandable-menu.component.ts +373 -374
- package/theme/layout/app/general-search/general-search.component.ts +2 -1
- package/theme/layout/app/history/history.service.ts +2 -1
- package/theme/layout/app/layout/app.layout.component.d.ts +0 -1
- package/theme/layout/app/layout/app.layout.component.ts +0 -1
- package/theme/layout/app/site-map/site-map-sidebar.component.html +121 -121
- package/theme/layout/app/site-map/site-map-sidebar.component.ts +3 -2
- package/theme/layout/app/static-sidebar/static-sidebar.component.ts +336 -337
- package/theme/layout/app/topbar/app.topbar.component.ts +6 -3
- package/theme/styles/layout/_fonts.scss +1 -13
- package/ui/form/src/form.component.d.ts +4 -1
- package/boot/mfe/src/loadStyles.d.ts +0 -3
- package/esm2022/boot/mfe/src/loadStyles.mjs +0 -37
- package/esm2022/util/custom_pages/aril-util-custom_pages.mjs +0 -5
- package/esm2022/util/custom_pages/index.mjs +0 -3
- package/esm2022/util/loaders/aril-util-loaders.mjs +0 -5
- package/esm2022/util/loaders/index.mjs +0 -2
- package/esm2022/util/loaders/style/style.loader.service.mjs +0 -61
- package/fesm2022/aril-app.component-hxaLgwmC.mjs.map +0 -1
- package/fesm2022/aril-boot-mfe-app.component-s1a-tkOD.mjs.map +0 -1
- package/fesm2022/aril-boot-mfe-aril-boot-mfe-wLTqwDtz.mjs.map +0 -1
- package/fesm2022/aril-util-custom_pages.mjs.map +0 -1
- package/fesm2022/aril-util-loaders.mjs +0 -68
- package/fesm2022/aril-util-loaders.mjs.map +0 -1
- package/theme/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-BlackItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-BoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-ExtraBoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-ExtraLight.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-ExtraLightItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-Italic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-LightItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-MediumItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-SemiBoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-Thin.ttf +0 -0
- package/theme/fonts/Inter/Inter_18pt-ThinItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Black.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-BlackItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Bold.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-BoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-ExtraBold.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-ExtraBoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-ExtraLight.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-ExtraLightItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Italic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Light.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-LightItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Medium.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-MediumItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Regular.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-SemiBold.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-SemiBoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-Thin.ttf +0 -0
- package/theme/fonts/Inter/Inter_24pt-ThinItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Black.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-BlackItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Bold.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-BoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-ExtraBold.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-ExtraBoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-ExtraLight.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-ExtraLightItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Italic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Light.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-LightItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Medium.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-MediumItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Regular.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-SemiBold.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-SemiBoldItalic.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-Thin.ttf +0 -0
- package/theme/fonts/Inter/Inter_28pt-ThinItalic.ttf +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Black.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Black.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-BlackItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-BlackItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-BoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-BoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraBold.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraBold.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraBoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraBoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraLight.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraLight.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraLightItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ExtraLightItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Italic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Italic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Light.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Light.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-LightItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-LightItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-MediumItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-MediumItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-SemiBoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-SemiBoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Thin.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-Thin.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ThinItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter18pt-ThinItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Black.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Black.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-BlackItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-BlackItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Bold.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Bold.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-BoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-BoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraBold.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraBold.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraBoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraBoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraLight.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraLight.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraLightItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ExtraLightItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Italic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Italic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-LightItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-LightItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Medium.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Medium.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-MediumItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-MediumItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Regular.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Regular.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-SemiBold.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-SemiBold.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-SemiBoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-SemiBoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Thin.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-Thin.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ThinItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter24pt-ThinItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Black.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Black.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-BlackItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-BlackItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Bold.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Bold.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-BoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-BoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-ExtraBoldItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-ExtraBoldItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-ExtraLightItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-ExtraLightItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Italic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Italic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Light.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Light.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-LightItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-LightItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Medium.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Medium.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-MediumItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-MediumItalic.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Regular.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Regular.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-SemiBold.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-SemiBold.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Thin.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-Thin.woff2 +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-ThinItalic.woff +0 -0
- package/theme/fonts/Inter/woff/Inter28pt-ThinItalic.woff2 +0 -0
- package/util/loaders/index.d.ts +0 -1
- package/util/loaders/style/style.loader.service.d.ts +0 -13
- /package/{util/custom_pages → boot/pages}/index.d.ts +0 -0
- /package/{util/custom_pages → boot/pages}/src/forbidden.component.d.ts +0 -0
- /package/{util/custom_pages → boot/pages}/src/notFound.component.d.ts +0 -0
|
@@ -3,8 +3,8 @@ import { inject, Injectable, Renderer2, ElementRef, Component, ViewEncapsulation
|
|
|
3
3
|
import { Router, BaseRouteReuseStrategy } from '@angular/router';
|
|
4
4
|
import { WebComponentWrapper, startsWith } from '@angular-architects/module-federation-tools';
|
|
5
5
|
import { KeycloakAuthGuard, KeycloakService } from 'keycloak-angular';
|
|
6
|
-
import {
|
|
7
|
-
import { ForbiddenComponent, NotFoundComponent } from 'aril/
|
|
6
|
+
import { map, catchError, of } from 'rxjs';
|
|
7
|
+
import { ForbiddenComponent, NotFoundComponent } from 'aril/boot/pages';
|
|
8
8
|
|
|
9
9
|
const routePermissions = new Map();
|
|
10
10
|
function setRoutePermissions(menuItems) {
|
|
@@ -94,7 +94,7 @@ class MicroAppService {
|
|
|
94
94
|
this.userRoles = this.keycloak.getUserRoles();
|
|
95
95
|
return httpClient
|
|
96
96
|
.get(isDevMode() ? './assets/local-configs/app.local.json' : hostAPI + '/ui-sidebar-configs')
|
|
97
|
-
.pipe(
|
|
97
|
+
.pipe(map((apps) => {
|
|
98
98
|
setRoutePermissions(apps.menuItems);
|
|
99
99
|
const routes = this.buildRoutes([...apps.modules, ...apps.plugins]);
|
|
100
100
|
this.router.resetConfig([
|
|
@@ -103,11 +103,17 @@ class MicroAppService {
|
|
|
103
103
|
{ path: 'forbidden', component: ForbiddenComponent },
|
|
104
104
|
{ path: '**', component: NotFoundComponent }
|
|
105
105
|
]);
|
|
106
|
-
this.
|
|
107
|
-
|
|
106
|
+
const filteredMenuItems = this.filterMenuItemsByRole(apps.menuItems);
|
|
107
|
+
return {
|
|
108
|
+
menuItems: [
|
|
109
|
+
{ root: true, label: { tr: 'Anasayfa', en: 'Home' }, icon: 'pi pi-fw pi-home', routerLink: '/' },
|
|
110
|
+
...filteredMenuItems
|
|
111
|
+
],
|
|
112
|
+
plugins: apps.extensions || {}
|
|
113
|
+
};
|
|
108
114
|
}), catchError((err) => {
|
|
109
115
|
console.log('Error Micro Apps Loading', err);
|
|
110
|
-
return of();
|
|
116
|
+
return of({ menuItems: [], plugins: {} });
|
|
111
117
|
}));
|
|
112
118
|
}
|
|
113
119
|
buildRoutes(options) {
|
|
@@ -121,15 +127,6 @@ class MicroAppService {
|
|
|
121
127
|
});
|
|
122
128
|
return routes;
|
|
123
129
|
}
|
|
124
|
-
setMenuItems(items) {
|
|
125
|
-
globalThis.hostMenuItems.set([
|
|
126
|
-
{ root: true, label: { tr: 'Anasayfa', en: 'Home' }, icon: 'pi pi-fw pi-home', routerLink: '/' },
|
|
127
|
-
...items
|
|
128
|
-
]);
|
|
129
|
-
}
|
|
130
|
-
setPlugins(items) {
|
|
131
|
-
globalThis.pluginJson = items || {};
|
|
132
|
-
}
|
|
133
130
|
filterMenuItemsByRole(items) {
|
|
134
131
|
return items.reduce((acc, item) => {
|
|
135
132
|
if (!this.hasPermission(item.permittedRoles)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aril-boot-config-apps.mjs","sources":["../../projects/aril/boot/config/apps/src/route-permissions.ts","../../projects/aril/boot/config/apps/src/auth.guard.ts","../../projects/aril/boot/config/apps/src/showdowDOMWrapper.ts","../../projects/aril/boot/config/apps/src/apps.service.ts","../../projects/aril/boot/config/apps/src/interfaces.ts","../../projects/aril/boot/config/apps/src/reuse-strategy.ts","../../projects/aril/boot/config/apps/aril-boot-config-apps.ts"],"sourcesContent":["import { PluginMenuItem } from './interfaces';\r\n\r\nconst routePermissions = new Map<string, string[]>();\r\n\r\nexport function setRoutePermissions(menuItems: PluginMenuItem[]): void {\r\n\troutePermissions.clear();\r\n\tbuildPermissionsMap(menuItems);\r\n}\r\n\r\nexport function getRoutePermissions(url: string): string[] | undefined {\r\n\tconst normalizedUrl = url.split('?')[0].replace(/^\\//, '');\r\n return routePermissions.get(normalizedUrl);\r\n}\r\n\r\nfunction buildPermissionsMap(items: PluginMenuItem[]): void {\r\n\tfor (const item of items) {\r\n\t\tif (item.routerLink && item.permittedRoles?.length) {\r\n\t\t\tconst normalized = item.routerLink.replace(/^\\//, '');\r\n\t\t\troutePermissions.set(normalized, item.permittedRoles);\r\n\t\t}\r\n\r\n\t\tif (item.items?.length) {\r\n\t\t\tbuildPermissionsMap(item.items);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Injectable, inject } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';\r\n\r\nimport { KeycloakAuthGuard, KeycloakService } from 'keycloak-angular';\r\n\r\nimport { getRoutePermissions } from './route-permissions';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class AuthGuard extends KeycloakAuthGuard {\r\n\tconstructor() {\r\n\t\tsuper(inject(Router), inject(KeycloakService));\r\n\t}\r\n\r\n\toverride async isAccessAllowed(\r\n\t\troute: ActivatedRouteSnapshot,\r\n\t\tstate: RouterStateSnapshot\r\n\t): Promise<boolean | UrlTree> {\r\n\t\tif (!this.authenticated) {\r\n\t\t\tawait this.keycloakAngular.login({ redirectUri: window.location.href });\r\n\t\t}\r\n\r\n\t\tconst permittedRoles = getRoutePermissions(state.url);\r\n\r\n\t\tif (permittedRoles?.length) {\r\n\t\t\tconst hasRole = permittedRoles.some((role) => this.roles.includes(role));\r\n\t\t\tif (!hasRole) {\r\n\t\t\t\treturn this.router.createUrlTree(['/forbidden']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.authenticated;\r\n\t}\r\n}\r\n","import { Component, ElementRef, OnInit, Renderer2, ViewChild, ViewEncapsulation, inject } from '@angular/core';\r\n\r\nimport { WebComponentWrapper } from '@angular-architects/module-federation-tools';\r\n\r\n@Component({\r\n\tstandalone: true,\r\n\ttemplate: '<div #vc></div>',\r\n\tencapsulation: ViewEncapsulation.ShadowDom\r\n})\r\nexport class ShadowDOMWrapperComponent extends WebComponentWrapper implements OnInit {\r\n\t@ViewChild('vc', { read: ElementRef, static: true }) override vc!: ElementRef;\r\n\r\n\tprivate renderer = inject(Renderer2);\r\n\r\n\tngOnInit(): void {\r\n\t\tconst shadowRoot = this.vc.nativeElement.parentNode;\r\n\t\tconst styleUrls = this['route'].snapshot.data.styleUrls || [];\r\n\r\n\t\t// Inject styles into the Shadow DOM\r\n\t\tstyleUrls.forEach((url: string) => {\r\n\t\t\tconst link = this.renderer.createElement('link');\r\n\t\t\tlink.setAttribute('rel', 'stylesheet');\r\n\t\t\tlink.setAttribute('type', 'text/css');\r\n\t\t\tlink.setAttribute('href', url);\r\n\t\t\tthis.renderer.appendChild(shadowRoot, link);\r\n\t\t});\r\n\t}\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject, isDevMode } from '@angular/core';\r\nimport { Router, Routes } from '@angular/router';\r\n\r\nimport {\r\n\tWebComponentWrapper,\r\n\tWebComponentWrapperOptions,\r\n\tstartsWith\r\n} from '@angular-architects/module-federation-tools';\r\nimport { KeycloakService } from 'keycloak-angular';\r\nimport { catchError, of, tap } from 'rxjs';\r\n\r\nimport { ForbiddenComponent, NotFoundComponent } from 'aril/util/custom_pages';\r\n\r\nimport { AuthGuard } from './auth.guard';\r\nimport { AppsDTO, ExtensionConfig, PluginConfig, PluginMenuItem } from './interfaces';\r\nimport { setRoutePermissions } from './route-permissions';\r\nimport { ShadowDOMWrapperComponent } from './showdowDOMWrapper';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class MicroAppService {\r\n\tprivate readonly router = inject(Router);\r\n\tprivate readonly keycloak = inject(KeycloakService);\r\n\r\n\tprivate userRoles: string[] = [];\r\n\r\n\tinit(httpClient: HttpClient, hostAPI: string) {\r\n\t\tthis.userRoles = this.keycloak.getUserRoles();\r\n\t\treturn httpClient\r\n\t\t\t.get<AppsDTO>(isDevMode() ? './assets/local-configs/app.local.json' : hostAPI + '/ui-sidebar-configs')\r\n\t\t\t.pipe(\r\n\t\t\t\ttap((apps) => {\r\n\t\t\t\t\tsetRoutePermissions(apps.menuItems);\r\n\t\t\t\t\tconst routes = this.buildRoutes([...apps.modules, ...apps.plugins]);\r\n\r\n\t\t\t\t\tthis.router.resetConfig([\r\n\t\t\t\t\t\t...this.router.config,\r\n\t\t\t\t\t\t...routes,\r\n\t\t\t\t\t\t{ path: 'forbidden', component: ForbiddenComponent },\r\n\t\t\t\t\t\t{ path: '**', component: NotFoundComponent }\r\n\t\t\t\t\t]);\r\n\t\t\t\t\tthis.setMenuItems(this.filterMenuItemsByRole(apps.menuItems));\r\n\t\t\t\t\tthis.setPlugins(apps.extensions);\r\n\t\t\t\t}),\r\n\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\tconsole.log('Error Micro Apps Loading', err);\r\n\t\t\t\t\treturn of();\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t}\r\n\r\n\tbuildRoutes(options: PluginConfig[]): Routes {\r\n\t\tconst routes: Routes = options.map((options) => {\r\n\t\t\treturn {\r\n\t\t\t\tmatcher: startsWith(options.remoteName),\r\n\t\t\t\tcomponent: options.shadowDomPassive ? WebComponentWrapper : ShadowDOMWrapperComponent,\r\n\t\t\t\tdata: options as WebComponentWrapperOptions,\r\n\t\t\t\tcanActivate: [AuthGuard]\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn routes;\r\n\t}\r\n\r\n\tsetMenuItems(items: PluginMenuItem[]): void {\r\n\t\t(<any>globalThis).hostMenuItems.set([\r\n\t\t\t{ root: true, label: { tr: 'Anasayfa', en: 'Home' }, icon: 'pi pi-fw pi-home', routerLink: '/' },\r\n\t\t\t...items\r\n\t\t]);\r\n\t}\r\n\tsetPlugins(items: Record<string, ExtensionConfig>): void {\r\n\t\t(<any>globalThis).pluginJson = items || {};\r\n\t}\r\n\r\n\tprivate filterMenuItemsByRole(items: PluginMenuItem[]): PluginMenuItem[] {\r\n\t\treturn items.reduce<PluginMenuItem[]>((acc, item) => {\r\n\t\t\tif (!this.hasPermission(item.permittedRoles)) {\r\n\t\t\t\treturn acc;\r\n\t\t\t}\r\n\r\n\t\t\tconst filteredItem = { ...item };\r\n\r\n\t\t\tif (filteredItem.items?.length) {\r\n\t\t\t\tfilteredItem.items = this.filterMenuItemsByRole(filteredItem.items);\r\n\r\n\t\t\t\tif (!filteredItem.items.length && !filteredItem.routerLink) {\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tacc.push(filteredItem);\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\t}\r\n\r\n\tprivate hasPermission(permittedRoles?: string[]): boolean {\r\n\t\tif (!permittedRoles?.length) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn permittedRoles.some((role) => this.userRoles.includes(role));\r\n\t}\r\n}\r\n","import { MenuItemCommandEvent } from 'primeng/api';\r\n\r\nimport { WebComponentWrapperOptions } from '@angular-architects/module-federation-tools';\r\n\r\nexport enum Apps {\r\n\tTHOR = 'thor',\r\n\tCRM = 'crm',\r\n\tWDM = 'wdm',\r\n\tBILLING = 'billing',\r\n\tPAYMENT = 'payment',\r\n\tYEAP = 'yeap',\r\n\tMW = 'mw',\r\n\tLENA = 'lena',\r\n\tHES = 'hes',\r\n\tCTS = 'cts',\r\n\tSIS = 'sis',\r\n\tMNG = 'mng',\r\n\tMDM = 'mdm',\r\n\tSTATE_MACHINE = 'state-machine',\r\n\tREPORT = 'report',\r\n\tLGC = 'lgc',\r\n\tDMS = 'dms'\r\n}\r\n\r\nexport interface AppsDTO {\r\n\tversion: number;\r\n\tmodules: PluginConfig[];\r\n\tplugins: PluginConfig[];\r\n\textensions: Record<string, ExtensionConfig>;\r\n\tmenuItems: PluginMenuItem[];\r\n}\r\n\r\nexport interface ExtensionConfig {\r\n\toptions: PluginConfig;\r\n}\r\n\r\nexport type PluginConfig = WebComponentWrapperOptions & {\r\n\tid?: string;\r\n\tremoteName: string;\r\n\tshadowDomPassive: boolean;\r\n\tpermittedRoles?: string[];\r\n};\r\n\r\nexport interface MenuItemAction {\r\n\tmethod?: 'GET' | 'POST';\r\n\turl: string;\r\n\tbody?: any;\r\n\tsuccessRoute: string;\r\n\tsuccessRouteResponseKey?: string;\r\n}\r\n\r\nexport interface PluginMenuItem {\r\n\trouterLink?: string;\r\n\ticon?: string;\r\n\tlabel: {\r\n\t\t[languageCode: string]: string;\r\n\t};\r\n\titems?: PluginMenuItem[];\r\n\tpermittedRoles?: string[];\r\n\taction?: MenuItemAction;\r\n\r\n\t// UI fields\r\n\tseparator?: boolean;\r\n\troot?: boolean;\r\n\tpath?: string;\r\n\tdisabled?: boolean;\r\n\tcommand?(event: MenuItemCommandEvent): void;\r\n}\r\n","import { ActivatedRouteSnapshot, BaseRouteReuseStrategy } from '@angular/router';\r\n\r\nexport class ArilReuseStrategy extends BaseRouteReuseStrategy {\r\n\toverride shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {\r\n\t\tif (curr.firstChild?.routeConfig?.data?.['remoteEntry'] === future.firstChild?.routeConfig?.data?.['remoteEntry'])\r\n\t\t\treturn false;\r\n\r\n\t\treturn future?.routeConfig === curr?.routeConfig && JSON.stringify(future?.params) === JSON.stringify(curr?.params);\r\n\t}\r\n}\r\n","/**\n * Generated bundle index. Do not edit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AM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACpH;AACD;;ACTD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"aril-boot-config-apps.mjs","sources":["../../projects/aril/boot/config/apps/src/route-permissions.ts","../../projects/aril/boot/config/apps/src/auth.guard.ts","../../projects/aril/boot/config/apps/src/showdowDOMWrapper.ts","../../projects/aril/boot/config/apps/src/apps.service.ts","../../projects/aril/boot/config/apps/src/interfaces.ts","../../projects/aril/boot/config/apps/src/reuse-strategy.ts","../../projects/aril/boot/config/apps/aril-boot-config-apps.ts"],"sourcesContent":["import { PluginMenuItem } from './interfaces';\r\n\r\nconst routePermissions = new Map<string, string[]>();\r\n\r\nexport function setRoutePermissions(menuItems: PluginMenuItem[]): void {\r\n\troutePermissions.clear();\r\n\tbuildPermissionsMap(menuItems);\r\n}\r\n\r\nexport function getRoutePermissions(url: string): string[] | undefined {\r\n\tconst normalizedUrl = url.split('?')[0].replace(/^\\//, '');\r\n return routePermissions.get(normalizedUrl);\r\n}\r\n\r\nfunction buildPermissionsMap(items: PluginMenuItem[]): void {\r\n\tfor (const item of items) {\r\n\t\tif (item.routerLink && item.permittedRoles?.length) {\r\n\t\t\tconst normalized = item.routerLink.replace(/^\\//, '');\r\n\t\t\troutePermissions.set(normalized, item.permittedRoles);\r\n\t\t}\r\n\r\n\t\tif (item.items?.length) {\r\n\t\t\tbuildPermissionsMap(item.items);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Injectable, inject } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';\r\n\r\nimport { KeycloakAuthGuard, KeycloakService } from 'keycloak-angular';\r\n\r\nimport { getRoutePermissions } from './route-permissions';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class AuthGuard extends KeycloakAuthGuard {\r\n\tconstructor() {\r\n\t\tsuper(inject(Router), inject(KeycloakService));\r\n\t}\r\n\r\n\toverride async isAccessAllowed(\r\n\t\troute: ActivatedRouteSnapshot,\r\n\t\tstate: RouterStateSnapshot\r\n\t): Promise<boolean | UrlTree> {\r\n\t\tif (!this.authenticated) {\r\n\t\t\tawait this.keycloakAngular.login({ redirectUri: window.location.href });\r\n\t\t}\r\n\r\n\t\tconst permittedRoles = getRoutePermissions(state.url);\r\n\r\n\t\tif (permittedRoles?.length) {\r\n\t\t\tconst hasRole = permittedRoles.some((role) => this.roles.includes(role));\r\n\t\t\tif (!hasRole) {\r\n\t\t\t\treturn this.router.createUrlTree(['/forbidden']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.authenticated;\r\n\t}\r\n}\r\n","import { Component, ElementRef, OnInit, Renderer2, ViewChild, ViewEncapsulation, inject } from '@angular/core';\r\n\r\nimport { WebComponentWrapper } from '@angular-architects/module-federation-tools';\r\n\r\n@Component({\r\n\tstandalone: true,\r\n\ttemplate: '<div #vc></div>',\r\n\tencapsulation: ViewEncapsulation.ShadowDom\r\n})\r\nexport class ShadowDOMWrapperComponent extends WebComponentWrapper implements OnInit {\r\n\t@ViewChild('vc', { read: ElementRef, static: true }) override vc!: ElementRef;\r\n\r\n\tprivate renderer = inject(Renderer2);\r\n\r\n\tngOnInit(): void {\r\n\t\tconst shadowRoot = this.vc.nativeElement.parentNode;\r\n\t\tconst styleUrls = this['route'].snapshot.data.styleUrls || [];\r\n\r\n\t\t// Inject styles into the Shadow DOM\r\n\t\tstyleUrls.forEach((url: string) => {\r\n\t\t\tconst link = this.renderer.createElement('link');\r\n\t\t\tlink.setAttribute('rel', 'stylesheet');\r\n\t\t\tlink.setAttribute('type', 'text/css');\r\n\t\t\tlink.setAttribute('href', url);\r\n\t\t\tthis.renderer.appendChild(shadowRoot, link);\r\n\t\t});\r\n\t}\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject, isDevMode } from '@angular/core';\r\nimport { Router, Routes } from '@angular/router';\r\n\r\nimport {\r\n\tWebComponentWrapper,\r\n\tWebComponentWrapperOptions,\r\n\tstartsWith\r\n} from '@angular-architects/module-federation-tools';\r\nimport { KeycloakService } from 'keycloak-angular';\r\nimport { Observable, catchError, map, of } from 'rxjs';\r\n\r\nimport { ForbiddenComponent, NotFoundComponent } from 'aril/boot/pages';\r\n\r\nimport { AuthGuard } from './auth.guard';\r\nimport { AppsDTO, ExtensionConfig, PluginConfig, PluginMenuItem } from './interfaces';\r\nimport { setRoutePermissions } from './route-permissions';\r\nimport { ShadowDOMWrapperComponent } from './showdowDOMWrapper';\r\n\r\nexport interface MicroAppInitResult {\r\n\tmenuItems: PluginMenuItem[];\r\n\tplugins: Record<string, ExtensionConfig>;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class MicroAppService {\r\n\tprivate readonly router = inject(Router);\r\n\tprivate readonly keycloak = inject(KeycloakService);\r\n\r\n\tprivate userRoles: string[] = [];\r\n\r\n\tinit(httpClient: HttpClient, hostAPI: string): Observable<MicroAppInitResult> {\r\n\t\tthis.userRoles = this.keycloak.getUserRoles();\r\n\t\treturn httpClient\r\n\t\t\t.get<AppsDTO>(isDevMode() ? './assets/local-configs/app.local.json' : hostAPI + '/ui-sidebar-configs')\r\n\t\t\t.pipe(\r\n\t\t\t\tmap((apps) => {\r\n\t\t\t\t\tsetRoutePermissions(apps.menuItems);\r\n\t\t\t\t\tconst routes = this.buildRoutes([...apps.modules, ...apps.plugins]);\r\n\r\n\t\t\t\t\tthis.router.resetConfig([\r\n\t\t\t\t\t\t...this.router.config,\r\n\t\t\t\t\t\t...routes,\r\n\t\t\t\t\t\t{ path: 'forbidden', component: ForbiddenComponent },\r\n\t\t\t\t\t\t{ path: '**', component: NotFoundComponent }\r\n\t\t\t\t\t]);\r\n\r\n\t\t\t\t\tconst filteredMenuItems = this.filterMenuItemsByRole(apps.menuItems);\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tmenuItems: [\r\n\t\t\t\t\t\t\t{ root: true, label: { tr: 'Anasayfa', en: 'Home' }, icon: 'pi pi-fw pi-home', routerLink: '/' } as PluginMenuItem,\r\n\t\t\t\t\t\t\t...filteredMenuItems\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\tplugins: apps.extensions || {}\r\n\t\t\t\t\t};\r\n\t\t\t\t}),\r\n\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\tconsole.log('Error Micro Apps Loading', err);\r\n\t\t\t\t\treturn of<MicroAppInitResult>({ menuItems: [], plugins: {} });\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t}\r\n\r\n\tbuildRoutes(options: PluginConfig[]): Routes {\r\n\t\tconst routes: Routes = options.map((options) => {\r\n\t\t\treturn {\r\n\t\t\t\tmatcher: startsWith(options.remoteName),\r\n\t\t\t\tcomponent: options.shadowDomPassive ? WebComponentWrapper : ShadowDOMWrapperComponent,\r\n\t\t\t\tdata: options as WebComponentWrapperOptions,\r\n\t\t\t\tcanActivate: [AuthGuard]\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn routes;\r\n\t}\r\n\r\n\tprivate filterMenuItemsByRole(items: PluginMenuItem[]): PluginMenuItem[] {\r\n\t\treturn items.reduce<PluginMenuItem[]>((acc, item) => {\r\n\t\t\tif (!this.hasPermission(item.permittedRoles)) {\r\n\t\t\t\treturn acc;\r\n\t\t\t}\r\n\r\n\t\t\tconst filteredItem = { ...item };\r\n\r\n\t\t\tif (filteredItem.items?.length) {\r\n\t\t\t\tfilteredItem.items = this.filterMenuItemsByRole(filteredItem.items);\r\n\r\n\t\t\t\tif (!filteredItem.items.length && !filteredItem.routerLink) {\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tacc.push(filteredItem);\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\t}\r\n\r\n\tprivate hasPermission(permittedRoles?: string[]): boolean {\r\n\t\tif (!permittedRoles?.length) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn permittedRoles.some((role) => this.userRoles.includes(role));\r\n\t}\r\n}\r\n","import { MenuItemCommandEvent } from 'primeng/api';\r\n\r\nimport { WebComponentWrapperOptions } from '@angular-architects/module-federation-tools';\r\n\r\nexport enum Apps {\r\n\tTHOR = 'thor',\r\n\tCRM = 'crm',\r\n\tWDM = 'wdm',\r\n\tBILLING = 'billing',\r\n\tPAYMENT = 'payment',\r\n\tYEAP = 'yeap',\r\n\tMW = 'mw',\r\n\tLENA = 'lena',\r\n\tHES = 'hes',\r\n\tCTS = 'cts',\r\n\tSIS = 'sis',\r\n\tMNG = 'mng',\r\n\tMDM = 'mdm',\r\n\tSTATE_MACHINE = 'state-machine',\r\n\tREPORT = 'report',\r\n\tLGC = 'lgc',\r\n\tDMS = 'dms'\r\n}\r\n\r\nexport interface AppsDTO {\r\n\tversion: number;\r\n\tmodules: PluginConfig[];\r\n\tplugins: PluginConfig[];\r\n\textensions: Record<string, ExtensionConfig>;\r\n\tmenuItems: PluginMenuItem[];\r\n}\r\n\r\nexport interface ExtensionConfig {\r\n\toptions: PluginConfig;\r\n}\r\n\r\nexport type PluginConfig = WebComponentWrapperOptions & {\r\n\tid?: string;\r\n\tremoteName: string;\r\n\tshadowDomPassive: boolean;\r\n\tpermittedRoles?: string[];\r\n};\r\n\r\nexport interface MenuItemAction {\r\n\tmethod?: 'GET' | 'POST';\r\n\turl: string;\r\n\tbody?: any;\r\n\tsuccessRoute: string;\r\n\tsuccessRouteResponseKey?: string;\r\n}\r\n\r\nexport interface PluginMenuItem {\r\n\trouterLink?: string;\r\n\ticon?: string;\r\n\tlabel: {\r\n\t\t[languageCode: string]: string;\r\n\t};\r\n\titems?: PluginMenuItem[];\r\n\tpermittedRoles?: string[];\r\n\taction?: MenuItemAction;\r\n\r\n\t// UI fields\r\n\tseparator?: boolean;\r\n\troot?: boolean;\r\n\tpath?: string;\r\n\tdisabled?: boolean;\r\n\tcommand?(event: MenuItemCommandEvent): void;\r\n}\r\n","import { ActivatedRouteSnapshot, BaseRouteReuseStrategy } from '@angular/router';\r\n\r\nexport class ArilReuseStrategy extends BaseRouteReuseStrategy {\r\n\toverride shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {\r\n\t\tif (curr.firstChild?.routeConfig?.data?.['remoteEntry'] === future.firstChild?.routeConfig?.data?.['remoteEntry'])\r\n\t\t\treturn false;\r\n\r\n\t\treturn future?.routeConfig === curr?.routeConfig && JSON.stringify(future?.params) === JSON.stringify(curr?.params);\r\n\t}\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAoB,CAAC;AAE/C,SAAU,mBAAmB,CAAC,SAA2B,EAAA;IAC9D,gBAAgB,CAAC,KAAK,EAAE,CAAC;IACzB,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC;AAEK,SAAU,mBAAmB,CAAC,GAAW,EAAA;AAC9C,IAAA,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC1D,IAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAuB,EAAA;AACnD,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACzB,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE;AACnD,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACtD,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;SACtD;AAED,QAAA,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;AACvB,YAAA,mBAAmB,CAAC,IAAI,CA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AE,WAAW,EAAE,IAAI,GAAG,aAAa,CAAC,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,GAAG,aAAa,CAAC;AAChH,YAAA,OAAO,KAAK,CAAC;QAEd,OAAO,MAAM,EAAE,WAAW,KAAK,IAAI,EAAE,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACpH;AACD;;ACTD;;AAEG;;;;"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
|
2
1
|
import { NgZone, importProvidersFrom, APP_INITIALIZER, isDevMode } from '@angular/core';
|
|
3
2
|
import { createCustomElement } from '@angular/elements';
|
|
4
3
|
import { createApplication } from '@angular/platform-browser';
|
|
5
|
-
import {
|
|
6
|
-
import { MessageService, ConfirmationService, PrimeNGConfig } from 'primeng/api';
|
|
4
|
+
import { PrimeNGConfig } from 'primeng/api';
|
|
7
5
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
8
6
|
import { ConfirmPopupModule } from 'primeng/confirmpopup';
|
|
9
7
|
import { DialogModule } from 'primeng/dialog';
|
|
10
8
|
import { MessagesModule } from 'primeng/messages';
|
|
11
9
|
import { ToastModule } from 'primeng/toast';
|
|
12
10
|
import { TranslocoService } from '@ngneat/transloco';
|
|
13
|
-
import { KeycloakBearerInterceptor, KeycloakAngularModule } from 'keycloak-angular';
|
|
14
11
|
import { tap, firstValueFrom } from 'rxjs';
|
|
12
|
+
import { createBaseAppConfig, HOST_I18N_FOLDER } from 'aril/boot/base';
|
|
13
|
+
import { bridge } from 'aril/boot/bridge';
|
|
15
14
|
import { API_CONFIGS } from 'aril/boot/config/api';
|
|
16
15
|
import { LanguageCode, TR_TRANSLATIONS } from 'aril/boot/config/translate';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { authInterceptor, keycloakAuthInterceptor } from 'aril/keycloak';
|
|
20
|
-
import { provideHost, provideHostRouter, provideLocaleId } from 'aril/provider';
|
|
16
|
+
import { HttpBackendService } from 'aril/http';
|
|
17
|
+
import { provideHost, provideHostRouter } from 'aril/provider';
|
|
21
18
|
|
|
22
19
|
const getNgZone = () => {
|
|
23
|
-
if (
|
|
24
|
-
return { provide: NgZone, useValue:
|
|
20
|
+
if (bridge.hostNgZone) {
|
|
21
|
+
return { provide: NgZone, useValue: bridge.hostNgZone };
|
|
25
22
|
}
|
|
26
23
|
else
|
|
27
24
|
return [];
|
|
@@ -29,71 +26,12 @@ const getNgZone = () => {
|
|
|
29
26
|
|
|
30
27
|
class FactoryClass {
|
|
31
28
|
}
|
|
32
|
-
var Apps;
|
|
33
|
-
(function (Apps) {
|
|
34
|
-
Apps["THOR"] = "thor";
|
|
35
|
-
Apps["CRM"] = "crm";
|
|
36
|
-
Apps["WDM"] = "wdm";
|
|
37
|
-
Apps["BILLING"] = "billing";
|
|
38
|
-
Apps["PAYMENT"] = "payment";
|
|
39
|
-
Apps["YEAP"] = "yeap";
|
|
40
|
-
Apps["MW"] = "mw";
|
|
41
|
-
Apps["LENA"] = "lena";
|
|
42
|
-
Apps["HES"] = "hes";
|
|
43
|
-
Apps["CTS"] = "cts";
|
|
44
|
-
Apps["SIS"] = "sis";
|
|
45
|
-
Apps["MNG"] = "mng";
|
|
46
|
-
Apps["MDM"] = "mdm";
|
|
47
|
-
Apps["STATE_MACHINE"] = "state-machine";
|
|
48
|
-
Apps["LGC"] = "lgc";
|
|
49
|
-
Apps["DMS"] = "dms";
|
|
50
|
-
})(Apps || (Apps = {}));
|
|
51
|
-
var AppsRoutes;
|
|
52
|
-
(function (AppsRoutes) {
|
|
53
|
-
AppsRoutes["MNG_BASE_URL"] = "mngBaseUrl";
|
|
54
|
-
})(AppsRoutes || (AppsRoutes = {}));
|
|
55
|
-
class ApiConfigsFactory {
|
|
56
|
-
constructor() {
|
|
57
|
-
this.api = '';
|
|
58
|
-
this.fromMail = '';
|
|
59
|
-
this.mwApi = '';
|
|
60
|
-
this.aiApi = '';
|
|
61
|
-
this.statusApi = '';
|
|
62
|
-
this.environment = '';
|
|
63
|
-
this.routes = {
|
|
64
|
-
mngBaseUrl: '',
|
|
65
|
-
};
|
|
66
|
-
this.prefixMap = {
|
|
67
|
-
[Apps.THOR]: '',
|
|
68
|
-
[Apps.CRM]: '',
|
|
69
|
-
[Apps.WDM]: '',
|
|
70
|
-
[Apps.BILLING]: '',
|
|
71
|
-
[Apps.PAYMENT]: '',
|
|
72
|
-
[Apps.YEAP]: '',
|
|
73
|
-
[Apps.MW]: '',
|
|
74
|
-
[Apps.LENA]: '',
|
|
75
|
-
[Apps.HES]: '',
|
|
76
|
-
[Apps.CTS]: '',
|
|
77
|
-
[Apps.SIS]: '',
|
|
78
|
-
[Apps.MNG]: '',
|
|
79
|
-
[Apps.STATE_MACHINE]: '',
|
|
80
|
-
[Apps.MDM]: '',
|
|
81
|
-
[Apps.LGC]: '',
|
|
82
|
-
[Apps.DMS]: ''
|
|
83
|
-
};
|
|
84
|
-
this.keycloak = {
|
|
85
|
-
url: '',
|
|
86
|
-
realm: '',
|
|
87
|
-
clientId: ''
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
29
|
|
|
92
30
|
const PLUGINS = new FactoryClass();
|
|
93
31
|
function loadPlugins() {
|
|
94
32
|
return () => {
|
|
95
33
|
try {
|
|
96
|
-
const pluginsData =
|
|
34
|
+
const pluginsData = bridge.pluginJson();
|
|
97
35
|
Object.assign(PLUGINS, pluginsData);
|
|
98
36
|
}
|
|
99
37
|
catch (err) {
|
|
@@ -106,16 +44,11 @@ async function bootPlugin(selector, component) {
|
|
|
106
44
|
return;
|
|
107
45
|
const config = {
|
|
108
46
|
providers: [
|
|
109
|
-
|
|
47
|
+
createBaseAppConfig({ i18nFolder: HOST_I18N_FOLDER }),
|
|
110
48
|
provideHost(selector), // todo refactor
|
|
111
49
|
provideHostRouter(),
|
|
112
|
-
|
|
113
|
-
KeycloakBearerInterceptor,
|
|
114
|
-
provideHttpClient(withInterceptors([acceptLanguageInterceptor, authInterceptor, keycloakAuthInterceptor])),
|
|
115
|
-
importProvidersFrom(i18nModule, KeycloakAngularModule, ConfirmDialogModule, ConfirmPopupModule, DialogModule, MessagesModule, ToastModule),
|
|
50
|
+
importProvidersFrom(ConfirmDialogModule, ConfirmPopupModule, DialogModule, MessagesModule, ToastModule),
|
|
116
51
|
getNgZone(),
|
|
117
|
-
MessageService,
|
|
118
|
-
ConfirmationService,
|
|
119
52
|
{
|
|
120
53
|
provide: APP_INITIALIZER,
|
|
121
54
|
useFactory: (httpBackend, translocoService, primeNgConfig) => {
|
|
@@ -139,10 +72,6 @@ async function bootPlugin(selector, component) {
|
|
|
139
72
|
},
|
|
140
73
|
deps: [HttpBackendService, TranslocoService, PrimeNGConfig],
|
|
141
74
|
multi: true
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
provide: i18nFolderName,
|
|
145
|
-
useValue: 'host'
|
|
146
75
|
}
|
|
147
76
|
]
|
|
148
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aril-boot-config-plugins.mjs","sources":["../../projects/aril/boot/config/plugins/src/getNgZone.ts","../../projects/aril/boot/config/plugins/src/interfaces.ts","../../projects/aril/boot/config/plugins/src/plugins.service.ts","../../projects/aril/boot/config/plugins/aril-boot-config-plugins.ts"],"sourcesContent":["import { NgZone } from '@angular/core';\r\n\r\nexport const getNgZone = () => {\r\n\tif ((<any>globalThis).ngZone) {\r\n\t\treturn { provide: NgZone, useValue: (<any>globalThis).ngZone };\r\n\t} else return [];\r\n};\r\n","import { LoadRemoteModuleScriptOptions } from '@angular-architects/module-federation';\r\n\r\ninterface PluginItem {\r\n\toptions: LoadRemoteModuleScriptOptions & { elementName: string };\r\n\tprops: { [key in string]: any };\r\n\tevents: { [key in string]: Function };\r\n}\r\n\r\nexport type PluginConfigs = { [key in string]: PluginItem };\r\n\r\nexport class FactoryClass {}\r\n\r\nenum Apps {\r\n\tTHOR = 'thor',\r\n\tCRM = 'crm',\r\n\tWDM = 'wdm',\r\n\tBILLING = 'billing',\r\n\tPAYMENT = 'payment',\r\n\tYEAP = 'yeap',\r\n\tMW = 'mw',\r\n\tLENA = 'lena',\r\n\tHES = 'hes',\r\n\tCTS = 'cts',\r\n\tSIS = 'sis',\r\n\tMNG = 'mng',\r\n\tMDM = 'mdm',\r\n\tSTATE_MACHINE = 'state-machine',\r\n\tLGC = 'lgc',\r\n\tDMS = 'dms'\r\n}\r\n\r\nexport enum AppsRoutes {\r\n\tMNG_BASE_URL = 'mngBaseUrl',\r\n}\r\n\r\nexport interface KeycloakConfig {\r\n\turl: string;\r\n\trealm: string;\r\n\tclientId: string;\r\n}\r\n\r\nexport class ApiConfigsFactory {\r\n\tapi: string = '';\r\n\tfromMail: string = '';\r\n\tmwApi: string = '';\r\n\taiApi: string='';\r\n\tstatusApi: string='';\r\n\tenvironment: string = '';\r\n\troutes: Record<AppsRoutes, string> = {\r\n\t\tmngBaseUrl: '',\r\n\t};\r\n\tprefixMap: Record<Apps,string>= {\r\n\t\t[Apps.THOR]: '',\r\n\t\t[Apps.CRM]: '',\r\n\t\t[Apps.WDM]: '',\r\n\t\t[Apps.BILLING]: '',\r\n\t\t[Apps.PAYMENT]: '',\r\n\t\t[Apps.YEAP]: '',\r\n\t\t[Apps.MW]: '',\r\n\t\t[Apps.LENA]: '',\r\n\t\t[Apps.HES]: '',\r\n\t\t[Apps.CTS]: '',\r\n\t\t[Apps.SIS]: '',\r\n\t\t[Apps.MNG]: '',\r\n\t\t[Apps.STATE_MACHINE]: '',\r\n\t\t[Apps.MDM]:'',\r\n\t\t[Apps.LGC]: '',\r\n\t\t[Apps.DMS]: ''\r\n\t};\r\n\tkeycloak: KeycloakConfig = {\r\n\t\turl: '',\r\n\t\trealm: '',\r\n\t\tclientId: ''\r\n\t};\r\n}\r\n","import { HttpClient, provideHttpClient, withInterceptors } from '@angular/common/http';\r\nimport { APP_INITIALIZER, ApplicationConfig, Type, importProvidersFrom, isDevMode } from '@angular/core';\r\nimport { createCustomElement } from '@angular/elements';\r\nimport { createApplication } from '@angular/platform-browser';\r\nimport { provideAnimations } from '@angular/platform-browser/animations';\r\n\r\nimport { ConfirmationService, MessageService, PrimeNGConfig } from 'primeng/api';\r\nimport { ConfirmDialogModule } from 'primeng/confirmdialog';\r\nimport { ConfirmPopupModule } from 'primeng/confirmpopup';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { MessagesModule } from 'primeng/messages';\r\nimport { ToastModule } from 'primeng/toast';\r\n\r\nimport { TranslocoService } from '@ngneat/transloco';\r\nimport { KeycloakAngularModule, KeycloakBearerInterceptor } from 'keycloak-angular';\r\nimport { firstValueFrom, tap } from 'rxjs';\r\n\r\nimport { API_CONFIGS } from 'aril/boot/config/api';\r\nimport { LanguageCode, TR_TRANSLATIONS } from 'aril/boot/config/translate';\r\nimport { HttpBackendService, acceptLanguageInterceptor } from 'aril/http';\r\nimport { i18nFolderName, i18nModule } from 'aril/i18n';\r\nimport { authInterceptor, keycloakAuthInterceptor } from 'aril/keycloak';\r\nimport { provideHost, provideHostRouter, provideLocaleId } from 'aril/provider';\r\n\r\nimport { getNgZone } from './getNgZone';\r\nimport { ApiConfigsFactory, FactoryClass, PluginConfigs } from './interfaces';\r\n\r\nexport const PLUGINS = new FactoryClass() as FactoryClass & PluginConfigs;\r\n\r\nexport function loadPlugins(): () => void {\r\n\treturn () => {\r\n\t\ttry {\r\n\t\t\tconst pluginsData = (<any>globalThis).pluginJson;\r\n\t\t\tObject.assign(PLUGINS, pluginsData);\r\n\t\t} catch (err) {\r\n\t\t\tconsole.log('Error Plugins Loading', err);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport async function bootPlugin(selector: string, component: Type<any>) {\r\n\tif (customElements.get(selector)) return;\r\n\r\n\tconst config: ApplicationConfig = {\r\n\t\tproviders: [\r\n\t\t\tprovideAnimations(),\r\n\t\t\tprovideHost(selector as any), // todo refactor\r\n\t\t\tprovideHostRouter(),\r\n\t\t\tprovideLocaleId(),\r\n\t\t\tKeycloakBearerInterceptor,\r\n\t\t\tprovideHttpClient(withInterceptors([acceptLanguageInterceptor, authInterceptor, keycloakAuthInterceptor])),\r\n\t\t\timportProvidersFrom(\r\n\t\t\t\ti18nModule,\r\n\t\t\t\tKeycloakAngularModule,\r\n\t\t\t\tConfirmDialogModule,\r\n\t\t\t\tConfirmPopupModule,\r\n\t\t\t\tDialogModule,\r\n\t\t\t\tMessagesModule,\r\n\t\t\t\tToastModule\r\n\t\t\t),\r\n\t\t\tgetNgZone(),\r\n\t\t\tMessageService,\r\n\t\t\tConfirmationService,\r\n\t\t\t{\r\n\t\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\t\tuseFactory: (\r\n\t\t\t\t\thttpBackend: { httpClient: HttpClient },\r\n\t\t\t\t\ttranslocoService: TranslocoService,\r\n\t\t\t\t\tprimeNgConfig: PrimeNGConfig\r\n\t\t\t\t) => {\r\n\t\t\t\t\treturn () => {\r\n\t\t\t\t\t\tconst activeLang: LanguageCode = (localStorage.getItem('lang') as LanguageCode) ?? LanguageCode.TR;\r\n\r\n\t\t\t\t\t\ttranslocoService.setActiveLang(activeLang);\r\n\r\n\t\t\t\t\t\tif (!activeLang?.length) {\r\n\t\t\t\t\t\t\tconsole.warn('No language selected');\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (activeLang === LanguageCode.TR) {\r\n\t\t\t\t\t\t\tprimeNgConfig.setTranslation(TR_TRANSLATIONS);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst observable$ = httpBackend.httpClient\r\n\t\t\t\t\t\t\t.get<ApiConfigsFactory>(isDevMode() ? './assets/local-configs/api.local.json' : './api.json')\r\n\t\t\t\t\t\t\t.pipe(\r\n\t\t\t\t\t\t\t\ttap((configs) => {\r\n\t\t\t\t\t\t\t\t\tObject.assign(API_CONFIGS, { ...configs });\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\treturn firstValueFrom(observable$);\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t\tdeps: [HttpBackendService, TranslocoService, PrimeNGConfig],\r\n\t\t\t\tmulti: true\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tprovide: i18nFolderName,\r\n\t\t\t\tuseValue: 'host'\r\n\t\t\t}\r\n\t\t]\r\n\t};\r\n\r\n\tconst appRef = await createApplication(config);\r\n\tconst plugin = createCustomElement(component, { injector: appRef.injector });\r\n\r\n\tcustomElements.define(selector, plugin);\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,SAAS,GAAG,MAAK;AAC7B,IAAA,IAAU,UAAW,CAAC,MAAM,EAAE;QAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAQ,UAAW,CAAC,MAAM,EAAE,CAAC;KAC/D;;AAAM,QAAA,OAAO,EAAE,CAAC;AAClB;;MCIa,YAAY,CAAA;AAAG,CAAA;AAE5B,IAAK,IAiBJ,CAAA;AAjBD,CAAA,UAAK,IAAI,EAAA;AACR,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,IAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,IAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,IAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,IAAA,CAAA,MAAA,C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AAG,OAAO,EAAE,CAAC,CAAC;yBAC3C,CAAC,CACF,CAAC;AAEH,wBAAA,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;AACpC,qBAAC,CAAC;iBACF;AACD,gBAAA,IAAI,EAAE,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,CAAC;AAC3D,gBAAA,KAAK,EAAE,IAAI;AACX,aAAA;AACD,YAAA;AACC,gBAAA,OAAO,EAAE,cAAc;AACvB,gBAAA,QAAQ,EAAE,MAAM;AAChB,aAAA;AACD,SAAA;KACD,CAAC;AAEF,IAAA,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC/C,IAAA,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE7E,IAAA,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACzC;;AC7GA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"aril-boot-config-plugins.mjs","sources":["../../projects/aril/boot/config/plugins/src/getNgZone.ts","../../projects/aril/boot/config/plugins/src/interfaces.ts","../../projects/aril/boot/config/plugins/src/plugins.service.ts","../../projects/aril/boot/config/plugins/aril-boot-config-plugins.ts"],"sourcesContent":["import { NgZone } from '@angular/core';\r\n\r\nimport { bridge } from 'aril/boot/bridge';\r\n\r\nexport const getNgZone = () => {\r\n\tif (bridge.hostNgZone) {\r\n\t\treturn { provide: NgZone, useValue: bridge.hostNgZone };\r\n\t} else return [];\r\n};\r\n","import { LoadRemoteModuleScriptOptions } from '@angular-architects/module-federation';\r\n\r\ninterface PluginItem {\r\n\toptions: LoadRemoteModuleScriptOptions & { elementName: string };\r\n\tprops: { [key in string]: any };\r\n\tevents: { [key in string]: Function };\r\n}\r\n\r\nexport type PluginConfigs = { [key in string]: PluginItem };\r\n\r\nexport class FactoryClass {}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { APP_INITIALIZER, ApplicationConfig, Type, importProvidersFrom, isDevMode } from '@angular/core';\r\nimport { createCustomElement } from '@angular/elements';\r\nimport { createApplication } from '@angular/platform-browser';\r\n\r\nimport { PrimeNGConfig } from 'primeng/api';\r\nimport { ConfirmDialogModule } from 'primeng/confirmdialog';\r\nimport { ConfirmPopupModule } from 'primeng/confirmpopup';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { MessagesModule } from 'primeng/messages';\r\nimport { ToastModule } from 'primeng/toast';\r\n\r\nimport { TranslocoService } from '@ngneat/transloco';\r\nimport { firstValueFrom, tap } from 'rxjs';\r\n\r\nimport { HOST_I18N_FOLDER, createBaseAppConfig } from 'aril/boot/base';\r\nimport { bridge } from 'aril/boot/bridge';\r\nimport { API_CONFIGS, ApiConfigsFactory } from 'aril/boot/config/api';\r\nimport { LanguageCode, TR_TRANSLATIONS } from 'aril/boot/config/translate';\r\nimport { HttpBackendService } from 'aril/http';\r\nimport { provideHost, provideHostRouter } from 'aril/provider';\r\n\r\nimport { getNgZone } from './getNgZone';\r\nimport { FactoryClass, PluginConfigs } from './interfaces';\r\n\r\nexport const PLUGINS = new FactoryClass() as FactoryClass & PluginConfigs;\r\n\r\nexport function loadPlugins(): () => void {\r\n\treturn () => {\r\n\t\ttry {\r\n\t\t\tconst pluginsData = bridge.pluginJson();\r\n\t\t\tObject.assign(PLUGINS, pluginsData);\r\n\t\t} catch (err) {\r\n\t\t\tconsole.log('Error Plugins Loading', err);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport async function bootPlugin(selector: string, component: Type<any>) {\r\n\tif (customElements.get(selector)) return;\r\n\r\n\tconst config: ApplicationConfig = {\r\n\t\tproviders: [\r\n\t\t\tcreateBaseAppConfig({ i18nFolder: HOST_I18N_FOLDER }),\r\n\t\t\tprovideHost(selector as any), // todo refactor\r\n\t\t\tprovideHostRouter(),\r\n\t\t\timportProvidersFrom(\r\n\t\t\t\tConfirmDialogModule,\r\n\t\t\t\tConfirmPopupModule,\r\n\t\t\t\tDialogModule,\r\n\t\t\t\tMessagesModule,\r\n\t\t\t\tToastModule\r\n\t\t\t),\r\n\t\t\tgetNgZone(),\r\n\t\t\t{\r\n\t\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\t\tuseFactory: (\r\n\t\t\t\t\thttpBackend: { httpClient: HttpClient },\r\n\t\t\t\t\ttranslocoService: TranslocoService,\r\n\t\t\t\t\tprimeNgConfig: PrimeNGConfig\r\n\t\t\t\t) => {\r\n\t\t\t\t\treturn () => {\r\n\t\t\t\t\t\tconst activeLang: LanguageCode = (localStorage.getItem('lang') as LanguageCode) ?? LanguageCode.TR;\r\n\r\n\t\t\t\t\t\ttranslocoService.setActiveLang(activeLang);\r\n\r\n\t\t\t\t\t\tif (!activeLang?.length) {\r\n\t\t\t\t\t\t\tconsole.warn('No language selected');\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (activeLang === LanguageCode.TR) {\r\n\t\t\t\t\t\t\tprimeNgConfig.setTranslation(TR_TRANSLATIONS);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst observable$ = httpBackend.httpClient\r\n\t\t\t\t\t\t\t.get<ApiConfigsFactory>(isDevMode() ? './assets/local-configs/api.local.json' : './api.json')\r\n\t\t\t\t\t\t\t.pipe(\r\n\t\t\t\t\t\t\t\ttap((configs) => {\r\n\t\t\t\t\t\t\t\t\tObject.assign(API_CONFIGS, { ...configs });\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\treturn firstValueFrom(observable$);\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t\tdeps: [HttpBackendService, TranslocoService, PrimeNGConfig],\r\n\t\t\t\tmulti: true\r\n\t\t\t}\r\n\t\t]\r\n\t};\r\n\r\n\tconst appRef = await createApplication(config);\r\n\tconst plugin = createCustomElement(component, { injector: appRef.injector });\r\n\r\n\tcustomElements.define(selector, plugin);\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIO,MAAM,SAAS,GAAG,MAAK;AAC7B,IAAA,IAAI,MAAM,CAAC,UAAU,EAAE;QACtB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;KACxD;;AAAM,QAAA,OAAO,EAAE,CAAC;AAClB;;MCEa,YAAY,CAAA;AAAG;;ACef,MAAA,OAAO,GAAG,IAAI,YAAY,GAAmC;SAE1D,WAAW,GAAA;AAC1B,IAAA,OAAO,MAAK;AACX,QAAA,IAAI;AACH,YAAA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;AACxC,YAAA,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;SACpC;QAAC,OAAO,GAAG,EAAE;AACb,YAAA,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;SAC1C;AACF,KAAC,CAAC;AACH,CAAC;AAEM,eAAe,UAAU,CAAC,QAAgB,EAAE,SAAoB,EAAA;AACtE,IAAA,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO;AAEzC,IAAA,MAAM,MAAM,GAAsB;AACjC,QAAA,SAAS,EAAE;AACV,YAAA,mBAAmB,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;AACrD,YAAA,WAAW,CAAC,QAAe,CAAC;AAC5B,YAAA,iBAAiB,EAAE;YACnB,mBAAmB,CAClB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,WAAW,CACX;AACD,YAAA,SAAS,EAAE;AACX,YAAA;AACC,gBAAA,OAAO,EAAE,eAAe;gBACxB,UAAU,EAAE,CACX,WAAuC,EACvC,gBAAkC,EAClC,aAA4B,KACzB;AACH,oBAAA,OAAO,M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ient } from '@angular/common/http';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { inject, NgZone, Component, APP_INITIALIZER } from '@angular/core';
|
|
4
4
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
5
|
-
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
6
5
|
import { provideRouter, withComponentInputBinding, withHashLocation, withViewTransitions, withRouterConfig, RouteReuseStrategy, Router } from '@angular/router';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { KeycloakService } from 'keycloak-angular';
|
|
7
|
+
import { createBaseAppConfig, HOST_I18N_FOLDER } from 'aril/boot/base';
|
|
8
|
+
import * as i3 from 'aril/boot/bridge';
|
|
9
|
+
import { bridge } from 'aril/boot/bridge';
|
|
9
10
|
import { loadApiConfigs, loadInitData } from 'aril/boot/config/api';
|
|
10
11
|
import { ArilReuseStrategy, MicroAppService } from 'aril/boot/config/apps';
|
|
11
12
|
import { loadPlugins } from 'aril/boot/config/plugins';
|
|
12
|
-
import {
|
|
13
|
-
import { i18nModule, i18nFolderName } from 'aril/i18n';
|
|
14
|
-
import { authInterceptor, keycloakAuthInterceptor } from 'aril/keycloak';
|
|
15
|
-
import { provideLocaleId } from 'aril/provider';
|
|
13
|
+
import { i18nFolderName } from 'aril/i18n';
|
|
16
14
|
import * as i1 from 'aril/theme/layout';
|
|
17
15
|
import { AppLayoutComponent } from 'aril/theme/layout';
|
|
18
16
|
import * as i2 from 'aril/util/pub-sub';
|
|
19
17
|
|
|
20
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
18
|
class AppComponent {
|
|
22
|
-
constructor(layoutService, pubSubService) {
|
|
19
|
+
constructor(layoutService, pubSubService, bridgeSvc) {
|
|
23
20
|
this.layoutService = layoutService;
|
|
24
21
|
this.pubSubService = pubSubService;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
this.bridgeSvc = bridgeSvc;
|
|
23
|
+
this.bridgeSvc.mirrorToWindow();
|
|
24
|
+
this.bridgeSvc.activeHost.set(appName);
|
|
25
|
+
this.bridgeSvc.isHostMode.set(true);
|
|
26
|
+
this.bridgeSvc.hostNgZone = inject(NgZone);
|
|
29
27
|
this.pubSubService.subscribe('menuModeChanged', (data) => {
|
|
30
28
|
const menuMode = data?.custom;
|
|
31
29
|
if (menuMode && (menuMode === 'static' || menuMode === 'expandable')) {
|
|
@@ -47,7 +45,7 @@ class AppComponent {
|
|
|
47
45
|
}
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AppComponent, deps: [{ token: i1.LayoutService }, { token: i2.PubSubService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AppComponent, deps: [{ token: i1.LayoutService }, { token: i2.PubSubService }, { token: i3.MfeBridge }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
49
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: AppComponent, isStandalone: true, selector: "aril-root", ngImport: i0, template: ` <app-layout></app-layout> `, isInline: true, dependencies: [{ kind: "component", type: AppLayoutComponent, selector: "app-layout" }] }); }
|
|
52
50
|
}
|
|
53
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AppComponent, decorators: [{
|
|
@@ -58,27 +56,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
58
56
|
template: ` <app-layout></app-layout> `,
|
|
59
57
|
imports: [AppLayoutComponent]
|
|
60
58
|
}]
|
|
61
|
-
}], ctorParameters: () => [{ type: i1.LayoutService }, { type: i2.PubSubService }] });
|
|
59
|
+
}], ctorParameters: () => [{ type: i1.LayoutService }, { type: i2.PubSubService }, { type: i3.MfeBridge }] });
|
|
62
60
|
|
|
63
61
|
var appName;
|
|
64
62
|
const boot = (_appName, routes) => {
|
|
65
63
|
appName = _appName;
|
|
66
64
|
const appConfig = {
|
|
67
65
|
providers: [
|
|
68
|
-
|
|
69
|
-
provideLocaleId(),
|
|
70
|
-
KeycloakBearerInterceptor,
|
|
71
|
-
provideHttpClient(withInterceptors([acceptLanguageInterceptor, authInterceptor, keycloakAuthInterceptor])),
|
|
66
|
+
createBaseAppConfig({ i18nFolder: HOST_I18N_FOLDER }),
|
|
72
67
|
provideRouter(routes, withComponentInputBinding(), withHashLocation(), withViewTransitions(), withRouterConfig({ onSameUrlNavigation: 'reload' })),
|
|
73
68
|
{ provide: RouteReuseStrategy, useClass: ArilReuseStrategy },
|
|
74
|
-
importProvidersFrom(i18nModule, KeycloakAngularModule),
|
|
75
|
-
MessageService,
|
|
76
|
-
ConfirmationService,
|
|
77
69
|
{
|
|
78
70
|
provide: APP_INITIALIZER,
|
|
79
71
|
useFactory: (httpClient, keycloak, router, folderName, microAppService) => {
|
|
80
72
|
if (router)
|
|
81
|
-
|
|
73
|
+
bridge.hostRouter = router;
|
|
82
74
|
const runLoadApiConfigs = loadApiConfigs(httpClient, keycloak, folderName, microAppService);
|
|
83
75
|
const runLoadInitData = loadInitData(httpClient);
|
|
84
76
|
const runLoadPlugins = loadPlugins();
|
|
@@ -90,10 +82,6 @@ const boot = (_appName, routes) => {
|
|
|
90
82
|
},
|
|
91
83
|
multi: true,
|
|
92
84
|
deps: [HttpClient, KeycloakService, Router, i18nFolderName, MicroAppService]
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
provide: i18nFolderName,
|
|
96
|
-
useValue: 'host'
|
|
97
85
|
}
|
|
98
86
|
]
|
|
99
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aril-boot-host.mjs","sources":["../../projects/aril/boot/host/src/app.component.ts","../../projects/aril/boot/host/src/bootstrap.ts","../../projects/aril/boot/host/aril-boot-host.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"aril-boot-host.mjs","sources":["../../projects/aril/boot/host/src/app.component.ts","../../projects/aril/boot/host/src/bootstrap.ts","../../projects/aril/boot/host/aril-boot-host.ts"],"sourcesContent":["import { Component, NgZone, inject } from '@angular/core';\r\n\r\nimport { MfeBridge } from 'aril/boot/bridge';\r\nimport { AppLayoutComponent, LayoutService } from 'aril/theme/layout';\r\nimport { PubSubService } from 'aril/util/pub-sub';\r\n\r\nimport { appName } from './bootstrap';\r\n\r\ntype MenuMode = 'static' | 'expandable';\r\n\r\n@Component({\r\n\tstandalone: true,\r\n\tselector: 'aril-root',\r\n\ttemplate: ` <app-layout></app-layout> `,\r\n\timports: [AppLayoutComponent]\r\n})\r\nexport class AppComponent {\r\n\tconstructor(\r\n\t\tprivate readonly layoutService: LayoutService,\r\n\t\tprivate readonly pubSubService: PubSubService,\r\n\t\tprivate readonly bridgeSvc: MfeBridge\r\n\t) {\r\n\t\tthis.bridgeSvc.mirrorToWindow();\r\n\t\tthis.bridgeSvc.activeHost.set(appName);\r\n\t\tthis.bridgeSvc.isHostMode.set(true);\r\n\t\tthis.bridgeSvc.hostNgZone = inject(NgZone);\r\n\r\n\t\tthis.pubSubService.subscribe('menuModeChanged', (data) => {\r\n\t\t\tconst menuMode = data?.custom;\r\n\r\n\t\t\tif (menuMode && (menuMode === 'static' || menuMode === 'expandable')) {\r\n\t\t\t\tthis.layoutService.config.update((config) => {\r\n\t\t\t\t\tconst newConfig = {\r\n\t\t\t\t\t\t...config,\r\n\t\t\t\t\t\tmenuMode: menuMode as MenuMode\r\n\t\t\t\t\t};\r\n\t\t\t\t\treturn newConfig;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (menuMode === 'static') {\r\n\t\t\t\t\tthis.layoutService.state.staticSidebarVisible = true;\r\n\t\t\t\t} else if (menuMode === 'expandable') {\r\n\t\t\t\t\tthis.layoutService.state.staticSidebarVisible = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Always close mobile menu on mode change\r\n\t\t\t\tthis.layoutService.state.staticMenuMobileActive = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { APP_INITIALIZER, ApplicationConfig } from '@angular/core';\r\nimport { bootstrapApplication } from '@angular/platform-browser';\r\nimport {\r\n\tRouteReuseStrategy,\r\n\tRouter,\r\n\tRoutes,\r\n\tprovideRouter,\r\n\twithComponentInputBinding,\r\n\twithHashLocation,\r\n\twithRouterConfig,\r\n\twithViewTransitions\r\n} from '@angular/router';\r\n\r\nimport { KeycloakService } from 'keycloak-angular';\r\n\r\nimport { HOST_I18N_FOLDER, createBaseAppConfig } from 'aril/boot/base';\r\nimport { bridge } from 'aril/boot/bridge';\r\nimport { loadApiConfigs, loadInitData } from 'aril/boot/config/api';\r\nimport { Apps, ArilReuseStrategy, MicroAppService } from 'aril/boot/config/apps';\r\nimport { loadPlugins } from 'aril/boot/config/plugins';\r\nimport { i18nFolderName } from 'aril/i18n';\r\n\r\nimport { AppComponent } from './app.component';\r\n\r\nexport var appName: Apps;\r\n\r\nexport const boot = (_appName: Apps, routes: Routes) => {\r\n\tappName = _appName;\r\n\tconst appConfig: ApplicationConfig = {\r\n\t\tproviders: [\r\n\t\t\tcreateBaseAppConfig({ i18nFolder: HOST_I18N_FOLDER }),\r\n\t\t\tprovideRouter(\r\n\t\t\t\troutes,\r\n\t\t\t\twithComponentInputBinding(),\r\n\t\t\t\twithHashLocation(),\r\n\t\t\t\twithViewTransitions(),\r\n\t\t\t\twithRouterConfig({ onSameUrlNavigation: 'reload' })\r\n\t\t\t),\r\n\t\t\t{ provide: RouteReuseStrategy, useClass: ArilReuseStrategy },\r\n\t\t\t{\r\n\t\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\t\tuseFactory: (\r\n\t\t\t\t\thttpClient: HttpClient,\r\n\t\t\t\t\tkeycloak: KeycloakService,\r\n\t\t\t\t\trouter: Router,\r\n\t\t\t\t\tfolderName: typeof i18nFolderName,\r\n\t\t\t\t\tmicroAppService: MicroAppService\r\n\t\t\t\t) => {\r\n\t\t\t\t\tif (router) bridge.hostRouter = router;\r\n\r\n\t\t\t\t\tconst runLoadApiConfigs = loadApiConfigs(\r\n\t\t\t\t\t\thttpClient,\r\n\t\t\t\t\t\tkeycloak,\r\n\t\t\t\t\t\tfolderName as unknown as string,\r\n\t\t\t\t\t\tmicroAppService\r\n\t\t\t\t\t);\r\n\t\t\t\t\tconst runLoadInitData = loadInitData(httpClient);\r\n\t\t\t\t\tconst runLoadPlugins = loadPlugins();\r\n\t\t\t\t\treturn async () => {\r\n\t\t\t\t\t\tawait runLoadApiConfigs();\r\n\t\t\t\t\t\tawait runLoadInitData();\r\n\t\t\t\t\t\trunLoadPlugins();\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t\tmulti: true,\r\n\t\t\t\tdeps: [HttpClient, KeycloakService, Router, i18nFolderName, MicroAppService]\r\n\t\t\t}\r\n\t\t]\r\n\t};\r\n\r\n\tbootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));\r\n};\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAgBa,YAAY,CAAA;AACxB,IAAA,WAAA,CACkB,aAA4B,EAC5B,aAA4B,EAC5B,SAAoB,EAAA;QAFpB,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAC5B,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAC5B,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;AAErC,QAAA,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;QAChC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAA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CAAC;AACjD,oBAAA,MAAM,cAAc,GAAG,WAAW,EAAE,CAAC;oBACrC,OAAO,YAAW;wBACjB,MAAM,iBAAiB,EAAE,CAAC;wBAC1B,MAAM,eAAe,EAAE,CAAC;AACxB,wBAAA,cAAc,EAAE,CAAC;AAClB,qBAAC,CAAC;iBACF;AACD,gBAAA,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,CAAC;AAC5E,aAAA;AACD,SAAA;KACD,CAAC;IAEF,oBAAoB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAClF;;ACxEA;;AAEG;;;;"}
|
|
@@ -3,46 +3,46 @@ import { inject, NgZone, Component } from '@angular/core';
|
|
|
3
3
|
import { connectRouter, ModuleFederationToolsModule } from '@angular-architects/module-federation-tools';
|
|
4
4
|
import { LanguageCode, TR_TRANSLATIONS } from 'aril/boot/config/translate';
|
|
5
5
|
import * as i3 from 'aril/theme/layout';
|
|
6
|
-
import {
|
|
7
|
-
import { a as appName, m as menuItems } from './aril-boot-mfe-aril-boot-mfe-
|
|
6
|
+
import { MFELayoutComponent } from 'aril/theme/layout';
|
|
7
|
+
import { a as appName, m as menuItems } from './aril-boot-mfe-aril-boot-mfe-KXDpUyv7.mjs';
|
|
8
8
|
import * as i1 from '@angular/router';
|
|
9
9
|
import * as i2 from '@ngneat/transloco';
|
|
10
10
|
import * as i4 from 'primeng/api';
|
|
11
|
+
import * as i5 from 'aril/boot/bridge';
|
|
11
12
|
import '@angular/common/http';
|
|
12
13
|
import '@angular/elements';
|
|
13
14
|
import '@angular/platform-browser';
|
|
14
|
-
import '@angular/platform-browser/animations';
|
|
15
15
|
import 'keycloak-angular';
|
|
16
16
|
import 'ngx-monaco-editor-v2';
|
|
17
|
+
import 'aril/boot/base';
|
|
17
18
|
import 'aril/boot/config/api';
|
|
18
19
|
import 'aril/boot/config/apps';
|
|
19
20
|
import 'aril/boot/config/plugins';
|
|
20
|
-
import 'aril/http';
|
|
21
21
|
import 'aril/i18n';
|
|
22
|
-
import 'aril/keycloak';
|
|
23
22
|
import 'aril/provider';
|
|
24
|
-
import 'aril/util/loaders';
|
|
25
23
|
|
|
26
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
27
24
|
class AppComponent {
|
|
28
|
-
constructor(router, translocoService, appMenuService, primeNgConfig) {
|
|
25
|
+
constructor(router, translocoService, appMenuService, primeNgConfig, bridgeSvc) {
|
|
29
26
|
this.router = router;
|
|
30
27
|
this.translocoService = translocoService;
|
|
31
28
|
this.appMenuService = appMenuService;
|
|
32
29
|
this.primeNgConfig = primeNgConfig;
|
|
33
|
-
this.
|
|
34
|
-
if (!this.isHostMode && !
|
|
35
|
-
|
|
30
|
+
this.bridgeSvc = bridgeSvc;
|
|
31
|
+
if (!this.bridgeSvc.isHostMode() && !this.bridgeSvc.hostNgZone) {
|
|
32
|
+
this.bridgeSvc.hostNgZone = inject(NgZone);
|
|
36
33
|
}
|
|
37
34
|
connectRouter(this.router, true);
|
|
38
|
-
|
|
35
|
+
this.bridgeSvc.activeMF.set(appName);
|
|
39
36
|
const lang = localStorage.getItem('lang') ?? LanguageCode.TR;
|
|
40
37
|
this.translocoService.setActiveLang(lang);
|
|
41
38
|
this.setLocale(lang);
|
|
42
|
-
if (!this.isHostMode) {
|
|
39
|
+
if (!this.bridgeSvc.isHostMode()) {
|
|
43
40
|
this.appMenuService.menuConfig.set({ items: structuredClone(menuItems), prefix: appName });
|
|
44
41
|
}
|
|
45
42
|
}
|
|
43
|
+
get isHostMode() {
|
|
44
|
+
return this.bridgeSvc.isHostMode;
|
|
45
|
+
}
|
|
46
46
|
setLocale(lang) {
|
|
47
47
|
if (!lang?.length) {
|
|
48
48
|
console.warn('No language selected');
|
|
@@ -52,29 +52,29 @@ class AppComponent {
|
|
|
52
52
|
this.primeNgConfig.setTranslation(TR_TRANSLATIONS);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AppComponent, deps: [{ token: i1.Router }, { token: i2.TranslocoService }, { token: i3.AppMenuService }, { token: i4.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AppComponent, deps: [{ token: i1.Router }, { token: i2.TranslocoService }, { token: i3.AppMenuService }, { token: i4.PrimeNGConfig }, { token: i5.MfeBridge }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
56
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.2", type: AppComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
|
|
57
|
-
@if (isHostMode) {
|
|
57
|
+
@if (isHostMode()) {
|
|
58
58
|
<mfe-layout></mfe-layout>
|
|
59
59
|
} @else {
|
|
60
|
-
|
|
60
|
+
Bu uygulama yalnızca host app içinden açılabilir
|
|
61
61
|
}
|
|
62
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ModuleFederationToolsModule }, { kind: "component", type:
|
|
62
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ModuleFederationToolsModule }, { kind: "component", type: MFELayoutComponent, selector: "mfe-layout" }] }); }
|
|
63
63
|
}
|
|
64
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AppComponent, decorators: [{
|
|
65
65
|
type: Component,
|
|
66
66
|
args: [{
|
|
67
67
|
standalone: true,
|
|
68
68
|
template: `
|
|
69
|
-
@if (isHostMode) {
|
|
69
|
+
@if (isHostMode()) {
|
|
70
70
|
<mfe-layout></mfe-layout>
|
|
71
71
|
} @else {
|
|
72
|
-
|
|
72
|
+
Bu uygulama yalnızca host app içinden açılabilir
|
|
73
73
|
}
|
|
74
74
|
`,
|
|
75
|
-
imports: [ModuleFederationToolsModule,
|
|
75
|
+
imports: [ModuleFederationToolsModule, MFELayoutComponent]
|
|
76
76
|
}]
|
|
77
|
-
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.TranslocoService }, { type: i3.AppMenuService }, { type: i4.PrimeNGConfig }] });
|
|
77
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.TranslocoService }, { type: i3.AppMenuService }, { type: i4.PrimeNGConfig }, { type: i5.MfeBridge }] });
|
|
78
78
|
|
|
79
79
|
export { AppComponent };
|
|
80
|
-
//# sourceMappingURL=aril-boot-mfe-app.component-
|
|
80
|
+
//# sourceMappingURL=aril-boot-mfe-app.component-7IjAmjz0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aril-boot-mfe-app.component-7IjAmjz0.mjs","sources":["../../projects/aril/boot/mfe/src/app.component.ts"],"sourcesContent":["import { Component, NgZone, inject } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { PrimeNGConfig } from 'primeng/api';\r\n\r\nimport { ModuleFederationToolsModule, connectRouter } from '@angular-architects/module-federation-tools';\r\nimport { TranslocoService } from '@ngneat/transloco';\r\n\r\nimport { MfeBridge } from 'aril/boot/bridge';\r\nimport { LanguageCode, TR_TRANSLATIONS } from 'aril/boot/config/translate';\r\nimport { AppMenuService, MFELayoutComponent } from 'aril/theme/layout';\r\n\r\nimport { appName, menuItems } from './bootstrap';\r\n\r\n@Component({\r\n\tstandalone: true,\r\n\ttemplate: `\r\n\t\t@if (isHostMode()) {\r\n\t\t\t<mfe-layout></mfe-layout>\r\n\t\t} @else {\r\n\t\t\tBu uygulama yalnızca host app içinden açılabilir\r\n\t\t}\r\n\t`,\r\n\timports: [ModuleFederationToolsModule, MFELayoutComponent]\r\n})\r\nexport class AppComponent {\r\n\tconstructor(\r\n\t\tprivate readonly router: Router,\r\n\t\tprivate readonly translocoService: TranslocoService,\r\n\t\tprivate readonly appMenuService: AppMenuService,\r\n\t\tprivate readonly primeNgConfig: PrimeNGConfig,\r\n\t\tprivate readonly bridgeSvc: MfeBridge\r\n\t) {\r\n\t\tif (!this.bridgeSvc.isHostMode() && !this.bridgeSvc.hostNgZone) {\r\n\t\t\tthis.bridgeSvc.hostNgZone = inject(NgZone);\r\n\t\t}\r\n\r\n\t\tconnectRouter(this.router, true);\r\n\r\n\t\tthis.bridgeSvc.activeMF.set(appName);\r\n\t\tconst lang: LanguageCode = (localStorage.getItem('lang') as LanguageCode) ?? LanguageCode.TR;\r\n\r\n\t\tthis.translocoService.setActiveLang(lang);\r\n\r\n\t\tthis.setLocale(lang);\r\n\r\n\t\tif (!this.bridgeSvc.isHostMode()) {\r\n\t\t\tthis.appMenuService.menuConfig.set({ items: structuredClone(menuItems), prefix: appName });\r\n\t\t}\r\n\t}\r\n\r\n\tget isHostMode() {\r\n\t\treturn this.bridgeSvc.isHostMode;\r\n\t}\r\n\r\n\tsetLocale(lang: LanguageCode) {\r\n\t\tif (!lang?.length) {\r\n\t\t\tconsole.warn('No language selected');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (lang === LanguageCode.TR) {\r\n\t\t\tthis.primeNgConfig.setTranslation(TR_TRANSLATIONS);\r\n\t\t}\r\n\t}\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MAyBa,YAAY,CAAA;IACxB,WACkB,CAAA,MAAc,EACd,gBAAkC,EAClC,cAA8B,EAC9B,aAA4B,EAC5B,SAAoB,EAAA;QAJpB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAClC,IAAc,CAAA,cAAA,GAAd,cAAc,CAAgB;QAC9B,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAC5B,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;AAErC,QAAA,IA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