@provoly/hypervisor 0.0.14 → 0.0.16

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 (41) hide show
  1. package/assets/svgs/event_filter.svg +5 -0
  2. package/assets/svgs/reset_filter_event.svg +13 -0
  3. package/esm2022/src/lib/event/detail/event-detail.component.mjs +25 -5
  4. package/esm2022/src/lib/event/filters/choice/choice-filter.component.mjs +141 -0
  5. package/esm2022/src/lib/event/filters/date/date-filter.component.mjs +38 -0
  6. package/esm2022/src/lib/event/filters/event-filters.component.mjs +31 -0
  7. package/esm2022/src/lib/event/filters/hvy-unit-filter.class.mjs +13 -0
  8. package/esm2022/src/lib/event/list/event-list.component.mjs +20 -4
  9. package/esm2022/src/lib/event/public-api.mjs +4 -1
  10. package/esm2022/src/lib/event-summary/list/event-summary-list.component.mjs +3 -3
  11. package/esm2022/src/lib/event-summary/page/event-summary-page.component.mjs +11 -7
  12. package/esm2022/src/lib/general/i18n/en.translations.mjs +16 -3
  13. package/esm2022/src/lib/general/i18n/fr.translations.mjs +19 -12
  14. package/esm2022/src/lib/hypervisor.module.mjs +22 -7
  15. package/esm2022/src/lib/model/event/hyp-event-category.type.mjs +6 -4
  16. package/esm2022/src/lib/store/event/event.effects.mjs +2 -2
  17. package/esm2022/src/lib/store/event/event.reducer.mjs +6 -4
  18. package/esm2022/src/lib/store/event/event.service.mjs +2 -2
  19. package/fesm2022/provoly-hypervisor.mjs +326 -48
  20. package/fesm2022/provoly-hypervisor.mjs.map +1 -1
  21. package/package.json +1 -1
  22. package/src/lib/event/detail/event-detail.component.d.ts +2 -0
  23. package/src/lib/event/filters/choice/choice-filter.component.d.ts +54 -0
  24. package/src/lib/event/filters/date/date-filter.component.d.ts +14 -0
  25. package/src/lib/event/filters/event-filters.component.d.ts +14 -0
  26. package/src/lib/event/filters/hvy-unit-filter.class.d.ts +9 -0
  27. package/src/lib/event/list/event-list.component.d.ts +4 -0
  28. package/src/lib/event/public-api.d.ts +3 -0
  29. package/src/lib/event-summary/page/event-summary-page.component.d.ts +11 -3
  30. package/src/lib/general/i18n/en.translations.d.ts +15 -2
  31. package/src/lib/general/i18n/fr.translations.d.ts +7 -0
  32. package/src/lib/hypervisor.module.d.ts +12 -9
  33. package/src/lib/model/event/hyp-event-category.type.d.ts +3 -1
  34. package/src/lib/store/event/event.reducer.d.ts +2 -3
  35. package/src/lib/store/event/event.selectors.d.ts +1 -5
  36. package/styles/components/_index.scss +1 -0
  37. package/styles/components/_m-hvy-event-summary-item.scss +2 -0
  38. package/styles/components/_o-hvy-event-detail.scss +5 -4
  39. package/styles/components/_o-hvy-event-filters.scss +77 -0
  40. package/styles/components/_o-hvy-event-summary-list.scss +32 -18
  41. package/styles/components/_o-hvy-events-table.scss +17 -3
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Pipe, Component, Input, EventEmitter, Output, InjectionToken, NgModule, Inject } from '@angular/core';
2
+ import { Injectable, Pipe, Component, Input, EventEmitter, Output, ContentChildren, forwardRef, signal, computed, TemplateRef, ViewChild, InjectionToken, NgModule, Inject } from '@angular/core';
3
3
  import * as i3 from '@provoly/dashboard';
4
4
  import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
5
5
  import * as i1$1 from '@ngrx/store';
6
6
  import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
7
- import { mergeMap, of, fromEvent, map, withLatestFrom, filter, auditTime } from 'rxjs';
7
+ import { mergeMap, of, combineLatest, map, fromEvent, withLatestFrom, filter, auditTime } from 'rxjs';
8
8
  import * as i1 from '@angular/common/http';
9
9
  import { HttpParams } from '@angular/common/http';
10
10
  import * as i3$1 from '@provoly/dashboard/components/checkbox';
@@ -17,6 +17,9 @@ import * as i2 from '@angular/router';
17
17
  import { RouterLink } from '@angular/router';
18
18
  import * as i10 from '@provoly/dashboard/components/sinceDate';
19
19
  import { PrySinceDateModule } from '@provoly/dashboard/components/sinceDate';
20
+ import * as i2$1 from '@angular/cdk/overlay';
21
+ import { OverlayConfig } from '@angular/cdk/overlay';
22
+ import { TemplatePortal } from '@angular/cdk/portal';
20
23
  import { map as map$1, debounceTime, mergeMap as mergeMap$1, catchError } from 'rxjs/operators';
21
24
  import * as i1$3 from '@ngrx/effects';
22
25
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
@@ -33,9 +36,11 @@ const HypEventCategory = {
33
36
  values: ['ALERT_MALFUNCTION', 'REPORT', 'OPERATOR_EVENT', 'ALERT_LIMIT', 'MANIFESTATION'],
34
37
  };
35
38
  const CATEGORIES_BY_TYPE = {
36
- 'OPERATOR': ['OPERATOR_EVENT', 'MANIFESTATION'],
37
- 'ALERT': ['ALERT_MALFUNCTION', 'ALERT_LIMIT'],
38
- 'REPORT': ['REPORT'],
39
+ values: {
40
+ 'OPERATOR': ['OPERATOR_EVENT', 'MANIFESTATION'],
41
+ 'ALERT': ['ALERT_MALFUNCTION', 'ALERT_LIMIT'],
42
+ 'REPORT': ['REPORT'],
43
+ },
39
44
  };
40
45
 
41
46
  const EventActions = {
@@ -214,7 +219,8 @@ class EventDetailComponent extends SubscriptionnerDirective {
214
219
  set events(events) {
215
220
  this._events = events.filter(ev => !!ev);
216
221
  this.eventModifications = new Array(this._events.length);
217
- this.opened = events.length === 1 ? [true] : [];
222
+ this.opened = this._events.length === 1 ? [true] : [];
223
+ this.canCloseSome = this._events.filter(ev => ev.status !== 'DONE').length > 0;
218
224
  }
219
225
  ;
220
226
  set procedure(procedure) {
@@ -240,6 +246,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
240
246
  this.DOMAINS = DOMAINS.values;
241
247
  this.eventErrors = new EventEmitter();
242
248
  this.errors = [];
249
+ this.canCloseSome = false;
243
250
  }
244
251
  get events() {
245
252
  return this._events.map((evt, idx) => ({ ...evt, ...(this.eventModifications[idx] ?? {}) }));
@@ -269,6 +276,21 @@ class EventDetailComponent extends SubscriptionnerDirective {
269
276
  }
270
277
  }
271
278
  access(event) {
279
+ if (event.status === 'DONE') {
280
+ return {
281
+ name: true,
282
+ category: true,
283
+ criticality: true,
284
+ description: true,
285
+ address: true,
286
+ source: true,
287
+ domain: true,
288
+ eqName: true,
289
+ eqEntity: true,
290
+ startDate: true,
291
+ endDate: true,
292
+ };
293
+ }
272
294
  switch (event.type) {
273
295
  case 'ALERT':
274
296
  default:
@@ -279,6 +301,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
279
301
  description: true,
280
302
  address: true,
281
303
  source: true,
304
+ domain: true,
282
305
  eqName: true,
283
306
  eqEntity: true,
284
307
  startDate: true,
@@ -292,6 +315,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
292
315
  description: true,
293
316
  address: false,
294
317
  source: true,
318
+ domain: false,
295
319
  eqName: false,
296
320
  eqEntity: true,
297
321
  startDate: true,
@@ -305,6 +329,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
305
329
  description: false,
306
330
  address: false,
307
331
  source: false,
332
+ domain: false,
308
333
  eqName: false,
309
334
  eqEntity: false,
310
335
  startDate: false,
@@ -365,7 +390,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
365
390
  return this.errors[idx]?.find(err => err.field === prop) ?? false;
366
391
  }
367
392
  categories(event) {
368
- return CATEGORIES_BY_TYPE[event.type];
393
+ return CATEGORIES_BY_TYPE.values[event.type];
369
394
  }
370
395
  changeStatus($event, event) {
371
396
  this.store.dispatch(EventActions.status({ targetStatus: $event, event: event }));
@@ -379,11 +404,11 @@ class EventDetailComponent extends SubscriptionnerDirective {
379
404
  }
380
405
  }
381
406
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
382
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure", cancelModifications: "cancelModifications" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\" (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\" (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
407
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure", cancelModifications: "cancelModifications" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}\n </button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"event.status !== 'DONE'\"\n (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n @if (!opened[idx]) {\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n } @else {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\" disabled>{{ '@hvy.action.comment' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
383
408
  }
384
409
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
385
410
  type: Component,
386
- args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\" (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\" (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
411
+ args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}\n </button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"event.status !== 'DONE'\"\n (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n @if (!opened[idx]) {\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n } @else {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\" disabled>{{ '@hvy.action.comment' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
387
412
  }], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }], propDecorators: { modifiedEvents: [{
388
413
  type: Output
389
414
  }], modifiedProcedure: [{
@@ -421,9 +446,6 @@ const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load,
421
446
  ...state,
422
447
  loading: false,
423
448
  events: [],
424
- })), on(EventActions.filter, (state, { filters }) => ({
425
- ...state,
426
- filters,
427
449
  })), on(EventActions.select, (state, { ids, cumulative }) => ({
428
450
  ...state,
429
451
  selectedIds: !cumulative ? ids : [...state.selectedIds, ...ids].reduce((p, c) => p.indexOf(c) === -1 ? [...p, c] : p.filter(p1 => p1 !== c), []),
@@ -438,6 +460,11 @@ const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load,
438
460
  events: [],
439
461
  noMoreEvents: false,
440
462
  sort: { field, order },
463
+ })), on(EventActions.filter, (state, { filters }) => ({
464
+ ...state,
465
+ events: [],
466
+ noMoreEvents: false,
467
+ filters: filters,
441
468
  })));
442
469
  function eventReducer(state, action) {
443
470
  return internalReducer$1(state, action);
@@ -495,9 +522,11 @@ class EventListComponent extends SubscriptionnerDirective {
495
522
  this.el = el;
496
523
  this.EVENT_LINK = EVENT_LINK;
497
524
  this._store = this.store;
525
+ this._inhibate = false;
498
526
  this.store.dispatch(EventActions.load({}));
499
527
  this.events$ = this.store.select(EventSelectors.events);
500
528
  this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
529
+ this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map(([events, selectedIds]) => events.filter(ev => !selectedIds.includes(ev.id)).length === 0));
501
530
  }
502
531
  ngAfterViewInit() {
503
532
  this.subscriptions.add(fromEvent(this.el.nativeElement, 'scroll')
@@ -511,18 +540,232 @@ class EventListComponent extends SubscriptionnerDirective {
511
540
  }));
512
541
  }
513
542
  select(event, $event) {
543
+ this.inhibate();
514
544
  this.store.dispatch(EventActions.select({ ids: [event.id], cumulative: true }));
515
545
  $event.preventDefault();
516
546
  $event.stopPropagation();
517
547
  }
548
+ selectAll($event) {
549
+ if (!this._inhibate) {
550
+ this.inhibate();
551
+ const tmpSub = this.events$.subscribe(events => {
552
+ this.store.dispatch(EventActions.select({ ids: $event ? events.map(ev => ev.id) : [], cumulative: false }));
553
+ setTimeout(() => tmpSub.unsubscribe(), 10);
554
+ });
555
+ }
556
+ }
557
+ inhibate() {
558
+ this._inhibate = true;
559
+ setTimeout(() => this._inhibate = false, 100);
560
+ }
518
561
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, deps: [{ token: i1$1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
519
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventListComponent, selector: "hvy-event-list", usesInheritance: true, ngImport: i0, template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th></th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"name\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"progress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async;track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"select(event, $event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__cell__name__main\">{{ event.name }}</div>\n <div\n class=\"o-hvy-events-table__line__cell__name__sub\">{{ event.equipment?.name ? event.equipment?.name : '' }}\n </div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.category.' + event.category | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-status-display [event]=\"event\"></hvy-status-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n {{ event.procedureProgress }} %\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"EVENT_LINK.fn(event, _store)\">\n > {{ '@hvy.action.consult' | i18n }} @if (event.linkedEvents > 1) {\n ({{ event.linkedEvents }})\n }\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.event.log.empty' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ColumnOrderComponent, selector: "hvy-column-order", inputs: ["field"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i10.PrySinceDatePipe, name: "sinceDate" }] }); }
562
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventListComponent, selector: "hvy-event-list", usesInheritance: true, ngImport: i0, template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <pry-checkbox [ngModel]=\"allSelected$|async\" (ngModelChange)=\"selectAll($event)\"></pry-checkbox>\n </th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"name\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"progress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async;track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"select(event, $event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__cell__name__main\">{{ event.name }}</div>\n <div\n class=\"o-hvy-events-table__line__cell__name__sub\">{{ event.equipment?.name ? event.equipment?.name : '' }}\n </div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.category.' + event.category | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-status-display [event]=\"event\"></hvy-status-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n {{ event.procedureProgress }} %\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"EVENT_LINK.fn(event, _store)\">\n > {{ '@hvy.action.consult' | i18n }} @if (event.linkedEvents > 1) {\n ({{ event.linkedEvents }})\n }\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.event.log.empty' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ColumnOrderComponent, selector: "hvy-column-order", inputs: ["field"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i10.PrySinceDatePipe, name: "sinceDate" }] }); }
520
563
  }
521
564
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
522
565
  type: Component,
523
- args: [{ selector: 'hvy-event-list', template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th></th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"name\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"progress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async;track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"select(event, $event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__cell__name__main\">{{ event.name }}</div>\n <div\n class=\"o-hvy-events-table__line__cell__name__sub\">{{ event.equipment?.name ? event.equipment?.name : '' }}\n </div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.category.' + event.category | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-status-display [event]=\"event\"></hvy-status-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n {{ event.procedureProgress }} %\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"EVENT_LINK.fn(event, _store)\">\n > {{ '@hvy.action.consult' | i18n }} @if (event.linkedEvents > 1) {\n ({{ event.linkedEvents }})\n }\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.event.log.empty' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n</table>\n" }]
566
+ args: [{ selector: 'hvy-event-list', template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <pry-checkbox [ngModel]=\"allSelected$|async\" (ngModelChange)=\"selectAll($event)\"></pry-checkbox>\n </th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"name\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"progress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async;track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"select(event, $event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__cell__name__main\">{{ event.name }}</div>\n <div\n class=\"o-hvy-events-table__line__cell__name__sub\">{{ event.equipment?.name ? event.equipment?.name : '' }}\n </div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.category.' + event.category | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-status-display [event]=\"event\"></hvy-status-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n {{ event.procedureProgress }} %\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"EVENT_LINK.fn(event, _store)\">\n > {{ '@hvy.action.consult' | i18n }} @if (event.linkedEvents > 1) {\n ({{ event.linkedEvents }})\n }\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.event.log.empty' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n</table>\n" }]
524
567
  }], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ElementRef }] });
525
568
 
569
+ class EventFiltersComponent extends SubscriptionnerDirective {
570
+ constructor(store) {
571
+ super();
572
+ this.store = store;
573
+ }
574
+ filter() {
575
+ const filters = this.filters.map(filter => filter.getParams())
576
+ .reduce((p, c) => ({ ...p, ...c }), {});
577
+ this.store.dispatch(EventActions.filter({ filters }));
578
+ }
579
+ reset() {
580
+ this.filters.forEach(filter => filter.reset());
581
+ this.store.dispatch(EventActions.filter({ filters: {} }));
582
+ }
583
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventFiltersComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
584
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventFiltersComponent, selector: "hvy-event-filters", queries: [{ propertyName: "filters", predicate: ["filter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n <div class=\"o-hvy-event-filters__buttons\">\n <button (click)=\"reset()\" class=\"a-btn a-btn--secondary\">\n <pry-icon iconSvg=\"reset_filter_event\"></pry-icon>\n </button>\n <button (click)=\"filter()\" class=\"a-btn a-btn--primary\">\n {{ '@hvy.event.filter.name' | i18n }}\n <pry-icon iconSvg=\"event_filter\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
585
+ }
586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventFiltersComponent, decorators: [{
587
+ type: Component,
588
+ args: [{ selector: 'hvy-event-filters', template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n <div class=\"o-hvy-event-filters__buttons\">\n <button (click)=\"reset()\" class=\"a-btn a-btn--secondary\">\n <pry-icon iconSvg=\"reset_filter_event\"></pry-icon>\n </button>\n <button (click)=\"filter()\" class=\"a-btn a-btn--primary\">\n {{ '@hvy.event.filter.name' | i18n }}\n <pry-icon iconSvg=\"event_filter\"></pry-icon>\n </button>\n </div>\n</div>\n" }]
589
+ }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { filters: [{
590
+ type: ContentChildren,
591
+ args: ['filter', { descendants: true }]
592
+ }] } });
593
+
594
+ class HvyUnitFilterComponent extends SubscriptionnerDirective {
595
+ constructor() {
596
+ super();
597
+ }
598
+ getParams() {
599
+ throw new Error('Must use sub implementation');
600
+ }
601
+ reset() {
602
+ throw new Error('Must use sub implementation');
603
+ }
604
+ }
605
+
606
+ class DateFilterComponent extends HvyUnitFilterComponent {
607
+ constructor(store) {
608
+ super();
609
+ this.store = store;
610
+ this.prop = 'no-prop-defined';
611
+ this.value = '';
612
+ this.subscriptions.add(this.store.select(EventSelectors.filters).subscribe(filters => {
613
+ this.value = filters[this.prop] ? (filters[this.prop][0] ?? '') : '';
614
+ }));
615
+ }
616
+ getParams() {
617
+ if (this.value === '') {
618
+ return {};
619
+ }
620
+ return { [this.prop]: [this.value] };
621
+ }
622
+ reset() {
623
+ this.value = '';
624
+ }
625
+ triggerChange($event) {
626
+ // @ts-ignore
627
+ this.value = $event instanceof Event ? $event.target?.value : $event;
628
+ }
629
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DateFilterComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
630
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: DateFilterComponent, selector: "hvy-date-filter", inputs: { prop: "prop" }, providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => DateFilterComponent) }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-date-filters\">\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"value\"\n (change)=\"triggerChange($event)\">\n</div>\n" }); }
631
+ }
632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DateFilterComponent, decorators: [{
633
+ type: Component,
634
+ args: [{ selector: 'hvy-date-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => DateFilterComponent) }], template: "<div class=\"o-hvy-date-filters\">\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"value\"\n (change)=\"triggerChange($event)\">\n</div>\n" }]
635
+ }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { prop: [{
636
+ type: Input
637
+ }] } });
638
+
639
+ class ChoiceFilterComponent extends HvyUnitFilterComponent {
640
+ static { this.idCounter = 0; }
641
+ constructor(store, overlay, viewContainerRef, i18nService, ref) {
642
+ super();
643
+ this.store = store;
644
+ this.overlay = overlay;
645
+ this.viewContainerRef = viewContainerRef;
646
+ this.i18nService = i18nService;
647
+ this.ref = ref;
648
+ this.id = -1;
649
+ this.prop = 'no-prop-defined';
650
+ this.label = 'no-label-defined';
651
+ this.i18nPrefix = 'no-prefix-defined.';
652
+ this.value = signal([]);
653
+ this.choices = [];
654
+ this.inhibate = false;
655
+ this.displayValue = computed(() => {
656
+ if (this.allSelected()) {
657
+ return this.i18nService.instant('@hvy.event.filter.choice.all');
658
+ }
659
+ if (this.value().length > 1) {
660
+ return `(${this.value().length})`;
661
+ }
662
+ if (this.value().length === 1) {
663
+ return this.i18nService.instant(this.i18nPrefix + this.value()[0]);
664
+ }
665
+ return '';
666
+ });
667
+ this.id = ChoiceFilterComponent.idCounter++;
668
+ }
669
+ ngAfterViewInit() {
670
+ this.subscriptions.add(this.store.select(EventSelectors.filters).subscribe(filters => {
671
+ this.assignValue(filters.hasOwnProperty(this.prop) ?
672
+ filters[this.prop].length === 1 && filters[this.prop][0] === '' ? [] : filters[this.prop] : this.allValues());
673
+ }));
674
+ }
675
+ getParams() {
676
+ if (this.value().length === this.allValues().length) {
677
+ return {};
678
+ }
679
+ return { [this.prop]: this.value().length === 0 ? [''] : this.value() };
680
+ }
681
+ reset() {
682
+ this.assignValue([]);
683
+ }
684
+ toggleModal() {
685
+ if (!this.overlayRef) {
686
+ this.triggerInhibate();
687
+ this.overlayRef = this.overlay.create(new OverlayConfig({
688
+ hasBackdrop: true,
689
+ backdropClass: 'backdrop',
690
+ panelClass: ['m-context-menu-wrapper', 'o-choice-filter-popup'],
691
+ }));
692
+ this.overlayRef.backdropClick().subscribe(() => this.toggleModal());
693
+ this.overlayRef.attach(new TemplatePortal(this.template, this.viewContainerRef));
694
+ const contextMenu = document.querySelector('.o-choice-filter-popup');
695
+ if (!!contextMenu) {
696
+ const rect = this.ref.nativeElement.getBoundingClientRect();
697
+ contextMenu.style.left = rect.x + 'px';
698
+ contextMenu.style.top = rect.bottom + 'px';
699
+ }
700
+ }
701
+ else {
702
+ this.overlayRef.dispose();
703
+ this.overlayRef = undefined;
704
+ }
705
+ }
706
+ clickAll() {
707
+ if (this.allSelected()) {
708
+ this.assignValue([]);
709
+ }
710
+ else {
711
+ this.assignValue(this.allValues());
712
+ }
713
+ }
714
+ toggle(elt) {
715
+ const isSelected = this.isSelected(elt);
716
+ const eltSubKeys = !elt.children ? [elt.key] : elt.children.map(ch => ch.key);
717
+ if (!isSelected) {
718
+ this.assignValue([...new Set([...this.value(), ...eltSubKeys])]);
719
+ }
720
+ else {
721
+ this.assignValue(this.value().filter(v => !eltSubKeys.includes(v)));
722
+ }
723
+ }
724
+ allSelected() {
725
+ return this.choices.map(choice => this.isSelected(choice)).reduce((p, c) => p && c, true);
726
+ }
727
+ isSelected(choice) {
728
+ if (!choice.children) {
729
+ return this.value().includes(choice.key);
730
+ }
731
+ else {
732
+ return choice.children.map(child => this.isSelected(child)).reduce((p, c) => p && c, true);
733
+ }
734
+ }
735
+ allValues() {
736
+ return this.choices
737
+ .map(choice => !choice.children ? [choice.key] : choice.children.map(child => child.key))
738
+ .reduce((p, c) => [...p, ...c], []);
739
+ }
740
+ assignValue(value) {
741
+ if (!this.inhibate) {
742
+ this.triggerInhibate();
743
+ this.value.set(value);
744
+ }
745
+ }
746
+ triggerInhibate() {
747
+ this.inhibate = true;
748
+ setTimeout(() => this.inhibate = false, 50);
749
+ }
750
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, deps: [{ token: i1$1.Store }, { token: i2$1.Overlay }, { token: i0.ViewContainerRef }, { token: i3.PryI18nService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
751
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ChoiceFilterComponent, selector: "hvy-choice-filter", inputs: { prop: "prop", label: "label", i18nPrefix: "i18nPrefix", choices: "choices" }, providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<button (click)=\"toggleModal()\" #button class=\"o-hvy-choice-filter -horizontal\"\n [class.-highlight]=\"displayValue() !== ('@hvy.event.filter.choice.all' | i18n)\" [class.-focus]=\"overlayRef\">\n <span class=\"o-hvy-choice-filter__label\">{{ label | i18n }}:</span>\n <span class=\"o-hvy-choice-filter__value\" type=\"text\" id=\"select_{{id}}\">{{ displayValue() }}</span>\n <pry-icon [iconSvg]=\"!!overlayRef ? 'chevron_top' : 'chevron_bottom'\" [width]=\"10\" [height]=\"10\"></pry-icon>\n</button>\n\n<ng-template #template>\n <div\n class=\"m-context-menu o-hvy-choice-filter\"\n aria-labelledby=\"manage-account\"\n tabindex=\"-1\"\n id=\"account-menu\"\n role=\"menu\"\n aria-modal=\"true\"\n >\n <div class=\"o-hvy-choice-filter__all\">\n <pry-checkbox [ngModel]=\"allSelected()\" (ngModelChange)=\"clickAll()\">\n <span>{{ '@hvy.event.filter.choice.all' | i18n }}</span>\n </pry-checkbox>\n </div>\n @for (elt of choices;track elt.key) {\n @if (!elt.children) {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n } @else {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n @for (child of elt.children;track child.key) {\n <pry-checkbox [ngModel]=\"isSelected(child)\" (ngModelChange)=\"toggle(child)\"\n class=\"o-hvy-choice-filter__child\">\n <span>{{ i18nPrefix + child.key | i18n }}</span>\n </pry-checkbox>\n }\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
752
+ }
753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, decorators: [{
754
+ type: Component,
755
+ args: [{ selector: 'hvy-choice-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], template: "<button (click)=\"toggleModal()\" #button class=\"o-hvy-choice-filter -horizontal\"\n [class.-highlight]=\"displayValue() !== ('@hvy.event.filter.choice.all' | i18n)\" [class.-focus]=\"overlayRef\">\n <span class=\"o-hvy-choice-filter__label\">{{ label | i18n }}:</span>\n <span class=\"o-hvy-choice-filter__value\" type=\"text\" id=\"select_{{id}}\">{{ displayValue() }}</span>\n <pry-icon [iconSvg]=\"!!overlayRef ? 'chevron_top' : 'chevron_bottom'\" [width]=\"10\" [height]=\"10\"></pry-icon>\n</button>\n\n<ng-template #template>\n <div\n class=\"m-context-menu o-hvy-choice-filter\"\n aria-labelledby=\"manage-account\"\n tabindex=\"-1\"\n id=\"account-menu\"\n role=\"menu\"\n aria-modal=\"true\"\n >\n <div class=\"o-hvy-choice-filter__all\">\n <pry-checkbox [ngModel]=\"allSelected()\" (ngModelChange)=\"clickAll()\">\n <span>{{ '@hvy.event.filter.choice.all' | i18n }}</span>\n </pry-checkbox>\n </div>\n @for (elt of choices;track elt.key) {\n @if (!elt.children) {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n } @else {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n @for (child of elt.children;track child.key) {\n <pry-checkbox [ngModel]=\"isSelected(child)\" (ngModelChange)=\"toggle(child)\"\n class=\"o-hvy-choice-filter__child\">\n <span>{{ i18nPrefix + child.key | i18n }}</span>\n </pry-checkbox>\n }\n }\n }\n </div>\n</ng-template>\n" }]
756
+ }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Overlay }, { type: i0.ViewContainerRef }, { type: i3.PryI18nService }, { type: i0.ElementRef }], propDecorators: { prop: [{
757
+ type: Input
758
+ }], label: [{
759
+ type: Input
760
+ }], i18nPrefix: [{
761
+ type: Input
762
+ }], choices: [{
763
+ type: Input
764
+ }], template: [{
765
+ type: ViewChild,
766
+ args: ['template', { read: TemplateRef }]
767
+ }] } });
768
+
526
769
  const EventSummaryActions = {
527
770
  load: createAction('[Event] Load Summaries'),
528
771
  loadSuccess: createAction('[Event Api] Load Summaries Success', props()),
@@ -564,6 +807,10 @@ const EventSummarySelectors = {
564
807
  loading
565
808
  };
566
809
 
810
+ const HypEventStatus = {
811
+ values: ['NEW', 'IN_PROGRESS', 'DONE'],
812
+ };
813
+
567
814
  class EventSummaryItemComponent {
568
815
  constructor(store) {
569
816
  this.store = store;
@@ -602,11 +849,11 @@ class EventSummaryListComponent {
602
849
  this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
603
850
  }
604
851
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1$1.Store }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
605
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: { events: "events", totalEventCount: "totalEventCount", status: "status", consultLink: "consultLink", itemLinkBase: "itemLinkBase" }, ngImport: i0, template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n Consulter\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: ["event", "linkBase"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
852
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: { events: "events", totalEventCount: "totalEventCount", status: "status", consultLink: "consultLink", itemLinkBase: "itemLinkBase" }, ngImport: i0, template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n {{ '@hvy.action.consult' | i18n }}\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: ["event", "linkBase"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
606
853
  }
607
854
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, decorators: [{
608
855
  type: Component,
609
- args: [{ selector: 'hvy-event-summary-list', template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n Consulter\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n" }]
856
+ args: [{ selector: 'hvy-event-summary-list', template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n {{ '@hvy.action.consult' | i18n }}\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n" }]
610
857
  }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2.Router }], propDecorators: { events: [{
611
858
  type: Input
612
859
  }], totalEventCount: [{
@@ -624,12 +871,16 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
624
871
  super();
625
872
  this.store = store;
626
873
  this.pageTitle = '';
874
+ this.consultLink = [];
627
875
  this.summaries = {
628
876
  NEW: { events: [], count: 0 },
629
877
  IN_PROGRESS: { events: [], count: 0 },
630
878
  DONE: { events: [], count: 0 },
631
879
  };
632
- this.criticalityList = ["LOW", "MEDIUM", "HIGH", "ALL"];
880
+ this.criticalityList = [...HypEventStatus.values, 'ALL'];
881
+ this.criticalityOrder = (a, b) => {
882
+ return this.criticalityList.indexOf(a.key) - this.criticalityList.indexOf(b.key);
883
+ };
633
884
  this.store.dispatch(EventSummaryActions.load());
634
885
  this.selectedCriticality$ = this.store.select(EventSelectors.filters).pipe(map$1((filters) => filters['criticality']?.[0] ?? 'ALL'));
635
886
  this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
@@ -641,17 +892,16 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
641
892
  this.store.dispatch(EventActions.filter({ filters: { criticality: [$event] } }));
642
893
  this.store.dispatch(EventSummaryActions.load());
643
894
  }
644
- asIsOrder() {
645
- return 0;
646
- }
647
895
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
648
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryPageComponent, selector: "hvy-event-summary-page", inputs: { pageTitle: "pageTitle" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality.name' | i18n }} :&nbsp;</label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: asIsOrder; track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: ["events", "totalEventCount", "status", "consultLink", "itemLinkBase"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$2.KeyValuePipe, name: "keyvalue" }] }); }
896
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryPageComponent, selector: "hvy-event-summary-page", inputs: { pageTitle: "pageTitle", consultLink: "consultLink" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality.name' | i18n }}\n :&nbsp;</label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: criticalityOrder;track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\"\n [consultLink]=\"consultLink\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: ["events", "totalEventCount", "status", "consultLink", "itemLinkBase"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$2.KeyValuePipe, name: "keyvalue" }] }); }
649
897
  }
650
898
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
651
899
  type: Component,
652
- args: [{ selector: 'hvy-event-summary-page', template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality.name' | i18n }} :&nbsp;</label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: asIsOrder; track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n" }]
900
+ args: [{ selector: 'hvy-event-summary-page', template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality.name' | i18n }}\n :&nbsp;</label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: criticalityOrder;track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\"\n [consultLink]=\"consultLink\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n" }]
653
901
  }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { pageTitle: [{
654
902
  type: Input
903
+ }], consultLink: [{
904
+ type: Input
655
905
  }] } });
656
906
 
657
907
  const HYP_BASE_CONFIG = new InjectionToken('base config');
@@ -659,7 +909,6 @@ const HYP_BASE_CONFIG = new InjectionToken('base config');
659
909
  const enTranslations = {
660
910
  '@hvy': {
661
911
  event: {
662
- criticality: 'Criticality',
663
912
  name: 'Event',
664
913
  type: {
665
914
  name: 'Event type',
@@ -708,12 +957,25 @@ const enTranslations = {
708
957
  },
709
958
  },
710
959
  category: {
711
- ALERT: 'Dysfunction alert',
960
+ name: "Event category",
961
+ ALERT_MALFUNCTION: 'Dysfunction alert',
712
962
  REPORT: 'GRC report',
713
963
  OPERATOR_EVENT: 'Operator event',
714
964
  ALERT_LIMIT: 'Limit alert',
715
965
  MANIFESTATION: 'Manifestation',
716
966
  },
967
+ criticality: {
968
+ name: 'Criticality',
969
+ LOW: 'Low',
970
+ MEDIUM: 'Middle',
971
+ HIGH: 'High',
972
+ },
973
+ filter: {
974
+ name: 'Filter',
975
+ choice: {
976
+ all: "All"
977
+ }
978
+ }
717
979
  },
718
980
  eventSummary: {
719
981
  noContent: 'No event with given criticality',
@@ -737,6 +999,7 @@ const enTranslations = {
737
999
  consult: 'Consult',
738
1000
  close: 'Close',
739
1001
  send: 'Send',
1002
+ comment: 'Comment'
740
1003
  },
741
1004
  },
742
1005
  };
@@ -744,15 +1007,15 @@ const enTranslations = {
744
1007
  const frTranslations = {
745
1008
  '@hvy': {
746
1009
  event: {
747
- name: 'Évènement',
1010
+ name: 'Événements',
748
1011
  type: {
749
- name: 'Type d\'évènement',
1012
+ name: 'Type d\'événement',
750
1013
  ALERT: 'Alerte',
751
1014
  REPORT: 'Signalement',
752
1015
  OPERATOR: 'Opérateur',
753
1016
  },
754
1017
  status: {
755
- name: 'Statut évènement',
1018
+ name: 'Statut événement',
756
1019
  NEW: 'Nouveau',
757
1020
  IN_PROGRESS: 'En cours',
758
1021
  DONE: 'Clôturé',
@@ -769,19 +1032,19 @@ const frTranslations = {
769
1032
  creationDate: 'Date de création',
770
1033
  lastModificationDate: 'Date dernières modifications',
771
1034
  closeDate: 'Date de clotûre',
772
- detail: "Description des évènements",
1035
+ detail: "Description des événements",
773
1036
  log: {
774
- name: 'Journal des évènements',
775
- empty: 'Aucun évènement n\'a été créé',
1037
+ name: 'Journal des événements',
1038
+ empty: 'Aucun événement n\'a été créé',
776
1039
  event: {
777
1040
  description: 'Description',
778
1041
  address: 'Adresse',
779
1042
  detail: 'Informations',
780
1043
  name: 'Nom',
781
1044
  category: 'Catégorie',
782
- close: 'Clôturer tous ces évènements',
1045
+ close: 'Clôturer tous ces événements',
783
1046
  comments: {
784
- name: 'Commentaires de l\'évènement',
1047
+ name: 'Commentaires de l\'événement',
785
1048
  placeholder: 'Écrivez votre commentaire'
786
1049
  }
787
1050
  },
@@ -794,7 +1057,7 @@ const frTranslations = {
794
1057
  },
795
1058
  },
796
1059
  category: {
797
- name: "Catégorie d'évènement",
1060
+ name: "Catégorie d'événement",
798
1061
  ALERT_MALFUNCTION: 'Alerte Dysfonctionnement',
799
1062
  REPORT: 'Signalement GRC',
800
1063
  OPERATOR_EVENT: 'Evènement Opérateur',
@@ -807,9 +1070,15 @@ const frTranslations = {
807
1070
  MEDIUM: 'Moyen',
808
1071
  HIGH: 'Haut',
809
1072
  },
1073
+ filter: {
1074
+ name: 'Filtrer',
1075
+ choice: {
1076
+ all: "Tous"
1077
+ }
1078
+ }
810
1079
  },
811
1080
  eventSummary: {
812
- noContent: 'Aucun évènement avec la criticité donnée',
1081
+ noContent: 'Aucun événement avec la criticité donnée',
813
1082
  statusLabels: {
814
1083
  NEW: 'Nouveaux',
815
1084
  IN_PROGRESS: 'En cours',
@@ -829,7 +1098,8 @@ const frTranslations = {
829
1098
  action: {
830
1099
  consult: 'Consulter',
831
1100
  close: 'Clotûrer',
832
- send: 'Envoyer'
1101
+ send: 'Envoyer',
1102
+ comment: 'Commenter'
833
1103
  },
834
1104
  },
835
1105
  };
@@ -839,10 +1109,6 @@ const eventForWriteAPI = (event) => ({
839
1109
  equipmentId: event.equipment?.id
840
1110
  });
841
1111
 
842
- const HypEventStatus = {
843
- values: ['NEW', 'IN_PROGRESS', 'DONE'],
844
- };
845
-
846
1112
  const HypEventType = { values: ['ALERT', 'REPORT', 'OPERATOR'] };
847
1113
 
848
1114
  const procedureForWriteAPI = (procedure) => ({
@@ -866,7 +1132,7 @@ class EventService {
866
1132
  let params = new HttpParams();
867
1133
  Object.keys(filters).forEach(filter => {
868
1134
  filters[filter].forEach((filterValue) => {
869
- params = params.set(filter, filterValue);
1135
+ params = params.append(filter, filterValue);
870
1136
  });
871
1137
  });
872
1138
  const pageSize = 20;
@@ -947,7 +1213,7 @@ class EventEffects {
947
1213
  return this.eventService.statusProcedure(action.procedure, action.targetStatus).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
948
1214
  }
949
1215
  })));
950
- this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort), debounceTime(200), map$1(() => EventActions.load({}))));
1216
+ this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort, EventActions.filter), debounceTime(200), map$1(() => EventActions.load({}))));
951
1217
  }
952
1218
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, deps: [{ token: i1$3.Actions }, { token: EventService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
953
1219
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
@@ -1035,7 +1301,10 @@ const components = [
1035
1301
  ForDatetimeLocalPipe,
1036
1302
  StatusDisplayComponent,
1037
1303
  ProgressDisplayComponent,
1038
- ColumnOrderComponent
1304
+ ColumnOrderComponent,
1305
+ EventFiltersComponent,
1306
+ DateFilterComponent,
1307
+ ChoiceFilterComponent
1039
1308
  ];
1040
1309
  class PvyHypervisorModule {
1041
1310
  static forRoot(options) {
@@ -1065,7 +1334,10 @@ class PvyHypervisorModule {
1065
1334
  ForDatetimeLocalPipe,
1066
1335
  StatusDisplayComponent,
1067
1336
  ProgressDisplayComponent,
1068
- ColumnOrderComponent], imports: [i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$3.EffectsFeatureModule, NgForOf,
1337
+ ColumnOrderComponent,
1338
+ EventFiltersComponent,
1339
+ DateFilterComponent,
1340
+ ChoiceFilterComponent], imports: [i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$3.EffectsFeatureModule, NgForOf,
1069
1341
  AsyncPipe,
1070
1342
  PryI18nModule,
1071
1343
  PryCoreModule,
@@ -1084,7 +1356,8 @@ class PvyHypervisorModule {
1084
1356
  JsonPipe,
1085
1357
  PryDatePickerModule,
1086
1358
  PryI18nModule,
1087
- PryIconModule], exports: [EventDetailComponent,
1359
+ PryIconModule,
1360
+ PryI18nModule], exports: [EventDetailComponent,
1088
1361
  EventListComponent,
1089
1362
  IconDisplayComponent,
1090
1363
  EventSummaryItemComponent,
@@ -1094,7 +1367,10 @@ class PvyHypervisorModule {
1094
1367
  ForDatetimeLocalPipe,
1095
1368
  StatusDisplayComponent,
1096
1369
  ProgressDisplayComponent,
1097
- ColumnOrderComponent] }); }
1370
+ ColumnOrderComponent,
1371
+ EventFiltersComponent,
1372
+ DateFilterComponent,
1373
+ ChoiceFilterComponent] }); }
1098
1374
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, imports: [StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
1099
1375
  StoreModule.forFeature(eventFeatureKey, eventReducer),
1100
1376
  StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
@@ -1110,7 +1386,8 @@ class PvyHypervisorModule {
1110
1386
  FormsModule,
1111
1387
  PryDatePickerModule,
1112
1388
  PryI18nModule,
1113
- PryIconModule] }); }
1389
+ PryIconModule,
1390
+ PryI18nModule] }); }
1114
1391
  }
1115
1392
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, decorators: [{
1116
1393
  type: NgModule,
@@ -1143,9 +1420,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
1143
1420
  PryDatePickerModule,
1144
1421
  PryI18nModule,
1145
1422
  PryIconModule,
1423
+ PryI18nModule,
1146
1424
  ],
1147
1425
  exports: [
1148
- ...components
1426
+ ...components,
1149
1427
  ],
1150
1428
  }]
1151
1429
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -1161,5 +1439,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
1161
1439
  * Generated bundle index. Do not edit.
1162
1440
  */
1163
1441
 
1164
- export { CATEGORIES_BY_TYPE, ColumnOrderComponent, DOMAINS, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, procedureForWriteAPI };
1442
+ export { CATEGORIES_BY_TYPE, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventFiltersComponent, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, procedureForWriteAPI };
1165
1443
  //# sourceMappingURL=provoly-hypervisor.mjs.map