@provoly/hypervisor 0.0.7 → 0.0.9

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 (94) hide show
  1. package/esm2022/public-api.mjs +3 -1
  2. package/esm2022/src/lib/event/detail/event-detail.component.mjs +117 -10
  3. package/esm2022/src/lib/event/list/event-list.component.mjs +31 -10
  4. package/esm2022/src/lib/event-summary/item/event-summary-item.component.mjs +13 -13
  5. package/esm2022/src/lib/event-summary/list/event-summary-list.component.mjs +1 -1
  6. package/esm2022/src/lib/event-summary/page/event-summary-page.component.mjs +3 -3
  7. package/esm2022/src/lib/general/for-datetime-local-pipe/for-datetime-local.pipe.mjs +20 -0
  8. package/esm2022/src/lib/general/i18n/en.translations.mjs +46 -9
  9. package/esm2022/src/lib/general/i18n/fr.translations.mjs +56 -12
  10. package/esm2022/src/lib/general/icon-display/icon-display.component.mjs +1 -1
  11. package/esm2022/src/lib/general/icon-pipe/event-icon.pipe.mjs +2 -2
  12. package/esm2022/src/lib/general/progress-display/progress-display.component.mjs +16 -0
  13. package/esm2022/src/lib/general/public-api.mjs +5 -1
  14. package/esm2022/src/lib/general/status-display/status-display.component.mjs +48 -0
  15. package/esm2022/src/lib/hypervisor.module.mjs +26 -9
  16. package/esm2022/src/lib/model/event/hyp-event-category.type.mjs +2 -0
  17. package/esm2022/src/lib/model/event/hyp-event-criticality.type.mjs +2 -0
  18. package/esm2022/src/lib/model/event/hyp-event-detail.interface.mjs +2 -0
  19. package/esm2022/src/lib/model/event/hyp-event-status.type.mjs +2 -0
  20. package/esm2022/src/lib/model/event/hyp-event-summary.interface.mjs +2 -0
  21. package/esm2022/src/lib/model/event/hyp-event-type.mjs +7 -0
  22. package/esm2022/src/lib/model/event/hyp-event.interface.mjs +2 -0
  23. package/esm2022/src/lib/model/hyp-action.interface.mjs +2 -0
  24. package/esm2022/src/lib/model/hyp-equipment.interface.mjs +2 -0
  25. package/esm2022/src/lib/model/hyp-procedure.interface.mjs +1 -1
  26. package/esm2022/src/lib/model/public-api.mjs +9 -8
  27. package/esm2022/src/lib/store/equipment/equipment.service.mjs +31 -0
  28. package/esm2022/src/lib/store/equipment/public-api.mjs +2 -0
  29. package/esm2022/src/lib/store/event/event.actions.mjs +7 -2
  30. package/esm2022/src/lib/store/event/event.effects.mjs +11 -5
  31. package/esm2022/src/lib/store/event/event.reducer.mjs +22 -11
  32. package/esm2022/src/lib/store/event/event.selectors.mjs +6 -2
  33. package/esm2022/src/lib/store/event/event.service.mjs +19 -3
  34. package/esm2022/src/lib/store/event/public-api.mjs +2 -1
  35. package/esm2022/src/lib/store/event-summary/event-summary.actions.mjs +1 -1
  36. package/esm2022/src/lib/store/event-summary/event-summary.reducer.mjs +1 -1
  37. package/esm2022/src/lib/store/hypervisor/public-api.mjs +6 -0
  38. package/fesm2022/provoly-hypervisor.mjs +515 -170
  39. package/fesm2022/provoly-hypervisor.mjs.map +1 -1
  40. package/package.json +2 -2
  41. package/public-api.d.ts +2 -0
  42. package/src/lib/event/detail/event-detail.component.d.ts +32 -4
  43. package/src/lib/event/list/event-list.component.d.ts +15 -3
  44. package/src/lib/event-summary/item/event-summary-item.component.d.ts +7 -3
  45. package/src/lib/event-summary/list/event-summary-list.component.d.ts +1 -1
  46. package/src/lib/event-summary/page/event-summary-page.component.d.ts +1 -1
  47. package/src/lib/general/for-datetime-local-pipe/for-datetime-local.pipe.d.ts +10 -0
  48. package/src/lib/general/i18n/en.translations.d.ts +39 -2
  49. package/src/lib/general/i18n/fr.translations.d.ts +47 -3
  50. package/src/lib/general/icon-display/icon-display.component.d.ts +1 -1
  51. package/src/lib/general/icon-pipe/event-icon.pipe.d.ts +5 -4
  52. package/src/lib/general/progress-display/progress-display.component.d.ts +6 -0
  53. package/src/lib/general/public-api.d.ts +4 -0
  54. package/src/lib/general/status-display/status-display.component.d.ts +19 -0
  55. package/src/lib/hypervisor.module.d.ts +12 -9
  56. package/src/lib/model/event/hyp-event-category.type.d.ts +1 -0
  57. package/src/lib/model/event/hyp-event-criticality.type.d.ts +1 -0
  58. package/src/lib/model/event/hyp-event-detail.interface.d.ts +22 -0
  59. package/src/lib/model/event/hyp-event-status.type.d.ts +1 -0
  60. package/src/lib/model/{hyp-event-summary.interface.d.ts → event/hyp-event-summary.interface.d.ts} +5 -4
  61. package/src/lib/model/event/hyp-event.interface.d.ts +6 -0
  62. package/src/lib/model/hyp-action.interface.d.ts +7 -0
  63. package/src/lib/model/hyp-equipment.interface.d.ts +5 -0
  64. package/src/lib/model/hyp-procedure.interface.d.ts +7 -0
  65. package/src/lib/model/public-api.d.ts +8 -7
  66. package/src/lib/store/equipment/equipment.service.d.ts +13 -0
  67. package/src/lib/store/equipment/public-api.d.ts +1 -0
  68. package/src/lib/store/event/event.actions.d.ts +36 -2
  69. package/src/lib/store/event/event.effects.d.ts +16 -1
  70. package/src/lib/store/event/event.reducer.d.ts +7 -1
  71. package/src/lib/store/event/event.selectors.d.ts +8 -0
  72. package/src/lib/store/event/event.service.d.ts +5 -2
  73. package/src/lib/store/event/public-api.d.ts +1 -0
  74. package/src/lib/store/event-summary/event-summary.actions.d.ts +1 -1
  75. package/src/lib/store/event-summary/event-summary.reducer.d.ts +1 -1
  76. package/src/lib/store/hypervisor/public-api.d.ts +5 -0
  77. package/styles/components/_a-chip-status.scss +46 -0
  78. package/styles/components/_index.scss +3 -0
  79. package/styles/components/_o-hvy-event-detail.scss +156 -0
  80. package/styles/components/_o-hvy-events-table.scss +39 -2
  81. package/styles/components/_o-progressbar.scss +46 -0
  82. package/esm2022/src/lib/model/hyp-event-category.type.mjs +0 -2
  83. package/esm2022/src/lib/model/hyp-event-criticality.type.mjs +0 -7
  84. package/esm2022/src/lib/model/hyp-event-detail.interface.mjs +0 -2
  85. package/esm2022/src/lib/model/hyp-event-status.type.mjs +0 -2
  86. package/esm2022/src/lib/model/hyp-event-summary.interface.mjs +0 -2
  87. package/esm2022/src/lib/model/hyp-event-type.mjs +0 -7
  88. package/esm2022/src/lib/model/hyp-event.interface.mjs +0 -2
  89. package/src/lib/model/hyp-event-category.type.d.ts +0 -2
  90. package/src/lib/model/hyp-event-criticality.type.d.ts +0 -5
  91. package/src/lib/model/hyp-event-detail.interface.d.ts +0 -14
  92. package/src/lib/model/hyp-event-status.type.d.ts +0 -1
  93. package/src/lib/model/hyp-event.interface.d.ts +0 -6
  94. /package/src/lib/model/{hyp-event-type.d.ts → event/hyp-event-type.d.ts} +0 -0
@@ -1,143 +1,404 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, Pipe, InjectionToken, Injectable, NgModule, Inject } from '@angular/core';
3
- import * as i1 from '@ngrx/store';
2
+ import { Injectable, Pipe, Component, Input, EventEmitter, Output, InjectionToken, NgModule, Inject } from '@angular/core';
3
+ import * as i3 from '@provoly/dashboard';
4
+ import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
5
+ import * as i1 from '@angular/common/http';
6
+ import { HttpParams } from '@angular/common/http';
7
+ import { mergeMap, of, fromEvent, map, withLatestFrom, filter, auditTime } from 'rxjs';
8
+ import * as i1$1 from '@ngrx/store';
4
9
  import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
5
- import * as i1$1 from '@angular/common';
6
- import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe } from '@angular/common';
7
- import * as i3$1 from '@provoly/dashboard/components/checkbox';
10
+ import * as i2 from '@provoly/dashboard/components/checkbox';
8
11
  import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
9
- import * as i4 from '@angular/forms';
12
+ import * as i3$1 from '@angular/forms';
10
13
  import { FormsModule } from '@angular/forms';
11
- import * as i2 from '@angular/router';
14
+ import * as i1$2 from '@angular/common';
15
+ import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe, JsonPipe } from '@angular/common';
16
+ import * as i2$1 from '@angular/router';
12
17
  import { RouterLink } from '@angular/router';
13
- import * as i3 from '@provoly/dashboard';
14
- import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule } from '@provoly/dashboard';
15
- import { of, withLatestFrom, mergeMap } from 'rxjs';
16
- import * as i8 from '@provoly/dashboard/components/sinceDate';
18
+ import * as i9 from '@provoly/dashboard/components/sinceDate';
17
19
  import { PrySinceDateModule } from '@provoly/dashboard/components/sinceDate';
18
- import { map, debounceTime, mergeMap as mergeMap$1, catchError } from 'rxjs/operators';
20
+ import { map as map$1, debounceTime, mergeMap as mergeMap$1, catchError } from 'rxjs/operators';
19
21
  import * as i1$3 from '@ngrx/effects';
20
22
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
21
- import * as i1$2 from '@angular/common/http';
22
- import { HttpParams } from '@angular/common/http';
23
23
 
24
- class EventDetailComponent {
24
+ const HypEventCategory = ['ALERT_MALFUNCTION', 'REPORT', 'OPERATOR', 'ALERT_LIMIT', 'MANIFESTATION'];
25
+
26
+ const HypEventCriticality = ['LOW', 'MEDIUM', 'HIGH'];
27
+
28
+ const HypervisorActions = {
29
+ setUrl: createAction('[Event] Set Backend Url', props())
30
+ };
31
+
32
+ const hypFeatureKey = '@hvy/general';
33
+ const hypInitialState = {
34
+ url: '/api/hypervisor',
35
+ };
36
+ const internalReducer$2 = createReducer(hypInitialState, on(HypervisorActions.setUrl, (state, action) => ({
37
+ ...state,
38
+ url: action.url ?? state.url,
39
+ })));
40
+ function hypervisorReducer(state, action) {
41
+ return internalReducer$2(state, action);
42
+ }
43
+
44
+ const feature$2 = createFeatureSelector(hypFeatureKey);
45
+ const url = createSelector(feature$2, (state) => state.url);
46
+ const HypSelectors = {
47
+ feature: feature$2,
48
+ url
49
+ };
50
+
51
+ class EquipmentService {
52
+ constructor(httpClient, store) {
53
+ this.httpClient = httpClient;
54
+ this.store = store;
55
+ }
56
+ findByName(name) {
57
+ return this.store
58
+ .select(HypSelectors.url)
59
+ .pipe(mergeMap((url) => {
60
+ let params = new HttpParams();
61
+ params = params.set('name', name);
62
+ return this.httpClient.get(encodeURI(`${url}/equipment`), { params });
63
+ }));
64
+ }
65
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EquipmentService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
66
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EquipmentService, providedIn: 'root' }); }
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EquipmentService, decorators: [{
69
+ type: Injectable,
70
+ args: [{
71
+ providedIn: 'root',
72
+ }]
73
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
74
+
75
+ const EVENT_TO_ICON = {
76
+ fn: (event, store) => of(DEFAULT_ICON_URL),
77
+ };
78
+ class EventIconPipe {
79
+ constructor(store) {
80
+ this.store = store;
81
+ }
82
+ transform(value, ...args) {
83
+ return EVENT_TO_ICON.fn(value, this.store);
84
+ }
85
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Pipe }); }
86
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, name: "eventIcon" }); }
87
+ }
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, decorators: [{
89
+ type: Pipe,
90
+ args: [{
91
+ name: 'eventIcon',
92
+ }]
93
+ }], ctorParameters: () => [{ type: i1$1.Store }] });
94
+
95
+ class IconDisplayComponent {
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
97
+ 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" }] }); }
98
+ }
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, decorators: [{
100
+ type: Component,
101
+ args: [{ selector: 'hvy-icon-display', 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" }]
102
+ }], propDecorators: { event: [{
103
+ type: Input
104
+ }] } });
105
+
106
+ class StatusDisplayComponent {
25
107
  constructor() {
26
- this.events = [];
108
+ this.modified = new EventEmitter();
109
+ this.targetStatuses = [];
110
+ this.targetsDisplayed = false;
111
+ this._modifiable = false;
112
+ }
113
+ set event(event) {
114
+ this._event = event;
115
+ this.updateTargetStatuses();
116
+ }
117
+ set modifiable(modifiable) {
118
+ this._modifiable = modifiable;
119
+ this.updateTargetStatuses();
120
+ }
121
+ get modifiable() {
122
+ return this._modifiable;
123
+ }
124
+ get event() {
125
+ return this._event;
126
+ }
127
+ trigger(status) {
128
+ this.modified.next(status);
129
+ this.targetsDisplayed = false;
130
+ }
131
+ updateTargetStatuses() {
132
+ this.targetStatuses = (this.modifiable && this.event.status !== 'DONE') ? ['DONE'] : [];
133
+ }
134
+ toggle() {
135
+ this.targetsDisplayed = this.targetStatuses.length > 0 && !this.targetsDisplayed;
136
+ }
137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: StatusDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
138
+ 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" }] }); }
139
+ }
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: StatusDisplayComponent, decorators: [{
141
+ type: Component,
142
+ args: [{ selector: 'hvy-status-display', 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" }]
143
+ }], propDecorators: { modified: [{
144
+ type: Output
145
+ }], event: [{
146
+ type: Input
147
+ }], modifiable: [{
148
+ type: Input
149
+ }] } });
150
+
151
+ class ProgressDisplayComponent {
152
+ constructor() {
153
+ this.progress = 50;
154
+ }
155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ProgressDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
156
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: { progress: "progress" }, ngImport: i0, template: "<div class=\"o-progressbar\">\n <div class=\"o-progressbar__header\">\n <div>0%</div>\n @if (progress > 0 && progress < 100) {\n <div [style.flex-grow]=\"progress\" class=\"-value\">{{ progress }}%</div>\n }\n <div [style.flex-grow]=\"progress === 100 ? 100 : 100 - progress\">100%</div>\n </div>\n <div class=\"o-progressbar__value\">\n <div [style.flex-grow]=\"progress\" class=\"-filled\"></div>\n <div [style.flex-grow]=\"100 - progress\" class=\"-empty\"></div>\n </div>\n</div>\n" }); }
157
+ }
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ProgressDisplayComponent, decorators: [{
159
+ type: Component,
160
+ args: [{ selector: 'hvy-progress-display', template: "<div class=\"o-progressbar\">\n <div class=\"o-progressbar__header\">\n <div>0%</div>\n @if (progress > 0 && progress < 100) {\n <div [style.flex-grow]=\"progress\" class=\"-value\">{{ progress }}%</div>\n }\n <div [style.flex-grow]=\"progress === 100 ? 100 : 100 - progress\">100%</div>\n </div>\n <div class=\"o-progressbar__value\">\n <div [style.flex-grow]=\"progress\" class=\"-filled\"></div>\n <div [style.flex-grow]=\"100 - progress\" class=\"-empty\"></div>\n </div>\n</div>\n" }]
161
+ }], propDecorators: { progress: [{
162
+ type: Input
163
+ }] } });
164
+
165
+ class ForDatetimeLocalPipe {
166
+ constructor(store) {
167
+ this.store = store;
168
+ }
169
+ transform(completeDate, ...args) {
170
+ return completeDate ? completeDate.substring(0, completeDate.lastIndexOf(':')) : '';
171
+ }
172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ForDatetimeLocalPipe, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Pipe }); }
173
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }); }
174
+ }
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ForDatetimeLocalPipe, decorators: [{
176
+ type: Pipe,
177
+ args: [{
178
+ name: 'forDateTimeLocal',
179
+ }]
180
+ }], ctorParameters: () => [{ type: i1$1.Store }] });
181
+
182
+ class EventDetailComponent extends SubscriptionnerDirective {
183
+ set events(events) {
184
+ this._events = events.filter(ev => !!ev);
185
+ this.modifications = new Array(this._events.length);
186
+ this.opened = events.length === 1 ? [true] : [];
187
+ }
188
+ ;
189
+ set cancelModifications(evt) {
190
+ this.modifications = new Array(this._events.length);
191
+ this.modified.next(this._events.map((ev, idx) => [this.modifications[idx], ev]));
192
+ }
193
+ constructor(equipmentService) {
194
+ super();
195
+ this.equipmentService = equipmentService;
27
196
  this.procedure = undefined;
197
+ this._events = [];
198
+ this.opened = [];
199
+ this.modified = new EventEmitter();
200
+ this.categories = HypEventCategory;
201
+ this.criticalities = HypEventCriticality;
202
+ this.modifications = [];
203
+ }
204
+ get events() {
205
+ return this._events.map((evt, idx) => ({ ...evt, ...(this.modifications[idx] ?? {}) }));
206
+ }
207
+ toggle(i) {
208
+ this.opened[i] = !this.opened[i];
209
+ }
210
+ modify(index, prop, $event) {
211
+ // @ts-ignore
212
+ const newValue = $event instanceof Event ? $event.target?.value : $event;
213
+ // @ts-ignore
214
+ if (this._events[index][prop] !== newValue) {
215
+ if (!this.modifications[index]) {
216
+ this.modifications[index] = {};
217
+ }
218
+ // @ts-ignore
219
+ this.modifications[index][prop] = newValue;
220
+ this.modified.next(this._events.map((ev, idx) => [this.modifications[idx], ev]));
221
+ }
222
+ }
223
+ access(event) {
224
+ switch (event.type) {
225
+ case 'ALERT':
226
+ default:
227
+ return {
228
+ name: true,
229
+ category: true,
230
+ criticality: true,
231
+ description: true,
232
+ address: true,
233
+ source: true,
234
+ eqName: true,
235
+ eqEntity: true,
236
+ startDate: true,
237
+ endDate: true,
238
+ };
239
+ case 'REPORT':
240
+ return {
241
+ name: false,
242
+ category: true,
243
+ criticality: false,
244
+ description: true,
245
+ address: false,
246
+ source: true,
247
+ eqName: false,
248
+ eqEntity: true,
249
+ startDate: true,
250
+ endDate: true,
251
+ };
252
+ case 'OPERATOR':
253
+ return {
254
+ name: false,
255
+ category: false,
256
+ criticality: false,
257
+ description: false,
258
+ address: false,
259
+ source: false,
260
+ eqName: false,
261
+ eqEntity: false,
262
+ startDate: false,
263
+ endDate: false,
264
+ };
265
+ }
266
+ }
267
+ changeEquipment(index, $event) {
268
+ this.equipmentService.findByName($event.target.value).subscribe((equipment) => {
269
+ if (equipment && this._events[index].name !== equipment.name) {
270
+ if (!this.modifications[index]) {
271
+ this.modifications[index] = {};
272
+ }
273
+ // @ts-ignore
274
+ this.modifications[index].equipment = equipment;
275
+ this.modified.next(this._events.map((ev, idx) => [this.modifications[idx], ev]));
276
+ }
277
+ });
28
278
  }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
30
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure" }, ngImport: i0, template: "<h1> TODO </h1>\n<p>Events: {{ events.length }}</p>\n<p>Procedure: {{ procedure }}</p>\n" }); }
279
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }], target: i0.ɵɵFactoryTarget.Component }); }
280
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { procedure: "procedure", events: "events", cancelModifications: "cancelModifications" }, outputs: { modified: "modified" }, 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.log.name' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.name\"\n (change)=\"modify(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\" [items]=\"categories\"\n (ngModelChange)=\"modify(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 i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modify(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 [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modify(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 [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modify(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 [readonly]=\"accessValue.source\" (change)=\"modify(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 [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.startDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.startDate | forDateTimeLocal\"\n [readonly]=\"accessValue.startDate\" (change)=\"modify(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.endDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.endDate | forDateTimeLocal\"\n [readonly]=\"accessValue.endDate\" (change)=\"modify(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: i2.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i3$1.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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.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" }] }); }
31
281
  }
32
282
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
33
283
  type: Component,
34
- args: [{ selector: 'hvy-event-detail', template: "<h1> TODO </h1>\n<p>Events: {{ events.length }}</p>\n<p>Procedure: {{ procedure }}</p>\n" }]
35
- }], propDecorators: { events: [{
284
+ 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.log.name' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.name\"\n (change)=\"modify(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\" [items]=\"categories\"\n (ngModelChange)=\"modify(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 i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modify(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 [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modify(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 [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modify(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 [readonly]=\"accessValue.source\" (change)=\"modify(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 [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.startDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.startDate | forDateTimeLocal\"\n [readonly]=\"accessValue.startDate\" (change)=\"modify(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.endDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.endDate | forDateTimeLocal\"\n [readonly]=\"accessValue.endDate\" (change)=\"modify(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" }]
285
+ }], ctorParameters: () => [{ type: EquipmentService }], propDecorators: { procedure: [{
36
286
  type: Input
37
- }], procedure: [{
287
+ }], modified: [{
288
+ type: Output
289
+ }], events: [{
290
+ type: Input
291
+ }], cancelModifications: [{
38
292
  type: Input
39
293
  }] } });
40
294
 
41
295
  const EventActions = {
42
- load: createAction('[Event] Load Events'),
296
+ load: createAction('[Event] Load Events', props()),
43
297
  loadSuccess: createAction('[Event Api] (bus) Load Events Success', props()),
44
298
  loadFailure: createAction('[Event Api] Load Events Failure', props()),
45
299
  filter: createAction('[Event Api] Set filters', props()),
46
300
  select: createAction('[Event Api] Select', props()),
301
+ get: createAction('[Event] Load specific Event', props()),
302
+ getForProcedure: createAction('[Event] Load specific Event for procedure', props()),
303
+ getSuccess: createAction('[Event Api] (bus) Get Events/Procedure Success', props()),
304
+ getFailure: createAction('[Event Api] Get Events/Procedure Failure', props()),
305
+ save: createAction('[Event] Save Event', props()),
47
306
  };
48
307
 
49
308
  const eventFeatureKey = '@hvy/event';
50
309
  const eventInitialState = {
51
310
  events: [],
311
+ noMoreEvents: false,
52
312
  loading: false,
53
313
  filters: {},
54
- selectedIds: []
314
+ selectedIds: [],
315
+ details: {},
55
316
  };
56
- const internalReducer$2 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
317
+ const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
57
318
  ...state,
58
- loading: true
59
- })), on(EventActions.loadSuccess, (state, { events }) => ({
319
+ loading: true,
320
+ })), on(EventActions.loadSuccess, (state, { events, startingFrom }) => {
321
+ return ({
322
+ ...state,
323
+ loading: false,
324
+ noMoreEvents: events.length < 20,
325
+ events: [...state.events.slice(0, startingFrom), ...events],
326
+ });
327
+ }), on(EventActions.loadFailure, (state, action) => ({
60
328
  ...state,
61
329
  loading: false,
62
- events
63
- })), on(EventActions.loadFailure, (state, action) => ({
64
- ...state,
65
- loading: false,
66
- events: []
330
+ events: [],
67
331
  })), on(EventActions.filter, (state, { filters }) => ({
68
332
  ...state,
69
- filters
333
+ filters,
70
334
  })), on(EventActions.select, (state, { ids, cumulative }) => ({
71
335
  ...state,
72
- selectedIds: !cumulative ? ids : [...state.selectedIds, ...ids].reduce((p, c) => p.indexOf(c) === -1 ? [...p, c] : p.filter(p1 => p1 !== c), [])
336
+ selectedIds: !cumulative ? ids : [...state.selectedIds, ...ids].reduce((p, c) => p.indexOf(c) === -1 ? [...p, c] : p.filter(p1 => p1 !== c), []),
337
+ })), on(EventActions.get, EventActions.getForProcedure, (state, _) => ({
338
+ ...state,
339
+ details: {},
340
+ })), on(EventActions.getSuccess, (state, { event, procedure }) => ({
341
+ ...state,
342
+ details: { event, procedure },
73
343
  })));
74
344
  function eventReducer(state, action) {
75
- return internalReducer$2(state, action);
345
+ return internalReducer$1(state, action);
76
346
  }
77
347
 
78
- const feature$2 = createFeatureSelector(eventFeatureKey);
79
- const events = createSelector(feature$2, (state) => state.events);
80
- const selectedIds = createSelector(feature$2, (state) => state.selectedIds);
81
- const loading$1 = createSelector(feature$2, (state) => state.loading);
82
- const filters = createSelector(feature$2, (state) => state.filters);
348
+ const feature$1 = createFeatureSelector(eventFeatureKey);
349
+ const events = createSelector(feature$1, (state) => state.events);
350
+ const noMoreEvents = createSelector(feature$1, (state) => state.noMoreEvents);
351
+ const selectedIds = createSelector(feature$1, (state) => state.selectedIds);
352
+ const loading$1 = createSelector(feature$1, (state) => state.loading);
353
+ const filters = createSelector(feature$1, (state) => state.filters);
354
+ const details = createSelector(feature$1, (state) => state.details);
83
355
  const EventSelectors = {
84
- feature: feature$2,
356
+ feature: feature$1,
85
357
  events,
86
358
  selectedIds,
87
359
  loading: loading$1,
88
- filters
360
+ filters,
361
+ details,
362
+ noMoreEvents
89
363
  };
90
364
 
91
- const EVENT_TO_ICON = {
92
- fn: (event, store) => of(DEFAULT_ICON_URL),
365
+ const EVENT_LINK = {
366
+ fn: (event, store) => ['./', event.id],
93
367
  };
94
- class EventIconPipe {
95
- constructor(store) {
96
- this.store = store;
97
- }
98
- transform(value, ...args) {
99
- return EVENT_TO_ICON.fn(value, this.store);
100
- }
101
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Pipe }); }
102
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, name: "eventIcon" }); }
103
- }
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, decorators: [{
105
- type: Pipe,
106
- args: [{
107
- name: 'eventIcon'
108
- }]
109
- }], ctorParameters: () => [{ type: i1.Store }] });
110
-
111
- class IconDisplayComponent {
112
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
113
- 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$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.GetSecuredImagePipe, name: "getSecuredImage" }, { kind: "pipe", type: EventIconPipe, name: "eventIcon" }] }); }
114
- }
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, decorators: [{
116
- type: Component,
117
- args: [{ selector: 'hvy-icon-display', 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" }]
118
- }], propDecorators: { event: [{
119
- type: Input
120
- }] } });
121
-
122
- class EventListComponent {
123
- constructor(store) {
368
+ class EventListComponent extends SubscriptionnerDirective {
369
+ constructor(store, el) {
370
+ super();
124
371
  this.store = store;
125
- this.store.dispatch(EventActions.load());
372
+ this.el = el;
373
+ this.EVENT_LINK = EVENT_LINK;
374
+ this._store = this.store;
375
+ this.store.dispatch(EventActions.load({}));
126
376
  this.events$ = this.store.select(EventSelectors.events);
127
377
  this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
128
378
  }
379
+ ngAfterViewInit() {
380
+ this.subscriptions.add(fromEvent(this.el.nativeElement, 'scroll')
381
+ .pipe(
382
+ // Are we close to end
383
+ map((e) => {
384
+ const target = e.currentTarget;
385
+ return target.scrollHeight - target.offsetHeight - target.scrollTop;
386
+ }), withLatestFrom(this.store.select(EventSelectors.noMoreEvents)), filter(([remaningScroll, noMore]) => !noMore && remaningScroll < 200), auditTime(200)).subscribe(() => {
387
+ this.store.dispatch(EventActions.load({ next: true }));
388
+ }));
389
+ }
129
390
  select(event, $event) {
130
391
  this.store.dispatch(EventActions.select({ ids: [event.id], cumulative: true }));
131
392
  $event.preventDefault();
132
393
  $event.stopPropagation();
133
394
  }
134
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
135
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventListComponent, selector: "hvy-event-list", 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.type.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>{{ '@hvy.event.date' | i18n }}</th>\n <th>{{ '@hvy.event.dateM' | i18n }}</th>\n <th>{{ '@hvy.event.status.name' | i18n }}</th>\n <th>{{ '@hvy.procedure.name' | i18n }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"o-hvy-events-table__line\" *ngFor=\"let event of events$|async\">\n <td class=\"o-hvy-events-table__line__cell\" (click)=\"select(event, $event)\">\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__name__main\">{{ event.name }}</div>\n <div>{{ event.equipmentReference ? event.equipmentReference : '' }}</div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.type.' + event.type | 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 } }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.status.' + event.status | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.procedureProgress }} %</td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"[event.id]\"><th>{{ '@hvy.action.consult' | i18n }}</th></a>\n </td>\n </tr>\n </tbody>\n</table>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i8.PrySinceDatePipe, name: "sinceDate" }] }); }
395
+ 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 }); }
396
+ 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>{{ '@hvy.event.creationDate' | i18n }}</th>\n <th>{{ '@hvy.event.lastModificationDate' | i18n }}</th>\n <th>{{ '@hvy.event.status.name' | i18n }}</th>\n <th>{{ '@hvy.procedure.progress' | i18n }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"o-hvy-events-table__line\" *ngFor=\"let event of events$|async\" (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 } }}</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 </tbody>\n</table>\n", dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.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: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i9.PrySinceDatePipe, name: "sinceDate" }] }); }
136
397
  }
137
398
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
138
399
  type: Component,
139
- 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.type.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>{{ '@hvy.event.date' | i18n }}</th>\n <th>{{ '@hvy.event.dateM' | i18n }}</th>\n <th>{{ '@hvy.event.status.name' | i18n }}</th>\n <th>{{ '@hvy.procedure.name' | i18n }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"o-hvy-events-table__line\" *ngFor=\"let event of events$|async\">\n <td class=\"o-hvy-events-table__line__cell\" (click)=\"select(event, $event)\">\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__name__main\">{{ event.name }}</div>\n <div>{{ event.equipmentReference ? event.equipmentReference : '' }}</div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.type.' + event.type | 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 } }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.status.' + event.status | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.procedureProgress }} %</td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"[event.id]\"><th>{{ '@hvy.action.consult' | i18n }}</th></a>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
140
- }], ctorParameters: () => [{ type: i1.Store }] });
400
+ 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>{{ '@hvy.event.creationDate' | i18n }}</th>\n <th>{{ '@hvy.event.lastModificationDate' | i18n }}</th>\n <th>{{ '@hvy.event.status.name' | i18n }}</th>\n <th>{{ '@hvy.procedure.progress' | i18n }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"o-hvy-events-table__line\" *ngFor=\"let event of events$|async\" (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 } }}</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 </tbody>\n</table>\n" }]
401
+ }], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ElementRef }] });
141
402
 
142
403
  const EventSummaryActions = {
143
404
  load: createAction('[Event] Load Summaries'),
@@ -156,7 +417,7 @@ const eventSummaryInitialState = {
156
417
  summaries: { ...emptySummaries },
157
418
  loading: false,
158
419
  };
159
- const internalReducer$1 = createReducer(eventSummaryInitialState, on(EventSummaryActions.load, (state, action) => ({
420
+ const internalReducer = createReducer(eventSummaryInitialState, on(EventSummaryActions.load, (state, action) => ({
160
421
  ...state,
161
422
  loading: true
162
423
  })), on(EventSummaryActions.loadSuccess, (state, { summaries }) => ({
@@ -168,33 +429,31 @@ const internalReducer$1 = createReducer(eventSummaryInitialState, on(EventSummar
168
429
  loading: false
169
430
  })));
170
431
  function eventSummaryReducer(state, action) {
171
- return internalReducer$1(state, action);
432
+ return internalReducer(state, action);
172
433
  }
173
434
 
174
- const feature$1 = createFeatureSelector(eventSummaryFeatureKey);
175
- const summaries = createSelector(feature$1, (state) => state.summaries);
176
- const loading = createSelector(feature$1, (state) => state.loading);
435
+ const feature = createFeatureSelector(eventSummaryFeatureKey);
436
+ const summaries = createSelector(feature, (state) => state.summaries);
437
+ const loading = createSelector(feature, (state) => state.loading);
177
438
  const EventSummarySelectors = {
178
- feature: feature$1,
439
+ feature,
179
440
  summaries,
180
441
  loading
181
442
  };
182
443
 
183
444
  class EventSummaryItemComponent {
184
- constructor() {
445
+ constructor(store) {
446
+ this.store = store;
185
447
  this.linkBase = [];
186
- this.linkFragments = [];
448
+ this.EVENT_LINK = EVENT_LINK;
187
449
  }
188
- ngOnInit() {
189
- this.linkFragments = this.linkFragments.length > 0 ? [...this.linkBase, this.event.id] : ['list', this.event.id];
190
- }
191
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
192
- 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]=\"linkFragments\">\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.interventionRequestTitle\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.interventionRequestCount }}</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$1.DatePipe, name: "date" }] }); }
450
+ 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 }); }
451
+ 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.interventionRequestTitle\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.interventionRequestCount }}</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" }] }); }
193
452
  }
194
453
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, decorators: [{
195
454
  type: Component,
196
- args: [{ selector: 'hvy-event-summary-item', template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"linkFragments\">\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.interventionRequestTitle\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.interventionRequestCount }}</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" }]
197
- }], propDecorators: { event: [{
455
+ args: [{ selector: 'hvy-event-summary-item', 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.interventionRequestTitle\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.interventionRequestCount }}</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" }]
456
+ }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { event: [{
198
457
  type: Input,
199
458
  args: [{ required: true }]
200
459
  }], linkBase: [{
@@ -219,13 +478,13 @@ class EventSummaryListComponent {
219
478
  this.router.navigate([...this.consultLink]);
220
479
  this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
221
480
  }
222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1.Store }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
481
+ 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 }); }
223
482
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: { events: "events", totalEventCount: "totalEventCount", status: "status", consultLink: "consultLink", itemLinkBase: "itemLinkBase" }, ngImport: i0, template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n Consulter\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: ["event", "linkBase"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
224
483
  }
225
484
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, decorators: [{
226
485
  type: Component,
227
486
  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" }]
228
- }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }], propDecorators: { events: [{
487
+ }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Router }], propDecorators: { events: [{
229
488
  type: Input
230
489
  }], totalEventCount: [{
231
490
  type: Input
@@ -249,7 +508,7 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
249
508
  };
250
509
  this.criticalityList = ["LOW", "MEDIUM", "HIGH", "ALL"];
251
510
  this.store.dispatch(EventSummaryActions.load());
252
- this.selectedCriticality$ = this.store.select(EventSelectors.filters).pipe(map((filters) => filters['criticality']?.[0] ?? 'ALL'));
511
+ this.selectedCriticality$ = this.store.select(EventSelectors.filters).pipe(map$1((filters) => filters['criticality']?.[0] ?? 'ALL'));
253
512
  this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
254
513
  this.summaries = summaries;
255
514
  }));
@@ -262,13 +521,13 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
262
521
  asIsOrder() {
263
522
  return 0;
264
523
  }
265
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
266
- 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' | i18n }} :&nbsp;</label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: asIsOrder; track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: ["events", "totalEventCount", "status", "consultLink", "itemLinkBase"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }] }); }
524
+ 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 }); }
525
+ 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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.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" }] }); }
267
526
  }
268
527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
269
528
  type: Component,
270
- 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' | 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" }]
271
- }], ctorParameters: () => [{ type: i1.Store }], propDecorators: { pageTitle: [{
529
+ 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" }]
530
+ }], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { pageTitle: [{
272
531
  type: Input
273
532
  }] } });
274
533
 
@@ -281,9 +540,9 @@ const enTranslations = {
281
540
  name: 'Event',
282
541
  type: {
283
542
  name: 'Event type',
284
- ALERT: "Alert",
285
- REPORT: "Report",
286
- OPERATOR: "Operator",
543
+ ALERT: 'Alert',
544
+ REPORT: 'Report',
545
+ OPERATOR: 'Operator',
287
546
  },
288
547
  status: {
289
548
  name: 'Status',
@@ -292,8 +551,42 @@ const enTranslations = {
292
551
  DONE: 'Done',
293
552
  },
294
553
  address: 'Address',
295
- date: 'Effect date',
296
- dateM: 'Modification date',
554
+ source: 'External reference',
555
+ equipment: 'Equipment reference',
556
+ equipmentEntity: 'Equipment entity',
557
+ startDate: 'Start date',
558
+ endDate: 'End date',
559
+ creationDate: 'Creation date',
560
+ lastModificationDate: 'Modification date',
561
+ closeDate: 'Close date',
562
+ log: {
563
+ name: 'Events log',
564
+ event: {
565
+ description: 'Description',
566
+ address: 'Address',
567
+ detail: 'Information',
568
+ name: 'Name',
569
+ category: 'Category',
570
+ comments: {
571
+ name: 'Event comments',
572
+ placeholder: 'Write your comment',
573
+ },
574
+ },
575
+ procedure: {
576
+ delete: 'Delete procedure',
577
+ progress: 'Progress',
578
+ noAction: 'No actions',
579
+ name: 'Common procedure',
580
+ addAction: 'Add action'
581
+ },
582
+ },
583
+ category: {
584
+ ALERT: 'Dysfunction alert',
585
+ REPORT: 'GRC report',
586
+ OPERATOR: 'Operator event',
587
+ ALERT_LIMIT: 'Limit alert',
588
+ MANIFESTATION: 'Manifestation',
589
+ },
297
590
  },
298
591
  eventSummary: {
299
592
  noContent: 'No event with given criticality',
@@ -306,38 +599,82 @@ const enTranslations = {
306
599
  LOW: 'Low',
307
600
  MEDIUM: 'Medium',
308
601
  HIGH: 'High',
309
- ALL: 'All'
602
+ ALL: 'All',
310
603
  },
311
604
  },
312
605
  procedure: {
313
606
  name: 'Procedure',
607
+ progress: 'Procedure progress %',
314
608
  },
315
609
  action: {
316
- consult: "Consult"
317
- }
610
+ consult: 'Consult',
611
+ close: 'Close',
612
+ send: 'Send',
613
+ },
318
614
  },
319
615
  };
320
616
 
321
617
  const frTranslations = {
322
618
  '@hvy': {
323
619
  event: {
324
- criticality: 'Criticité',
325
620
  name: 'Évènement',
326
621
  type: {
327
622
  name: 'Type d\'évènement',
328
- ALERT: "Alerte",
329
- REPORT: "Signalement",
330
- OPERATOR: "Opérateur",
623
+ ALERT: 'Alerte',
624
+ REPORT: 'Signalement',
625
+ OPERATOR: 'Opérateur',
331
626
  },
332
627
  status: {
333
- name: 'Statut',
628
+ name: 'Statut évènement',
334
629
  NEW: 'Nouveau',
335
630
  IN_PROGRESS: 'En cours',
336
631
  DONE: 'Clôturé',
337
632
  },
338
633
  address: 'Adresse',
339
- date: 'Date d\'effet',
340
- dateM: 'Date de modification',
634
+ source: 'Référence externe',
635
+ equipment: 'Référence matériel',
636
+ equipmentEntity: 'Entité de l\'équipement',
637
+ startDate: 'Date de début',
638
+ endDate: 'Date de fin',
639
+ creationDate: 'Date de création',
640
+ lastModificationDate: 'Date dernières modifications',
641
+ closeDate: 'Date de clotûre',
642
+ log: {
643
+ name: 'Journal des évènements',
644
+ event: {
645
+ description: 'Description',
646
+ address: 'Adresse',
647
+ detail: 'Informations',
648
+ name: 'Nom',
649
+ category: 'Catégorie',
650
+ close: 'Clôturer tous ces évènements',
651
+ comments: {
652
+ name: 'Commentaires de l\'évènement',
653
+ placeholder: 'Écrivez votre commentaire'
654
+ }
655
+ },
656
+ procedure: {
657
+ delete: 'Supprimer la procédure',
658
+ progress: 'Progression',
659
+ noAction: 'Pas d\'action',
660
+ name: 'Procédure commune',
661
+ addAction: 'Ajouter une action'
662
+ },
663
+ },
664
+ category: {
665
+ name: "Catégorie d'évènement",
666
+ ALERT_MALFUNCTION: 'Alerte Dysfonctionnement',
667
+ REPORT: 'Signalement GRC',
668
+ OPERATOR: 'Evènement Opérateur',
669
+ ALERT_LIMIT: 'Alerte Seuil',
670
+ MANIFESTATION: 'Manifestation',
671
+ },
672
+ criticality: {
673
+ name: 'Criticité',
674
+ LOW: 'Bas',
675
+ MEDIUM: 'Moyen',
676
+ HIGH: 'Haut',
677
+ },
341
678
  },
342
679
  eventSummary: {
343
680
  noContent: 'Aucun évènement avec la criticité donnée',
@@ -350,24 +687,22 @@ const frTranslations = {
350
687
  LOW: 'Bas',
351
688
  MEDIUM: 'Moyen',
352
689
  HIGH: 'Haut',
353
- ALL: 'Tous'
690
+ ALL: 'Tous',
354
691
  },
355
692
  },
356
693
  procedure: {
357
694
  name: 'Procédure',
695
+ progress: '% avancement procédure'
358
696
  },
359
697
  action: {
360
- consult: "Consulter"
361
- }
362
- }
698
+ consult: 'Consulter',
699
+ close: 'Clotûrer',
700
+ send: 'Envoyer'
701
+ },
702
+ },
363
703
  };
364
704
 
365
- var HypEventCriticality;
366
- (function (HypEventCriticality) {
367
- HypEventCriticality[HypEventCriticality["LOW"] = 0] = "LOW";
368
- HypEventCriticality[HypEventCriticality["MEDIUM"] = 1] = "MEDIUM";
369
- HypEventCriticality[HypEventCriticality["HIGH"] = 2] = "HIGH";
370
- })(HypEventCriticality || (HypEventCriticality = {}));
705
+ const HypEventStatus = ['NEW', 'IN_PROGRESS', 'DONE'];
371
706
 
372
707
  var HypEventType;
373
708
  (function (HypEventType) {
@@ -380,35 +715,12 @@ var HypEventType;
380
715
  * Public API Surface of hypervisor
381
716
  */
382
717
 
383
- const HypervisorActions = {
384
- setUrl: createAction('[Event] Set Backend Url', props())
385
- };
386
-
387
- const hypFeatureKey = '@hvy/general';
388
- const hypInitialState = {
389
- url: '/api/hypervisor',
390
- };
391
- const internalReducer = createReducer(hypInitialState, on(HypervisorActions.setUrl, (state, action) => ({
392
- ...state,
393
- url: action.url ?? state.url,
394
- })));
395
- function hypervisorReducer(state, action) {
396
- return internalReducer(state, action);
397
- }
398
-
399
- const feature = createFeatureSelector(hypFeatureKey);
400
- const url = createSelector(feature, (state) => state.url);
401
- const HypSelectors = {
402
- feature,
403
- url
404
- };
405
-
406
718
  class EventService {
407
719
  constructor(httpClient, store) {
408
720
  this.httpClient = httpClient;
409
721
  this.store = store;
410
722
  }
411
- list() {
723
+ list(startWith = 0) {
412
724
  return this.store
413
725
  .select(HypSelectors.url)
414
726
  .pipe(withLatestFrom(this.store.select(EventSelectors.filters)), mergeMap(([url, filters]) => {
@@ -418,38 +730,57 @@ class EventService {
418
730
  params = params.set(filter, filterValue);
419
731
  });
420
732
  });
733
+ const pageSize = 20;
734
+ params = params.set('page', (startWith / pageSize) + 1);
421
735
  return this.httpClient.get(encodeURI(`${url}/events`), { params });
422
736
  }));
423
737
  }
424
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
738
+ get(id) {
739
+ return this.store
740
+ .select(HypSelectors.url)
741
+ .pipe(mergeMap((url) => {
742
+ return this.httpClient.get(encodeURI(`${url}/events/id/${id}`));
743
+ }));
744
+ }
745
+ getProcedure(id) {
746
+ return this.store
747
+ .select(HypSelectors.url)
748
+ .pipe(mergeMap((url) => {
749
+ return this.httpClient.get(encodeURI(`${url}/procedures/id/${id}`));
750
+ }));
751
+ }
752
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
425
753
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, providedIn: 'root' }); }
426
754
  }
427
755
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, decorators: [{
428
756
  type: Injectable,
429
757
  args: [{
430
- providedIn: 'root'
758
+ providedIn: 'root',
431
759
  }]
432
- }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
760
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
433
761
 
434
762
  class EventEffects {
435
- constructor(actions$, eventService) {
763
+ constructor(actions$, eventService, store) {
436
764
  this.actions$ = actions$;
437
765
  this.eventService = eventService;
438
- this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime(200), mergeMap$1((action) => this.eventService.list().pipe(map((events) => EventActions.loadSuccess({ events })), catchError((error) => [EventActions.loadFailure({ error: error })])))));
766
+ this.store = store;
767
+ this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime(200), withLatestFrom(this.store.select(EventSelectors.events), this.store.select(EventSelectors.noMoreEvents)), filter(([action, events, noMore]) => !noMore), mergeMap$1(([action, stateEvents]) => this.eventService.list(action.next ? stateEvents.length : 0).pipe(map$1((events) => EventActions.loadSuccess({ events, startingFrom: action.next ? stateEvents.length : 0 })), catchError((error) => [EventActions.loadFailure({ error: error })])))));
768
+ this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime(200), mergeMap$1((action) => this.eventService.get(action.id).pipe(map$1((event) => EventActions.getSuccess({ event })), catchError((error) => [EventActions.getFailure({ error: error })])))));
769
+ this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.getProcedure(action.id).pipe(map$1((procedure) => EventActions.getSuccess({ procedure })), catchError((error) => [EventActions.getFailure({ error: error })])))));
439
770
  }
440
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, deps: [{ token: i1$3.Actions }, { token: EventService }], target: i0.ɵɵFactoryTarget.Injectable }); }
771
+ 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 }); }
441
772
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
442
773
  }
443
774
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, decorators: [{
444
775
  type: Injectable
445
- }], ctorParameters: () => [{ type: i1$3.Actions }, { type: EventService }] });
776
+ }], ctorParameters: () => [{ type: i1$3.Actions }, { type: EventService }, { type: i1$1.Store }] });
446
777
 
447
778
  class HypervisorService {
448
779
  constructor(httpClient, store) {
449
780
  this.httpClient = httpClient;
450
781
  this.store = store;
451
782
  }
452
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
783
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
453
784
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, providedIn: 'root' }); }
454
785
  }
455
786
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, decorators: [{
@@ -457,7 +788,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
457
788
  args: [{
458
789
  providedIn: 'root'
459
790
  }]
460
- }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
791
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
461
792
 
462
793
  class HypervisorEffects {
463
794
  constructor(actions$, eventService) {
@@ -489,7 +820,7 @@ class EventSummaryService {
489
820
  return this.httpClient.get(encodeURI(`${url}/events/summary`), { params });
490
821
  }));
491
822
  }
492
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
823
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
493
824
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, providedIn: 'root' }); }
494
825
  }
495
826
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, decorators: [{
@@ -497,13 +828,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
497
828
  args: [{
498
829
  providedIn: 'root'
499
830
  }]
500
- }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
831
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
501
832
 
502
833
  class EventSummaryEffects {
503
834
  constructor(actions$, eventSummaryService) {
504
835
  this.actions$ = actions$;
505
836
  this.eventSummaryService = eventSummaryService;
506
- this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime(200), mergeMap$1((action) => this.eventSummaryService.list().pipe(map((summaries) => EventSummaryActions.loadSuccess({ summaries })), catchError((error) => [EventSummaryActions.loadFailure({ error: error })])))));
837
+ this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime(200), mergeMap$1((action) => this.eventSummaryService.list().pipe(map$1((summaries) => EventSummaryActions.loadSuccess({ summaries })), catchError((error) => [EventSummaryActions.loadFailure({ error: error })])))));
507
838
  }
508
839
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryEffects, deps: [{ token: i1$3.Actions }, { token: EventSummaryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
509
840
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryEffects }); }
@@ -519,7 +850,10 @@ const components = [
519
850
  EventSummaryItemComponent,
520
851
  EventSummaryListComponent,
521
852
  EventSummaryPageComponent,
522
- EventIconPipe
853
+ EventIconPipe,
854
+ ForDatetimeLocalPipe,
855
+ StatusDisplayComponent,
856
+ ProgressDisplayComponent
523
857
  ];
524
858
  class PvyHypervisorModule {
525
859
  static forRoot(options) {
@@ -538,14 +872,17 @@ class PvyHypervisorModule {
538
872
  this.i18nService.addLangObject('en', '@hvy', enTranslations);
539
873
  this.i18nService.addLangObject('fr', '@hvy', frTranslations);
540
874
  }
541
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, deps: [{ token: HYP_BASE_CONFIG }, { token: i1.Store }, { token: i3.PryI18nService }], target: i0.ɵɵFactoryTarget.NgModule }); }
875
+ 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 }); }
542
876
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, declarations: [EventDetailComponent,
543
877
  EventListComponent,
544
878
  IconDisplayComponent,
545
879
  EventSummaryItemComponent,
546
880
  EventSummaryListComponent,
547
881
  EventSummaryPageComponent,
548
- EventIconPipe], imports: [i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1$3.EffectsFeatureModule, NgForOf,
882
+ EventIconPipe,
883
+ ForDatetimeLocalPipe,
884
+ StatusDisplayComponent,
885
+ ProgressDisplayComponent], imports: [i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$3.EffectsFeatureModule, NgForOf,
549
886
  AsyncPipe,
550
887
  PryI18nModule,
551
888
  PryCoreModule,
@@ -560,13 +897,18 @@ class PvyHypervisorModule {
560
897
  PryIconModule,
561
898
  KeyValuePipe,
562
899
  PrySelectModule,
563
- FormsModule], exports: [EventDetailComponent,
900
+ FormsModule,
901
+ JsonPipe,
902
+ PryDatePickerModule], exports: [EventDetailComponent,
564
903
  EventListComponent,
565
904
  IconDisplayComponent,
566
905
  EventSummaryItemComponent,
567
906
  EventSummaryListComponent,
568
907
  EventSummaryPageComponent,
569
- EventIconPipe] }); }
908
+ EventIconPipe,
909
+ ForDatetimeLocalPipe,
910
+ StatusDisplayComponent,
911
+ ProgressDisplayComponent] }); }
570
912
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, imports: [StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
571
913
  StoreModule.forFeature(eventFeatureKey, eventReducer),
572
914
  StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
@@ -579,7 +921,8 @@ class PvyHypervisorModule {
579
921
  PrySinceDateModule,
580
922
  PryIconModule,
581
923
  PrySelectModule,
582
- FormsModule] }); }
924
+ FormsModule,
925
+ PryDatePickerModule] }); }
583
926
  }
584
927
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, decorators: [{
585
928
  type: NgModule,
@@ -607,7 +950,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
607
950
  PryIconModule,
608
951
  KeyValuePipe,
609
952
  PrySelectModule,
610
- FormsModule
953
+ FormsModule,
954
+ JsonPipe,
955
+ PryDatePickerModule,
611
956
  ],
612
957
  exports: [
613
958
  ...components
@@ -616,7 +961,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
616
961
  }], ctorParameters: () => [{ type: undefined, decorators: [{
617
962
  type: Inject,
618
963
  args: [HYP_BASE_CONFIG]
619
- }] }, { type: i1.Store }, { type: i3.PryI18nService }] });
964
+ }] }, { type: i1$1.Store }, { type: i3.PryI18nService }] });
620
965
 
621
966
  /*
622
967
  * Public API Surface of hypervisor
@@ -626,5 +971,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
626
971
  * Generated bundle index. Do not edit.
627
972
  */
628
973
 
629
- export { EVENT_TO_ICON, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, HYP_BASE_CONFIG, HypEventCriticality, HypEventType, IconDisplayComponent, PvyHypervisorModule, enTranslations, eventFeatureKey, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations };
974
+ export { EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer };
630
975
  //# sourceMappingURL=provoly-hypervisor.mjs.map