@dsivd/prestations-ng 19.0.0-beta.5 → 19.0.0-beta.7

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/CHANGELOG.md CHANGED
@@ -22,6 +22,23 @@
22
22
  - [HasCustomErrors](projects/prestations-ng/src/has-custom-errors.ts)
23
23
  - Added `HasCustomErrors` interface representing a component that has custom error messages
24
24
 
25
+ - [foehn-header.component.html](projects/prestations-ng/src/foehn-header/foehn-header.component.html)
26
+ - Added a few more ids
27
+
28
+ ### Updated
29
+
30
+ - [foehn-footer.component.ts](projects/prestations-ng/src/foehn-footer/foehn-footer.component.ts)
31
+ - Updated default guide link URL
32
+
33
+ - [foehn-input.component.ts](projects/prestations-ng/src/foehn-input/foehn-input.component.ts)
34
+ - `[name]` attribut is required
35
+ - `[model]` attribut is required
36
+
37
+ ### Deleted
38
+
39
+ - [foehn-list-summary.component.ts](projects/prestations-ng/src/foehn-menu-prestation/foehn-list-summary/foehn-list-summary.component.ts)
40
+ - `[list]` attribut has been removed. Use `[model]` instead.
41
+
25
42
  ## [18.3.12]
26
43
 
27
44
  ### Updated
package/CONTRIBUTING.md CHANGED
@@ -2,19 +2,10 @@
2
2
 
3
3
  ## Prerequisite
4
4
 
5
- - Node 20.11+
5
+ - Node 22.18+
6
6
  - npm 10.2+
7
7
  - Chrome or Chromium
8
8
  - G++
9
- - The variable `CHROMIUM_BIN` set in your environment
10
-
11
- If you're using bashrc.dev.pee, the variable `CHROMIUM_BIN` is already set to `~/slave-apps/chromium-headless-64/chrome`
12
-
13
- If not, you can set the variable in your `.bashrc` or `.zshrc`:
14
-
15
- ```bash
16
- export CHROMIUM_BIN=/usr/bin/google-chrome-stable
17
- ```
18
9
 
19
10
  ## Developing using the Dev Tool
20
11
 
@@ -28,13 +19,13 @@ in both the Dev Tool and the library reload the page.
28
19
  ## Testing the library in integration
29
20
 
30
21
  Since version `8`, we can't use native symlink to integrate `prestations-ng` to
31
- a prestation such as Skeleton. We can however use `yarn link` to achieve the same
22
+ a prestation such as Skeleton. We can however use `npm link` to achieve the same
32
23
  result.
33
24
 
34
25
  ### In **prestations-ng**
35
26
 
36
27
  - if it is the first time, execute `npm install` then `npm run build:lib` (at root level)
37
- - `cd dist/prestations-ng && yarn link` (it's critical to link the content of `dist/prestations-ng`, not the root)
28
+ - `cd dist/prestations-ng && npm link` (it's critical to link the content of `dist/prestations-ng`, not the root)
38
29
  - `cd ../.. && npm run build:lib:dev` (at root level)
39
30
 
40
31
  `build:lib:dev` will use a feature of the Angular CLI: `--watch`. For more information on `--watch`, refer to the [official documentation](https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/create-library.md#why-do-i-need-to-build-the-library-everytime-i-make-changes).
@@ -42,12 +33,12 @@ result.
42
33
  ### In the prestation
43
34
 
44
35
  - `cd front`
45
- - `yarn link @dsivd/prestations-ng`
36
+ - `npm link @dsivd/prestations-ng`
46
37
  - `npm start` (only when `npm run build:lib:dev` in `prestations-ng` has started)
47
38
 
48
39
  Now if you change something in `prestations-ng`, the CLI of the prestation will hot swap the missing pieces and reload the page.
49
40
 
50
- Finally, when you're done, run `yarn unlink @dsivd/prestations-ng` to unlink the local version. You will need to run `npm install --force` to re-install the package that was linked.
41
+ Finally, when you're done, run `npm install` to unlink the local version.
51
42
 
52
43
  **NB: When the project uses a version 12+ or 13+ of the library, you need to use `yarn start:symlink` and checkout the library tag matching v12+ or v13+. More information on [UPGRADING_V12](UPGRADING_V12.md)**
53
44
 
@@ -73,12 +64,12 @@ run `npm run test:schematics` (at root level).
73
64
 
74
65
  - **In prestations-ng**:
75
66
  - if it is the first time, execute `npm install` then `npm run build:lib` (at root level)
76
- - `cd dist/prestations-ng && yarn link` (it's critical to link the content of `dist/prestations-ng`, not the root)
77
- - `npm run build:lib:dev` (at root level)
67
+ - `cd dist/prestations-ng && npm link` (it's critical to link the content of `dist/prestations-ng`, not the root)
68
+ - `cd ../.. && npm run build:lib:dev` (at root level)
78
69
 
79
70
  - **In project**:
80
71
  - `cd front`
81
- - `yarn link @dsivd/prestations-ng` (`yarn unlink @dsivd/prestations-ng` to remove link)
72
+ - `npm link @dsivd/prestations-ng` (`npm install` to remove link)
82
73
  - `ng g @dsivd/prestations-ng:[YOUR_SCHEMATIC]` (i.e. `ng g @dsivd/prestations-ng:ng-add` or `ng g @dsivd/prestations-ng:update-karma-config` or `ng g @dsivd/prestations-ng:replace-browsers-list`)
83
74
 
84
75
  In your project, you can test any schematic added into [collection.json](projects/prestations-ng/schematics/collection.json).
package/UPGRADING_V19.md CHANGED
@@ -330,7 +330,7 @@ ng update ngx-matomo-client@9
330
330
 
331
331
  ### Quick fix
332
332
 
333
- In all custom components extending `FoehnInputComponent`, in `providers` providing `FoehnInputComponent` remove `multi: true,`
333
+ - In all custom components extending `FoehnInputComponent`, in `providers` providing `FoehnInputComponent` remove `multi: true,`.
334
334
 
335
335
  ```diff
336
336
  {
@@ -340,9 +340,11 @@ In all custom components extending `FoehnInputComponent`, in `providers` providi
340
340
  }
341
341
  ```
342
342
 
343
- In your `.eslintrc.json`, remove `"/src/main.ts",` from `ignorePatterns`
343
+ - In your `.eslintrc.json`, remove `"/src/main.ts",` from `ignorePatterns`.
344
344
 
345
- In `main.ts`, replace `platformBrowserDynamic` by `platformBrowser`
345
+ - In `main.ts`, replace `platformBrowserDynamic` by `platformBrowser`.
346
+
347
+ - When using `<foehn-list-summary` component, replace `list` by `model`.
346
348
 
347
349
  ### Now fix your project before continuing
348
350
 
@@ -426,6 +428,8 @@ ng generate @angular/core:self-closing-tag
426
428
 
427
429
  **WARNING: The following command will work only when your application compiles without errors. If you have errors, fix them before continuing.**
428
430
 
431
+ **TIP: Check [Migrating from NgModules](COMPONENTS.md#migrating_from_ngmodules) for more information before running following commands.**
432
+
429
433
  ```bash
430
434
  npm run build
431
435
  ```
@@ -472,13 +476,13 @@ It should look like that:
472
476
  @Component({
473
477
  selector: 'app-root',
474
478
  templateUrl: './app.component.html',
475
- imports: [
476
- - // eslint-disable-next-line @angular-eslint/prefer-standalone
477
- - standalone: false
479
+ - // eslint-disable-next-line @angular-eslint/prefer-standalone
480
+ - standalone: false
481
+ + imports: [
478
482
  + RouterOutlet,
479
483
  + NgHttpLoaderComponent,
480
484
  + RedirectComponent,
481
- ]
485
+ + ]
482
486
  })
483
487
  ```
484
488
 
@@ -525,6 +529,67 @@ bootstrapApplication(AppComponent, appConfig).catch((err) =>
525
529
 
526
530
  Clean up your project by removing `app-routing.module.ts` and `app.module.ts` files if it has not already been done.
527
531
 
532
+ #### Migration to lazy-loaded routes when working with large applications
533
+
534
+ You may have some other modules that are maybe lazy-loaded. Just be sure that all your components are standalone before continuing.
535
+
536
+ > You can run the following command to convert eagerly loaded component routes to lazy loaded routes. This allows the build process to split the production bundle into smaller chunks, to avoid a big JS bundle that includes all routes, which negatively affects initial page load of an application.
537
+
538
+ > This migration will also collect information about all the components declared in NgModules and output the list of routes that use them (including corresponding location of the file). Consider making those components standalone.
539
+
540
+ ```bash
541
+ ng generate @angular/core:route-lazy-loading
542
+ ```
543
+
544
+ Here is a example when doing it manually because schematic above does not work as intended:
545
+
546
+ Your `app.routing.ts` file should look something like this:
547
+
548
+ ```ts
549
+ const routes: Routes = [
550
+ {
551
+ path: '',
552
+ component: PageWrapperComponent,
553
+ data: { root: true },
554
+ children: [
555
+ {
556
+ path: 'demandes',
557
+ loadChildren: () =>
558
+ import('./modules/demandes/demandes.module').then(
559
+ (m) => m.DemandesModule,
560
+ ),
561
+ },
562
+ { path: '404', component: FoehnNotfoundComponent },
563
+ { path: '', redirectTo: 'demandes', pathMatch: 'full' },
564
+ { path: '**', redirectTo: '/404', pathMatch: 'full' },
565
+ ],
566
+ },
567
+ ];
568
+ ```
569
+
570
+ Now, navigate to `DemandesModule`, at the same file level as `demandes.module.ts`, you create a `demandes.routes.ts` file with the following content:
571
+
572
+ ```ts
573
+ export const demandes_routes: Routes = [
574
+ // Your routes found in demandes.module.ts go here
575
+ ];
576
+ ```
577
+
578
+ Then replace `loadChildren: () => import('./modules/demandes/demandes.module').then(m => m.DemandesModule)` by `loadChildren: () => import('./modules/demandes/demandes.routes').then(m => m.demandes_routes)`.
579
+
580
+ Now you can safely delete `demandes.module.ts` as all components are `standalone` now.
581
+
582
+ ---
583
+
584
+ You can `lazy-load` components as well, for example:
585
+
586
+ ```diff
587
+ export const demandes_routes: Routes = [
588
+ - { path: 'list', component: DemandeListPageComponent },
589
+ + { path: 'list', loadComponent: () => import('./demande-list-page/demande-list-page.component').then(m => m.DemandeListPageComponent) },
590
+ ];
591
+ ```
592
+
528
593
  ### Migrate from NgClass to class bindings
529
594
 
530
595
  **WARNING: The following command will work only when your application compiles without errors. If you have errors, fix them before continuing.**
@@ -1314,3 +1379,20 @@ npm run test
1314
1379
  ```
1315
1380
 
1316
1381
  > 🚨 **Read carefully following [PITFALLS](ANGULAR_SIGNALS.md#common_pitfalls), especially points 4, 6 & 8 and check again your application**
1382
+
1383
+ ### Release your application using `jenkins-libs`
1384
+
1385
+ When your code has been merged/rebased onto `master`, you need to update your application in `jenkins-libs` to use node 22 instead of node 20.
1386
+
1387
+ See [getImtPortailApplications](https://dsigit.etat-de-vaud.ch/outils/git/projects/PEE/repos/jenkins-libs/browse/vars/getImtPortailApplications.groovy)
1388
+
1389
+ ```diff
1390
+ [
1391
+ 'project': 'cybersdk',
1392
+ 'name' : 'skeleton',
1393
+ 'gitUrl' : 'ssh://git@bitbucket.etat-de-vaud.ch/cybsdk/skeleton.git',
1394
+ 'jdk' : '21',
1395
+ - 'node' : '20'
1396
+ + 'node' : '22'
1397
+ ],
1398
+ ```