@provoly/hypervisor 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/lib/event/detail/event-detail.component.mjs +81 -20
- package/esm2022/src/lib/event/list/event-list.component.mjs +9 -9
- package/esm2022/src/lib/event-summary/item/event-summary-item.component.mjs +3 -3
- package/esm2022/src/lib/general/for-datetime-local-pipe/for-datetime-local.pipe.mjs +1 -1
- package/esm2022/src/lib/general/i18n/en.translations.mjs +2 -1
- package/esm2022/src/lib/general/i18n/fr.translations.mjs +3 -1
- package/esm2022/src/lib/hypervisor.module.mjs +9 -3
- package/esm2022/src/lib/model/event/hyp-event-category.type.mjs +9 -2
- package/esm2022/src/lib/model/event/hyp-event-criticality.type.mjs +4 -2
- package/esm2022/src/lib/model/event/hyp-event-detail.interface.mjs +5 -2
- package/esm2022/src/lib/model/event/hyp-event-status.type.mjs +4 -2
- package/esm2022/src/lib/model/event/hyp-event-summary.interface.mjs +1 -1
- package/esm2022/src/lib/model/event/hyp-event-type.mjs +2 -7
- package/esm2022/src/lib/model/hyp-procedure.interface.mjs +6 -2
- package/esm2022/src/lib/store/equipment/equipment.service.mjs +2 -5
- package/esm2022/src/lib/store/event/event.actions.mjs +4 -1
- package/esm2022/src/lib/store/event/event.effects.mjs +11 -3
- package/esm2022/src/lib/store/event/event.service.mjs +19 -3
- package/fesm2022/provoly-hypervisor.mjs +167 -60
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +2 -2
- package/src/lib/event/detail/event-detail.component.d.ts +20 -3
- package/src/lib/event/list/event-list.component.d.ts +1 -1
- package/src/lib/general/for-datetime-local-pipe/for-datetime-local.pipe.d.ts +1 -1
- package/src/lib/general/i18n/en.translations.d.ts +1 -0
- package/src/lib/general/i18n/fr.translations.d.ts +2 -0
- package/src/lib/hypervisor.module.d.ts +1 -1
- package/src/lib/model/event/hyp-event-category.type.d.ts +6 -1
- package/src/lib/model/event/hyp-event-criticality.type.d.ts +3 -1
- package/src/lib/model/event/hyp-event-detail.interface.d.ts +29 -2
- package/src/lib/model/event/hyp-event-status.type.d.ts +3 -1
- package/src/lib/model/event/hyp-event-summary.interface.d.ts +2 -2
- package/src/lib/model/event/hyp-event-type.d.ts +3 -5
- package/src/lib/model/hyp-procedure.interface.d.ts +35 -0
- package/src/lib/store/event/event.actions.d.ts +15 -0
- package/src/lib/store/event/event.effects.d.ts +3 -0
- package/src/lib/store/event/event.service.d.ts +4 -2
- package/styles/components/_o-hvy-events-table.scss +9 -0
|
@@ -2,18 +2,18 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Pipe, Component, Input, EventEmitter, Output, InjectionToken, NgModule, Inject } from '@angular/core';
|
|
3
3
|
import * as i3 from '@provoly/dashboard';
|
|
4
4
|
import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
|
|
5
|
-
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
5
|
import * as i1$1 from '@ngrx/store';
|
|
9
6
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
10
|
-
import
|
|
7
|
+
import { mergeMap, of, fromEvent, map, withLatestFrom, filter, auditTime } from 'rxjs';
|
|
8
|
+
import * as i1 from '@angular/common/http';
|
|
9
|
+
import { HttpParams } from '@angular/common/http';
|
|
10
|
+
import * as i3$1 from '@provoly/dashboard/components/checkbox';
|
|
11
11
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i4 from '@angular/forms';
|
|
13
13
|
import { FormsModule } from '@angular/forms';
|
|
14
14
|
import * as i1$2 from '@angular/common';
|
|
15
15
|
import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe, JsonPipe } from '@angular/common';
|
|
16
|
-
import * as i2
|
|
16
|
+
import * as i2 from '@angular/router';
|
|
17
17
|
import { RouterLink } from '@angular/router';
|
|
18
18
|
import * as i9 from '@provoly/dashboard/components/sinceDate';
|
|
19
19
|
import { PrySinceDateModule } from '@provoly/dashboard/components/sinceDate';
|
|
@@ -21,14 +21,42 @@ import { map as map$1, debounceTime, mergeMap as mergeMap$1, catchError } from '
|
|
|
21
21
|
import * as i1$3 from '@ngrx/effects';
|
|
22
22
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const HypEventCriticality = {
|
|
25
|
+
values: ['LOW', 'MEDIUM', 'HIGH'],
|
|
26
|
+
};
|
|
27
27
|
|
|
28
28
|
const DOMAINS = {
|
|
29
29
|
values: ['DOMAIN1', 'DOMAIN2'],
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
const HypEventCategory = {
|
|
33
|
+
values: ['ALERT_MALFUNCTION', 'REPORT', 'OPERATOR_EVENT', 'ALERT_LIMIT', 'MANIFESTATION'],
|
|
34
|
+
};
|
|
35
|
+
const CATEGORIES_BY_TYPE = {
|
|
36
|
+
'OPERATOR': ['OPERATOR_EVENT', 'MANIFESTATION'],
|
|
37
|
+
'ALERT': ['ALERT_MALFUNCTION', 'ALERT_LIMIT'],
|
|
38
|
+
'REPORT': ['REPORT'],
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const EventActions = {
|
|
42
|
+
load: createAction('[Event] Load Events', props()),
|
|
43
|
+
loadSuccess: createAction('[Event Api] (bus) Load Events Success', props()),
|
|
44
|
+
loadFailure: createAction('[Event Api] Load Events Failure', props()),
|
|
45
|
+
filter: createAction('[Event Api] Set filters', props()),
|
|
46
|
+
select: createAction('[Event Api] Select', props()),
|
|
47
|
+
get: createAction('[Event] Load specific Event', props()),
|
|
48
|
+
getForProcedure: createAction('[Event] Load specific Event for procedure', props()),
|
|
49
|
+
getSuccess: createAction('[Event Api] (bus) Get Events/Procedure Success', props()),
|
|
50
|
+
getFailure: createAction('[Event Api] Get Events/Procedure Failure', props()),
|
|
51
|
+
save: createAction('[Event] Save Event', props()),
|
|
52
|
+
saveProcedure: createAction('[Event] Save Procedure and linked Events', props()),
|
|
53
|
+
saveSuccess: createAction('[Event] Save success', props()),
|
|
54
|
+
saveFailure: createAction('[Event] Save failure', props()),
|
|
55
|
+
status: createAction('[Event] Close Event or Procedure', props()),
|
|
56
|
+
statusSuccess: createAction('[Event] Close success'),
|
|
57
|
+
statusFailure: createAction('[Event] Close failure', props()),
|
|
58
|
+
};
|
|
59
|
+
|
|
32
60
|
const HypervisorActions = {
|
|
33
61
|
setUrl: createAction('[Event] Set Backend Url', props())
|
|
34
62
|
};
|
|
@@ -61,9 +89,7 @@ class EquipmentService {
|
|
|
61
89
|
return this.store
|
|
62
90
|
.select(HypSelectors.url)
|
|
63
91
|
.pipe(mergeMap((url) => {
|
|
64
|
-
|
|
65
|
-
params = params.set('name', name);
|
|
66
|
-
return this.httpClient.get(encodeURI(`${url}/equipment`), { params });
|
|
92
|
+
return this.httpClient.get(encodeURI(`${url}/equipments/name/${name}`));
|
|
67
93
|
}));
|
|
68
94
|
}
|
|
69
95
|
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 }); }
|
|
@@ -199,38 +225,45 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
199
225
|
this.procedureModifications = {};
|
|
200
226
|
this._outputModifications();
|
|
201
227
|
}
|
|
202
|
-
constructor(equipmentService) {
|
|
228
|
+
constructor(equipmentService, store) {
|
|
203
229
|
super();
|
|
204
230
|
this.equipmentService = equipmentService;
|
|
231
|
+
this.store = store;
|
|
205
232
|
this.opened = [];
|
|
206
|
-
this.
|
|
207
|
-
this.criticalities = HypEventCriticality;
|
|
233
|
+
this.criticalities = HypEventCriticality.values;
|
|
208
234
|
this._events = [];
|
|
209
235
|
this.eventModifications = [];
|
|
210
236
|
this.modifiedEvents = new EventEmitter();
|
|
211
237
|
this.procedureModifications = {};
|
|
212
238
|
this.modifiedProcedure = new EventEmitter();
|
|
213
239
|
this.DOMAINS = DOMAINS.values;
|
|
240
|
+
this.eventErrors = new EventEmitter();
|
|
241
|
+
this.errors = [];
|
|
214
242
|
}
|
|
215
243
|
get events() {
|
|
216
244
|
return this._events.map((evt, idx) => ({ ...evt, ...(this.eventModifications[idx] ?? {}) }));
|
|
217
245
|
}
|
|
218
246
|
get procedure() {
|
|
219
|
-
return this._procedure ? ({
|
|
247
|
+
return this._procedure ? ({
|
|
248
|
+
...this._procedure, ...(this.procedureModifications ?? {}),
|
|
249
|
+
events: this.events,
|
|
250
|
+
}) : undefined;
|
|
220
251
|
}
|
|
221
252
|
toggle(i) {
|
|
222
253
|
this.opened[i] = !this.opened[i];
|
|
223
254
|
}
|
|
224
255
|
modifyEvent(index, prop, $event) {
|
|
256
|
+
const isDate = prop.indexOf('Date') > -1;
|
|
225
257
|
// @ts-ignore
|
|
226
258
|
const newValue = $event instanceof Event ? $event.target?.value : $event;
|
|
259
|
+
const correctedValue = !isDate ? newValue : `${newValue}:00.000000Z`;
|
|
227
260
|
// @ts-ignore
|
|
228
|
-
if (this.
|
|
261
|
+
if (this.events[index][prop] !== correctedValue) {
|
|
229
262
|
if (!this.eventModifications[index]) {
|
|
230
263
|
this.eventModifications[index] = {};
|
|
231
264
|
}
|
|
232
265
|
// @ts-ignore
|
|
233
|
-
this.eventModifications[index][prop] =
|
|
266
|
+
this.eventModifications[index][prop] = correctedValue;
|
|
234
267
|
this._outputModifications();
|
|
235
268
|
}
|
|
236
269
|
}
|
|
@@ -291,19 +324,71 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
291
324
|
});
|
|
292
325
|
}
|
|
293
326
|
_outputModifications() {
|
|
294
|
-
this.
|
|
327
|
+
this.validateEvents(this.events);
|
|
328
|
+
this.modifiedEvents.next(this.events.map((ev, idx) => [this.eventModifications[idx], ev]));
|
|
295
329
|
this.modifiedProcedure.next(this.procedure ? [this.procedureModifications, this.procedure] : undefined);
|
|
296
330
|
}
|
|
297
|
-
|
|
298
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure", cancelModifications: "cancelModifications" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure" }, 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)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\" [items]=\"categories\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"></pry-select>\n </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)=\"modifyEvent(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)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: 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" }] }); }
|
|
331
|
+
validateEvents(events) {
|
|
332
|
+
this.errors = [];
|
|
333
|
+
events.forEach(event => {
|
|
334
|
+
const eventErrors = [];
|
|
335
|
+
if (!event.name || event.name.length === 0) {
|
|
336
|
+
eventErrors.push({ field: 'name', code: 'required' });
|
|
337
|
+
}
|
|
338
|
+
if (!event.category || event.category.length === 0) {
|
|
339
|
+
eventErrors.push({ field: 'category', code: 'required' });
|
|
340
|
+
}
|
|
341
|
+
if (!event.criticality || event.criticality.length === 0) {
|
|
342
|
+
eventErrors.push({ field: 'criticality', code: 'required' });
|
|
343
|
+
}
|
|
344
|
+
if (!event.description || event.description.length === 0) {
|
|
345
|
+
eventErrors.push({ field: 'description', code: 'required' });
|
|
346
|
+
}
|
|
347
|
+
if (event.category === 'MANIFESTATION') {
|
|
348
|
+
if (!event.startDate || event.startDate.length === 0) {
|
|
349
|
+
eventErrors.push({ field: 'startDate', code: 'required' });
|
|
350
|
+
}
|
|
351
|
+
if (!event.endDate || event.endDate.length === 0) {
|
|
352
|
+
eventErrors.push({ field: 'endDate', code: 'required' });
|
|
353
|
+
}
|
|
354
|
+
if ((event.startDate?.localeCompare(event.endDate ?? '') ?? 0) > 0) {
|
|
355
|
+
eventErrors.push({ field: 'startDate', code: 'before' });
|
|
356
|
+
eventErrors.push({ field: 'endDate', code: 'after' });
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
this.errors.push(eventErrors);
|
|
360
|
+
});
|
|
361
|
+
this.eventErrors.next(this.errors);
|
|
362
|
+
}
|
|
363
|
+
hasError(prop, idx) {
|
|
364
|
+
return this.errors[idx]?.find(err => err.field === prop) ?? false;
|
|
365
|
+
}
|
|
366
|
+
categories(event) {
|
|
367
|
+
return CATEGORIES_BY_TYPE[event.type];
|
|
368
|
+
}
|
|
369
|
+
changeStatus($event, event) {
|
|
370
|
+
this.store.dispatch(EventActions.status({ targetStatus: $event, event: event }));
|
|
371
|
+
}
|
|
372
|
+
closeAll() {
|
|
373
|
+
if (!this.procedure) {
|
|
374
|
+
this.store.dispatch(EventActions.status({ targetStatus: 'DONE', event: this.events[0] }));
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
this.store.dispatch(EventActions.status({ targetStatus: 'DONE', procedure: this.procedure }));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
381
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure", cancelModifications: "cancelModifications" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\" (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\" (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
299
382
|
}
|
|
300
383
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
301
384
|
type: Component,
|
|
302
|
-
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)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\" [items]=\"categories\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"></pry-select>\n </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)=\"modifyEvent(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)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
303
|
-
}], ctorParameters: () => [{ type: EquipmentService }], propDecorators: { modifiedEvents: [{
|
|
385
|
+
args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\" (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\" (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
386
|
+
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }], propDecorators: { modifiedEvents: [{
|
|
304
387
|
type: Output
|
|
305
388
|
}], modifiedProcedure: [{
|
|
306
389
|
type: Output
|
|
390
|
+
}], eventErrors: [{
|
|
391
|
+
type: Output
|
|
307
392
|
}], events: [{
|
|
308
393
|
type: Input
|
|
309
394
|
}], procedure: [{
|
|
@@ -312,22 +397,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
312
397
|
type: Input
|
|
313
398
|
}] } });
|
|
314
399
|
|
|
315
|
-
const EventActions = {
|
|
316
|
-
load: createAction('[Event] Load Events', props()),
|
|
317
|
-
loadSuccess: createAction('[Event Api] (bus) Load Events Success', props()),
|
|
318
|
-
loadFailure: createAction('[Event Api] Load Events Failure', props()),
|
|
319
|
-
filter: createAction('[Event Api] Set filters', props()),
|
|
320
|
-
select: createAction('[Event Api] Select', props()),
|
|
321
|
-
get: createAction('[Event] Load specific Event', props()),
|
|
322
|
-
getForProcedure: createAction('[Event] Load specific Event for procedure', props()),
|
|
323
|
-
getSuccess: createAction('[Event Api] (bus) Get Events/Procedure Success', props()),
|
|
324
|
-
getFailure: createAction('[Event Api] Get Events/Procedure Failure', props()),
|
|
325
|
-
save: createAction('[Event] Save Event', props()),
|
|
326
|
-
saveProcedure: createAction('[Event] Save Procedure and linked Events', props()),
|
|
327
|
-
saveSuccess: createAction('[Event] Save success', props()),
|
|
328
|
-
saveFailure: createAction('[Event] Save failure', props()),
|
|
329
|
-
};
|
|
330
|
-
|
|
331
400
|
const eventFeatureKey = '@hvy/event';
|
|
332
401
|
const eventInitialState = {
|
|
333
402
|
events: [],
|
|
@@ -416,11 +485,11 @@ class EventListComponent extends SubscriptionnerDirective {
|
|
|
416
485
|
$event.stopPropagation();
|
|
417
486
|
}
|
|
418
487
|
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 }); }
|
|
419
|
-
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
|
|
488
|
+
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 @for (event of events$|async;track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"select(event, $event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__cell__name__main\">{{ event.name }}</div>\n <div\n class=\"o-hvy-events-table__line__cell__name__sub\">{{ event.equipment?.name ? event.equipment?.name : '' }}\n </div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.category.' + event.category | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-status-display [event]=\"event\"></hvy-status-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n {{ event.procedureProgress }} %\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"EVENT_LINK.fn(event, _store)\">\n > {{ '@hvy.action.consult' | i18n }} @if (event.linkedEvents > 1) {\n ({{ event.linkedEvents }})\n }\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.event.log.empty' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i9.PrySinceDatePipe, name: "sinceDate" }] }); }
|
|
420
489
|
}
|
|
421
490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
|
|
422
491
|
type: Component,
|
|
423
|
-
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
|
|
492
|
+
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 @for (event of events$|async;track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"select(event, $event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__cell__name__main\">{{ event.name }}</div>\n <div\n class=\"o-hvy-events-table__line__cell__name__sub\">{{ event.equipment?.name ? event.equipment?.name : '' }}\n </div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.category.' + event.category | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-status-display [event]=\"event\"></hvy-status-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n {{ event.procedureProgress }} %\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"EVENT_LINK.fn(event, _store)\">\n > {{ '@hvy.action.consult' | i18n }} @if (event.linkedEvents > 1) {\n ({{ event.linkedEvents }})\n }\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.event.log.empty' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n</table>\n" }]
|
|
424
493
|
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ElementRef }] });
|
|
425
494
|
|
|
426
495
|
const EventSummaryActions = {
|
|
@@ -471,11 +540,11 @@ class EventSummaryItemComponent {
|
|
|
471
540
|
this.EVENT_LINK = EVENT_LINK;
|
|
472
541
|
}
|
|
473
542
|
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 }); }
|
|
474
|
-
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.
|
|
543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: { event: "event", linkBase: "linkBase" }, ngImport: i0, template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.serviceTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.serviceCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
|
|
475
544
|
}
|
|
476
545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, decorators: [{
|
|
477
546
|
type: Component,
|
|
478
|
-
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.
|
|
547
|
+
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.serviceTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.serviceCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n" }]
|
|
479
548
|
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { event: [{
|
|
480
549
|
type: Input,
|
|
481
550
|
args: [{ required: true }]
|
|
@@ -501,13 +570,13 @@ class EventSummaryListComponent {
|
|
|
501
570
|
this.router.navigate([...this.consultLink]);
|
|
502
571
|
this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
|
|
503
572
|
}
|
|
504
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1$1.Store }, { token: i2
|
|
573
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1$1.Store }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
505
574
|
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" }] }); }
|
|
506
575
|
}
|
|
507
576
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, decorators: [{
|
|
508
577
|
type: Component,
|
|
509
578
|
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" }]
|
|
510
|
-
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i2
|
|
579
|
+
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i2.Router }], propDecorators: { events: [{
|
|
511
580
|
type: Input
|
|
512
581
|
}], totalEventCount: [{
|
|
513
582
|
type: Input
|
|
@@ -545,7 +614,7 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
|
|
|
545
614
|
return 0;
|
|
546
615
|
}
|
|
547
616
|
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 }); }
|
|
548
|
-
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 }} : </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:
|
|
617
|
+
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 }} : </label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: asIsOrder; track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: ["events", "totalEventCount", "status", "consultLink", "itemLinkBase"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$2.KeyValuePipe, name: "keyvalue" }] }); }
|
|
549
618
|
}
|
|
550
619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
|
|
551
620
|
type: Component,
|
|
@@ -585,6 +654,7 @@ const enTranslations = {
|
|
|
585
654
|
creationDate: 'Creation date',
|
|
586
655
|
lastModificationDate: 'Modification date',
|
|
587
656
|
closeDate: 'Close date',
|
|
657
|
+
detail: "Events description",
|
|
588
658
|
log: {
|
|
589
659
|
name: 'Events log',
|
|
590
660
|
event: {
|
|
@@ -668,8 +738,10 @@ const frTranslations = {
|
|
|
668
738
|
creationDate: 'Date de création',
|
|
669
739
|
lastModificationDate: 'Date dernières modifications',
|
|
670
740
|
closeDate: 'Date de clotûre',
|
|
741
|
+
detail: "Description des évènements",
|
|
671
742
|
log: {
|
|
672
743
|
name: 'Journal des évènements',
|
|
744
|
+
empty: 'Aucun évènement n\'a été créé',
|
|
673
745
|
event: {
|
|
674
746
|
description: 'Description',
|
|
675
747
|
address: 'Adresse',
|
|
@@ -731,14 +803,21 @@ const frTranslations = {
|
|
|
731
803
|
},
|
|
732
804
|
};
|
|
733
805
|
|
|
734
|
-
const
|
|
806
|
+
const eventForWriteAPI = (event) => ({
|
|
807
|
+
...event,
|
|
808
|
+
equipmentId: event.equipment?.id
|
|
809
|
+
});
|
|
810
|
+
|
|
811
|
+
const HypEventStatus = {
|
|
812
|
+
values: ['NEW', 'IN_PROGRESS', 'DONE'],
|
|
813
|
+
};
|
|
735
814
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
})
|
|
815
|
+
const HypEventType = { values: ['ALERT', 'REPORT', 'OPERATOR'] };
|
|
816
|
+
|
|
817
|
+
const procedureForWriteAPI = (procedure) => ({
|
|
818
|
+
...procedure,
|
|
819
|
+
events: procedure.events.map(eventForWriteAPI)
|
|
820
|
+
});
|
|
742
821
|
|
|
743
822
|
/*
|
|
744
823
|
* Public API Surface of hypervisor
|
|
@@ -782,14 +861,28 @@ class EventService {
|
|
|
782
861
|
return this.store
|
|
783
862
|
.select(HypSelectors.url)
|
|
784
863
|
.pipe(mergeMap((url) => {
|
|
785
|
-
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), event);
|
|
864
|
+
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), eventForWriteAPI(event));
|
|
786
865
|
}));
|
|
787
866
|
}
|
|
788
867
|
saveProcedure(procedure) {
|
|
789
868
|
return this.store
|
|
790
869
|
.select(HypSelectors.url)
|
|
791
870
|
.pipe(mergeMap((url) => {
|
|
792
|
-
return this.httpClient.post(encodeURI(`${url}/procedures`), procedure);
|
|
871
|
+
return this.httpClient.post(encodeURI(`${url}/procedures`), procedureForWriteAPI(procedure));
|
|
872
|
+
}));
|
|
873
|
+
}
|
|
874
|
+
status(event, status) {
|
|
875
|
+
return this.store
|
|
876
|
+
.select(HypSelectors.url)
|
|
877
|
+
.pipe(mergeMap((url) => {
|
|
878
|
+
return this.httpClient.put(encodeURI(`${url}/events/id/${event.id}/close`), { status });
|
|
879
|
+
}));
|
|
880
|
+
}
|
|
881
|
+
statusProcedure(procedure, status) {
|
|
882
|
+
return this.store
|
|
883
|
+
.select(HypSelectors.url)
|
|
884
|
+
.pipe(mergeMap((url) => {
|
|
885
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}/close`), { status });
|
|
793
886
|
}));
|
|
794
887
|
}
|
|
795
888
|
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 }); }
|
|
@@ -810,8 +903,16 @@ class EventEffects {
|
|
|
810
903
|
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 })])))));
|
|
811
904
|
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 })])))));
|
|
812
905
|
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 })])))));
|
|
813
|
-
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map$1((event) => EventActions.saveSuccess({ event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
814
|
-
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.saveProcedure(action.procedure).pipe(map$1((procedure) => EventActions.saveSuccess({ procedure })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
906
|
+
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map$1((event) => EventActions.saveSuccess({ event: action.event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
907
|
+
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.saveProcedure(action.procedure).pipe(map$1((procedure) => EventActions.saveSuccess({ procedure: action.procedure })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
908
|
+
this.close$ = createEffect(() => this.actions$.pipe(ofType(EventActions.status), debounceTime(200), mergeMap$1((action) => {
|
|
909
|
+
if (!!action.event) {
|
|
910
|
+
return this.eventService.status(action.event, action.targetStatus).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
return this.eventService.statusProcedure(action.procedure, action.targetStatus).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
914
|
+
}
|
|
915
|
+
})));
|
|
815
916
|
}
|
|
816
917
|
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 }); }
|
|
817
918
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
|
|
@@ -944,7 +1045,9 @@ class PvyHypervisorModule {
|
|
|
944
1045
|
PrySelectModule,
|
|
945
1046
|
FormsModule,
|
|
946
1047
|
JsonPipe,
|
|
947
|
-
PryDatePickerModule
|
|
1048
|
+
PryDatePickerModule,
|
|
1049
|
+
PryI18nModule,
|
|
1050
|
+
PryIconModule], exports: [EventDetailComponent,
|
|
948
1051
|
EventListComponent,
|
|
949
1052
|
IconDisplayComponent,
|
|
950
1053
|
EventSummaryItemComponent,
|
|
@@ -967,7 +1070,9 @@ class PvyHypervisorModule {
|
|
|
967
1070
|
PryIconModule,
|
|
968
1071
|
PrySelectModule,
|
|
969
1072
|
FormsModule,
|
|
970
|
-
PryDatePickerModule
|
|
1073
|
+
PryDatePickerModule,
|
|
1074
|
+
PryI18nModule,
|
|
1075
|
+
PryIconModule] }); }
|
|
971
1076
|
}
|
|
972
1077
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, decorators: [{
|
|
973
1078
|
type: NgModule,
|
|
@@ -998,6 +1103,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
998
1103
|
FormsModule,
|
|
999
1104
|
JsonPipe,
|
|
1000
1105
|
PryDatePickerModule,
|
|
1106
|
+
PryI18nModule,
|
|
1107
|
+
PryIconModule,
|
|
1001
1108
|
],
|
|
1002
1109
|
exports: [
|
|
1003
1110
|
...components
|
|
@@ -1016,5 +1123,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
1016
1123
|
* Generated bundle index. Do not edit.
|
|
1017
1124
|
*/
|
|
1018
1125
|
|
|
1019
|
-
export { DOMAINS, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer };
|
|
1126
|
+
export { CATEGORIES_BY_TYPE, DOMAINS, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, procedureForWriteAPI };
|
|
1020
1127
|
//# sourceMappingURL=provoly-hypervisor.mjs.map
|