@dsivd/prestations-ng 14.5.15 → 14.5.17-beta2

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
@@ -26,8 +26,26 @@ A change is considered **breaking** if you have to change your code or update yo
26
26
 
27
27
  ---
28
28
 
29
+ ## [14.5.17]
30
+
31
+ ### Updated
32
+
33
+ - [support-alert.service.ts](projects/prestations-ng/src/sdk-support-alert/support-alert.service.ts)
34
+ - removed `setRefreshIntervalInSeconds(refreshIntervalsInSeconds: number)`, support alerts are now refreshed on every NavigationStart event from the Angular Router, but at most every 3 minutes.
35
+ - [foehn-page.component.html](projects/prestations-ng/src/foehn-page/foehn-page.component.html)
36
+ - added `@Input() supportAlertRefreshIntervalsInSeconds: number`, support alerts are now refreshed on every NavigationStart event from the Angular Router, but at most every 3 minutes.
37
+
38
+ ## [14.5.16]
39
+
40
+ ### Updated
41
+
42
+ - [support-alert.service.ts](projects/prestations-ng/src/sdk-support-alert/support-alert.service.ts)
43
+ - added `setRefreshIntervalInSeconds(refreshIntervalsInSeconds: number)` allowing to override the default refresh interval for support-alerts (default = 5 * 1000)
44
+ - [foehn-page.component.html](projects/prestations-ng/src/foehn-page/foehn-page.component.html)
45
+ - added `@Input() supportAlertRefreshIntervalsInSeconds: number` allowing to call SupportAlertService.setRefreshIntervalInSeconds()
29
46
 
30
47
  ## [14.5.15]
48
+
31
49
  ### Added
32
50
 
33
51
  - [Autogenerated documentation](https://dsi-vd.github.io/prestations-ng/generateddoc)
package/CONTRIBUTING.md CHANGED
@@ -188,3 +188,34 @@ export NODE_OPTIONS=--max_old_space_size=4096
188
188
  ```
189
189
 
190
190
  Use at your own risks.
191
+
192
+ ## E2E testing
193
+
194
+ `Protractor` is no longer included in new Angular projects as of Angular 12.
195
+ We have decided to remove it from `prestations-ng` and use instead `Cypress`.
196
+
197
+ For more informations, please visit :
198
+ https://github.com/angular/protractor/issues/5502
199
+ https://docs.cypress.io/guides/migrating-to-cypress/protractor#Introduction
200
+
201
+ **DO NOT FORGET TO BUILD THE LIBRARY BEFORE RUNNING E2E TESTS**
202
+
203
+ ### Running e2e in headless mode
204
+
205
+ When launching Cypress in headless mode, execute:
206
+ ```bash
207
+ yarn e2e
208
+ ```
209
+ When a test fails, a screenshot will be added in `e2e/cypress/screenshots` folder.
210
+
211
+ ### Running e2e using Cypress visual interface
212
+
213
+ When launching Cypress visual interface for running tests files individually in `watch` mode, execute:
214
+ ```bash
215
+ yarn e2e:open
216
+ ```
217
+ To execute a test, just click on your integration test file listed in the newly open window.
218
+ A new window will open showing your e2e test execution.
219
+ To show back your test list window, just click on `Tests` button in the top left corner.
220
+ Click the `Stop` button to close your e2e test execution window.
221
+ Then click on an other test in the list and so on...
package/UPGRADING_V12.md CHANGED
@@ -216,18 +216,3 @@ In your `package.json` located at the root of your application, add `start:symli
216
216
  }
217
217
  }
218
218
  ```
219
-
220
- ## e2e tip
221
-
222
- When `e2e` test are broken due to `puppeteer` not having the same version between browser and driver, you can temporarily modify your `package.json` with:
223
-
224
- ```json
225
- {
226
- "scripts": {
227
- "pree2e": "node_modules/protractor/bin/webdriver-manager update --versions.chrome=[VERSION_OF_CHROME_MATCHING_DRIVER] --gecko false --standalone false",
228
- "e2e": "ng e2e --webdriverUpdate=false"
229
- }
230
- }
231
- ```
232
-
233
- **Be sure to rollback when `puppeteer` is up-to-date**
package/UPGRADING_V13.md CHANGED
@@ -29,18 +29,3 @@ yarn upgrade
29
29
  ## Migrating to ESLint
30
30
 
31
31
  - Follow [our migration guide](ESLINT_MIGRATION_GUIDE.md) to migrate your project from TSLint to ESLint
32
-
33
- ## e2e tip
34
-
35
- When `e2e` test are broken due to `puppeteer` not having the same version between browser and driver, you can temporarily modify your `package.json` with:
36
-
37
- ```json
38
- {
39
- "scripts": {
40
- "pree2e": "node_modules/protractor/bin/webdriver-manager update --versions.chrome=[VERSION_OF_CHROME_MATCHING_DRIVER] --gecko false --standalone false",
41
- "e2e": "ng e2e --webdriverUpdate=false"
42
- }
43
- }
44
- ```
45
-
46
- **Be sure to rollback when `puppeteer` is up-to-date**
package/UPGRADING_V14.md CHANGED
@@ -50,18 +50,3 @@ yarn upgrade
50
50
  ## Migrating to ESLint
51
51
 
52
52
  - Follow [our migration guide](ESLINT_MIGRATION_GUIDE.md) to migrate your project from TSLint to ESLint
53
-
54
- ## e2e tip
55
-
56
- When `e2e` test are broken due to `puppeteer` not having the same version between browser and driver, you can temporarily modify your `package.json` with:
57
-
58
- ```json
59
- {
60
- "scripts": {
61
- "pree2e": "node_modules/protractor/bin/webdriver-manager update --versions.chrome=[VERSION_OF_CHROME_MATCHING_DRIVER] --gecko false --standalone false",
62
- "e2e": "ng e2e --webdriverUpdate=false"
63
- }
64
- }
65
- ```
66
-
67
- **Be sure to rollback when `puppeteer` is up-to-date**
@@ -3362,7 +3362,6 @@
3362
3362
  return I18nForm;
3363
3363
  }());
3364
3364
 
3365
- var ALERTS_REFRESH_SECONDS = 5 * 60;
3366
3365
  // Shared between prestations.
3367
3366
  var STORAGE_KEY = 'hidden-alerts';
3368
3367
  /**
@@ -3393,18 +3392,18 @@
3393
3392
  }
3394
3393
  };
3395
3394
  var SupportAlertService = /** @class */ (function () {
3396
- function SupportAlertService(http) {
3395
+ function SupportAlertService(http, router) {
3397
3396
  var _this = this;
3398
3397
  this.http = http;
3398
+ this.router = router;
3399
3399
  this.hiddenAlertIds = new rxjs.BehaviorSubject(getPersistedDismissedAlertIds());
3400
3400
  this.refreshTrigger = new rxjs.BehaviorSubject(true);
3401
- this.refreshInterval = rxjs.interval(ALERTS_REFRESH_SECONDS * 1000);
3402
3401
  this.supportAlertUrl = new rxjs.BehaviorSubject('');
3403
- // This ensures that we load the alerts when the page loads and at every configured interval.
3404
- var refreshAlertsTriggerAndTimer = rxjs.merge(this.refreshTrigger, this.refreshInterval);
3402
+ var navigationTrigger = this.router.events.pipe(operators.filter(function (e) { return e instanceof i1$1.NavigationStart; }));
3403
+ var refreshAlertsTriggerAndNavigation = rxjs.merge(this.refreshTrigger, navigationTrigger).pipe(operators.throttleTime(3 * 60 * 1000));
3405
3404
  this.allAlerts = rxjs.combineLatest([
3406
3405
  this.supportAlertUrl,
3407
- refreshAlertsTriggerAndTimer
3406
+ refreshAlertsTriggerAndNavigation
3408
3407
  ]).pipe(
3409
3408
  // Only if an url is defined
3410
3409
  operators.filter(function (_a) {
@@ -3473,14 +3472,14 @@
3473
3472
  };
3474
3473
  return SupportAlertService;
3475
3474
  }());
3476
- SupportAlertService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: SupportAlertService, deps: [{ token: i1__namespace.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3475
+ SupportAlertService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: SupportAlertService, deps: [{ token: i1__namespace.HttpClient }, { token: i1__namespace$1.Router }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3477
3476
  SupportAlertService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: SupportAlertService, providedIn: 'root' });
3478
3477
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: SupportAlertService, decorators: [{
3479
3478
  type: i0.Injectable,
3480
3479
  args: [{
3481
3480
  providedIn: 'root'
3482
3481
  }]
3483
- }], ctorParameters: function () { return [{ type: i1__namespace.HttpClient }]; } });
3482
+ }], ctorParameters: function () { return [{ type: i1__namespace.HttpClient }, { type: i1__namespace$1.Router }]; } });
3484
3483
 
3485
3484
  var FoehnDisplayAddressComponent = /** @class */ (function () {
3486
3485
  function FoehnDisplayAddressComponent() {