@provoly/hypervisor 0.0.8 → 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 +26 -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 +1 -1
  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 +3 -2
  30. package/esm2022/src/lib/store/event/event.effects.mjs +9 -5
  31. package/esm2022/src/lib/store/event/event.reducer.mjs +17 -13
  32. package/esm2022/src/lib/store/event/event.selectors.mjs +4 -2
  33. package/esm2022/src/lib/store/event/event.service.mjs +5 -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 +487 -176
  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 +10 -5
  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 +1 -1
  63. package/src/lib/model/hyp-equipment.interface.d.ts +5 -0
  64. package/src/lib/model/hyp-procedure.interface.d.ts +1 -1
  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 +13 -2
  69. package/src/lib/store/event/event.effects.d.ts +4 -1
  70. package/src/lib/store/event/event.reducer.d.ts +2 -1
  71. package/src/lib/store/event/event.selectors.d.ts +1 -0
  72. package/src/lib/store/event/event.service.d.ts +2 -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,45 +1,299 @@
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
+ }
28
266
  }
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" }); }
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
+ });
278
+ }
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: [{
286
+ type: Input
287
+ }], modified: [{
288
+ type: Output
289
+ }], events: [{
36
290
  type: Input
37
- }], procedure: [{
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()),
@@ -48,114 +302,103 @@ const EventActions = {
48
302
  getForProcedure: createAction('[Event] Load specific Event for procedure', props()),
49
303
  getSuccess: createAction('[Event Api] (bus) Get Events/Procedure Success', props()),
50
304
  getFailure: createAction('[Event Api] Get Events/Procedure Failure', props()),
305
+ save: createAction('[Event] Save Event', props()),
51
306
  };
52
307
 
53
308
  const eventFeatureKey = '@hvy/event';
54
309
  const eventInitialState = {
55
310
  events: [],
311
+ noMoreEvents: false,
56
312
  loading: false,
57
313
  filters: {},
58
314
  selectedIds: [],
59
- details: {}
315
+ details: {},
60
316
  };
61
- const internalReducer$2 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
62
- ...state,
63
- loading: true
64
- })), on(EventActions.loadSuccess, (state, { events }) => ({
317
+ const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
65
318
  ...state,
66
- loading: false,
67
- events
68
- })), on(EventActions.loadFailure, (state, action) => ({
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) => ({
69
328
  ...state,
70
329
  loading: false,
71
- events: []
330
+ events: [],
72
331
  })), on(EventActions.filter, (state, { filters }) => ({
73
332
  ...state,
74
- filters
333
+ filters,
75
334
  })), on(EventActions.select, (state, { ids, cumulative }) => ({
76
335
  ...state,
77
- 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), []),
78
337
  })), on(EventActions.get, EventActions.getForProcedure, (state, _) => ({
79
338
  ...state,
80
- details: {}
339
+ details: {},
81
340
  })), on(EventActions.getSuccess, (state, { event, procedure }) => ({
82
341
  ...state,
83
- details: { event, procedure }
342
+ details: { event, procedure },
84
343
  })));
85
344
  function eventReducer(state, action) {
86
- return internalReducer$2(state, action);
345
+ return internalReducer$1(state, action);
87
346
  }
88
347
 
89
- const feature$2 = createFeatureSelector(eventFeatureKey);
90
- const events = createSelector(feature$2, (state) => state.events);
91
- const selectedIds = createSelector(feature$2, (state) => state.selectedIds);
92
- const loading$1 = createSelector(feature$2, (state) => state.loading);
93
- const filters = createSelector(feature$2, (state) => state.filters);
94
- const details = createSelector(feature$2, (state) => state.details);
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);
95
355
  const EventSelectors = {
96
- feature: feature$2,
356
+ feature: feature$1,
97
357
  events,
98
358
  selectedIds,
99
359
  loading: loading$1,
100
360
  filters,
101
- details
361
+ details,
362
+ noMoreEvents
102
363
  };
103
364
 
104
- const EVENT_TO_ICON = {
105
- fn: (event, store) => of(DEFAULT_ICON_URL),
106
- };
107
- class EventIconPipe {
108
- constructor(store) {
109
- this.store = store;
110
- }
111
- transform(value, ...args) {
112
- return EVENT_TO_ICON.fn(value, this.store);
113
- }
114
- 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 }); }
115
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, name: "eventIcon" }); }
116
- }
117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, decorators: [{
118
- type: Pipe,
119
- args: [{
120
- name: 'eventIcon'
121
- }]
122
- }], ctorParameters: () => [{ type: i1.Store }] });
123
-
124
- class IconDisplayComponent {
125
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
126
- 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" }] }); }
127
- }
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, decorators: [{
129
- type: Component,
130
- 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" }]
131
- }], propDecorators: { event: [{
132
- type: Input
133
- }] } });
134
-
135
365
  const EVENT_LINK = {
136
366
  fn: (event, store) => ['./', event.id],
137
367
  };
138
- class EventListComponent {
139
- constructor(store) {
368
+ class EventListComponent extends SubscriptionnerDirective {
369
+ constructor(store, el) {
370
+ super();
140
371
  this.store = store;
372
+ this.el = el;
141
373
  this.EVENT_LINK = EVENT_LINK;
142
374
  this._store = this.store;
143
- this.store.dispatch(EventActions.load());
375
+ this.store.dispatch(EventActions.load({}));
144
376
  this.events$ = this.store.select(EventSelectors.events);
145
377
  this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
146
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
+ }
147
390
  select(event, $event) {
148
391
  this.store.dispatch(EventActions.select({ ids: [event.id], cumulative: true }));
149
392
  $event.preventDefault();
150
393
  $event.stopPropagation();
151
394
  }
152
- 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 }); }
153
- 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_LINK.fn(event, _store)\"><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" }] }); }
154
397
  }
155
398
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
156
399
  type: Component,
157
- 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_LINK.fn(event, _store)\"><th>{{ '@hvy.action.consult' | i18n }}</th></a>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
158
- }], 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 }] });
159
402
 
160
403
  const EventSummaryActions = {
161
404
  load: createAction('[Event] Load Summaries'),
@@ -174,7 +417,7 @@ const eventSummaryInitialState = {
174
417
  summaries: { ...emptySummaries },
175
418
  loading: false,
176
419
  };
177
- const internalReducer$1 = createReducer(eventSummaryInitialState, on(EventSummaryActions.load, (state, action) => ({
420
+ const internalReducer = createReducer(eventSummaryInitialState, on(EventSummaryActions.load, (state, action) => ({
178
421
  ...state,
179
422
  loading: true
180
423
  })), on(EventSummaryActions.loadSuccess, (state, { summaries }) => ({
@@ -186,33 +429,31 @@ const internalReducer$1 = createReducer(eventSummaryInitialState, on(EventSummar
186
429
  loading: false
187
430
  })));
188
431
  function eventSummaryReducer(state, action) {
189
- return internalReducer$1(state, action);
432
+ return internalReducer(state, action);
190
433
  }
191
434
 
192
- const feature$1 = createFeatureSelector(eventSummaryFeatureKey);
193
- const summaries = createSelector(feature$1, (state) => state.summaries);
194
- 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);
195
438
  const EventSummarySelectors = {
196
- feature: feature$1,
439
+ feature,
197
440
  summaries,
198
441
  loading
199
442
  };
200
443
 
201
444
  class EventSummaryItemComponent {
202
- constructor() {
445
+ constructor(store) {
446
+ this.store = store;
203
447
  this.linkBase = [];
204
- this.linkFragments = [];
205
- }
206
- ngOnInit() {
207
- this.linkFragments = this.linkFragments.length > 0 ? [...this.linkBase, this.event.id] : ['list', this.event.id];
448
+ this.EVENT_LINK = EVENT_LINK;
208
449
  }
209
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
210
- 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" }] }); }
211
452
  }
212
453
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, decorators: [{
213
454
  type: Component,
214
- 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" }]
215
- }], 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: [{
216
457
  type: Input,
217
458
  args: [{ required: true }]
218
459
  }], linkBase: [{
@@ -237,13 +478,13 @@ class EventSummaryListComponent {
237
478
  this.router.navigate([...this.consultLink]);
238
479
  this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
239
480
  }
240
- 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 }); }
241
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" }] }); }
242
483
  }
243
484
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, decorators: [{
244
485
  type: Component,
245
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" }]
246
- }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }], propDecorators: { events: [{
487
+ }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Router }], propDecorators: { events: [{
247
488
  type: Input
248
489
  }], totalEventCount: [{
249
490
  type: Input
@@ -267,7 +508,7 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
267
508
  };
268
509
  this.criticalityList = ["LOW", "MEDIUM", "HIGH", "ALL"];
269
510
  this.store.dispatch(EventSummaryActions.load());
270
- 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'));
271
512
  this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
272
513
  this.summaries = summaries;
273
514
  }));
@@ -280,13 +521,13 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
280
521
  asIsOrder() {
281
522
  return 0;
282
523
  }
283
- 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 }); }
284
- 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" }] }); }
285
526
  }
286
527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
287
528
  type: Component,
288
- 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" }]
289
- }], 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: [{
290
531
  type: Input
291
532
  }] } });
292
533
 
@@ -299,9 +540,9 @@ const enTranslations = {
299
540
  name: 'Event',
300
541
  type: {
301
542
  name: 'Event type',
302
- ALERT: "Alert",
303
- REPORT: "Report",
304
- OPERATOR: "Operator",
543
+ ALERT: 'Alert',
544
+ REPORT: 'Report',
545
+ OPERATOR: 'Operator',
305
546
  },
306
547
  status: {
307
548
  name: 'Status',
@@ -310,8 +551,42 @@ const enTranslations = {
310
551
  DONE: 'Done',
311
552
  },
312
553
  address: 'Address',
313
- date: 'Effect date',
314
- 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
+ },
315
590
  },
316
591
  eventSummary: {
317
592
  noContent: 'No event with given criticality',
@@ -324,38 +599,82 @@ const enTranslations = {
324
599
  LOW: 'Low',
325
600
  MEDIUM: 'Medium',
326
601
  HIGH: 'High',
327
- ALL: 'All'
602
+ ALL: 'All',
328
603
  },
329
604
  },
330
605
  procedure: {
331
606
  name: 'Procedure',
607
+ progress: 'Procedure progress %',
332
608
  },
333
609
  action: {
334
- consult: "Consult"
335
- }
610
+ consult: 'Consult',
611
+ close: 'Close',
612
+ send: 'Send',
613
+ },
336
614
  },
337
615
  };
338
616
 
339
617
  const frTranslations = {
340
618
  '@hvy': {
341
619
  event: {
342
- criticality: 'Criticité',
343
620
  name: 'Évènement',
344
621
  type: {
345
622
  name: 'Type d\'évènement',
346
- ALERT: "Alerte",
347
- REPORT: "Signalement",
348
- OPERATOR: "Opérateur",
623
+ ALERT: 'Alerte',
624
+ REPORT: 'Signalement',
625
+ OPERATOR: 'Opérateur',
349
626
  },
350
627
  status: {
351
- name: 'Statut',
628
+ name: 'Statut évènement',
352
629
  NEW: 'Nouveau',
353
630
  IN_PROGRESS: 'En cours',
354
631
  DONE: 'Clôturé',
355
632
  },
356
633
  address: 'Adresse',
357
- date: 'Date d\'effet',
358
- 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
+ },
359
678
  },
360
679
  eventSummary: {
361
680
  noContent: 'Aucun évènement avec la criticité donnée',
@@ -368,24 +687,22 @@ const frTranslations = {
368
687
  LOW: 'Bas',
369
688
  MEDIUM: 'Moyen',
370
689
  HIGH: 'Haut',
371
- ALL: 'Tous'
690
+ ALL: 'Tous',
372
691
  },
373
692
  },
374
693
  procedure: {
375
694
  name: 'Procédure',
695
+ progress: '% avancement procédure'
376
696
  },
377
697
  action: {
378
- consult: "Consulter"
379
- }
380
- }
698
+ consult: 'Consulter',
699
+ close: 'Clotûrer',
700
+ send: 'Envoyer'
701
+ },
702
+ },
381
703
  };
382
704
 
383
- var HypEventCriticality;
384
- (function (HypEventCriticality) {
385
- HypEventCriticality[HypEventCriticality["LOW"] = 0] = "LOW";
386
- HypEventCriticality[HypEventCriticality["MEDIUM"] = 1] = "MEDIUM";
387
- HypEventCriticality[HypEventCriticality["HIGH"] = 2] = "HIGH";
388
- })(HypEventCriticality || (HypEventCriticality = {}));
705
+ const HypEventStatus = ['NEW', 'IN_PROGRESS', 'DONE'];
389
706
 
390
707
  var HypEventType;
391
708
  (function (HypEventType) {
@@ -398,35 +715,12 @@ var HypEventType;
398
715
  * Public API Surface of hypervisor
399
716
  */
400
717
 
401
- const HypervisorActions = {
402
- setUrl: createAction('[Event] Set Backend Url', props())
403
- };
404
-
405
- const hypFeatureKey = '@hvy/general';
406
- const hypInitialState = {
407
- url: '/api/hypervisor',
408
- };
409
- const internalReducer = createReducer(hypInitialState, on(HypervisorActions.setUrl, (state, action) => ({
410
- ...state,
411
- url: action.url ?? state.url,
412
- })));
413
- function hypervisorReducer(state, action) {
414
- return internalReducer(state, action);
415
- }
416
-
417
- const feature = createFeatureSelector(hypFeatureKey);
418
- const url = createSelector(feature, (state) => state.url);
419
- const HypSelectors = {
420
- feature,
421
- url
422
- };
423
-
424
718
  class EventService {
425
719
  constructor(httpClient, store) {
426
720
  this.httpClient = httpClient;
427
721
  this.store = store;
428
722
  }
429
- list() {
723
+ list(startWith = 0) {
430
724
  return this.store
431
725
  .select(HypSelectors.url)
432
726
  .pipe(withLatestFrom(this.store.select(EventSelectors.filters)), mergeMap(([url, filters]) => {
@@ -436,6 +730,8 @@ class EventService {
436
730
  params = params.set(filter, filterValue);
437
731
  });
438
732
  });
733
+ const pageSize = 20;
734
+ params = params.set('page', (startWith / pageSize) + 1);
439
735
  return this.httpClient.get(encodeURI(`${url}/events`), { params });
440
736
  }));
441
737
  }
@@ -453,37 +749,38 @@ class EventService {
453
749
  return this.httpClient.get(encodeURI(`${url}/procedures/id/${id}`));
454
750
  }));
455
751
  }
456
- 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 }); }
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 }); }
457
753
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, providedIn: 'root' }); }
458
754
  }
459
755
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, decorators: [{
460
756
  type: Injectable,
461
757
  args: [{
462
- providedIn: 'root'
758
+ providedIn: 'root',
463
759
  }]
464
- }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
760
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
465
761
 
466
762
  class EventEffects {
467
- constructor(actions$, eventService) {
763
+ constructor(actions$, eventService, store) {
468
764
  this.actions$ = actions$;
469
765
  this.eventService = eventService;
470
- 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 })])))));
471
- this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime(200), mergeMap$1((action) => this.eventService.get(action.id).pipe(map((event) => EventActions.getSuccess({ event })), catchError((error) => [EventActions.getFailure({ error: error })])))));
472
- this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.getProcedure(action.id).pipe(map((procedure) => EventActions.getSuccess({ procedure })), catchError((error) => [EventActions.getFailure({ 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 })])))));
473
770
  }
474
- 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 }); }
475
772
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
476
773
  }
477
774
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, decorators: [{
478
775
  type: Injectable
479
- }], ctorParameters: () => [{ type: i1$3.Actions }, { type: EventService }] });
776
+ }], ctorParameters: () => [{ type: i1$3.Actions }, { type: EventService }, { type: i1$1.Store }] });
480
777
 
481
778
  class HypervisorService {
482
779
  constructor(httpClient, store) {
483
780
  this.httpClient = httpClient;
484
781
  this.store = store;
485
782
  }
486
- 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 }); }
487
784
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, providedIn: 'root' }); }
488
785
  }
489
786
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, decorators: [{
@@ -491,7 +788,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
491
788
  args: [{
492
789
  providedIn: 'root'
493
790
  }]
494
- }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
791
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
495
792
 
496
793
  class HypervisorEffects {
497
794
  constructor(actions$, eventService) {
@@ -523,7 +820,7 @@ class EventSummaryService {
523
820
  return this.httpClient.get(encodeURI(`${url}/events/summary`), { params });
524
821
  }));
525
822
  }
526
- 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 }); }
527
824
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, providedIn: 'root' }); }
528
825
  }
529
826
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, decorators: [{
@@ -531,13 +828,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
531
828
  args: [{
532
829
  providedIn: 'root'
533
830
  }]
534
- }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
831
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
535
832
 
536
833
  class EventSummaryEffects {
537
834
  constructor(actions$, eventSummaryService) {
538
835
  this.actions$ = actions$;
539
836
  this.eventSummaryService = eventSummaryService;
540
- 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 })])))));
541
838
  }
542
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 }); }
543
840
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryEffects }); }
@@ -553,7 +850,10 @@ const components = [
553
850
  EventSummaryItemComponent,
554
851
  EventSummaryListComponent,
555
852
  EventSummaryPageComponent,
556
- EventIconPipe
853
+ EventIconPipe,
854
+ ForDatetimeLocalPipe,
855
+ StatusDisplayComponent,
856
+ ProgressDisplayComponent
557
857
  ];
558
858
  class PvyHypervisorModule {
559
859
  static forRoot(options) {
@@ -572,14 +872,17 @@ class PvyHypervisorModule {
572
872
  this.i18nService.addLangObject('en', '@hvy', enTranslations);
573
873
  this.i18nService.addLangObject('fr', '@hvy', frTranslations);
574
874
  }
575
- 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 }); }
576
876
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, declarations: [EventDetailComponent,
577
877
  EventListComponent,
578
878
  IconDisplayComponent,
579
879
  EventSummaryItemComponent,
580
880
  EventSummaryListComponent,
581
881
  EventSummaryPageComponent,
582
- 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,
583
886
  AsyncPipe,
584
887
  PryI18nModule,
585
888
  PryCoreModule,
@@ -594,13 +897,18 @@ class PvyHypervisorModule {
594
897
  PryIconModule,
595
898
  KeyValuePipe,
596
899
  PrySelectModule,
597
- FormsModule], exports: [EventDetailComponent,
900
+ FormsModule,
901
+ JsonPipe,
902
+ PryDatePickerModule], exports: [EventDetailComponent,
598
903
  EventListComponent,
599
904
  IconDisplayComponent,
600
905
  EventSummaryItemComponent,
601
906
  EventSummaryListComponent,
602
907
  EventSummaryPageComponent,
603
- EventIconPipe] }); }
908
+ EventIconPipe,
909
+ ForDatetimeLocalPipe,
910
+ StatusDisplayComponent,
911
+ ProgressDisplayComponent] }); }
604
912
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, imports: [StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
605
913
  StoreModule.forFeature(eventFeatureKey, eventReducer),
606
914
  StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
@@ -613,7 +921,8 @@ class PvyHypervisorModule {
613
921
  PrySinceDateModule,
614
922
  PryIconModule,
615
923
  PrySelectModule,
616
- FormsModule] }); }
924
+ FormsModule,
925
+ PryDatePickerModule] }); }
617
926
  }
618
927
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, decorators: [{
619
928
  type: NgModule,
@@ -641,7 +950,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
641
950
  PryIconModule,
642
951
  KeyValuePipe,
643
952
  PrySelectModule,
644
- FormsModule
953
+ FormsModule,
954
+ JsonPipe,
955
+ PryDatePickerModule,
645
956
  ],
646
957
  exports: [
647
958
  ...components
@@ -650,7 +961,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
650
961
  }], ctorParameters: () => [{ type: undefined, decorators: [{
651
962
  type: Inject,
652
963
  args: [HYP_BASE_CONFIG]
653
- }] }, { type: i1.Store }, { type: i3.PryI18nService }] });
964
+ }] }, { type: i1$1.Store }, { type: i3.PryI18nService }] });
654
965
 
655
966
  /*
656
967
  * Public API Surface of hypervisor
@@ -660,5 +971,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
660
971
  * Generated bundle index. Do not edit.
661
972
  */
662
973
 
663
- export { EVENT_LINK, 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 };
664
975
  //# sourceMappingURL=provoly-hypervisor.mjs.map