@cima-foundation/schematics 0.4.9 → 0.4.11

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.
Files changed (15) hide show
  1. package/.idea/vcs.xml +6 -0
  2. package/README.md +3 -0
  3. package/package.json +1 -1
  4. package/src/new-library/files/__name@dasherize__/angular.json +15 -3
  5. package/src/new-library/files/__name@dasherize__/package.json +2 -2
  6. package/src/new-library/files/__name@dasherize__/projects/__name@dasherize__-test-app/src/app/app-routing.module.ts +1 -12
  7. package/src/new-library/files/__name@dasherize__/projects/__name@dasherize__-test-app/src/app/app.module.ts +4 -0
  8. package/src/new-library/files/__name@dasherize__/projects/__name@dasherize__-test-app/src/app/credits/credits-page/credits-page.component.html +3 -5
  9. package/src/new-library/files/__name@dasherize__/projects/__name@dasherize__-test-app/src/app/credits/credits-page/credits-page.component.ts +15 -6
  10. package/src/new-library/files/__name@dasherize__/projects/__name@dasherize__-test-app/src/environments/environment.prod.ts +10 -5
  11. package/src/new-library/files/__name@dasherize__/projects/__name@dasherize__-test-app/src/environments/environment.ts +3 -11
  12. package/src/new-library/files/__name@dasherize__/projects/cima/__name@dasherize__/src/lib/components/__name@dasherize__-app-container/__name@dasherize__-app-container.component.html +1 -1
  13. package/src/new-library/files/__name@dasherize__/projects/cima/__name@dasherize__/src/lib/components/__name@dasherize__-app-container/__name@dasherize__-app-container.component.ts +15 -2
  14. package/src/new-portal/files/__name@dasherize__-portal/package.json +2 -1
  15. package/src/new-portal/files/__name@dasherize__-portal/projects/__name@dasherize__-portal/src/app/app.module.ts +5 -0
package/.idea/vcs.xml CHANGED
@@ -1,5 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
+ <component name="CommitMessageInspectionProfile">
4
+ <profile version="1.0">
5
+ <inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
6
+ <inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
7
+ </profile>
8
+ </component>
3
9
  <component name="VcsDirectoryMappings">
4
10
  <mapping directory="" vcs="Git" />
5
11
  </component>
package/README.md CHANGED
@@ -22,7 +22,10 @@ To publish, simply do:
22
22
 
23
23
  ```bash
24
24
  npm run build
25
+ npm login
25
26
  npm publish
27
+ or
28
+ npm publish --access public
26
29
  ```
27
30
 
28
31
  That's it!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cima-foundation/schematics",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "description": "A blank schematics",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -51,6 +51,16 @@
51
51
  "projects/<%= dasherize(name) %>-test-app/src/web.config",
52
52
  "projects/<%= dasherize(name) %>-test-app/src/silent-refresh.html",
53
53
  "projects/<%= dasherize(name) %>-test-app/src/manifest.webmanifest",
54
+ {
55
+ "glob": "**/*",
56
+ "input": "./node_modules/@cima/commons/icons",
57
+ "output": "./assets/icons"
58
+ },
59
+ {
60
+ "glob": "**/*",
61
+ "input": "./node_modules/@cima/commons/img",
62
+ "output": "./assets/img"
63
+ },
54
64
  {
55
65
  "glob": "**/*",
56
66
  "input": "./projects/cima/<%= dasherize(name) %>/assets",
@@ -62,7 +72,8 @@
62
72
  "projects/<%= dasherize(name) %>-test-app/src/styles.scss",
63
73
  "node_modules/@fortawesome/fontawesome-free/css/all.css",
64
74
  "node_modules/bootstrap/scss/bootstrap-grid.scss",
65
- "node_modules/bootstrap/scss/bootstrap-utilities.scss"
75
+ "node_modules/bootstrap/scss/bootstrap-utilities.scss",
76
+ "node_modules/flag-icons/css/flag-icons.min.css"
66
77
  ],
67
78
  "allowedCommonJsDependencies": ["ngx-masonry"],
68
79
  "stylePreprocessorOptions": {
@@ -78,7 +89,7 @@
78
89
  {
79
90
  "type": "initial",
80
91
  "maximumWarning": "750kb",
81
- "maximumError": "2mb"
92
+ "maximumError": "8mb"
82
93
  },
83
94
  {
84
95
  "type": "anyComponentStyle",
@@ -158,7 +169,8 @@
158
169
  "projects/<%= dasherize(name) %>-test-app/src/styles.scss",
159
170
  "node_modules/@fortawesome/fontawesome-free/css/all.css",
160
171
  "node_modules/bootstrap/scss/bootstrap-grid.scss",
161
- "node_modules/bootstrap/scss/bootstrap-utilities.scss"
172
+ "node_modules/bootstrap/scss/bootstrap-utilities.scss",
173
+ "node_modules/flag-icons/css/flag-icons.min.css"
162
174
  ],
163
175
  "scripts": []
164
176
  }
@@ -27,12 +27,12 @@
27
27
  "@angular/flex-layout": "^13.0.0-beta.36",
28
28
  "@angular/forms": "~13.3.0",
29
29
  "@angular/material": "^13.2.3",
30
+ "@ngx-translate/core": "^14.0.0",
30
31
  "@angular/platform-browser": "~13.3.0",
31
32
  "@angular/platform-browser-dynamic": "~13.3.0",
32
33
  "@angular/router": "~13.3.0",
33
34
  "@angular/service-worker": "~13.3.0",
34
- "@cima/commons": "git+https://github.com/CIMAFoundation/ngx-cima-commons.git#v0.9.55",
35
- "@cima/dashboard": "git+https://github.com/CIMAFoundation/ngx-cima-dashboard.git#v0.4.4",
35
+ "@cima/commons": "git+https://github.com/CIMAFoundation/ngx-cima-commons.git#v0.13.6",
36
36
  "@fortawesome/fontawesome-free": "^6.3.0",
37
37
  "@kolkov/angular-editor": "2.0.0",
38
38
  "@ngneat/until-destroy": "^8.1.4",
@@ -8,29 +8,18 @@ import {
8
8
  } from '@cima/commons';
9
9
 
10
10
  const routes: Routes = [
11
- {
12
- path: '',
13
- redirectTo: '<%= dasherize(name) %>',
14
- pathMatch: 'full',
15
- },
16
-
17
11
  {
18
12
  path: '',
19
13
  component: PortalContainerComponent,
20
14
  canActivate: [AuthGuard],
21
15
  children: [
22
- {
23
- path: 'dashboard',
24
- loadChildren: () =>
25
- import('@cima/dashboard').then((m) => m.DashboardModule),
26
- },
27
16
  {
28
17
  path: 'credits',
29
18
  loadChildren: () =>
30
19
  import('./credits/credits.module').then((m) => m.CreditsModule),
31
20
  },
32
21
  {
33
- path: '<%= dasherize(name) %>',
22
+ path: '',
34
23
  loadChildren: () =>
35
24
  import('@cima/<%= dasherize(name) %>').then((m) => m.Cima<%= classify(name) %>Module),
36
25
  },
@@ -1,5 +1,6 @@
1
1
  import { APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';
2
2
  import { ServiceWorkerModule } from '@angular/service-worker';
3
+ import {TranslateModule} from "@ngx-translate/core";
3
4
 
4
5
  import {
5
6
  CimaCommonsModule,
@@ -43,6 +44,9 @@ registerLocaleData(localeIt, 'it-IT', localeItExtra);
43
44
  // or after 30 seconds (whichever comes first).
44
45
  registrationStrategy: 'registerWhenStable:30000',
45
46
  }),
47
+ TranslateModule.forRoot({
48
+ defaultLanguage: 'en',
49
+ })
46
50
  ],
47
51
  providers: [
48
52
  AuthGuard,
@@ -1,5 +1,3 @@
1
- <cima-credits>
2
- <ng-container tor>
3
- <cima-tor></cima-tor>
4
- </ng-container>
5
- </cima-credits>
1
+ <cima-page-container style="background-color:unset">
2
+ <commons-credits [credits]="credits"></commons-credits>
3
+ </cima-page-container>
@@ -1,15 +1,24 @@
1
- import { Component, OnInit } from '@angular/core';
2
- import { Title } from '@angular/platform-browser';
1
+ import { Component, AfterViewInit } from '@angular/core';
2
+ import {CimaConfigService, FaviconService, PortalService} from '@cima/commons';
3
3
 
4
4
  @Component({
5
5
  selector: 'cima-credits-page',
6
6
  templateUrl: './credits-page.component.html',
7
7
  styleUrls: ['./credits-page.component.scss'],
8
8
  })
9
- export class CreditsPageComponent implements OnInit {
10
- constructor(private titleService: Title) {}
9
+ export class CreditsPageComponent implements AfterViewInit {
10
+ constructor(
11
+ private portalService: PortalService,
12
+ private faviconService: FaviconService,
13
+ private configService: CimaConfigService
14
+ ) {}
11
15
 
12
- ngOnInit(): void {
13
- this.titleService.setTitle($localize`Credits`);
16
+ credits: any[]
17
+ ngAfterViewInit(): void {
18
+ this.portalService.setTitle(`Credits`);
19
+ this.faviconService.setPortalFavicon();
20
+ this.configService.getStaticCredits().subscribe((credits) => {
21
+ this.credits = credits;
22
+ } );
14
23
  }
15
24
  }
@@ -1,12 +1,17 @@
1
+ const protocol = window.location.protocol;
2
+ const hostname = window.location.hostname;
3
+ let port = window.location.port ? `:${window.location.port}` : '';
4
+
5
+ const wsProtocol = protocol === 'https:' ? 'wss:' : 'ws:';
6
+
1
7
  export const environment = {
2
- title: '<%= classify(name) %> Test App',
8
+ title: '<%= classify(name) %>',
3
9
  production: true,
4
10
  fakeData: false,
5
11
  debug: true,
6
12
  server: {
7
- baseUrl: 'https://acroweb3-portal-backend-test.cimafoundation.org',
8
- configEndpoint: '/acroweb',
9
- wsEndpoint:
10
- 'ws://acroweb3-portal-backend-test.cimafoundation.org/ws/notifier/',
13
+ baseUrl: `${protocol}//${hostname}${port}/api`,
14
+ configEndpoint: `/acroweb`,
15
+ wsEndpoint: `${wsProtocol}//${hostname}${port}/ws/notifier/`,
11
16
  },
12
17
  };
@@ -3,23 +3,15 @@
3
3
  // The list of file replacements can be found in `angular.json`.
4
4
 
5
5
  export const environment = {
6
- title: '<%= classify(name) %> Test App',
6
+ title: '<%= classify(name) %>',
7
7
  production: false,
8
8
  fakeData: false,
9
9
  debug: true,
10
10
  server: {
11
- baseUrl: 'https://acroweb3-portal-backend-test.cimafoundation.org',
11
+ baseUrl: 'https://mydewetra3-staging.cimafoundation.org/api',
12
12
  configEndpoint: '/acroweb',
13
13
  wsEndpoint:
14
- 'ws://acroweb3-portal-backend-test.cimafoundation.org/ws/notifier/',
14
+ 'wss://mydewetra3-staging.cimafoundation.org/ws/notifier/',
15
15
  },
16
16
  };
17
17
 
18
- /*
19
- * For easier debugging in development mode, you can import the following file
20
- * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
21
- *
22
- * This import should be commented out in production mode because it will have a negative impact
23
- * on performance if an error is thrown.
24
- */
25
- // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
@@ -1,6 +1,6 @@
1
1
  <cima-app-container mode="side">
2
2
  <ng-container app-menu>
3
- <a [routerLink]="['/', '<%= dasherize(name) %>']">Home</a>
3
+ <a routerLink="'./<%= dasherize(name) %>'">Home</a>
4
4
  </ng-container>
5
5
 
6
6
  <app-sidenav-tab icon="list" i18-label label="Tab Label">
@@ -2,6 +2,8 @@ import { AfterViewInit, Component, Inject } from '@angular/core';
2
2
 
3
3
  import { AppConfig, APP_CONFIG, FaviconService, PortalService } from '@cima/commons';
4
4
 
5
+ import {LangChangeEvent, TranslateService} from "@ngx-translate/core";
6
+
5
7
 
6
8
  @Component({
7
9
  selector: '<%= dasherize(name) %>-app-container',
@@ -12,8 +14,19 @@ export class <%= classify(name) %>AppContainerComponent implements AfterViewIni
12
14
  constructor(
13
15
  @Inject(APP_CONFIG) private config: AppConfig,
14
16
  private faviconService: FaviconService,
15
- private portalService: PortalService
16
- ) {}
17
+ private portalService: PortalService,
18
+ public translate: TranslateService,
19
+ ) {
20
+
21
+ let portal_current_language: string = this.translate.currentLang;
22
+ if(!portal_current_language) portal_current_language = this.translate.defaultLang;
23
+ this.portalService.getPortalLabels('mydewetra', '<%= dasherize(name) %>', portal_current_language);
24
+
25
+ this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
26
+ this.portalService.getPortalLabels('mydewetra', '<%= dasherize(name) %>', event.lang);
27
+ });
28
+
29
+ }
17
30
 
18
31
  ngAfterViewInit() {
19
32
  this.faviconService.setAppFavicon(this.config.name);
@@ -30,10 +30,11 @@
30
30
  "@angular/platform-browser-dynamic": "~13.3.0",
31
31
  "@angular/router": "~13.3.0",
32
32
  "@angular/service-worker": "~13.3.0",
33
- "@cima/commons": "git+https://github.com/CIMAFoundation/ngx-cima-commons.git#v0.9.55",
33
+ "@cima/commons": "git+https://github.com/CIMAFoundation/ngx-cima-commons.git#v0.9.58",
34
34
  "@cima/dashboard": "git+https://github.com/CIMAFoundation/ngx-cima-dashboard.git#v0.4.4",
35
35
  "@cima/kumale": "git+https://github.com/CIMAFoundation/ngx-cima-kumale.git#v0.1.18",
36
36
  "@cima/admin": "git+https://github.com/CIMAFoundation/ngx-cima-admin.git#v0.1.15",
37
+ "@ngx-translate/core": "^14.0.0",
37
38
  "@fortawesome/fontawesome-free": "^6.3.0",
38
39
  "@kolkov/angular-editor": "2.0.0",
39
40
  "@ngneat/until-destroy": "^8.1.4",
@@ -8,6 +8,8 @@ import { OAuthModuleConfig, OAuthStorage } from 'angular-oauth2-oidc';
8
8
  import localeIt from '@angular/common/locales/it';
9
9
  import localeItExtra from '@angular/common/locales/extra/it';
10
10
 
11
+ import {TranslateModule} from "@ngx-translate/core";
12
+
11
13
  registerLocaleData(localeIt, 'it-IT', localeItExtra);
12
14
 
13
15
  import {
@@ -45,6 +47,9 @@ import { AppComponent } from './app.component';
45
47
  // or after 30 seconds (whichever comes first).
46
48
  registrationStrategy: 'registerWhenStable:30000',
47
49
  }),
50
+ TranslateModule.forRoot({
51
+ defaultLanguage: 'en',
52
+ })
48
53
  ],
49
54
  providers: [
50
55
  AuthGuard,