@dsivd/prestations-ng 18.0.4 → 18.0.5

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
@@ -6,6 +6,13 @@
6
6
 
7
7
  ---
8
8
 
9
+ ## [18.0.5]
10
+
11
+ ### Updated
12
+
13
+ - [foehn-input-email.component.ts](projects/prestations-ng/src/foehn-input/foehn-input-email.component.ts)
14
+ - Do not override `helpModal` and `standardHelpText` if already set as input
15
+
9
16
  ## [18.0.4]
10
17
 
11
18
  ### Added
@@ -13,7 +20,7 @@
13
20
  - [default-dictionary.ts](projects/prestations-ng/src/sdk-dictionary/default-dictionary.ts)
14
21
  - added key `foehn-input-email.standard-connected-help-text`
15
22
 
16
- ### Update
23
+ ### Updated
17
24
 
18
25
  - [.browserslistrc](src/.browserslistrc)
19
26
  - added step by step for upgrading browsers list
package/UPGRADING_V18.md CHANGED
@@ -32,26 +32,6 @@ ng update @angular/core@18 @angular/cli@18
32
32
 
33
33
  When asked the question "Select the migrations that you'd like to run", accept "use-application-builder" by hitting "Space" key then "Enter".
34
34
 
35
- #### Fix provideHttpClient withXsrfConfiguration
36
-
37
- Modify your `app.module.ts` and add:
38
- `{
39
- cookieName: 'XSRF-TOKEN',
40
- headerName: 'X-XSRF-TOKEN'
41
- }`
42
- to `withXsrfConfiguration()`.
43
-
44
- ```diff
45
- providers: [
46
- META_SERVICE_PROVIDER,
47
- - provideHttpClient(withXsrfConfiguration()),
48
- + provideHttpClient(withXsrfConfiguration({
49
- + cookieName: 'XSRF-TOKEN',
50
- + headerName: 'X-XSRF-TOKEN'
51
- + })),
52
- ]
53
- ```
54
-
55
35
  #### Add an empty "browser" to your output path in angular.json
56
36
 
57
37
  ```diff
@@ -163,7 +143,7 @@ In your `proxy.conf.json` file:
163
143
  }
164
144
  ```
165
145
 
166
- #### NgHttpLoader migration as standalone
146
+ #### NgHttpLoader migration as standalone + Fix provideHttpClient withXsrfConfiguration
167
147
 
168
148
  In your `app.module.ts` file:
169
149
 
@@ -181,8 +161,14 @@ In your `app.module.ts` file:
181
161
  - NgHttpLoaderModule.forRoot(),
182
162
  + NgHttpLoaderComponent,
183
163
  ], providers: [
184
- provideHttpClient(
185
- + withInterceptors([pendingRequestsInterceptor$]),
164
+ - provideHttpClient(withXsrfConfiguration()),
165
+ + provideHttpClient(
166
+ + withInterceptors([pendingRequestsInterceptor$]),
167
+ + withXsrfConfiguration({
168
+ + cookieName: 'XSRF-TOKEN',
169
+ + headerName: 'X-XSRF-TOKEN'
170
+ + })
171
+ + ),
186
172
  ]
187
173
  })
188
174
  ```
@@ -416,7 +402,7 @@ see https://dsigit.etat-de-vaud.ch/outils/git/projects/PEE/repos/imt-charts/brow
416
402
  You can use this openrewrite recipe to simplify the migration (run with java 11)
417
403
 
418
404
  ```bash
419
- mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4 -Drewrite.exportDatatables=true -Pnof,noft
405
+ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4 -Pnof,noft
420
406
  ```
421
407
 
422
408
  Fix application.properties :
@@ -501,6 +487,7 @@ with these properties :
501
487
 
502
488
  ### APPLICATION-PARENT
503
489
 
490
+ - set parent version to `14.x.x`
504
491
  - remove property `java.version` (already set to `21` in the parent)
505
492
  - if existing, remove exclusion `spring-cloud-starter-netflix-eureka-client` from `starter-prestation`
506
493
  - remove dependency `spring-boot-starter-validation` (already in `starter-prestation`)
@@ -616,6 +603,18 @@ buildAppPipelinePodmanUT([
616
603
  ])
617
604
  ```
618
605
 
606
+ ### Code cleanup
607
+
608
+ You can use these openrewrite recipes to clean your code :
609
+
610
+ ```bash
611
+ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.testing.junit5.JUnit5BestPractices
612
+ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-static-analysis:RELEASE -Drewrite.activeRecipes=org.openrewrite.staticanalysis.CommonStaticAnalysis
613
+ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.activeRecipes=org.openrewrite.java.RemoveUnusedImports
614
+ ```
615
+
616
+ Finally, take a look at sonar
617
+
619
618
  ### Debugging tips
620
619
 
621
620
  Spring boot 3 doesn't support calling a controller with a trailing slash, fix the url called (/api/ping != /api/ping**/**)
Binary file
@@ -11139,6 +11139,11 @@ class FoehnInputEmailComponent extends FoehnInputStringComponent {
11139
11139
  constructor(dictionaryService) {
11140
11140
  super();
11141
11141
  this.dictionaryService = dictionaryService;
11142
+ }
11143
+ ngOnInit() {
11144
+ super.ngOnInit();
11145
+ this.type = 'email';
11146
+ this.autocomplete = 'email';
11142
11147
  this.languageChangeSubscription = this.dictionaryService
11143
11148
  .getCurrentLanguageCode()
11144
11149
  .pipe(switchMap(() => combineLatest([
@@ -11148,19 +11153,20 @@ class FoehnInputEmailComponent extends FoehnInputStringComponent {
11148
11153
  ])))
11149
11154
  // eslint-disable-next-line rxjs-angular/prefer-async-pipe
11150
11155
  .subscribe(([modalTitle, modalContent, standardHelpText]) => {
11151
- this.helpModal = {
11152
- title: modalTitle,
11153
- body: modalContent,
11154
- modalSize: 'modal-xs'
11155
- };
11156
- this.standardHelpText = standardHelpText;
11156
+ if (this.helpModal === undefined) {
11157
+ // Do not override if already set
11158
+ this.helpModal = {
11159
+ title: modalTitle,
11160
+ body: modalContent,
11161
+ modalSize: 'modal-xs'
11162
+ };
11163
+ }
11164
+ if (this.standardHelpText === undefined) {
11165
+ // Do not override if already set
11166
+ this.standardHelpText = standardHelpText;
11167
+ }
11157
11168
  });
11158
11169
  }
11159
- ngOnInit() {
11160
- super.ngOnInit();
11161
- this.type = 'email';
11162
- this.autocomplete = 'email';
11163
- }
11164
11170
  ngOnDestroy() {
11165
11171
  super.ngOnDestroy();
11166
11172
  this.languageChangeSubscription?.unsubscribe();