@provoly/hypervisor 0.0.15 → 0.0.17

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 (34) 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 +49 -5
  4. package/esm2022/src/lib/event/filters/choice/choice-filter.component.mjs +118 -12
  5. package/esm2022/src/lib/event/filters/event-filters.component.mjs +6 -6
  6. package/esm2022/src/lib/event/list/event-list.component.mjs +20 -4
  7. package/esm2022/src/lib/event-summary/list/event-summary-list.component.mjs +3 -3
  8. package/esm2022/src/lib/event-summary/page/event-summary-page.component.mjs +11 -7
  9. package/esm2022/src/lib/general/i18n/en.translations.mjs +16 -3
  10. package/esm2022/src/lib/general/i18n/fr.translations.mjs +19 -12
  11. package/esm2022/src/lib/hypervisor.module.mjs +11 -3
  12. package/esm2022/src/lib/model/event/hyp-event-category.type.mjs +6 -4
  13. package/esm2022/src/lib/store/event/event.actions.mjs +1 -2
  14. package/esm2022/src/lib/store/event/event.effects.mjs +2 -2
  15. package/esm2022/src/lib/store/event/event.reducer.mjs +6 -4
  16. package/esm2022/src/lib/store/event/event.service.mjs +2 -2
  17. package/fesm2022/provoly-hypervisor.mjs +267 -69
  18. package/fesm2022/provoly-hypervisor.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/src/lib/event/detail/event-detail.component.d.ts +14 -0
  21. package/src/lib/event/filters/choice/choice-filter.component.d.ts +38 -4
  22. package/src/lib/event/list/event-list.component.d.ts +4 -0
  23. package/src/lib/event-summary/page/event-summary-page.component.d.ts +11 -3
  24. package/src/lib/general/i18n/en.translations.d.ts +15 -2
  25. package/src/lib/general/i18n/fr.translations.d.ts +7 -0
  26. package/src/lib/hypervisor.module.d.ts +1 -1
  27. package/src/lib/model/event/hyp-event-category.type.d.ts +3 -1
  28. package/src/lib/store/event/event.actions.d.ts +0 -6
  29. package/styles/components/_m-hvy-event-summary-item.scss +2 -0
  30. package/styles/components/_o-hvy-event-detail.scss +11 -4
  31. package/styles/components/_o-hvy-event-filters.scss +65 -0
  32. package/styles/components/_o-hvy-event-summary-list.scss +32 -19
  33. package/styles/components/_o-hvy-event-summary-page.scss +9 -5
  34. package/styles/components/_o-hvy-events-table.scss +17 -3
@@ -1,22 +1,25 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Pipe, Component, Input, EventEmitter, Output, ContentChildren, forwardRef, InjectionToken, NgModule, Inject } from '@angular/core';
3
- import * as i2 from '@provoly/dashboard';
2
+ import { Injectable, Pipe, Component, Input, EventEmitter, Output, ContentChildren, forwardRef, signal, computed, TemplateRef, ViewChild, InjectionToken, NgModule, Inject } from '@angular/core';
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
- import * as i3 from '@provoly/dashboard/components/checkbox';
10
+ import * as i3$1 from '@provoly/dashboard/components/checkbox';
11
11
  import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
12
12
  import * as i4 from '@angular/forms';
13
13
  import { FormsModule } from '@angular/forms';
14
14
  import * as i1$2 from '@angular/common';
15
15
  import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe, JsonPipe } from '@angular/common';
16
- import * as i2$1 from '@angular/router';
16
+ 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 = {
@@ -56,7 +61,6 @@ const EventActions = {
56
61
  statusSuccess: createAction('[Event] Close success'),
57
62
  statusFailure: createAction('[Event] Close failure', props()),
58
63
  sort: createAction('[Event] set log event sorting', props()),
59
- setFilters: createAction('[Event] set filters', props()),
60
64
  };
61
65
 
62
66
  const HypervisorActions = {
@@ -126,7 +130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
126
130
 
127
131
  class IconDisplayComponent {
128
132
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
129
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: { event: "event" }, ngImport: i0, template: "<div class=\"\n m-hvy-event-summary-item__event-icon-container\n -hvy-{{ event.criticality.toString().toLowerCase()}}\n -hvy-{{event.type.toString().toLowerCase()}}\n \">\n <span\n class=\"m-hvy-event-summary-item__event-icon a-icon\"\n [ngStyle]=\"{\n 'mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')',\n '-webkit-mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')'\n }\"\n aria-hidden=\"true\"\n focusable=\"false\"\n ></span>\n</div>\n", dependencies: [{ kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.GetSecuredImagePipe, name: "getSecuredImage" }, { kind: "pipe", type: EventIconPipe, name: "eventIcon" }] }); }
133
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: { event: "event" }, ngImport: i0, template: "<div class=\"\n m-hvy-event-summary-item__event-icon-container\n -hvy-{{ event.criticality.toString().toLowerCase()}}\n -hvy-{{event.type.toString().toLowerCase()}}\n \">\n <span\n class=\"m-hvy-event-summary-item__event-icon a-icon\"\n [ngStyle]=\"{\n 'mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')',\n '-webkit-mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')'\n }\"\n aria-hidden=\"true\"\n focusable=\"false\"\n ></span>\n</div>\n", dependencies: [{ kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.GetSecuredImagePipe, name: "getSecuredImage" }, { kind: "pipe", type: EventIconPipe, name: "eventIcon" }] }); }
130
134
  }
131
135
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, decorators: [{
132
136
  type: Component,
@@ -167,7 +171,7 @@ class StatusDisplayComponent {
167
171
  this.targetsDisplayed = this.targetStatuses.length > 0 && !this.targetsDisplayed;
168
172
  }
169
173
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: StatusDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
170
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: { event: "event", modifiable: "modifiable" }, outputs: { modified: "modified" }, ngImport: i0, template: "<span class=\"a-chip -md -{{event.status}} a-chip-status\" (click)=\"toggle()\" >\n {{ '@hvy.event.status.' + event.status | i18n }}\n @if (targetStatuses.length > 0) {\n <pry-icon iconSvg=\"chevron_bottom\" [width]=\"10\" [height]=\"10\"></pry-icon>\n }\n</span>\n@if (targetsDisplayed) {\n <div class=\"a-chip-status__target\">\n <div class=\"a-chip-status__target__filler\"></div>\n @for (status of targetStatuses;track status) {\n <div class=\"a-chip-status__target__item\" (click)=\"trigger(status)\">{{ '@hvy.event.status.' + status | i18n }}</div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i2.I18nPipe, name: "i18n" }] }); }
174
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: { event: "event", modifiable: "modifiable" }, outputs: { modified: "modified" }, ngImport: i0, template: "<span class=\"a-chip -md -{{event.status}} a-chip-status\" (click)=\"toggle()\" >\n {{ '@hvy.event.status.' + event.status | i18n }}\n @if (targetStatuses.length > 0) {\n <pry-icon iconSvg=\"chevron_bottom\" [width]=\"10\" [height]=\"10\"></pry-icon>\n }\n</span>\n@if (targetsDisplayed) {\n <div class=\"a-chip-status__target\">\n <div class=\"a-chip-status__target__filler\"></div>\n @for (status of targetStatuses;track status) {\n <div class=\"a-chip-status__target__item\" (click)=\"trigger(status)\">{{ '@hvy.event.status.' + status | i18n }}</div>\n }\n </div>\n}\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" }] }); }
171
175
  }
172
176
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: StatusDisplayComponent, decorators: [{
173
177
  type: Component,
@@ -212,6 +216,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
212
216
  }], ctorParameters: () => [{ type: i1$1.Store }] });
213
217
 
214
218
  class EventDetailComponent extends SubscriptionnerDirective {
219
+ static { this.CARD_HEIGHT = 75; }
215
220
  set events(events) {
216
221
  this._events = events.filter(ev => !!ev);
217
222
  this.eventModifications = new Array(this._events.length);
@@ -243,13 +248,19 @@ class EventDetailComponent extends SubscriptionnerDirective {
243
248
  this.eventErrors = new EventEmitter();
244
249
  this.errors = [];
245
250
  this.canCloseSome = false;
251
+ this.newComentContent = '';
252
+ this.moveStart = 0;
253
+ this.moveInitialIndex = 0;
254
+ this.initialActionList = [];
255
+ this.previousOffset = 0;
246
256
  }
247
257
  get events() {
248
258
  return this._events.map((evt, idx) => ({ ...evt, ...(this.eventModifications[idx] ?? {}) }));
249
259
  }
250
260
  get procedure() {
251
261
  return this._procedure ? ({
252
- ...this._procedure, ...(this.procedureModifications ?? {}),
262
+ ...this._procedure,
263
+ ...(this.procedureModifications ?? {}),
253
264
  events: this.events,
254
265
  }) : undefined;
255
266
  }
@@ -386,7 +397,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
386
397
  return this.errors[idx]?.find(err => err.field === prop) ?? false;
387
398
  }
388
399
  categories(event) {
389
- return CATEGORIES_BY_TYPE[event.type];
400
+ return CATEGORIES_BY_TYPE.values[event.type];
390
401
  }
391
402
  changeStatus($event, event) {
392
403
  this.store.dispatch(EventActions.status({ targetStatus: $event, event: event }));
@@ -399,12 +410,49 @@ class EventDetailComponent extends SubscriptionnerDirective {
399
410
  this.store.dispatch(EventActions.status({ targetStatus: 'DONE', procedure: this.procedure }));
400
411
  }
401
412
  }
413
+ onMouseDown($event) {
414
+ this.dragTarget = $event.target;
415
+ }
416
+ dragStart($event, action, index) {
417
+ if (this.dragTarget && this.dragTarget.style.maskImage.indexOf('six_dot') > -1) {
418
+ this.movingAction = action;
419
+ this.moveStart = $event.clientY;
420
+ this.moveInitialIndex = index;
421
+ this.initialActionList = [...this.procedure.actions];
422
+ }
423
+ else {
424
+ $event.preventDefault();
425
+ }
426
+ }
427
+ move($event) {
428
+ $event.preventDefault();
429
+ if (this.movingAction) {
430
+ const offsetInCards = Math.round(($event.clientY - this.moveStart) / EventDetailComponent.CARD_HEIGHT);
431
+ if (this.previousOffset !== offsetInCards) {
432
+ this.previousOffset = offsetInCards;
433
+ const newIndex = Math.min(Math.max(this.moveInitialIndex + offsetInCards, 0), this.initialActionList.length - 1);
434
+ const newTab = [...this.initialActionList];
435
+ const element = newTab.splice(this.moveInitialIndex, 1)[0];
436
+ newTab.splice(newIndex, 0, element);
437
+ this.procedureModifications.actions = newTab;
438
+ }
439
+ }
440
+ }
441
+ drop($event) {
442
+ $event.preventDefault();
443
+ this.move($event);
444
+ this.movingAction = undefined;
445
+ this._outputModifications();
446
+ }
447
+ allowDrop($event) {
448
+ $event.preventDefault();
449
+ }
402
450
  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 }); }
403
- 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\">{{ '@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.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: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i2.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: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
451
+ 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 @if (events.length > 1) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}\n </button>\n }\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) + '...'\"\n [(ngModel)]=\"newComentContent\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\"\n [disabled]=\"newComentContent.length === 0\">{{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n @if (procedure) {\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\" (drag)=\"move($event)\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n @for (action of procedure.actions;track action.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\" [draggable]=\"true\" (dragstart)=\"dragStart($event, action, idx)\" (mousedown)=\"onMouseDown($event)\">\n <pry-icon iconSvg=\"six_dot\" #handle></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 } @else {\n <button class=\"a-btn a-btn--secondary\">\n {{ '@chh.actions.associate' | i18n }}\n </button>\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" }] }); }
404
452
  }
405
453
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
406
454
  type: Component,
407
- 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\">{{ '@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" }]
455
+ 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 @if (events.length > 1) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}\n </button>\n }\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) + '...'\"\n [(ngModel)]=\"newComentContent\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\"\n [disabled]=\"newComentContent.length === 0\">{{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n @if (procedure) {\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\" (drag)=\"move($event)\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n @for (action of procedure.actions;track action.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\" [draggable]=\"true\" (dragstart)=\"dragStart($event, action, idx)\" (mousedown)=\"onMouseDown($event)\">\n <pry-icon iconSvg=\"six_dot\" #handle></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 } @else {\n <button class=\"a-btn a-btn--secondary\">\n {{ '@chh.actions.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
408
456
  }], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }], propDecorators: { modifiedEvents: [{
409
457
  type: Output
410
458
  }], modifiedProcedure: [{
@@ -442,9 +490,6 @@ const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load,
442
490
  ...state,
443
491
  loading: false,
444
492
  events: [],
445
- })), on(EventActions.filter, (state, { filters }) => ({
446
- ...state,
447
- filters,
448
493
  })), on(EventActions.select, (state, { ids, cumulative }) => ({
449
494
  ...state,
450
495
  selectedIds: !cumulative ? ids : [...state.selectedIds, ...ids].reduce((p, c) => p.indexOf(c) === -1 ? [...p, c] : p.filter(p1 => p1 !== c), []),
@@ -459,6 +504,11 @@ const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load,
459
504
  events: [],
460
505
  noMoreEvents: false,
461
506
  sort: { field, order },
507
+ })), on(EventActions.filter, (state, { filters }) => ({
508
+ ...state,
509
+ events: [],
510
+ noMoreEvents: false,
511
+ filters: filters,
462
512
  })));
463
513
  function eventReducer(state, action) {
464
514
  return internalReducer$1(state, action);
@@ -497,7 +547,7 @@ class ColumnOrderComponent extends SubscriptionnerDirective {
497
547
  return this.field === this.sortValue?.field && order === this.sortValue.order;
498
548
  }
499
549
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ColumnOrderComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
500
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: ColumnOrderComponent, selector: "hvy-column-order", inputs: { field: "field" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-column-order\">\n <div>\n <ng-content></ng-content>\n </div>\n <div class=\"o-hvy-column-order__chevrons\">\n <pry-icon iconSvg=\"caret_top\" (click)=\"sort('ASC')\" [height]=\"10\" [width]=\"10\" [class.-active]=\"isActive('ASC')\"></pry-icon>\n <pry-icon iconSvg=\"caret_bottom\" (click)=\"sort('DESC')\" [height]=\"10\" [width]=\"10\" [class.-active]=\"isActive('DESC')\"></pry-icon>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }] }); }
550
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: ColumnOrderComponent, selector: "hvy-column-order", inputs: { field: "field" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-column-order\">\n <div>\n <ng-content></ng-content>\n </div>\n <div class=\"o-hvy-column-order__chevrons\">\n <pry-icon iconSvg=\"caret_top\" (click)=\"sort('ASC')\" [height]=\"10\" [width]=\"10\" [class.-active]=\"isActive('ASC')\"></pry-icon>\n <pry-icon iconSvg=\"caret_bottom\" (click)=\"sort('DESC')\" [height]=\"10\" [width]=\"10\" [class.-active]=\"isActive('DESC')\"></pry-icon>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }] }); }
501
551
  }
502
552
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ColumnOrderComponent, decorators: [{
503
553
  type: Component,
@@ -516,9 +566,11 @@ class EventListComponent extends SubscriptionnerDirective {
516
566
  this.el = el;
517
567
  this.EVENT_LINK = EVENT_LINK;
518
568
  this._store = this.store;
569
+ this._inhibate = false;
519
570
  this.store.dispatch(EventActions.load({}));
520
571
  this.events$ = this.store.select(EventSelectors.events);
521
572
  this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
573
+ this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map(([events, selectedIds]) => events.filter(ev => !selectedIds.includes(ev.id)).length === 0));
522
574
  }
523
575
  ngAfterViewInit() {
524
576
  this.subscriptions.add(fromEvent(this.el.nativeElement, 'scroll')
@@ -532,16 +584,30 @@ class EventListComponent extends SubscriptionnerDirective {
532
584
  }));
533
585
  }
534
586
  select(event, $event) {
587
+ this.inhibate();
535
588
  this.store.dispatch(EventActions.select({ ids: [event.id], cumulative: true }));
536
589
  $event.preventDefault();
537
590
  $event.stopPropagation();
538
591
  }
592
+ selectAll($event) {
593
+ if (!this._inhibate) {
594
+ this.inhibate();
595
+ const tmpSub = this.events$.subscribe(events => {
596
+ this.store.dispatch(EventActions.select({ ids: $event ? events.map(ev => ev.id) : [], cumulative: false }));
597
+ setTimeout(() => tmpSub.unsubscribe(), 10);
598
+ });
599
+ }
600
+ }
601
+ inhibate() {
602
+ this._inhibate = true;
603
+ setTimeout(() => this._inhibate = false, 100);
604
+ }
539
605
  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 }); }
540
- 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.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$1.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: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: i10.PrySinceDatePipe, name: "sinceDate" }] }); }
606
+ 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" }] }); }
541
607
  }
542
608
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
543
609
  type: Component,
544
- 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" }]
610
+ 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" }]
545
611
  }], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ElementRef }] });
546
612
 
547
613
  class EventFiltersComponent extends SubscriptionnerDirective {
@@ -552,21 +618,21 @@ class EventFiltersComponent extends SubscriptionnerDirective {
552
618
  filter() {
553
619
  const filters = this.filters.map(filter => filter.getParams())
554
620
  .reduce((p, c) => ({ ...p, ...c }), {});
555
- this.store.dispatch(EventActions.setFilters({ filters }));
621
+ this.store.dispatch(EventActions.filter({ filters }));
556
622
  }
557
623
  reset() {
558
624
  this.filters.forEach(filter => filter.reset());
559
- this.store.dispatch(EventActions.setFilters({ filters: {} }));
625
+ this.store.dispatch(EventActions.filter({ filters: {} }));
560
626
  }
561
627
  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 }); }
562
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventFiltersComponent, selector: "hvy-event-filters", queries: [{ propertyName: "filters", predicate: ["filter"] }], 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()\">\n <pry-icon iconSvg=\"reset\"></pry-icon>\n RESET\n </button>\n <button (click)=\"filter()\">\n <pry-icon iconSvg=\"filter\"></pry-icon>\n FILTRER\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }] }); }
628
+ 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" }] }); }
563
629
  }
564
630
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventFiltersComponent, decorators: [{
565
631
  type: Component,
566
- 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()\">\n <pry-icon iconSvg=\"reset\"></pry-icon>\n RESET\n </button>\n <button (click)=\"filter()\">\n <pry-icon iconSvg=\"filter\"></pry-icon>\n FILTRER\n </button>\n </div>\n</div>\n" }]
632
+ 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" }]
567
633
  }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { filters: [{
568
634
  type: ContentChildren,
569
- args: ['filter']
635
+ args: ['filter', { descendants: true }]
570
636
  }] } });
571
637
 
572
638
  class HvyUnitFilterComponent extends SubscriptionnerDirective {
@@ -615,32 +681,133 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
615
681
  }] } });
616
682
 
617
683
  class ChoiceFilterComponent extends HvyUnitFilterComponent {
618
- constructor(store) {
684
+ static { this.idCounter = 0; }
685
+ constructor(store, overlay, viewContainerRef, i18nService, ref) {
619
686
  super();
620
687
  this.store = store;
688
+ this.overlay = overlay;
689
+ this.viewContainerRef = viewContainerRef;
690
+ this.i18nService = i18nService;
691
+ this.ref = ref;
692
+ this.id = -1;
621
693
  this.prop = 'no-prop-defined';
622
- this.value = [];
694
+ this.label = 'no-label-defined';
695
+ this.i18nPrefix = 'no-prefix-defined.';
696
+ this.value = signal([]);
623
697
  this.choices = [];
698
+ this.inhibate = false;
699
+ this.displayValue = computed(() => {
700
+ if (this.allSelected()) {
701
+ return this.i18nService.instant('@hvy.event.filter.choice.all');
702
+ }
703
+ if (this.value().length > 1) {
704
+ return `(${this.value().length})`;
705
+ }
706
+ if (this.value().length === 1) {
707
+ return this.i18nService.instant(this.i18nPrefix + this.value()[0]);
708
+ }
709
+ return '';
710
+ });
711
+ this.id = ChoiceFilterComponent.idCounter++;
712
+ }
713
+ ngAfterViewInit() {
624
714
  this.subscriptions.add(this.store.select(EventSelectors.filters).subscribe(filters => {
625
- this.value = filters[this.prop] ?? [];
715
+ this.assignValue(filters.hasOwnProperty(this.prop) ?
716
+ filters[this.prop].length === 1 && filters[this.prop][0] === '' ? [] : filters[this.prop] : this.allValues());
626
717
  }));
627
718
  }
628
719
  getParams() {
629
- return { [this.prop]: this.value };
720
+ if (this.value().length === this.allValues().length) {
721
+ return {};
722
+ }
723
+ return { [this.prop]: this.value().length === 0 ? [''] : this.value() };
630
724
  }
631
725
  reset() {
632
- this.value = [];
726
+ this.assignValue([]);
727
+ }
728
+ toggleModal() {
729
+ if (!this.overlayRef) {
730
+ this.triggerInhibate();
731
+ this.overlayRef = this.overlay.create(new OverlayConfig({
732
+ hasBackdrop: true,
733
+ backdropClass: 'backdrop',
734
+ panelClass: ['m-context-menu-wrapper', 'o-choice-filter-popup'],
735
+ }));
736
+ this.overlayRef.backdropClick().subscribe(() => this.toggleModal());
737
+ this.overlayRef.attach(new TemplatePortal(this.template, this.viewContainerRef));
738
+ const contextMenu = document.querySelector('.o-choice-filter-popup');
739
+ if (!!contextMenu) {
740
+ const rect = this.ref.nativeElement.getBoundingClientRect();
741
+ contextMenu.style.left = rect.x + 'px';
742
+ contextMenu.style.top = rect.bottom + 'px';
743
+ }
744
+ }
745
+ else {
746
+ this.overlayRef.dispose();
747
+ this.overlayRef = undefined;
748
+ }
749
+ }
750
+ clickAll() {
751
+ if (this.allSelected()) {
752
+ this.assignValue([]);
753
+ }
754
+ else {
755
+ this.assignValue(this.allValues());
756
+ }
757
+ }
758
+ toggle(elt) {
759
+ const isSelected = this.isSelected(elt);
760
+ const eltSubKeys = !elt.children ? [elt.key] : elt.children.map(ch => ch.key);
761
+ if (!isSelected) {
762
+ this.assignValue([...new Set([...this.value(), ...eltSubKeys])]);
763
+ }
764
+ else {
765
+ this.assignValue(this.value().filter(v => !eltSubKeys.includes(v)));
766
+ }
767
+ }
768
+ allSelected() {
769
+ return this.choices.map(choice => this.isSelected(choice)).reduce((p, c) => p && c, true);
770
+ }
771
+ isSelected(choice) {
772
+ if (!choice.children) {
773
+ return this.value().includes(choice.key);
774
+ }
775
+ else {
776
+ return choice.children.map(child => this.isSelected(child)).reduce((p, c) => p && c, true);
777
+ }
778
+ }
779
+ allValues() {
780
+ return this.choices
781
+ .map(choice => !choice.children ? [choice.key] : choice.children.map(child => child.key))
782
+ .reduce((p, c) => [...p, ...c], []);
783
+ }
784
+ assignValue(value) {
785
+ if (!this.inhibate) {
786
+ this.triggerInhibate();
787
+ this.value.set(value);
788
+ }
789
+ }
790
+ triggerInhibate() {
791
+ this.inhibate = true;
792
+ setTimeout(() => this.inhibate = false, 50);
633
793
  }
634
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
635
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: ChoiceFilterComponent, selector: "hvy-choice-filter", inputs: { prop: "prop", choices: "choices" }, providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-choice-filters\">\n CHOICE: {{ value | json }}\n</div>\n", dependencies: [{ kind: "pipe", type: i1$2.JsonPipe, name: "json" }] }); }
794
+ 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 }); }
795
+ 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" }] }); }
636
796
  }
637
797
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, decorators: [{
638
798
  type: Component,
639
- args: [{ selector: 'hvy-choice-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], template: "<div class=\"o-hvy-choice-filters\">\n CHOICE: {{ value | json }}\n</div>\n" }]
640
- }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { prop: [{
799
+ 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" }]
800
+ }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Overlay }, { type: i0.ViewContainerRef }, { type: i3.PryI18nService }, { type: i0.ElementRef }], propDecorators: { prop: [{
801
+ type: Input
802
+ }], label: [{
803
+ type: Input
804
+ }], i18nPrefix: [{
641
805
  type: Input
642
806
  }], choices: [{
643
807
  type: Input
808
+ }], template: [{
809
+ type: ViewChild,
810
+ args: ['template', { read: TemplateRef }]
644
811
  }] } });
645
812
 
646
813
  const EventSummaryActions = {
@@ -684,6 +851,10 @@ const EventSummarySelectors = {
684
851
  loading
685
852
  };
686
853
 
854
+ const HypEventStatus = {
855
+ values: ['NEW', 'IN_PROGRESS', 'DONE'],
856
+ };
857
+
687
858
  class EventSummaryItemComponent {
688
859
  constructor(store) {
689
860
  this.store = store;
@@ -691,7 +862,7 @@ class EventSummaryItemComponent {
691
862
  this.EVENT_LINK = EVENT_LINK;
692
863
  }
693
864
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
694
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: { event: "event", linkBase: "linkBase" }, ngImport: i0, template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.serviceTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.serviceCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2$1.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: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
865
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: { event: "event", linkBase: "linkBase" }, ngImport: i0, template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.serviceTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.serviceCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n", dependencies: [{ 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: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
695
866
  }
696
867
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, decorators: [{
697
868
  type: Component,
@@ -721,13 +892,13 @@ class EventSummaryListComponent {
721
892
  this.router.navigate([...this.consultLink]);
722
893
  this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
723
894
  }
724
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1$1.Store }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
725
- 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: i2.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: i2.I18nPipe, name: "i18n" }] }); }
895
+ 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 }); }
896
+ 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" }] }); }
726
897
  }
727
898
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, decorators: [{
728
899
  type: Component,
729
- 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" }]
730
- }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Router }], propDecorators: { events: [{
900
+ 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" }]
901
+ }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2.Router }], propDecorators: { events: [{
731
902
  type: Input
732
903
  }], totalEventCount: [{
733
904
  type: Input
@@ -744,12 +915,16 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
744
915
  super();
745
916
  this.store = store;
746
917
  this.pageTitle = '';
918
+ this.consultLink = [];
747
919
  this.summaries = {
748
920
  NEW: { events: [], count: 0 },
749
921
  IN_PROGRESS: { events: [], count: 0 },
750
922
  DONE: { events: [], count: 0 },
751
923
  };
752
- this.criticalityList = ["LOW", "MEDIUM", "HIGH", "ALL"];
924
+ this.criticalityList = [...HypEventStatus.values, 'ALL'];
925
+ this.criticalityOrder = (a, b) => {
926
+ return this.criticalityList.indexOf(a.key) - this.criticalityList.indexOf(b.key);
927
+ };
753
928
  this.store.dispatch(EventSummaryActions.load());
754
929
  this.selectedCriticality$ = this.store.select(EventSelectors.filters).pipe(map$1((filters) => filters['criticality']?.[0] ?? 'ALL'));
755
930
  this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
@@ -761,17 +936,16 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
761
936
  this.store.dispatch(EventActions.filter({ filters: { criticality: [$event] } }));
762
937
  this.store.dispatch(EventSummaryActions.load());
763
938
  }
764
- asIsOrder() {
765
- return 0;
766
- }
767
939
  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 }); }
768
- 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: i2.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: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$2.KeyValuePipe, name: "keyvalue" }] }); }
940
+ 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 <div class=\"o-hvy-event-summary-page__content__sub\">\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</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" }] }); }
769
941
  }
770
942
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
771
943
  type: Component,
772
- 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" }]
944
+ 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 <div class=\"o-hvy-event-summary-page__content__sub\">\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</div>\n" }]
773
945
  }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { pageTitle: [{
774
946
  type: Input
947
+ }], consultLink: [{
948
+ type: Input
775
949
  }] } });
776
950
 
777
951
  const HYP_BASE_CONFIG = new InjectionToken('base config');
@@ -779,7 +953,6 @@ const HYP_BASE_CONFIG = new InjectionToken('base config');
779
953
  const enTranslations = {
780
954
  '@hvy': {
781
955
  event: {
782
- criticality: 'Criticality',
783
956
  name: 'Event',
784
957
  type: {
785
958
  name: 'Event type',
@@ -828,12 +1001,25 @@ const enTranslations = {
828
1001
  },
829
1002
  },
830
1003
  category: {
831
- ALERT: 'Dysfunction alert',
1004
+ name: "Event category",
1005
+ ALERT_MALFUNCTION: 'Dysfunction alert',
832
1006
  REPORT: 'GRC report',
833
1007
  OPERATOR_EVENT: 'Operator event',
834
1008
  ALERT_LIMIT: 'Limit alert',
835
1009
  MANIFESTATION: 'Manifestation',
836
1010
  },
1011
+ criticality: {
1012
+ name: 'Criticality',
1013
+ LOW: 'Low',
1014
+ MEDIUM: 'Middle',
1015
+ HIGH: 'High',
1016
+ },
1017
+ filter: {
1018
+ name: 'Filter',
1019
+ choice: {
1020
+ all: "All"
1021
+ }
1022
+ }
837
1023
  },
838
1024
  eventSummary: {
839
1025
  noContent: 'No event with given criticality',
@@ -857,6 +1043,7 @@ const enTranslations = {
857
1043
  consult: 'Consult',
858
1044
  close: 'Close',
859
1045
  send: 'Send',
1046
+ comment: 'Comment'
860
1047
  },
861
1048
  },
862
1049
  };
@@ -864,15 +1051,15 @@ const enTranslations = {
864
1051
  const frTranslations = {
865
1052
  '@hvy': {
866
1053
  event: {
867
- name: 'Évènement',
1054
+ name: 'Événements',
868
1055
  type: {
869
- name: 'Type d\'évènement',
1056
+ name: 'Type d\'événement',
870
1057
  ALERT: 'Alerte',
871
1058
  REPORT: 'Signalement',
872
1059
  OPERATOR: 'Opérateur',
873
1060
  },
874
1061
  status: {
875
- name: 'Statut évènement',
1062
+ name: 'Statut événement',
876
1063
  NEW: 'Nouveau',
877
1064
  IN_PROGRESS: 'En cours',
878
1065
  DONE: 'Clôturé',
@@ -889,19 +1076,19 @@ const frTranslations = {
889
1076
  creationDate: 'Date de création',
890
1077
  lastModificationDate: 'Date dernières modifications',
891
1078
  closeDate: 'Date de clotûre',
892
- detail: "Description des évènements",
1079
+ detail: "Description des événements",
893
1080
  log: {
894
- name: 'Journal des évènements',
895
- empty: 'Aucun évènement n\'a été créé',
1081
+ name: 'Journal des événements',
1082
+ empty: 'Aucun événement n\'a été créé',
896
1083
  event: {
897
1084
  description: 'Description',
898
1085
  address: 'Adresse',
899
1086
  detail: 'Informations',
900
1087
  name: 'Nom',
901
1088
  category: 'Catégorie',
902
- close: 'Clôturer tous ces évènements',
1089
+ close: 'Clôturer tous ces événements',
903
1090
  comments: {
904
- name: 'Commentaires de l\'évènement',
1091
+ name: 'Commentaires de l\'événement',
905
1092
  placeholder: 'Écrivez votre commentaire'
906
1093
  }
907
1094
  },
@@ -914,7 +1101,7 @@ const frTranslations = {
914
1101
  },
915
1102
  },
916
1103
  category: {
917
- name: "Catégorie d'évènement",
1104
+ name: "Catégorie d'événement",
918
1105
  ALERT_MALFUNCTION: 'Alerte Dysfonctionnement',
919
1106
  REPORT: 'Signalement GRC',
920
1107
  OPERATOR_EVENT: 'Evènement Opérateur',
@@ -927,9 +1114,15 @@ const frTranslations = {
927
1114
  MEDIUM: 'Moyen',
928
1115
  HIGH: 'Haut',
929
1116
  },
1117
+ filter: {
1118
+ name: 'Filtrer',
1119
+ choice: {
1120
+ all: "Tous"
1121
+ }
1122
+ }
930
1123
  },
931
1124
  eventSummary: {
932
- noContent: 'Aucun évènement avec la criticité donnée',
1125
+ noContent: 'Aucun événement avec la criticité donnée',
933
1126
  statusLabels: {
934
1127
  NEW: 'Nouveaux',
935
1128
  IN_PROGRESS: 'En cours',
@@ -949,7 +1142,8 @@ const frTranslations = {
949
1142
  action: {
950
1143
  consult: 'Consulter',
951
1144
  close: 'Clotûrer',
952
- send: 'Envoyer'
1145
+ send: 'Envoyer',
1146
+ comment: 'Commenter'
953
1147
  },
954
1148
  },
955
1149
  };
@@ -959,10 +1153,6 @@ const eventForWriteAPI = (event) => ({
959
1153
  equipmentId: event.equipment?.id
960
1154
  });
961
1155
 
962
- const HypEventStatus = {
963
- values: ['NEW', 'IN_PROGRESS', 'DONE'],
964
- };
965
-
966
1156
  const HypEventType = { values: ['ALERT', 'REPORT', 'OPERATOR'] };
967
1157
 
968
1158
  const procedureForWriteAPI = (procedure) => ({
@@ -986,7 +1176,7 @@ class EventService {
986
1176
  let params = new HttpParams();
987
1177
  Object.keys(filters).forEach(filter => {
988
1178
  filters[filter].forEach((filterValue) => {
989
- params = params.set(filter, filterValue);
1179
+ params = params.append(filter, filterValue);
990
1180
  });
991
1181
  });
992
1182
  const pageSize = 20;
@@ -1067,7 +1257,7 @@ class EventEffects {
1067
1257
  return this.eventService.statusProcedure(action.procedure, action.targetStatus).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
1068
1258
  }
1069
1259
  })));
1070
- this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort), debounceTime(200), map$1(() => EventActions.load({}))));
1260
+ this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort, EventActions.filter), debounceTime(200), map$1(() => EventActions.load({}))));
1071
1261
  }
1072
1262
  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 }); }
1073
1263
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
@@ -1177,7 +1367,7 @@ class PvyHypervisorModule {
1177
1367
  this.i18nService.addLangObject('en', '@hvy', enTranslations);
1178
1368
  this.i18nService.addLangObject('fr', '@hvy', frTranslations);
1179
1369
  }
1180
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, deps: [{ token: HYP_BASE_CONFIG }, { token: i1$1.Store }, { token: i2.PryI18nService }], target: i0.ɵɵFactoryTarget.NgModule }); }
1370
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, deps: [{ token: HYP_BASE_CONFIG }, { token: i1$1.Store }, { token: i3.PryI18nService }], target: i0.ɵɵFactoryTarget.NgModule }); }
1181
1371
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, declarations: [EventDetailComponent,
1182
1372
  EventListComponent,
1183
1373
  IconDisplayComponent,
@@ -1210,7 +1400,10 @@ class PvyHypervisorModule {
1210
1400
  JsonPipe,
1211
1401
  PryDatePickerModule,
1212
1402
  PryI18nModule,
1213
- PryIconModule], exports: [EventDetailComponent,
1403
+ PryIconModule,
1404
+ PryI18nModule,
1405
+ AsyncPipe,
1406
+ PryI18nModule], exports: [EventDetailComponent,
1214
1407
  EventListComponent,
1215
1408
  IconDisplayComponent,
1216
1409
  EventSummaryItemComponent,
@@ -1239,7 +1432,9 @@ class PvyHypervisorModule {
1239
1432
  FormsModule,
1240
1433
  PryDatePickerModule,
1241
1434
  PryI18nModule,
1242
- PryIconModule] }); }
1435
+ PryIconModule,
1436
+ PryI18nModule,
1437
+ PryI18nModule] }); }
1243
1438
  }
1244
1439
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, decorators: [{
1245
1440
  type: NgModule,
@@ -1272,6 +1467,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
1272
1467
  PryDatePickerModule,
1273
1468
  PryI18nModule,
1274
1469
  PryIconModule,
1470
+ PryI18nModule,
1471
+ AsyncPipe,
1472
+ PryI18nModule,
1275
1473
  ],
1276
1474
  exports: [
1277
1475
  ...components,
@@ -1280,7 +1478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
1280
1478
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1281
1479
  type: Inject,
1282
1480
  args: [HYP_BASE_CONFIG]
1283
- }] }, { type: i1$1.Store }, { type: i2.PryI18nService }] });
1481
+ }] }, { type: i1$1.Store }, { type: i3.PryI18nService }] });
1284
1482
 
1285
1483
  /*
1286
1484
  * Public API Surface of hypervisor