@eui/cli 21.0.0-alpha.4 → 21.0.0-alpha.40
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/README.md +1 -1
- package/bin/eui-cli.js +67 -0
- package/bin/scripts/build-app.js +12 -0
- package/bin/scripts/lint-app.js +22 -0
- package/bin/scripts/new.js +39 -0
- package/bin/scripts/serve-app.js +12 -0
- package/lib/app-utils/build.js +176 -0
- package/lib/app-utils/projects.js +41 -0
- package/lib/app-utils/serve.js +78 -0
- package/lib/build.js +130 -0
- package/lib/cli.js +140 -0
- package/lib/config.js +59 -0
- package/lib/generators.js +72 -0
- package/lib/install.js +45 -0
- package/lib/maven-build/build.xml +115 -0
- package/lib/maven-build/lib/ant-contrib-20061014.jar +0 -0
- package/lib/maven-build/pom.xml +64 -0
- package/lib/post-build.js +31 -0
- package/lib/skeletons/_angular/base/.browserslistrc +16 -0
- package/lib/skeletons/_angular/base/.editorconfig +16 -0
- package/lib/skeletons/_angular/base/README.md +26 -0
- package/lib/skeletons/_angular/base/angular.json +129 -0
- package/lib/skeletons/_angular/base/gitignore_TO_REPLACE +51 -0
- package/lib/skeletons/_angular/base/mock/app/models/user.js +6 -0
- package/lib/skeletons/_angular/base/mock/app/routes/index.js +5 -0
- package/lib/skeletons/_angular/base/mock/app/routes/user_routes.js +44 -0
- package/lib/skeletons/_angular/base/mock/db/db.json +10 -0
- package/lib/skeletons/_angular/base/mock/server.js +23 -0
- package/lib/skeletons/_angular/base/package.json +39 -0
- package/lib/skeletons/_angular/base/proxy-mock.conf.json +6 -0
- package/lib/skeletons/_angular/base/proxy.conf.json +6 -0
- package/lib/skeletons/_angular/base/src/.eslintrc.json +121 -0
- package/lib/skeletons/_angular/base/src/app/app-starter.service.spec.ts +68 -0
- package/lib/skeletons/_angular/base/src/app/app-starter.service.ts +68 -0
- package/lib/skeletons/_angular/base/src/app/app.component.html +35 -0
- package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +60 -0
- package/lib/skeletons/_angular/base/src/app/app.component.ts +35 -0
- package/lib/skeletons/_angular/base/src/app/app.config.ts +84 -0
- package/lib/skeletons/_angular/base/src/app/app.routes.ts +9 -0
- package/lib/skeletons/_angular/base/src/app/features/home/home.component.html +41 -0
- package/lib/skeletons/_angular/base/src/app/features/home/home.component.ts +17 -0
- package/lib/skeletons/_angular/base/src/app/features/home/home.routes.ts +6 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.routes.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.routes.ts +6 -0
- package/lib/skeletons/_angular/base/src/app/shared/testing/router.mock.ts +18 -0
- package/lib/skeletons/_angular/base/src/assets/config/env-json-config-dev.json +8 -0
- package/lib/skeletons/_angular/base/src/assets/config/env-json-config-prod.json +8 -0
- package/lib/skeletons/_angular/base/src/assets/config/env-json-config.json +7 -0
- package/lib/skeletons/_angular/base/src/assets/i18n/en.json +7 -0
- package/lib/skeletons/_angular/base/src/assets/i18n/fr.json +7 -0
- package/lib/skeletons/_angular/base/src/config/global.ts +33 -0
- package/lib/skeletons/_angular/base/src/config/index.ts +8 -0
- package/lib/skeletons/_angular/base/src/config/modules.ts +7 -0
- package/lib/skeletons/_angular/base/src/dummy.spec.ts +6 -0
- package/lib/skeletons/_angular/base/src/environments/environment.prod.ts +11 -0
- package/lib/skeletons/_angular/base/src/environments/environment.ts +15 -0
- package/lib/skeletons/_angular/base/src/favicon.ico +0 -0
- package/lib/skeletons/_angular/base/src/index.html +20 -0
- package/lib/skeletons/_angular/base/src/karma.conf.js +47 -0
- package/lib/skeletons/_angular/base/src/main.ts +20 -0
- package/lib/skeletons/_angular/base/src/styles.scss +1 -0
- package/lib/skeletons/_angular/base/src/tsconfig.app.json +18 -0
- package/lib/skeletons/_angular/base/src/tsconfig.spec.json +10 -0
- package/lib/skeletons/_angular/base/tsconfig.json +27 -0
- package/lib/skeletons/_angular/base-mobile/angular.json +156 -0
- package/lib/skeletons/_angular/base-mobile/ionic.config.json +5 -0
- package/lib/skeletons/_angular/base-mobile/ngsw-config.json +33 -0
- package/lib/skeletons/_angular/base-mobile/package.json +27 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app-routing.module.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app-starter.service.ts +73 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.component.html +47 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.component.ts +81 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.config.ts +81 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.module.ts +44 -0
- package/lib/skeletons/_angular/base-mobile/src/app/core/components/.gitkeep +0 -0
- package/lib/skeletons/_angular/base-mobile/src/app/core/core.module.ts +89 -0
- package/lib/skeletons/_angular/base-mobile/src/app/core/reducers/index.ts +32 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about-routing.module.ts +45 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about.component.html +70 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about.component.ts +19 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about.module.ts +30 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/change-log/changelog.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/change-log/changelog.component.ts +102 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/help-support/help-support.component.html +20 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/help-support/help-support.component.ts +75 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/legal-notice/legal-notice.component.html +12 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/legal-notice/legal-notice.component.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/licence-details/licence-details.component.html +48 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/licence-details/licence-details.component.ts +7 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/opensource-licences/opensource-licences.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/opensource-licences/opensource-licences.component.ts +31 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/privacy-statement/privacy-statement.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/privacy-statement/privacy-statement.component.ts +103 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home-routing.module.ts +15 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.component.ts +9 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.module.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page1/page1.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page1/page1.component.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page2/page2.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page2/page2.component.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1-routing.module.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.component.html +15 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.component.ts +17 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.module.ts +21 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2-routing.module.ts +16 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.component.ts +7 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.module.ts +17 -0
- package/lib/skeletons/_angular/base-mobile/src/app/shared/shared.module.ts +16 -0
- package/lib/skeletons/_angular/base-mobile/src/app/shared/testing/router.mock.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/docs/pdf-test.pdf +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/en.json +25 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/es.json +24 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/fr.json +25 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/tr.json +25 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-1024.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-114.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-120.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-128.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-144.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-152.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-16.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-180.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-192.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-32.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-36.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-384.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-48.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-512.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-57.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-60.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-72.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-76.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-96.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1125-2436.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1170-2532.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1179-2556.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1242-2208.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1242-2688.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1284-2778.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1290-2796.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1488-2266.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1536-2048.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1620-2160.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1640-2360.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1668-2224.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1668-2388.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-2048-2732.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-640-1136.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-750-1334.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-828-1792.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1125-2436.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1170-2532.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1179-2556.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1242-2208.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1242-2688.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1284-2778.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1290-2796.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1488-2266.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1536-2048.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1620-2160.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1640-2360.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1668-2224.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1668-2388.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-2048-2732.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-640-1136.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-750-1334.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-828-1792.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/images/app-icon.svg +10 -0
- package/lib/skeletons/_angular/base-mobile/src/config/global.ts +39 -0
- package/lib/skeletons/_angular/base-mobile/src/config/index.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/config/modules.ts +7 -0
- package/lib/skeletons/_angular/base-mobile/src/index.html +76 -0
- package/lib/skeletons/_angular/base-mobile/src/main.ts +23 -0
- package/lib/skeletons/_angular/base-mobile/src/manifest.webmanifest +66 -0
- package/lib/skeletons/_angular/base-mobile/src/tsconfig.app.json +20 -0
- package/lib/skeletons/_angular/base-mobile/tsconfig.json +27 -0
- package/lib/skeletons/_angular/options/ecl-ec/angular.json +181 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.html +237 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.ts +65 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.config.ts +84 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.html +71 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.ts +20 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page1/page1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page1/page1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page2/page2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page2/page2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/module1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/module1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module2/module2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module2/module2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/config/global.ts +23 -0
- package/lib/skeletons/_angular/options/ecl-eu/angular.json +181 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.html +203 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.ts +65 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.config.ts +84 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.html +71 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.ts +20 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page1/page1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page1/page1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page2/page2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page2/page2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/module1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/module1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module2/module2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module2/module2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/shared/shared.module.ts +15 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/config/global.ts +23 -0
- package/lib/skeletons/_angular/options/pnpm/package.json +72 -0
- package/lib/skeletons/web-maven/package.json +17 -0
- package/lib/skeletons/web-maven/pom.xml +55 -0
- package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/servlet/SpringWebApplicationInitializer.java +22 -0
- package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/spring/SpringRestConfiguration.java +24 -0
- package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/spring/rest/UserDetailsResource.java +23 -0
- package/lib/skeletons/web-maven/src/main/resources/ecas-config-application-name.xml +7 -0
- package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/dispatcher-servlet.xml +11 -0
- package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/web.xml +38 -0
- package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/weblogic.xml +16 -0
- package/lib/skeletons/web-maven/src/main/webapp/index.jsp +30 -0
- package/lib/skeletons/web-spring-boot/myapp-web/pom.xml +83 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/pom.xml +83 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/MyappApplication.java +46 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/domain/Address.java +65 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/domain/Building.java +44 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/repositories/BuildingRepository.java +11 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/BuildingResource.java +26 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/SwaggerConfig.java +16 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/HateoasPageableHandlerMethodArgumentResolver.java +45 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/HypermediaSupport.java +25 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/PageJsonSerializer.java +17 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/CachingPreventionFilter.java +29 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/CsrfPreventionFilter.java +35 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/FakeAuthenticationFilter.java +372 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/SecurityConfig.java +47 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingSearchCriteria.java +26 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingService.java +10 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingServiceImpl.java +26 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/resources/application.properties +0 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/resources/data.sql +11 -0
- package/lib/skeletons/web-spring-boot/pom.xml +30 -0
- package/lib/utils.js +217 -0
- package/package.json +10 -13
- package/sonar-project.properties +14 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"cli": {
|
|
6
|
+
"analytics": false
|
|
7
|
+
},
|
|
8
|
+
"projects": {
|
|
9
|
+
"app": {
|
|
10
|
+
"root": "",
|
|
11
|
+
"sourceRoot": "src",
|
|
12
|
+
"projectType": "application",
|
|
13
|
+
"prefix": "app",
|
|
14
|
+
"schematics": {
|
|
15
|
+
"@schematics/angular:component": {
|
|
16
|
+
"style": "scss"
|
|
17
|
+
},
|
|
18
|
+
"@schematics/angular:application": {
|
|
19
|
+
"strict": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"architect": {
|
|
23
|
+
"build": {
|
|
24
|
+
"builder": "@angular/build:application",
|
|
25
|
+
"options": {
|
|
26
|
+
"outputPath": "dist",
|
|
27
|
+
"index": "src/index.html",
|
|
28
|
+
"browser": "src/main.ts",
|
|
29
|
+
"polyfills": ["zone.js"],
|
|
30
|
+
"tsConfig": "src/tsconfig.app.json",
|
|
31
|
+
"inlineStyleLanguage": "scss",
|
|
32
|
+
"assets": [
|
|
33
|
+
"src/favicon.ico",
|
|
34
|
+
"src/assets",
|
|
35
|
+
{
|
|
36
|
+
"glob": "**/*",
|
|
37
|
+
"input": "node_modules/@eui/core/assets/",
|
|
38
|
+
"output": "./assets"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"glob": "**/*",
|
|
42
|
+
"input": "node_modules/@eui/styles/dist/assets/",
|
|
43
|
+
"output": "./assets"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"styles": [
|
|
47
|
+
"node_modules/@eui/styles/dist/eui.css",
|
|
48
|
+
"node_modules/@eui/styles/dist/eui-utilities.css",
|
|
49
|
+
"src/styles.scss"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"configurations": {
|
|
53
|
+
"production": {
|
|
54
|
+
"fileReplacements": [
|
|
55
|
+
{
|
|
56
|
+
"replace": "src/environments/environment.ts",
|
|
57
|
+
"with": "src/environments/environment.prod.ts"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"optimization": false,
|
|
61
|
+
"outputHashing": "all",
|
|
62
|
+
"sourceMap": false,
|
|
63
|
+
"aot": true,
|
|
64
|
+
"extractLicenses": true,
|
|
65
|
+
"budgets": [
|
|
66
|
+
{
|
|
67
|
+
"type": "initial",
|
|
68
|
+
"maximumWarning": "1mb",
|
|
69
|
+
"maximumError": "2mb"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"production-optimized": {
|
|
74
|
+
"fileReplacements": [
|
|
75
|
+
{
|
|
76
|
+
"replace": "src/environments/environment.ts",
|
|
77
|
+
"with": "src/environments/environment.prod.ts"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"optimization": {
|
|
81
|
+
"scripts": true,
|
|
82
|
+
"styles": {
|
|
83
|
+
"minify": false,
|
|
84
|
+
"inlineCritical": true
|
|
85
|
+
},
|
|
86
|
+
"fonts": true
|
|
87
|
+
},
|
|
88
|
+
"outputHashing": "all",
|
|
89
|
+
"sourceMap": false,
|
|
90
|
+
"extractLicenses": true,
|
|
91
|
+
"budgets": [
|
|
92
|
+
{
|
|
93
|
+
"type": "initial",
|
|
94
|
+
"maximumWarning": "2mb",
|
|
95
|
+
"maximumError": "6mb"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"development": {
|
|
100
|
+
"optimization": false,
|
|
101
|
+
"extractLicenses": false,
|
|
102
|
+
"sourceMap": true
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"defaultConfiguration": "production"
|
|
106
|
+
},
|
|
107
|
+
"serve": {
|
|
108
|
+
"builder": "@angular/build:dev-server",
|
|
109
|
+
"options": {
|
|
110
|
+
"buildTarget": "app:build"
|
|
111
|
+
},
|
|
112
|
+
"configurations": {
|
|
113
|
+
"proxy-mock": {
|
|
114
|
+
"buildTarget": "app:build:development",
|
|
115
|
+
"proxyConfig": "proxy-mock.conf.json"
|
|
116
|
+
},
|
|
117
|
+
"production": {
|
|
118
|
+
"buildTarget": "app:build:production"
|
|
119
|
+
},
|
|
120
|
+
"development": {
|
|
121
|
+
"buildTarget": "app:build:development"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"defaultConfiguration": "development"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# compiled output
|
|
4
|
+
**/node_modules
|
|
5
|
+
**/target
|
|
6
|
+
**/build
|
|
7
|
+
**/dist
|
|
8
|
+
**/out-tsc
|
|
9
|
+
**/tmp
|
|
10
|
+
**/test/reports
|
|
11
|
+
**/coverage
|
|
12
|
+
|
|
13
|
+
# IDEs and editors
|
|
14
|
+
/.idea
|
|
15
|
+
.project
|
|
16
|
+
.classpath
|
|
17
|
+
.c9/
|
|
18
|
+
*.launch
|
|
19
|
+
.settings/
|
|
20
|
+
*.sublime-workspace
|
|
21
|
+
|
|
22
|
+
# IDE - VSCode
|
|
23
|
+
.vscode/*
|
|
24
|
+
!.vscode/settings.json
|
|
25
|
+
!.vscode/tasks.json
|
|
26
|
+
!.vscode/launch.json
|
|
27
|
+
!.vscode/extensions.json
|
|
28
|
+
|
|
29
|
+
# misc
|
|
30
|
+
/.sass-cache
|
|
31
|
+
/connect.lock
|
|
32
|
+
/coverage
|
|
33
|
+
/libpeerconnection.log
|
|
34
|
+
npm-debug.log
|
|
35
|
+
testem.log
|
|
36
|
+
/typings
|
|
37
|
+
yarn-error.log
|
|
38
|
+
|
|
39
|
+
# e2e
|
|
40
|
+
/e2e/*.js
|
|
41
|
+
/e2e/*.map
|
|
42
|
+
|
|
43
|
+
# Angular specific
|
|
44
|
+
.angular
|
|
45
|
+
.nx
|
|
46
|
+
|
|
47
|
+
# System Files
|
|
48
|
+
.DS_Store
|
|
49
|
+
Thumbs.db
|
|
50
|
+
|
|
51
|
+
/assets/env-json-config.json
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const User = require('../models/user');
|
|
2
|
+
const uuid = require('uuid');
|
|
3
|
+
|
|
4
|
+
module.exports = function (app, db) {
|
|
5
|
+
db.then(db => {
|
|
6
|
+
app.get('/api/user-details', (req, res) => {
|
|
7
|
+
res.send(db.get('user-details'))
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
app.get('/api/users', (req, res) => {
|
|
11
|
+
res.send(db.get('users'))
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
app.get('/api/users/:userId', (req, res) => {
|
|
15
|
+
res.send(
|
|
16
|
+
db.get('users')
|
|
17
|
+
.find({ userId: req.params.userId })
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
app.put('/api/users/:userId', (req, res) => {
|
|
22
|
+
db.get('users')
|
|
23
|
+
.find({ userId: req.params.userId })
|
|
24
|
+
.assign( { ...req.body } )
|
|
25
|
+
.write()
|
|
26
|
+
.then(user => res.send(user))
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
app.delete('/api/users/:userId', (req, res) => {
|
|
30
|
+
db.get('users')
|
|
31
|
+
.remove({ userId: req.params.userId })
|
|
32
|
+
.write()
|
|
33
|
+
.then(res.send())
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
app.post('/api/users', (req, res) => {
|
|
37
|
+
db.get('users')
|
|
38
|
+
.push({ ...User, ...req.body, ...{ userId: uuid.v4() } })
|
|
39
|
+
.last()
|
|
40
|
+
.write()
|
|
41
|
+
.then(user => res.send(user))
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const bodyParser = require('body-parser');
|
|
3
|
+
const app = express();
|
|
4
|
+
const low = require('lowdb');
|
|
5
|
+
const FileAsync = require('lowdb/adapters/FileAsync');
|
|
6
|
+
const adapter = new FileAsync('mock/db/db.json');
|
|
7
|
+
const db = low(adapter);
|
|
8
|
+
const port = 3000;
|
|
9
|
+
|
|
10
|
+
app.use(express.json());
|
|
11
|
+
app.use(bodyParser.urlencoded({ extended: true }));
|
|
12
|
+
// const cors = require('cors');
|
|
13
|
+
// if needed to be reached from another localhost server for local testing a distributed app f.e.
|
|
14
|
+
// app.use(cors({
|
|
15
|
+
// origin: 'http://127.0.0.1:8080',
|
|
16
|
+
// credentials: true,
|
|
17
|
+
// }));
|
|
18
|
+
|
|
19
|
+
require('./app/routes')(app, db);
|
|
20
|
+
|
|
21
|
+
app.listen(port, () => {
|
|
22
|
+
console.log('We are live on ' + port);
|
|
23
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eui-angular-app",
|
|
3
|
+
"version": "21.0.0-alpha.40",
|
|
4
|
+
"license": "EUPL-1.1",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"ng": "ng",
|
|
7
|
+
"start-mock-server": "nodemon --watch ./mock ./mock/server.js",
|
|
8
|
+
"start-serve": "eui-cli serve-app --configuration=proxy-mock",
|
|
9
|
+
"start": "npm-run-all --parallel start-mock-server start-serve",
|
|
10
|
+
"start-proxy": "eui-cli serve-app --configuration=proxy",
|
|
11
|
+
"start-local": "eui-cli serve-app",
|
|
12
|
+
"build": "eui-cli build-app",
|
|
13
|
+
"build-dev": "eui-cli build-app --configuration=development --configEnvTarget=dev",
|
|
14
|
+
"build-prod": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod",
|
|
15
|
+
"build-prod-skip-test": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod --skipTest",
|
|
16
|
+
"build-prod-stats": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod --statsJson",
|
|
17
|
+
"app:build": "eui-cli build-app",
|
|
18
|
+
"app:inject-config": "eui-cli inject-config-app",
|
|
19
|
+
"generate-changelog": "eui-cli generate-changelog",
|
|
20
|
+
"generate-sprite": "eui-cli generate-sprite"
|
|
21
|
+
},
|
|
22
|
+
"private": true,
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@eui/deps-base": "21.0.0-alpha.40"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"npm-run-all": "4.1.5",
|
|
28
|
+
"json-server": "1.0.0-beta.3",
|
|
29
|
+
"nodemon": "2.0.22",
|
|
30
|
+
"lowdb": "1.0.0",
|
|
31
|
+
"body-parser": "1.20.3",
|
|
32
|
+
"express": "4.21.2"
|
|
33
|
+
},
|
|
34
|
+
"resolutions": {
|
|
35
|
+
"semver": ">=7.5.2",
|
|
36
|
+
"dompurify": ">=3.2.4",
|
|
37
|
+
"tmp": ">0.2.4"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"ignorePatterns": [
|
|
4
|
+
"**/node_modules/**",
|
|
5
|
+
"**/dist/**",
|
|
6
|
+
"**/coverage/**",
|
|
7
|
+
"**/e2e/**",
|
|
8
|
+
"**/test/**",
|
|
9
|
+
"**/testing/**"
|
|
10
|
+
],
|
|
11
|
+
"overrides": [
|
|
12
|
+
{
|
|
13
|
+
"files": [
|
|
14
|
+
"*.ts"
|
|
15
|
+
],
|
|
16
|
+
"parserOptions": {
|
|
17
|
+
"project": [
|
|
18
|
+
"tsconfig.json",
|
|
19
|
+
"e2e/tsconfig.json"
|
|
20
|
+
],
|
|
21
|
+
"createDefaultProgram": true
|
|
22
|
+
},
|
|
23
|
+
"extends": [
|
|
24
|
+
"eslint:recommended",
|
|
25
|
+
"plugin:@typescript-eslint/recommended",
|
|
26
|
+
"plugin:@angular-eslint/recommended",
|
|
27
|
+
"plugin:@angular-eslint/template/process-inline-templates"
|
|
28
|
+
],
|
|
29
|
+
"rules": {
|
|
30
|
+
"@angular-eslint/component-selector": [
|
|
31
|
+
"error",
|
|
32
|
+
{
|
|
33
|
+
"type": "element",
|
|
34
|
+
"prefix": ["app", "app"],
|
|
35
|
+
"style": "kebab-case"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"@angular-eslint/directive-selector": [
|
|
39
|
+
"error",
|
|
40
|
+
{
|
|
41
|
+
"type": "attribute",
|
|
42
|
+
"prefix": ["app", "eui"],
|
|
43
|
+
"style": "camelCase"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
47
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
48
|
+
"@typescript-eslint/no-unsafe-function-type": "error",
|
|
49
|
+
"@typescript-eslint/consistent-type-definitions": "off",
|
|
50
|
+
"@typescript-eslint/dot-notation": "off",
|
|
51
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
52
|
+
"off",
|
|
53
|
+
{
|
|
54
|
+
"accessibility": "explicit"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
58
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
59
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
60
|
+
"@typescript-eslint/require-await": "error",
|
|
61
|
+
"brace-style": [
|
|
62
|
+
"error",
|
|
63
|
+
"1tbs"
|
|
64
|
+
],
|
|
65
|
+
"id-blacklist": "off",
|
|
66
|
+
"id-match": "off",
|
|
67
|
+
"no-duplicate-case": "error",
|
|
68
|
+
"no-duplicate-imports": "off",
|
|
69
|
+
"no-invalid-this": "error",
|
|
70
|
+
"no-multiple-empty-lines": [
|
|
71
|
+
"error",
|
|
72
|
+
{
|
|
73
|
+
"max": 1
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"no-new-func": "error",
|
|
77
|
+
"no-redeclare": "off",
|
|
78
|
+
"@typescript-eslint/no-redeclare": [
|
|
79
|
+
"error"
|
|
80
|
+
],
|
|
81
|
+
"no-template-curly-in-string": "error",
|
|
82
|
+
"no-underscore-dangle": "off",
|
|
83
|
+
"@typescript-eslint/naming-convention": [
|
|
84
|
+
"error",
|
|
85
|
+
{
|
|
86
|
+
"selector": "enum",
|
|
87
|
+
"format": [
|
|
88
|
+
"PascalCase",
|
|
89
|
+
"UPPER_CASE"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"@typescript-eslint/member-ordering": [
|
|
94
|
+
"error",
|
|
95
|
+
{
|
|
96
|
+
"default": [
|
|
97
|
+
"public-static-field",
|
|
98
|
+
"public-instance-field",
|
|
99
|
+
"private-static-field",
|
|
100
|
+
"private-instance-field",
|
|
101
|
+
"public-constructor",
|
|
102
|
+
"private-constructor",
|
|
103
|
+
"public-instance-method",
|
|
104
|
+
"protected-instance-method",
|
|
105
|
+
"private-instance-method"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"files": [
|
|
113
|
+
"*.html"
|
|
114
|
+
],
|
|
115
|
+
"extends": [
|
|
116
|
+
"plugin:@angular-eslint/template/recommended"
|
|
117
|
+
],
|
|
118
|
+
"rules": {}
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {TestBed} from '@angular/core/testing';
|
|
2
|
+
import { HttpTestingController, provideHttpClientTesting } from "@angular/common/http/testing";
|
|
3
|
+
import {CONFIG_TOKEN, I18nService, UserService} from '@eui/core';
|
|
4
|
+
import {EuiAppConfig} from '@eui/core';
|
|
5
|
+
import {of} from 'rxjs';
|
|
6
|
+
import {AppStarterService} from './app-starter.service';
|
|
7
|
+
import SpyObj = jasmine.SpyObj;
|
|
8
|
+
import { EuiServiceStatus } from '@eui/base';
|
|
9
|
+
import { provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
|
|
10
|
+
|
|
11
|
+
describe('AppStarterService', () => {
|
|
12
|
+
let service: AppStarterService;
|
|
13
|
+
let httpMock: HttpTestingController;
|
|
14
|
+
let userServiceMock: SpyObj<UserService>;
|
|
15
|
+
let i18nServiceMock: SpyObj<I18nService>;
|
|
16
|
+
let configMock: EuiAppConfig;
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
userServiceMock = jasmine.createSpyObj('UserService', ['init']);
|
|
20
|
+
i18nServiceMock = jasmine.createSpyObj('I18nService', ['init']);
|
|
21
|
+
configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
|
|
22
|
+
|
|
23
|
+
TestBed.configureTestingModule({
|
|
24
|
+
providers: [
|
|
25
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
26
|
+
provideHttpClientTesting(),
|
|
27
|
+
AppStarterService,
|
|
28
|
+
{provide: UserService, useValue: userServiceMock},
|
|
29
|
+
{provide: I18nService, useValue: i18nServiceMock},
|
|
30
|
+
{provide: CONFIG_TOKEN, useValue: configMock},
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
service = TestBed.inject(AppStarterService);
|
|
35
|
+
httpMock = TestBed.inject(HttpTestingController);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should be created', () => {
|
|
39
|
+
expect(service).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should call start method', () => {
|
|
43
|
+
userServiceMock.init.and.returnValue(of({ } as EuiServiceStatus));
|
|
44
|
+
i18nServiceMock.init.and.returnValue(of({ } as EuiServiceStatus));
|
|
45
|
+
service.start().subscribe(() => {
|
|
46
|
+
expect(userServiceMock.init).toHaveBeenCalled();
|
|
47
|
+
expect(i18nServiceMock.init).toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should call initUserService method', () => {
|
|
52
|
+
userServiceMock.init.and.returnValue(of({ } as EuiServiceStatus));
|
|
53
|
+
service.initUserService().subscribe(() => {
|
|
54
|
+
expect(userServiceMock.init).toHaveBeenCalled();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should fetch user details', () => {
|
|
59
|
+
const dummyUserDetails = {userId: 'anonymous'};
|
|
60
|
+
service['fetchUserDetails']().subscribe(userDetails => {
|
|
61
|
+
expect(userDetails).toEqual(dummyUserDetails);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const req = httpMock.expectOne(`${configMock.modules?.['core']['base']}${configMock.modules?.['core']['userDetails']}`);
|
|
65
|
+
expect(req.request.method).toBe('GET');
|
|
66
|
+
req.flush(dummyUserDetails);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { inject, Injectable } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import {
|
|
4
|
+
CONFIG_TOKEN,
|
|
5
|
+
UserService,
|
|
6
|
+
I18nService,
|
|
7
|
+
EuiAppConfig,
|
|
8
|
+
UserDetails,
|
|
9
|
+
UserPreferences,
|
|
10
|
+
EuiServiceStatus,
|
|
11
|
+
} from '@eui/core';
|
|
12
|
+
import { catchError, Observable, of } from 'rxjs';
|
|
13
|
+
import { switchMap } from 'rxjs/operators';
|
|
14
|
+
|
|
15
|
+
@Injectable({
|
|
16
|
+
providedIn: 'root',
|
|
17
|
+
})
|
|
18
|
+
export class AppStarterService {
|
|
19
|
+
defaultUserPreferences: UserPreferences | undefined;
|
|
20
|
+
private userService: UserService = inject(UserService);
|
|
21
|
+
private i18nService: I18nService = inject(I18nService);
|
|
22
|
+
private config: EuiAppConfig = inject(CONFIG_TOKEN);
|
|
23
|
+
private http: HttpClient = inject(HttpClient);
|
|
24
|
+
|
|
25
|
+
start(): Observable<EuiServiceStatus> {
|
|
26
|
+
return this.initUserService().pipe(
|
|
27
|
+
switchMap((userStatus) => {
|
|
28
|
+
console.log(userStatus);
|
|
29
|
+
return this.i18nService.init();
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Fetches user details,
|
|
36
|
+
* create user: UserState object
|
|
37
|
+
* then initialise to the UserService on run time
|
|
38
|
+
*/
|
|
39
|
+
initUserService(): Observable<EuiServiceStatus> {
|
|
40
|
+
return this.fetchUserDetails().pipe(
|
|
41
|
+
switchMap((userDetails) => this.userService.init(userDetails))
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Fetches user details
|
|
47
|
+
*/
|
|
48
|
+
private fetchUserDetails(): Observable<UserDetails> {
|
|
49
|
+
// const url = this.config.modules.your_custom_module.your_custom_endpoint
|
|
50
|
+
const moduleCoreApi= this.config.modules?.['core'];
|
|
51
|
+
const url = `${moduleCoreApi?.['base']}${moduleCoreApi?.['userDetails']}`;
|
|
52
|
+
const user = {
|
|
53
|
+
userId: 'anonymous',
|
|
54
|
+
firstName: 'FirstName',
|
|
55
|
+
lastName: 'LastName',
|
|
56
|
+
fullName: 'FullName',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
if (!url) {
|
|
60
|
+
return of(user);
|
|
61
|
+
}
|
|
62
|
+
return this.http.get<UserDetails>(url)
|
|
63
|
+
.pipe(
|
|
64
|
+
// in case of Http failure return dummy user
|
|
65
|
+
catchError(() => of(user)),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<eui-app>
|
|
2
|
+
<eui-app-toolbar>
|
|
3
|
+
<eui-toolbar>
|
|
4
|
+
<eui-toolbar-logo/>
|
|
5
|
+
<eui-toolbar-app appName="appName"/>
|
|
6
|
+
<eui-toolbar-environment>MOCK</eui-toolbar-environment>
|
|
7
|
+
|
|
8
|
+
<eui-toolbar-items>
|
|
9
|
+
<eui-toolbar-item>
|
|
10
|
+
<eui-user-profile isShowAvatarInitials>
|
|
11
|
+
<eui-user-profile-menu>
|
|
12
|
+
<eui-user-profile-menu-item>
|
|
13
|
+
<eui-icon-svg icon="person:outline"/>{{ 'eui.my-profile-informations' | translate }}
|
|
14
|
+
</eui-user-profile-menu-item>
|
|
15
|
+
<eui-user-profile-menu-item>
|
|
16
|
+
<eui-icon-svg icon="log-out:outline"/>{{ 'eui.sign-out' | translate }}
|
|
17
|
+
</eui-user-profile-menu-item>
|
|
18
|
+
</eui-user-profile-menu>
|
|
19
|
+
</eui-user-profile>
|
|
20
|
+
</eui-toolbar-item>
|
|
21
|
+
|
|
22
|
+
<eui-toolbar-item>
|
|
23
|
+
<eui-notifications [count]="notificationItems?.length" [items]="notificationItems"></eui-notifications>
|
|
24
|
+
</eui-toolbar-item>
|
|
25
|
+
</eui-toolbar-items>
|
|
26
|
+
|
|
27
|
+
<eui-language-selector/>
|
|
28
|
+
</eui-toolbar>
|
|
29
|
+
</eui-app-toolbar>
|
|
30
|
+
<eui-app-sidebar>
|
|
31
|
+
<eui-app-sidebar-body>
|
|
32
|
+
<eui-app-sidebar-menu [items]="sidebarItems"/>
|
|
33
|
+
</eui-app-sidebar-body>
|
|
34
|
+
</eui-app-sidebar>
|
|
35
|
+
</eui-app>
|