@provoly/hypervisor 0.0.22 → 0.0.24
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/assets/svgs/i.svg +18 -0
- package/esm2022/src/lib/event/detail/event-detail.component.mjs +92 -32
- package/esm2022/src/lib/event/filters/choice/choice-filter.component.mjs +21 -21
- package/esm2022/src/lib/event/filters/date/date-filter.component.mjs +7 -9
- package/esm2022/src/lib/event/filters/event-filters.component.mjs +14 -9
- package/esm2022/src/lib/event/filters/hvy-unit-filter.class.mjs +21 -1
- package/esm2022/src/lib/event/list/event-list.component.mjs +22 -16
- package/esm2022/src/lib/event-summary/list/event-summary-list.component.mjs +4 -3
- package/esm2022/src/lib/event-summary/page/event-summary-page.component.mjs +14 -7
- package/esm2022/src/lib/general/i18n/en.translations.mjs +25 -18
- package/esm2022/src/lib/general/i18n/fr.translations.mjs +33 -24
- package/esm2022/src/lib/general/status-display/status-display.component.mjs +3 -3
- package/esm2022/src/lib/model/event/hyp-event-detail.interface.mjs +1 -1
- package/esm2022/src/lib/model/event/hyp-event-summary.interface.mjs +1 -1
- package/esm2022/src/lib/model/event/hyp-event.interface.mjs +1 -1
- package/esm2022/src/lib/store/event/event.actions.mjs +2 -2
- package/esm2022/src/lib/store/event/event.effects.mjs +3 -3
- package/esm2022/src/lib/store/event/event.reducer.mjs +15 -13
- package/esm2022/src/lib/store/event/event.service.mjs +22 -31
- package/esm2022/src/lib/store/event-summary/event-summary.service.mjs +5 -5
- package/fesm2022/provoly-hypervisor.mjs +327 -232
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/event/detail/event-detail.component.d.ts +16 -2
- package/src/lib/event/filters/choice/choice-filter.component.d.ts +6 -5
- package/src/lib/event/filters/date/date-filter.component.d.ts +5 -4
- package/src/lib/event/filters/event-filters.component.d.ts +5 -3
- package/src/lib/event/filters/hvy-unit-filter.class.d.ts +14 -2
- package/src/lib/event/list/event-list.component.d.ts +7 -1
- package/src/lib/general/i18n/en.translations.d.ts +7 -0
- package/src/lib/general/i18n/fr.translations.d.ts +9 -0
- package/src/lib/model/event/hyp-event-detail.interface.d.ts +1 -2
- package/src/lib/model/event/hyp-event-summary.interface.d.ts +0 -1
- package/src/lib/model/event/hyp-event.interface.d.ts +1 -0
- package/src/lib/model/hyp-procedure.interface.d.ts +1 -1
- package/src/lib/store/event/event.actions.d.ts +4 -0
- package/src/lib/store/event/event.service.d.ts +10 -3
- package/styles/components/_a-chip-status.scss +0 -14
- package/styles/components/_m-hvy-event-summary-item.scss +37 -7
- package/styles/components/_o-hvy-event-detail.scss +41 -0
- package/styles/components/_o-hvy-event-filters.scss +1 -0
- package/styles/components/_o-hvy-events-table.scss +2 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Pipe, Component, Input, EventEmitter, Output, ContentChildren, forwardRef, signal, computed,
|
|
2
|
+
import { Injectable, Pipe, Component, Input, EventEmitter, Output, TemplateRef, ViewChild, ContentChildren, Directive, forwardRef, signal, computed, InjectionToken, NgModule, Inject } from '@angular/core';
|
|
3
3
|
import * as i3 from '@provoly/dashboard';
|
|
4
4
|
import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
|
|
5
5
|
import * as i1$1 from '@ngrx/store';
|
|
6
6
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
7
|
-
import
|
|
7
|
+
import * as i3$1 from '@angular/cdk/overlay';
|
|
8
|
+
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
9
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
10
|
+
import { mergeMap, of, combineLatest, map, fromEvent, withLatestFrom, filter, auditTime, BehaviorSubject } from 'rxjs';
|
|
8
11
|
import * as i1 from '@angular/common/http';
|
|
9
12
|
import { HttpParams } from '@angular/common/http';
|
|
10
|
-
import * as
|
|
13
|
+
import * as i4 from '@provoly/dashboard/components/checkbox';
|
|
11
14
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
12
|
-
import * as
|
|
15
|
+
import * as i5 from '@angular/forms';
|
|
13
16
|
import { FormsModule } from '@angular/forms';
|
|
14
17
|
import * as i1$2 from '@angular/common';
|
|
15
18
|
import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe, JsonPipe } from '@angular/common';
|
|
@@ -17,9 +20,6 @@ import * as i2 from '@angular/router';
|
|
|
17
20
|
import { RouterLink } from '@angular/router';
|
|
18
21
|
import * as i10 from '@provoly/dashboard/components/sinceDate';
|
|
19
22
|
import { PrySinceDateModule } from '@provoly/dashboard/components/sinceDate';
|
|
20
|
-
import * as i2$1 from '@angular/cdk/overlay';
|
|
21
|
-
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
22
|
-
import { TemplatePortal } from '@angular/cdk/portal';
|
|
23
23
|
import { map as map$1, debounceTime, mergeMap as mergeMap$1, catchError } from 'rxjs/operators';
|
|
24
24
|
import * as i1$3 from '@ngrx/effects';
|
|
25
25
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
@@ -60,7 +60,7 @@ const EventActions = {
|
|
|
60
60
|
status: createAction('[Event] Close Event or Procedure', props()),
|
|
61
61
|
statusSuccess: createAction('[Event] Close success'),
|
|
62
62
|
statusFailure: createAction('[Event] Close failure', props()),
|
|
63
|
-
sort: createAction('[Event] set log event sorting', props())
|
|
63
|
+
sort: createAction('[Event] set log event sorting', props())
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
const HypervisorActions = {
|
|
@@ -171,11 +171,11 @@ class StatusDisplayComponent {
|
|
|
171
171
|
this.targetsDisplayed = this.targetStatuses.length > 0 && !this.targetsDisplayed;
|
|
172
172
|
}
|
|
173
173
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: StatusDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
174
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: { event: "event", modifiable: "modifiable" }, outputs: { modified: "modified" }, ngImport: i0, template: "<span class=\"a-chip -
|
|
174
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: { event: "event", modifiable: "modifiable" }, outputs: { modified: "modified" }, ngImport: i0, template: "<span class=\"a-chip -{{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 }}\n </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" }] }); }
|
|
175
175
|
}
|
|
176
176
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: StatusDisplayComponent, decorators: [{
|
|
177
177
|
type: Component,
|
|
178
|
-
args: [{ selector: 'hvy-status-display', template: "<span class=\"a-chip -
|
|
178
|
+
args: [{ selector: 'hvy-status-display', template: "<span class=\"a-chip -{{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 }}\n </div>\n }\n </div>\n}\n" }]
|
|
179
179
|
}], propDecorators: { modified: [{
|
|
180
180
|
type: Output
|
|
181
181
|
}], event: [{
|
|
@@ -218,12 +218,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
218
218
|
class EventDetailComponent extends SubscriptionnerDirective {
|
|
219
219
|
static { this.CARD_HEIGHT = 75; }
|
|
220
220
|
set events(events) {
|
|
221
|
-
this._events = events.filter(ev => !!ev);
|
|
221
|
+
this._events = events.filter((ev) => !!ev);
|
|
222
222
|
this.eventModifications = new Array(this._events.length);
|
|
223
223
|
this.opened = this._events.length === 1 ? [true] : [];
|
|
224
|
-
this.canCloseSome = this._events.filter(ev => ev.status !== 'DONE').length > 0;
|
|
224
|
+
this.canCloseSome = this._events.filter((ev) => ev.status !== 'DONE').length > 0;
|
|
225
225
|
}
|
|
226
|
-
;
|
|
227
226
|
set procedure(procedure) {
|
|
228
227
|
this._procedure = procedure;
|
|
229
228
|
this.procedureModifications = {};
|
|
@@ -233,10 +232,12 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
233
232
|
this.procedureModifications = {};
|
|
234
233
|
this._outputModifications();
|
|
235
234
|
}
|
|
236
|
-
constructor(equipmentService, store) {
|
|
235
|
+
constructor(equipmentService, store, overlay, viewContainerRef) {
|
|
237
236
|
super();
|
|
238
237
|
this.equipmentService = equipmentService;
|
|
239
238
|
this.store = store;
|
|
239
|
+
this.overlay = overlay;
|
|
240
|
+
this.viewContainerRef = viewContainerRef;
|
|
240
241
|
this.opened = [];
|
|
241
242
|
this.criticalities = HypEventCriticality.values;
|
|
242
243
|
this._events = [];
|
|
@@ -253,16 +254,24 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
253
254
|
this.moveInitialIndex = 0;
|
|
254
255
|
this.initialActionList = [];
|
|
255
256
|
this.previousOffset = 0;
|
|
257
|
+
this.changeStatusContext = {
|
|
258
|
+
comment: '',
|
|
259
|
+
events: [],
|
|
260
|
+
status: 'DONE',
|
|
261
|
+
all: false
|
|
262
|
+
};
|
|
256
263
|
}
|
|
257
264
|
get events() {
|
|
258
265
|
return this._events.map((evt, idx) => ({ ...evt, ...(this.eventModifications[idx] ?? {}) }));
|
|
259
266
|
}
|
|
260
267
|
get procedure() {
|
|
261
|
-
return this._procedure
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
268
|
+
return this._procedure
|
|
269
|
+
? {
|
|
270
|
+
...this._procedure,
|
|
271
|
+
...(this.procedureModifications ?? {}),
|
|
272
|
+
events: this.events
|
|
273
|
+
}
|
|
274
|
+
: undefined;
|
|
266
275
|
}
|
|
267
276
|
toggle(i) {
|
|
268
277
|
this.opened[i] = !this.opened[i];
|
|
@@ -295,7 +304,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
295
304
|
eqName: true,
|
|
296
305
|
eqEntity: true,
|
|
297
306
|
startDate: true,
|
|
298
|
-
endDate: true
|
|
307
|
+
endDate: true
|
|
299
308
|
};
|
|
300
309
|
}
|
|
301
310
|
switch (event.type) {
|
|
@@ -312,7 +321,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
312
321
|
eqName: true,
|
|
313
322
|
eqEntity: true,
|
|
314
323
|
startDate: true,
|
|
315
|
-
endDate: true
|
|
324
|
+
endDate: true
|
|
316
325
|
};
|
|
317
326
|
case 'REPORT':
|
|
318
327
|
return {
|
|
@@ -326,7 +335,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
326
335
|
eqName: false,
|
|
327
336
|
eqEntity: true,
|
|
328
337
|
startDate: true,
|
|
329
|
-
endDate: true
|
|
338
|
+
endDate: true
|
|
330
339
|
};
|
|
331
340
|
case 'OPERATOR':
|
|
332
341
|
return {
|
|
@@ -340,7 +349,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
340
349
|
eqName: false,
|
|
341
350
|
eqEntity: false,
|
|
342
351
|
startDate: false,
|
|
343
|
-
endDate: false
|
|
352
|
+
endDate: false
|
|
344
353
|
};
|
|
345
354
|
}
|
|
346
355
|
}
|
|
@@ -363,7 +372,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
363
372
|
}
|
|
364
373
|
validateEvents(events) {
|
|
365
374
|
this.errors = [];
|
|
366
|
-
events.forEach(event => {
|
|
375
|
+
events.forEach((event) => {
|
|
367
376
|
const eventErrors = [];
|
|
368
377
|
if (!event.name || event.name.length === 0) {
|
|
369
378
|
eventErrors.push({ field: 'name', code: 'required' });
|
|
@@ -394,20 +403,62 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
394
403
|
this.eventErrors.next(this.errors);
|
|
395
404
|
}
|
|
396
405
|
hasError(prop, idx) {
|
|
397
|
-
return this.errors[idx]?.find(err => err.field === prop) ?? false;
|
|
406
|
+
return this.errors[idx]?.find((err) => err.field === prop) ?? false;
|
|
398
407
|
}
|
|
399
408
|
categories(event) {
|
|
400
409
|
return CATEGORIES_BY_TYPE.values[event.type];
|
|
401
410
|
}
|
|
402
411
|
changeStatus($event, event) {
|
|
403
|
-
this.
|
|
412
|
+
this.changeStatusContext.events = [event];
|
|
413
|
+
this.changeStatusContext.status = $event;
|
|
414
|
+
this.changeStatusContext.all = false;
|
|
415
|
+
this.toggleConfirm();
|
|
404
416
|
}
|
|
405
417
|
closeAll() {
|
|
406
|
-
|
|
407
|
-
|
|
418
|
+
this.changeStatusContext.all = true;
|
|
419
|
+
this.changeStatusContext.events = this.events;
|
|
420
|
+
this.changeStatusContext.status = 'DONE';
|
|
421
|
+
this.toggleConfirm();
|
|
422
|
+
}
|
|
423
|
+
confirmedClose() {
|
|
424
|
+
if (this.changeStatusContext.all) {
|
|
425
|
+
if (!this.procedure) {
|
|
426
|
+
this.store.dispatch(EventActions.status({
|
|
427
|
+
targetStatus: this.changeStatusContext.status,
|
|
428
|
+
event: this.changeStatusContext.events[0],
|
|
429
|
+
comment: this.changeStatusContext.comment
|
|
430
|
+
}));
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
this.store.dispatch(EventActions.status({
|
|
434
|
+
targetStatus: this.changeStatusContext.status,
|
|
435
|
+
procedure: this.procedure,
|
|
436
|
+
comment: this.changeStatusContext.comment
|
|
437
|
+
}));
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
this.store.dispatch(EventActions.status({
|
|
442
|
+
targetStatus: this.changeStatusContext.status,
|
|
443
|
+
event: this.changeStatusContext.events[0],
|
|
444
|
+
comment: this.changeStatusContext.comment
|
|
445
|
+
}));
|
|
446
|
+
}
|
|
447
|
+
this.toggleConfirm();
|
|
448
|
+
}
|
|
449
|
+
toggleConfirm() {
|
|
450
|
+
if (!this.overlayRef) {
|
|
451
|
+
this.overlayRef = this.overlay.create(new OverlayConfig({
|
|
452
|
+
hasBackdrop: true,
|
|
453
|
+
backdropClass: 'backdrop-dark',
|
|
454
|
+
panelClass: ['o-hvy-close-confirm']
|
|
455
|
+
}));
|
|
456
|
+
this.overlayRef.backdropClick().subscribe(() => this.toggleConfirm());
|
|
457
|
+
this.overlayRef.attach(new TemplatePortal(this.confirmDialog, this.viewContainerRef));
|
|
408
458
|
}
|
|
409
459
|
else {
|
|
410
|
-
this.
|
|
460
|
+
this.overlayRef.dispose();
|
|
461
|
+
this.overlayRef = undefined;
|
|
411
462
|
}
|
|
412
463
|
}
|
|
413
464
|
onMouseDown($event) {
|
|
@@ -447,18 +498,24 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
447
498
|
allowDrop($event) {
|
|
448
499
|
$event.preventDefault();
|
|
449
500
|
}
|
|
450
|
-
|
|
451
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure", cancelModifications: "cancelModifications" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}\n </button>\n }\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"event.status !== 'DONE'\"\n (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n @if (!opened[idx]) {\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n } @else {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\"\n [disabled]=\"newComentContent.length === 0\">{{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}</h2>\n </div>\n @if (procedure) {\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\" (drag)=\"move($event)\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n @for (action of procedure.actions;track action.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\" [draggable]=\"true\" (dragstart)=\"dragStart($event, action, idx)\" (mousedown)=\"onMouseDown($event)\">\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n } @else {\n <button class=\"a-btn a-btn--secondary\">\n {{ '@chh.actions.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { 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" }] }); }
|
|
501
|
+
confirmDisabled() {
|
|
502
|
+
return this.changeStatusContext.comment.length === 0;
|
|
503
|
+
}
|
|
504
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }, { token: i1$1.Store }, { token: i3$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
505
|
+
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" }, viewQueries: [{ propertyName: "confirmDialog", first: true, predicate: ["confirmDialog"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ (canCloseSome ? '@hvy.event.log.event.close' : '@hvy.event.log.event.closed') | i18n }}\n </button>\n @if (!canCloseSome) {\n <div\n class=\"a-tooltip\"\n [attr.data-tooltip]=\"'... TODO: get closing comment ...'\"\n data-tooltip-position=\"bottom\">\n <pry-icon iconSvg=\"i\" [height]=\"18\" [width]=\"18\">i</pry-icon>\n </div>\n }\n }\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events; track event.id; let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"event.status !== 'DONE'\"\n (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n @if (!opened[idx]) {\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n } @else {\n @if (access(event); as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\"\n [disabled]=\"newComentContent.length === 0\">{{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}</h2>\n </div>\n @if (procedure) {\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\" (drag)=\"move($event)\" (drop)=\"drop($event)\"\n (dragover)=\"allowDrop($event)\">\n @for (action of procedure.actions; track action.id; let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\" [draggable]=\"true\"\n (dragstart)=\"dragStart($event, action, idx)\" (mousedown)=\"onMouseDown($event)\">\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n } @else {\n <button class=\"a-btn a-btn--secondary\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #confirmDialog>\n <div\n class=\"o-hvy-close-confirm__dialog\"\n aria-labelledby=\"confirm\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <h2>{{ (changeStatusContext.events.length === 1 ? '@hvy.event.close.one' : '@hvy.event.close.multi') | i18n }}</h2>\n <ul>\n @for (event of changeStatusContext.events; track event.id) {\n <li>{{ event.name }}</li>\n }\n </ul>\n <p class=\"o-hvy-close-confirm__dialog__comment-title\">\n {{ '@hvy.event.close.comment' | i18n }}<span class=\"required\">*</span>:\n </p>\n <div class=\"o-hvy-close-confirm__dialog__comment\">\n <textarea [(ngModel)]=\"changeStatusContext.comment\" class=\"a-form-field\"></textarea>\n </div>\n <div class=\"o-hvy-close-confirm__dialog__actions\">\n <button class=\"a-btn a-btn--primary\" (click)=\"confirmedClose()\"\n [disabled]=\"confirmDisabled()\">{{ '@hvy.action.validate' | i18n }}\n </button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"toggleConfirm()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: i4.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i5.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: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.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", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { 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" }] }); }
|
|
452
506
|
}
|
|
453
507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
454
508
|
type: Component,
|
|
455
|
-
args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ '@hvy.event.log.event.close' | i18n }}\n </button>\n }\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"event.status !== 'DONE'\"\n (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n @if (!opened[idx]) {\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n } @else {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\"\n [disabled]=\"newComentContent.length === 0\">{{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}</h2>\n </div>\n @if (procedure) {\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\" (drag)=\"move($event)\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n @for (action of procedure.actions;track action.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\" [draggable]=\"true\" (dragstart)=\"dragStart($event, action, idx)\" (mousedown)=\"onMouseDown($event)\">\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n } @else {\n <button class=\"a-btn a-btn--secondary\">\n {{ '@chh.actions.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
456
|
-
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }], propDecorators: { modifiedEvents: [{
|
|
509
|
+
args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\"\n (click)=\"closeAll()\">{{ (canCloseSome ? '@hvy.event.log.event.close' : '@hvy.event.log.event.closed') | i18n }}\n </button>\n @if (!canCloseSome) {\n <div\n class=\"a-tooltip\"\n [attr.data-tooltip]=\"'... TODO: get closing comment ...'\"\n data-tooltip-position=\"bottom\">\n <pry-icon iconSvg=\"i\" [height]=\"18\" [width]=\"18\">i</pry-icon>\n </div>\n }\n }\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events; track event.id; let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"event.status !== 'DONE'\"\n (modified)=\"changeStatus($event, event)\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n @if (!opened[idx]) {\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n } @else {\n @if (access(event); as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\"\n [disabled]=\"newComentContent.length === 0\">{{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}</h2>\n </div>\n @if (procedure) {\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\" (drag)=\"move($event)\" (drop)=\"drop($event)\"\n (dragover)=\"allowDrop($event)\">\n @for (action of procedure.actions; track action.id; let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\" [draggable]=\"true\"\n (dragstart)=\"dragStart($event, action, idx)\" (mousedown)=\"onMouseDown($event)\">\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n } @else {\n <button class=\"a-btn a-btn--secondary\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #confirmDialog>\n <div\n class=\"o-hvy-close-confirm__dialog\"\n aria-labelledby=\"confirm\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <h2>{{ (changeStatusContext.events.length === 1 ? '@hvy.event.close.one' : '@hvy.event.close.multi') | i18n }}</h2>\n <ul>\n @for (event of changeStatusContext.events; track event.id) {\n <li>{{ event.name }}</li>\n }\n </ul>\n <p class=\"o-hvy-close-confirm__dialog__comment-title\">\n {{ '@hvy.event.close.comment' | i18n }}<span class=\"required\">*</span>:\n </p>\n <div class=\"o-hvy-close-confirm__dialog__comment\">\n <textarea [(ngModel)]=\"changeStatusContext.comment\" class=\"a-form-field\"></textarea>\n </div>\n <div class=\"o-hvy-close-confirm__dialog__actions\">\n <button class=\"a-btn a-btn--primary\" (click)=\"confirmedClose()\"\n [disabled]=\"confirmDisabled()\">{{ '@hvy.action.validate' | i18n }}\n </button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"toggleConfirm()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
510
|
+
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }, { type: i3$1.Overlay }, { type: i0.ViewContainerRef }], propDecorators: { modifiedEvents: [{
|
|
457
511
|
type: Output
|
|
458
512
|
}], modifiedProcedure: [{
|
|
459
513
|
type: Output
|
|
460
514
|
}], eventErrors: [{
|
|
461
515
|
type: Output
|
|
516
|
+
}], confirmDialog: [{
|
|
517
|
+
type: ViewChild,
|
|
518
|
+
args: ['confirmDialog', { read: TemplateRef }]
|
|
462
519
|
}], events: [{
|
|
463
520
|
type: Input
|
|
464
521
|
}], procedure: [{
|
|
@@ -474,41 +531,43 @@ const eventInitialState = {
|
|
|
474
531
|
loading: false,
|
|
475
532
|
filters: {},
|
|
476
533
|
selectedIds: [],
|
|
477
|
-
details: {}
|
|
534
|
+
details: {}
|
|
478
535
|
};
|
|
479
536
|
const internalReducer$1 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
|
|
480
537
|
...state,
|
|
481
|
-
loading: true
|
|
538
|
+
loading: true
|
|
482
539
|
})), on(EventActions.loadSuccess, (state, { events, startingFrom }) => {
|
|
483
|
-
return
|
|
540
|
+
return {
|
|
484
541
|
...state,
|
|
485
542
|
loading: false,
|
|
486
543
|
noMoreEvents: events.length < 20,
|
|
487
|
-
events: [...state.events.slice(0, startingFrom), ...events]
|
|
488
|
-
}
|
|
544
|
+
events: [...state.events.slice(0, startingFrom), ...events]
|
|
545
|
+
};
|
|
489
546
|
}), on(EventActions.loadFailure, (state, action) => ({
|
|
490
547
|
...state,
|
|
491
548
|
loading: false,
|
|
492
|
-
events: []
|
|
549
|
+
events: []
|
|
493
550
|
})), on(EventActions.select, (state, { ids, cumulative }) => ({
|
|
494
551
|
...state,
|
|
495
|
-
selectedIds: !cumulative
|
|
552
|
+
selectedIds: !cumulative
|
|
553
|
+
? ids
|
|
554
|
+
: [...state.selectedIds, ...ids].reduce((p, c) => (p.indexOf(c) === -1 ? [...p, c] : p.filter((p1) => p1 !== c)), [])
|
|
496
555
|
})), on(EventActions.get, EventActions.getForProcedure, (state, _) => ({
|
|
497
556
|
...state,
|
|
498
|
-
details: {}
|
|
557
|
+
details: {}
|
|
499
558
|
})), on(EventActions.getSuccess, (state, { event, procedure }) => ({
|
|
500
559
|
...state,
|
|
501
|
-
details: { event, procedure }
|
|
560
|
+
details: { event, procedure }
|
|
502
561
|
})), on(EventActions.sort, (state, { field, order }) => ({
|
|
503
562
|
...state,
|
|
504
563
|
events: [],
|
|
505
564
|
noMoreEvents: false,
|
|
506
|
-
sort: { field, order }
|
|
507
|
-
})), on(EventActions.filter, (state, { filters }) => ({
|
|
565
|
+
sort: { field, order }
|
|
566
|
+
})), on(EventActions.filter, (state, { filters, filterSet }) => ({
|
|
508
567
|
...state,
|
|
509
568
|
events: [],
|
|
510
569
|
noMoreEvents: false,
|
|
511
|
-
filters: filters,
|
|
570
|
+
filters: { ...state.filters, [filterSet]: filters }
|
|
512
571
|
})));
|
|
513
572
|
function eventReducer(state, action) {
|
|
514
573
|
return internalReducer$1(state, action);
|
|
@@ -557,20 +616,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
557
616
|
}] } });
|
|
558
617
|
|
|
559
618
|
const EVENT_LINK = {
|
|
560
|
-
fn: (event, store) => ['./', event.id]
|
|
619
|
+
fn: (event, store) => ['./', event.id]
|
|
561
620
|
};
|
|
621
|
+
const SCROLL_PX_TO_TRIGGER_FETCH_PAGE = { value: 200 };
|
|
562
622
|
class EventListComponent extends SubscriptionnerDirective {
|
|
563
|
-
constructor(store, el) {
|
|
623
|
+
constructor(store, el, router) {
|
|
564
624
|
super();
|
|
565
625
|
this.store = store;
|
|
566
626
|
this.el = el;
|
|
627
|
+
this.router = router;
|
|
567
628
|
this.EVENT_LINK = EVENT_LINK;
|
|
568
629
|
this._store = this.store;
|
|
569
|
-
this._inhibate =
|
|
630
|
+
this._inhibate = true;
|
|
570
631
|
this.store.dispatch(EventActions.load({}));
|
|
571
632
|
this.events$ = this.store.select(EventSelectors.events);
|
|
572
633
|
this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
|
|
573
|
-
this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map(([events, selectedIds]) => events.filter(ev => !selectedIds.includes(ev.id)).length === 0));
|
|
634
|
+
this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map(([events, selectedIds]) => events.filter((ev) => !selectedIds.includes(ev.id)).length === 0));
|
|
574
635
|
}
|
|
575
636
|
ngAfterViewInit() {
|
|
576
637
|
this.subscriptions.add(fromEvent(this.el.nativeElement, 'scroll')
|
|
@@ -579,7 +640,8 @@ class EventListComponent extends SubscriptionnerDirective {
|
|
|
579
640
|
map((e) => {
|
|
580
641
|
const target = e.currentTarget;
|
|
581
642
|
return target.scrollHeight - target.offsetHeight - target.scrollTop;
|
|
582
|
-
}), withLatestFrom(this.store.select(EventSelectors.noMoreEvents)), filter(([remaningScroll, noMore]) => !noMore && remaningScroll <
|
|
643
|
+
}), withLatestFrom(this.store.select(EventSelectors.noMoreEvents)), filter(([remaningScroll, noMore]) => !noMore && remaningScroll < SCROLL_PX_TO_TRIGGER_FETCH_PAGE.value), auditTime(200))
|
|
644
|
+
.subscribe(() => {
|
|
583
645
|
this.store.dispatch(EventActions.load({ next: true }));
|
|
584
646
|
}));
|
|
585
647
|
}
|
|
@@ -592,52 +654,68 @@ class EventListComponent extends SubscriptionnerDirective {
|
|
|
592
654
|
selectAll($event) {
|
|
593
655
|
if (!this._inhibate) {
|
|
594
656
|
this.inhibate();
|
|
595
|
-
const tmpSub = this.events$.subscribe(events => {
|
|
596
|
-
this.store.dispatch(EventActions.select({ ids: $event ? events.map(ev => ev.id) : [], cumulative: false }));
|
|
657
|
+
const tmpSub = this.events$.subscribe((events) => {
|
|
658
|
+
this.store.dispatch(EventActions.select({ ids: $event ? events.map((ev) => ev.id) : [], cumulative: false }));
|
|
597
659
|
setTimeout(() => tmpSub.unsubscribe(), 10);
|
|
598
660
|
});
|
|
599
661
|
}
|
|
600
662
|
}
|
|
601
663
|
inhibate() {
|
|
602
664
|
this._inhibate = true;
|
|
603
|
-
setTimeout(() => this._inhibate = false, 100);
|
|
665
|
+
setTimeout(() => (this._inhibate = false), 100);
|
|
604
666
|
}
|
|
605
|
-
|
|
606
|
-
|
|
667
|
+
goto(event) {
|
|
668
|
+
return this.router.navigate(this.EVENT_LINK.fn(event, this.store));
|
|
669
|
+
}
|
|
670
|
+
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 }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
671
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventListComponent, selector: "hvy-event-list", usesInheritance: true, ngImport: i0, template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <pry-checkbox [ngModel]=\"allSelected$|async\" (ngModelChange)=\"selectAll($event)\"></pry-checkbox>\n </th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"status\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"procedureProgress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async; track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"goto(event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"\n (click)=\"select(event, $event)\"></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: i4.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ColumnOrderComponent, selector: "hvy-column-order", inputs: ["field"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i10.PrySinceDatePipe, name: "sinceDate" }] }); }
|
|
607
672
|
}
|
|
608
673
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
|
|
609
674
|
type: Component,
|
|
610
|
-
args: [{ selector: 'hvy-event-list', template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <pry-checkbox [ngModel]=\"allSelected$|async\" (ngModelChange)=\"selectAll($event)\"></pry-checkbox>\n </th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"status\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"procedureProgress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async; track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"
|
|
611
|
-
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ElementRef }] });
|
|
675
|
+
args: [{ selector: 'hvy-event-list', template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <pry-checkbox [ngModel]=\"allSelected$|async\" (ngModelChange)=\"selectAll($event)\"></pry-checkbox>\n </th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.category.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>\n <hvy-column-order field=\"creationDate\">{{ '@hvy.event.creationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"lastModificationDate\">{{ '@hvy.event.lastModificationDate' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"status\">{{ '@hvy.event.status.name' | i18n }}</hvy-column-order>\n </th>\n <th>\n <hvy-column-order field=\"procedureProgress\">{{ '@hvy.procedure.progress' | i18n }}</hvy-column-order>\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (event of events$|async; track event.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"goto(event)\">\n <td class=\"o-hvy-events-table__line__cell\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"\n (click)=\"select(event, $event)\"></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" }]
|
|
676
|
+
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ElementRef }, { type: i2.Router }] });
|
|
612
677
|
|
|
613
678
|
class EventFiltersComponent extends SubscriptionnerDirective {
|
|
614
679
|
constructor(store) {
|
|
615
680
|
super();
|
|
616
681
|
this.store = store;
|
|
682
|
+
this.filterSet = 'global';
|
|
683
|
+
}
|
|
684
|
+
ngAfterViewInit() {
|
|
685
|
+
this.filters.forEach((filter) => (filter.filterSet = this.filterSet));
|
|
617
686
|
}
|
|
618
687
|
filter() {
|
|
619
|
-
const filters = this.filters.map(filter => filter.getParams())
|
|
620
|
-
|
|
621
|
-
this.store.dispatch(EventActions.filter({ filters }));
|
|
688
|
+
const filters = this.filters.map((filter) => filter.getParams()).reduce((p, c) => ({ ...p, ...c }), {});
|
|
689
|
+
this.store.dispatch(EventActions.filter({ filters, filterSet: this.filterSet }));
|
|
622
690
|
}
|
|
623
691
|
reset() {
|
|
624
|
-
this.filters.forEach(filter => filter.reset());
|
|
625
|
-
this.store.dispatch(EventActions.filter({ filters: {} }));
|
|
692
|
+
this.filters.forEach((filter) => filter.reset());
|
|
693
|
+
this.store.dispatch(EventActions.filter({ filters: {}, filterSet: this.filterSet }));
|
|
626
694
|
}
|
|
627
695
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventFiltersComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
628
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventFiltersComponent, selector: "hvy-event-filters", queries: [{ propertyName: "filters", predicate: ["filter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n <div class=\"o-hvy-event-filters__buttons\">\n <button (click)=\"reset()\" class=\"a-btn a-btn--secondary\">\n <pry-icon iconSvg=\"reset_filter_event\"></pry-icon>\n </button>\n <button (click)=\"filter()\" class=\"a-btn a-btn--primary\">\n {{ '@hvy.event.filter.name' | i18n }}\n <pry-icon iconSvg=\"event_filter\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
696
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventFiltersComponent, selector: "hvy-event-filters", inputs: { filterSet: "filterSet" }, queries: [{ propertyName: "filters", predicate: ["filter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n <div class=\"o-hvy-event-filters__buttons\">\n <button (click)=\"reset()\" class=\"a-btn a-btn--secondary\">\n <pry-icon iconSvg=\"reset_filter_event\"></pry-icon>\n </button>\n <button (click)=\"filter()\" class=\"a-btn a-btn--primary\">\n {{ '@hvy.event.filter.name' | i18n }}\n <pry-icon iconSvg=\"event_filter\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
629
697
|
}
|
|
630
698
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventFiltersComponent, decorators: [{
|
|
631
699
|
type: Component,
|
|
632
700
|
args: [{ selector: 'hvy-event-filters', template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n <div class=\"o-hvy-event-filters__buttons\">\n <button (click)=\"reset()\" class=\"a-btn a-btn--secondary\">\n <pry-icon iconSvg=\"reset_filter_event\"></pry-icon>\n </button>\n <button (click)=\"filter()\" class=\"a-btn a-btn--primary\">\n {{ '@hvy.event.filter.name' | i18n }}\n <pry-icon iconSvg=\"event_filter\"></pry-icon>\n </button>\n </div>\n</div>\n" }]
|
|
633
|
-
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: {
|
|
701
|
+
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { filterSet: [{
|
|
702
|
+
type: Input
|
|
703
|
+
}], filters: [{
|
|
634
704
|
type: ContentChildren,
|
|
635
705
|
args: ['filter', { descendants: true }]
|
|
636
706
|
}] } });
|
|
637
707
|
|
|
638
708
|
class HvyUnitFilterComponent extends SubscriptionnerDirective {
|
|
709
|
+
set filterSet(filterSet) {
|
|
710
|
+
this._filterSet$.next(filterSet);
|
|
711
|
+
}
|
|
712
|
+
get filterSet() {
|
|
713
|
+
return this._filterSet$.value;
|
|
714
|
+
}
|
|
639
715
|
constructor() {
|
|
640
716
|
super();
|
|
717
|
+
this.prop = 'no-prop-defined';
|
|
718
|
+
this._filterSet$ = new BehaviorSubject('global');
|
|
641
719
|
}
|
|
642
720
|
getParams() {
|
|
643
721
|
throw new Error('Must use sub implementation');
|
|
@@ -645,16 +723,24 @@ class HvyUnitFilterComponent extends SubscriptionnerDirective {
|
|
|
645
723
|
reset() {
|
|
646
724
|
throw new Error('Must use sub implementation');
|
|
647
725
|
}
|
|
726
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HvyUnitFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
727
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: HvyUnitFilterComponent, inputs: { prop: "prop", filterSet: "filterSet" }, usesInheritance: true, ngImport: i0 }); }
|
|
648
728
|
}
|
|
729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HvyUnitFilterComponent, decorators: [{
|
|
730
|
+
type: Directive
|
|
731
|
+
}], ctorParameters: () => [], propDecorators: { prop: [{
|
|
732
|
+
type: Input
|
|
733
|
+
}], filterSet: [{
|
|
734
|
+
type: Input
|
|
735
|
+
}] } });
|
|
649
736
|
|
|
650
737
|
class DateFilterComponent extends HvyUnitFilterComponent {
|
|
651
738
|
constructor(store) {
|
|
652
739
|
super();
|
|
653
740
|
this.store = store;
|
|
654
|
-
this.prop = 'no-prop-defined';
|
|
655
741
|
this.value = '';
|
|
656
|
-
this.subscriptions.add(this.store.select(EventSelectors.filters).subscribe(filters => {
|
|
657
|
-
this.value = filters[this.prop] ? (filters[this.prop][0] ?? ''
|
|
742
|
+
this.subscriptions.add(combineLatest([this.store.select(EventSelectors.filters), this._filterSet$]).subscribe(([filters, filterSet]) => {
|
|
743
|
+
this.value = (filters[filterSet] ?? {})[this.prop] ? (filters[filterSet] ?? {})[this.prop][0] ?? '' : '';
|
|
658
744
|
}));
|
|
659
745
|
}
|
|
660
746
|
getParams() {
|
|
@@ -671,14 +757,12 @@ class DateFilterComponent extends HvyUnitFilterComponent {
|
|
|
671
757
|
this.value = $event instanceof Event ? $event.target?.value : $event;
|
|
672
758
|
}
|
|
673
759
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DateFilterComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
674
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: DateFilterComponent, selector: "hvy-date-filter",
|
|
760
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: DateFilterComponent, selector: "hvy-date-filter", providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => DateFilterComponent) }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-date-filters\">\n <input type=\"date\" class=\"a-form-field\"\n [value]=\"value\"\n (change)=\"triggerChange($event)\">\n</div>\n" }); }
|
|
675
761
|
}
|
|
676
762
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DateFilterComponent, decorators: [{
|
|
677
763
|
type: Component,
|
|
678
764
|
args: [{ selector: 'hvy-date-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => DateFilterComponent) }], template: "<div class=\"o-hvy-date-filters\">\n <input type=\"date\" class=\"a-form-field\"\n [value]=\"value\"\n (change)=\"triggerChange($event)\">\n</div>\n" }]
|
|
679
|
-
}], ctorParameters: () => [{ type: i1$1.Store }]
|
|
680
|
-
type: Input
|
|
681
|
-
}] } });
|
|
765
|
+
}], ctorParameters: () => [{ type: i1$1.Store }] });
|
|
682
766
|
|
|
683
767
|
class ChoiceFilterComponent extends HvyUnitFilterComponent {
|
|
684
768
|
static { this.idCounter = 0; }
|
|
@@ -690,12 +774,10 @@ class ChoiceFilterComponent extends HvyUnitFilterComponent {
|
|
|
690
774
|
this.i18nService = i18nService;
|
|
691
775
|
this.ref = ref;
|
|
692
776
|
this.id = -1;
|
|
693
|
-
this.prop = 'no-prop-defined';
|
|
694
777
|
this.label = 'no-label-defined';
|
|
695
778
|
this.i18nPrefix = '';
|
|
696
779
|
this.value = signal([]);
|
|
697
780
|
this.choices = [];
|
|
698
|
-
this.inhibate = false;
|
|
699
781
|
this.displayValue = computed(() => {
|
|
700
782
|
if (this.allSelected()) {
|
|
701
783
|
return this.i18nService.instant('@hvy.event.filter.choice.all');
|
|
@@ -711,9 +793,12 @@ class ChoiceFilterComponent extends HvyUnitFilterComponent {
|
|
|
711
793
|
this.id = ChoiceFilterComponent.idCounter++;
|
|
712
794
|
}
|
|
713
795
|
ngAfterViewInit() {
|
|
714
|
-
this.subscriptions.add(this.store.select(EventSelectors.filters).subscribe(filters => {
|
|
715
|
-
this.assignValue(filters.hasOwnProperty(this.prop)
|
|
716
|
-
filters[this.prop].length === 1 && filters[this.prop][0] === ''
|
|
796
|
+
this.subscriptions.add(combineLatest([this.store.select(EventSelectors.filters), this._filterSet$]).subscribe(([filters, filterSet]) => {
|
|
797
|
+
this.assignValue((filters[filterSet] ?? {}).hasOwnProperty(this.prop)
|
|
798
|
+
? filters[filterSet][this.prop].length === 1 && filters[filterSet][this.prop][0] === ''
|
|
799
|
+
? []
|
|
800
|
+
: filters[filterSet][this.prop]
|
|
801
|
+
: this.allValues());
|
|
717
802
|
}));
|
|
718
803
|
}
|
|
719
804
|
getParams() {
|
|
@@ -731,7 +816,7 @@ class ChoiceFilterComponent extends HvyUnitFilterComponent {
|
|
|
731
816
|
this.overlayRef = this.overlay.create(new OverlayConfig({
|
|
732
817
|
hasBackdrop: true,
|
|
733
818
|
backdropClass: 'backdrop',
|
|
734
|
-
panelClass: ['m-context-menu-wrapper', 'o-choice-filter-popup']
|
|
819
|
+
panelClass: ['m-context-menu-wrapper', 'o-choice-filter-popup']
|
|
735
820
|
}));
|
|
736
821
|
this.overlayRef.backdropClick().subscribe(() => this.toggleModal());
|
|
737
822
|
this.overlayRef.attach(new TemplatePortal(this.template, this.viewContainerRef));
|
|
@@ -757,49 +842,47 @@ class ChoiceFilterComponent extends HvyUnitFilterComponent {
|
|
|
757
842
|
}
|
|
758
843
|
toggle(elt) {
|
|
759
844
|
const isSelected = this.isSelected(elt);
|
|
760
|
-
const eltSubKeys = !elt.children ? [elt.key] : elt.children.map(ch => ch.key);
|
|
845
|
+
const eltSubKeys = !elt.children ? [elt.key] : elt.children.map((ch) => ch.key);
|
|
761
846
|
if (!isSelected) {
|
|
762
847
|
this.assignValue([...new Set([...this.value(), ...eltSubKeys])]);
|
|
763
848
|
}
|
|
764
849
|
else {
|
|
765
|
-
this.assignValue(this.value().filter(v => !eltSubKeys.includes(v)));
|
|
850
|
+
this.assignValue(this.value().filter((v) => !eltSubKeys.includes(v)));
|
|
766
851
|
}
|
|
767
852
|
}
|
|
768
853
|
allSelected() {
|
|
769
|
-
return this.choices.map(choice => this.isSelected(choice)).reduce((p, c) => p && c, true);
|
|
854
|
+
return this.choices.map((choice) => this.isSelected(choice)).reduce((p, c) => p && c, true);
|
|
770
855
|
}
|
|
771
856
|
isSelected(choice) {
|
|
772
857
|
if (!choice.children) {
|
|
773
858
|
return this.value().includes(choice.key);
|
|
774
859
|
}
|
|
775
860
|
else {
|
|
776
|
-
return choice.children.map(child => this.isSelected(child)).reduce((p, c) => p && c, true);
|
|
861
|
+
return choice.children.map((child) => this.isSelected(child)).reduce((p, c) => p && c, true);
|
|
777
862
|
}
|
|
778
863
|
}
|
|
779
864
|
allValues() {
|
|
780
865
|
return this.choices
|
|
781
|
-
.map(choice => !choice.children ? [choice.key] : choice.children.map(child => child.key))
|
|
866
|
+
.map((choice) => (!choice.children ? [choice.key] : choice.children.map((child) => child.key)))
|
|
782
867
|
.reduce((p, c) => [...p, ...c], []);
|
|
783
868
|
}
|
|
784
869
|
assignValue(value) {
|
|
785
|
-
if (!this.inhibate) {
|
|
870
|
+
if (!this.inhibate || this.inhibate !== this.filterSet) {
|
|
786
871
|
this.triggerInhibate();
|
|
787
872
|
this.value.set(value);
|
|
788
873
|
}
|
|
789
874
|
}
|
|
790
875
|
triggerInhibate() {
|
|
791
|
-
this.inhibate =
|
|
792
|
-
setTimeout(() => this.inhibate =
|
|
876
|
+
this.inhibate = this.filterSet;
|
|
877
|
+
setTimeout(() => (this.inhibate = undefined), 50);
|
|
793
878
|
}
|
|
794
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, deps: [{ token: i1$1.Store }, { token:
|
|
795
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ChoiceFilterComponent, selector: "hvy-choice-filter", inputs: {
|
|
879
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, deps: [{ token: i1$1.Store }, { token: i3$1.Overlay }, { token: i0.ViewContainerRef }, { token: i3.PryI18nService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
880
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ChoiceFilterComponent, selector: "hvy-choice-filter", inputs: { label: "label", i18nPrefix: "i18nPrefix", choices: "choices" }, providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<button (click)=\"toggleModal()\" #button class=\"o-hvy-choice-filter -horizontal\"\n [class.-highlight]=\"displayValue() !== ('@hvy.event.filter.choice.all' | i18n)\" [class.-focus]=\"overlayRef\">\n <div class=\"o-hvy-choice-filter__choice-value\">\n <span class=\"o-hvy-choice-filter__label\">{{ label | i18n }} :</span>\n <span class=\"o-hvy-choice-filter__value\" type=\"text\" id=\"select_{{id}}\">{{ displayValue() }}</span>\n </div>\n <pry-icon [iconSvg]=\"!!overlayRef ? 'chevron_top' : 'chevron_bottom'\" [width]=\"10\" [height]=\"10\"></pry-icon>\n</button>\n\n<ng-template #template>\n <div\n class=\"m-context-menu o-hvy-choice-filter\"\n aria-labelledby=\"choice\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"menu\"\n aria-modal=\"true\"\n >\n <div class=\"o-hvy-choice-filter__all\">\n <pry-checkbox [ngModel]=\"allSelected()\" (ngModelChange)=\"clickAll()\">\n <span>{{ '@hvy.event.filter.choice.all' | i18n }}</span>\n </pry-checkbox>\n </div>\n @for (elt of choices; track elt.key) {\n @if (!elt.children) {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n } @else {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n @for (child of elt.children; track child.key) {\n <pry-checkbox [ngModel]=\"isSelected(child)\" (ngModelChange)=\"toggle(child)\"\n class=\"o-hvy-choice-filter__child\">\n <span>{{ i18nPrefix + child.key | i18n }}</span>\n </pry-checkbox>\n }\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: i4.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
796
881
|
}
|
|
797
882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ChoiceFilterComponent, decorators: [{
|
|
798
883
|
type: Component,
|
|
799
|
-
args: [{ selector: 'hvy-choice-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], template: "<button (click)=\"toggleModal()\" #button class=\"o-hvy-choice-filter -horizontal\"\n [class.-highlight]=\"displayValue() !== ('@hvy.event.filter.choice.all' | i18n)\" [class.-focus]=\"overlayRef\">\n <div class=\"o-hvy-choice-filter__choice-value\">\n <span class=\"o-hvy-choice-filter__label\">{{ label | i18n }}:</span>\n <span class=\"o-hvy-choice-filter__value\" type=\"text\" id=\"select_{{id}}\">{{ displayValue() }}</span>\n </div>\n <pry-icon [iconSvg]=\"!!overlayRef ? 'chevron_top' : 'chevron_bottom'\" [width]=\"10\" [height]=\"10\"></pry-icon>\n</button>\n\n<ng-template #template>\n <div\n class=\"m-context-menu o-hvy-choice-filter\"\n aria-labelledby=\"choice\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"menu\"\n aria-modal=\"true\"\n >\n <div class=\"o-hvy-choice-filter__all\">\n <pry-checkbox [ngModel]=\"allSelected()\" (ngModelChange)=\"clickAll()\">\n <span>{{ '@hvy.event.filter.choice.all' | i18n }}</span>\n </pry-checkbox>\n </div>\n @for (elt of choices; track elt.key) {\n @if (!elt.children) {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n } @else {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n @for (child of elt.children; track child.key) {\n <pry-checkbox [ngModel]=\"isSelected(child)\" (ngModelChange)=\"toggle(child)\"\n class=\"o-hvy-choice-filter__child\">\n <span>{{ i18nPrefix + child.key | i18n }}</span>\n </pry-checkbox>\n }\n }\n }\n </div>\n</ng-template>\n" }]
|
|
800
|
-
}], ctorParameters: () => [{ type: i1$1.Store }, { type:
|
|
801
|
-
type: Input
|
|
802
|
-
}], label: [{
|
|
884
|
+
args: [{ selector: 'hvy-choice-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => ChoiceFilterComponent) }], template: "<button (click)=\"toggleModal()\" #button class=\"o-hvy-choice-filter -horizontal\"\n [class.-highlight]=\"displayValue() !== ('@hvy.event.filter.choice.all' | i18n)\" [class.-focus]=\"overlayRef\">\n <div class=\"o-hvy-choice-filter__choice-value\">\n <span class=\"o-hvy-choice-filter__label\">{{ label | i18n }} :</span>\n <span class=\"o-hvy-choice-filter__value\" type=\"text\" id=\"select_{{id}}\">{{ displayValue() }}</span>\n </div>\n <pry-icon [iconSvg]=\"!!overlayRef ? 'chevron_top' : 'chevron_bottom'\" [width]=\"10\" [height]=\"10\"></pry-icon>\n</button>\n\n<ng-template #template>\n <div\n class=\"m-context-menu o-hvy-choice-filter\"\n aria-labelledby=\"choice\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"menu\"\n aria-modal=\"true\"\n >\n <div class=\"o-hvy-choice-filter__all\">\n <pry-checkbox [ngModel]=\"allSelected()\" (ngModelChange)=\"clickAll()\">\n <span>{{ '@hvy.event.filter.choice.all' | i18n }}</span>\n </pry-checkbox>\n </div>\n @for (elt of choices; track elt.key) {\n @if (!elt.children) {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n } @else {\n <pry-checkbox [ngModel]=\"isSelected(elt)\" (ngModelChange)=\"toggle(elt)\" class=\"o-hvy-choice-filter__root\">\n <span>{{ i18nPrefix + elt.key | i18n }}</span>\n </pry-checkbox>\n @for (child of elt.children; track child.key) {\n <pry-checkbox [ngModel]=\"isSelected(child)\" (ngModelChange)=\"toggle(child)\"\n class=\"o-hvy-choice-filter__child\">\n <span>{{ i18nPrefix + child.key | i18n }}</span>\n </pry-checkbox>\n }\n }\n }\n </div>\n</ng-template>\n" }]
|
|
885
|
+
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i3$1.Overlay }, { type: i0.ViewContainerRef }, { type: i3.PryI18nService }, { type: i0.ElementRef }], propDecorators: { label: [{
|
|
803
886
|
type: Input
|
|
804
887
|
}], i18nPrefix: [{
|
|
805
888
|
type: Input
|
|
@@ -851,9 +934,81 @@ const EventSummarySelectors = {
|
|
|
851
934
|
loading
|
|
852
935
|
};
|
|
853
936
|
|
|
854
|
-
const
|
|
855
|
-
|
|
937
|
+
const eventForWriteAPI = (event) => ({
|
|
938
|
+
...event,
|
|
939
|
+
equipmentId: event.equipment?.id
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
const procedureForWriteAPI = (procedure) => ({
|
|
943
|
+
...procedure,
|
|
944
|
+
events: procedure.events.map(eventForWriteAPI)
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
const PAGE_SIZE_FETCH = { value: 20 };
|
|
948
|
+
const KNOWN_FILTER_SETS = {
|
|
949
|
+
EVENTS: 'events',
|
|
950
|
+
SUMMARY: 'summary'
|
|
856
951
|
};
|
|
952
|
+
class EventService {
|
|
953
|
+
constructor(httpClient, store) {
|
|
954
|
+
this.httpClient = httpClient;
|
|
955
|
+
this.store = store;
|
|
956
|
+
}
|
|
957
|
+
list(startWith = 0, pageSize = PAGE_SIZE_FETCH.value) {
|
|
958
|
+
return this.store.select(HypSelectors.url).pipe(withLatestFrom(this.store.select(EventSelectors.filters), this.store.select(EventSelectors.sort)), mergeMap(([url, filterSets, sort]) => {
|
|
959
|
+
const filters = filterSets[KNOWN_FILTER_SETS.EVENTS] ?? {};
|
|
960
|
+
let params = new HttpParams();
|
|
961
|
+
Object.keys(filters).forEach((filter) => {
|
|
962
|
+
filters[filter].forEach((filterValue) => {
|
|
963
|
+
params = params.append(filter, filterValue);
|
|
964
|
+
});
|
|
965
|
+
});
|
|
966
|
+
params = params.set('page', startWith / pageSize + 1);
|
|
967
|
+
if (sort) {
|
|
968
|
+
params = params.set('sort', sort.field).set('order', sort.order);
|
|
969
|
+
}
|
|
970
|
+
return this.httpClient.get(encodeURI(`${url}/events`), { params });
|
|
971
|
+
}));
|
|
972
|
+
}
|
|
973
|
+
get(id) {
|
|
974
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
975
|
+
return this.httpClient.get(encodeURI(`${url}/events/id/${id}`));
|
|
976
|
+
}));
|
|
977
|
+
}
|
|
978
|
+
getProcedure(id) {
|
|
979
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
980
|
+
return this.httpClient.get(encodeURI(`${url}/procedures/id/${id}`));
|
|
981
|
+
}));
|
|
982
|
+
}
|
|
983
|
+
save(event) {
|
|
984
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
985
|
+
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), eventForWriteAPI(event));
|
|
986
|
+
}));
|
|
987
|
+
}
|
|
988
|
+
saveProcedure(procedure) {
|
|
989
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
990
|
+
return this.httpClient.post(encodeURI(`${url}/procedures`), procedureForWriteAPI(procedure));
|
|
991
|
+
}));
|
|
992
|
+
}
|
|
993
|
+
status(event, status, comment) {
|
|
994
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
995
|
+
return this.httpClient.put(encodeURI(`${url}/events/id/${event.id}/close`), { status, comment });
|
|
996
|
+
}));
|
|
997
|
+
}
|
|
998
|
+
statusProcedure(procedure, status, comment) {
|
|
999
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1000
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}/close`), { status, comment });
|
|
1001
|
+
}));
|
|
1002
|
+
}
|
|
1003
|
+
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 }); }
|
|
1004
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, providedIn: 'root' }); }
|
|
1005
|
+
}
|
|
1006
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, decorators: [{
|
|
1007
|
+
type: Injectable,
|
|
1008
|
+
args: [{
|
|
1009
|
+
providedIn: 'root'
|
|
1010
|
+
}]
|
|
1011
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
857
1012
|
|
|
858
1013
|
class EventSummaryItemComponent {
|
|
859
1014
|
constructor(store) {
|
|
@@ -889,8 +1044,8 @@ class EventSummaryListComponent {
|
|
|
889
1044
|
this.itemLinkBase = this.itemLinkBase.length > 0 ? this.itemLinkBase : ['events'];
|
|
890
1045
|
}
|
|
891
1046
|
filterAndRoute(status) {
|
|
892
|
-
this.router.navigate([...this.consultLink]);
|
|
893
|
-
this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
|
|
1047
|
+
this.router.navigate([...this.consultLink], { queryParams: { status: this.status } });
|
|
1048
|
+
this.store.dispatch(EventActions.filter({ filters: { status: [status] }, filterSet: KNOWN_FILTER_SETS.EVENTS }));
|
|
894
1049
|
}
|
|
895
1050
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1$1.Store }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
896
1051
|
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 <a class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n > {{ '@hvy.action.consult' | i18n }}\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </a>\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" }] }); }
|
|
@@ -919,25 +1074,31 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
|
|
|
919
1074
|
this.summaries = {
|
|
920
1075
|
NEW: { events: [], count: 0 },
|
|
921
1076
|
IN_PROGRESS: { events: [], count: 0 },
|
|
922
|
-
DONE: { events: [], count: 0 }
|
|
1077
|
+
DONE: { events: [], count: 0 }
|
|
923
1078
|
};
|
|
924
|
-
this.criticalityList = [...
|
|
1079
|
+
this.criticalityList = [...HypEventCriticality.values, 'ALL'];
|
|
925
1080
|
this.criticalityOrder = (a, b) => {
|
|
926
1081
|
return this.criticalityList.indexOf(a.key) - this.criticalityList.indexOf(b.key);
|
|
927
1082
|
};
|
|
928
1083
|
this.store.dispatch(EventSummaryActions.load());
|
|
929
|
-
this.selectedCriticality$ = this.store
|
|
1084
|
+
this.selectedCriticality$ = this.store
|
|
1085
|
+
.select(EventSelectors.filters)
|
|
1086
|
+
.pipe(map$1((filters) => (filters[KNOWN_FILTER_SETS.EVENTS] ?? {})['criticality']?.[0] ?? 'ALL'));
|
|
930
1087
|
this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
|
|
931
1088
|
this.summaries = summaries;
|
|
932
1089
|
}));
|
|
933
1090
|
}
|
|
934
1091
|
filterByCriticality($event) {
|
|
935
|
-
$event === 'ALL'
|
|
936
|
-
this.store.dispatch(EventActions.filter({ filters: {
|
|
1092
|
+
$event === 'ALL'
|
|
1093
|
+
? this.store.dispatch(EventActions.filter({ filters: {}, filterSet: KNOWN_FILTER_SETS.EVENTS }))
|
|
1094
|
+
: this.store.dispatch(EventActions.filter({
|
|
1095
|
+
filters: { criticality: [$event] },
|
|
1096
|
+
filterSet: KNOWN_FILTER_SETS.EVENTS
|
|
1097
|
+
}));
|
|
937
1098
|
this.store.dispatch(EventSummaryActions.load());
|
|
938
1099
|
}
|
|
939
1100
|
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 }); }
|
|
940
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryPageComponent, selector: "hvy-event-summary-page", inputs: { pageTitle: "pageTitle", consultLink: "consultLink" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality.name' | i18n }}\n : </label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n <div class=\"o-hvy-event-summary-page__content__sub\">\n @for (summaryList of summaries | keyvalue: criticalityOrder;track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\"\n [consultLink]=\"consultLink\">\n </hvy-event-summary-list>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
1101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryPageComponent, selector: "hvy-event-summary-page", inputs: { pageTitle: "pageTitle", consultLink: "consultLink" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality.name' | i18n }}\n : </label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n <div class=\"o-hvy-event-summary-page__content__sub\">\n @for (summaryList of summaries | keyvalue: criticalityOrder;track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\"\n [consultLink]=\"consultLink\">\n </hvy-event-summary-list>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.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", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { 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" }] }); }
|
|
941
1102
|
}
|
|
942
1103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
|
|
943
1104
|
type: Component,
|
|
@@ -958,13 +1119,13 @@ const enTranslations = {
|
|
|
958
1119
|
name: 'Event type',
|
|
959
1120
|
ALERT: 'Alert',
|
|
960
1121
|
REPORT: 'Report',
|
|
961
|
-
OPERATOR: 'Operator'
|
|
1122
|
+
OPERATOR: 'Operator'
|
|
962
1123
|
},
|
|
963
1124
|
status: {
|
|
964
1125
|
name: 'Status',
|
|
965
1126
|
NEW: 'Open',
|
|
966
1127
|
IN_PROGRESS: 'In progress',
|
|
967
|
-
DONE: 'Done'
|
|
1128
|
+
DONE: 'Done'
|
|
968
1129
|
},
|
|
969
1130
|
address: 'Address',
|
|
970
1131
|
source: 'External reference',
|
|
@@ -978,7 +1139,7 @@ const enTranslations = {
|
|
|
978
1139
|
creationDate: 'Creation date',
|
|
979
1140
|
lastModificationDate: 'Modification date',
|
|
980
1141
|
closeDate: 'Close date',
|
|
981
|
-
detail:
|
|
1142
|
+
detail: 'Events description',
|
|
982
1143
|
log: {
|
|
983
1144
|
name: 'Events log',
|
|
984
1145
|
event: {
|
|
@@ -989,8 +1150,8 @@ const enTranslations = {
|
|
|
989
1150
|
category: 'Category',
|
|
990
1151
|
comments: {
|
|
991
1152
|
name: 'Event comments',
|
|
992
|
-
placeholder: 'Write your comment'
|
|
993
|
-
}
|
|
1153
|
+
placeholder: 'Write your comment'
|
|
1154
|
+
}
|
|
994
1155
|
},
|
|
995
1156
|
procedure: {
|
|
996
1157
|
delete: 'Delete procedure',
|
|
@@ -998,28 +1159,32 @@ const enTranslations = {
|
|
|
998
1159
|
noAction: 'No actions',
|
|
999
1160
|
name: 'Common procedure',
|
|
1000
1161
|
addAction: 'Add action'
|
|
1001
|
-
}
|
|
1162
|
+
}
|
|
1002
1163
|
},
|
|
1003
1164
|
category: {
|
|
1004
|
-
name:
|
|
1165
|
+
name: 'Event category',
|
|
1005
1166
|
ALERT_MALFUNCTION: 'Dysfunction alert',
|
|
1006
1167
|
REPORT: 'GRC report',
|
|
1007
1168
|
OPERATOR_EVENT: 'Operator event',
|
|
1008
1169
|
ALERT_LIMIT: 'Limit alert',
|
|
1009
|
-
MANIFESTATION: 'Manifestation'
|
|
1170
|
+
MANIFESTATION: 'Manifestation'
|
|
1010
1171
|
},
|
|
1011
1172
|
criticality: {
|
|
1012
1173
|
name: 'Criticality',
|
|
1013
1174
|
LOW: 'Low',
|
|
1014
1175
|
MEDIUM: 'Middle',
|
|
1015
|
-
HIGH: 'High'
|
|
1176
|
+
HIGH: 'High'
|
|
1016
1177
|
},
|
|
1017
1178
|
filter: {
|
|
1018
1179
|
name: 'Filter',
|
|
1019
1180
|
choice: {
|
|
1020
|
-
all:
|
|
1181
|
+
all: 'All'
|
|
1021
1182
|
},
|
|
1022
1183
|
reset: 'Reset'
|
|
1184
|
+
},
|
|
1185
|
+
close: {
|
|
1186
|
+
one: 'Close event',
|
|
1187
|
+
multi: 'Close events'
|
|
1023
1188
|
}
|
|
1024
1189
|
},
|
|
1025
1190
|
eventSummary: {
|
|
@@ -1027,26 +1192,29 @@ const enTranslations = {
|
|
|
1027
1192
|
statusLabels: {
|
|
1028
1193
|
NEW: 'Open',
|
|
1029
1194
|
IN_PROGRESS: 'In progress',
|
|
1030
|
-
DONE: 'Done'
|
|
1195
|
+
DONE: 'Done'
|
|
1031
1196
|
},
|
|
1032
1197
|
criticalityLabels: {
|
|
1033
1198
|
LOW: 'Low',
|
|
1034
1199
|
MEDIUM: 'Medium',
|
|
1035
1200
|
HIGH: 'High',
|
|
1036
|
-
ALL: 'All'
|
|
1037
|
-
}
|
|
1201
|
+
ALL: 'All'
|
|
1202
|
+
}
|
|
1038
1203
|
},
|
|
1039
1204
|
procedure: {
|
|
1040
1205
|
name: 'Procedure',
|
|
1041
|
-
progress: 'Procedure progress %'
|
|
1206
|
+
progress: 'Procedure progress %'
|
|
1042
1207
|
},
|
|
1043
1208
|
action: {
|
|
1044
1209
|
consult: 'Consult',
|
|
1045
1210
|
close: 'Close',
|
|
1046
1211
|
send: 'Send',
|
|
1047
|
-
comment: 'Comment'
|
|
1048
|
-
|
|
1049
|
-
|
|
1212
|
+
comment: 'Comment',
|
|
1213
|
+
associate: 'Link to procedure',
|
|
1214
|
+
validate: 'Validate',
|
|
1215
|
+
cancel: 'Cancel'
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1050
1218
|
};
|
|
1051
1219
|
|
|
1052
1220
|
const frTranslations = {
|
|
@@ -1054,33 +1222,33 @@ const frTranslations = {
|
|
|
1054
1222
|
event: {
|
|
1055
1223
|
name: 'Événements',
|
|
1056
1224
|
type: {
|
|
1057
|
-
name:
|
|
1225
|
+
name: "Type d'événement",
|
|
1058
1226
|
ALERT: 'Alerte',
|
|
1059
1227
|
REPORT: 'Signalement',
|
|
1060
|
-
OPERATOR: 'Opérateur'
|
|
1228
|
+
OPERATOR: 'Opérateur'
|
|
1061
1229
|
},
|
|
1062
1230
|
status: {
|
|
1063
1231
|
name: 'Statut événement',
|
|
1064
1232
|
NEW: 'Nouveau',
|
|
1065
1233
|
IN_PROGRESS: 'En cours',
|
|
1066
|
-
DONE: 'Clôturé'
|
|
1234
|
+
DONE: 'Clôturé'
|
|
1067
1235
|
},
|
|
1068
1236
|
address: 'Adresse',
|
|
1069
1237
|
source: 'Référence externe',
|
|
1070
1238
|
equipment: 'Référence matériel',
|
|
1071
|
-
equipmentEntity:
|
|
1239
|
+
equipmentEntity: "Entité de l'équipement",
|
|
1072
1240
|
domain: {
|
|
1073
|
-
name: 'Métier'
|
|
1241
|
+
name: 'Métier'
|
|
1074
1242
|
},
|
|
1075
1243
|
startDate: 'Date de début',
|
|
1076
1244
|
endDate: 'Date de fin',
|
|
1077
1245
|
creationDate: 'Date de création',
|
|
1078
|
-
lastModificationDate: 'Date
|
|
1246
|
+
lastModificationDate: 'Date de dernière modification',
|
|
1079
1247
|
closeDate: 'Date de clotûre',
|
|
1080
1248
|
detail: 'Description des événements',
|
|
1081
1249
|
log: {
|
|
1082
1250
|
name: 'Journal des événements',
|
|
1083
|
-
empty:
|
|
1251
|
+
empty: "Aucun événement n'a été créé",
|
|
1084
1252
|
event: {
|
|
1085
1253
|
description: 'Description',
|
|
1086
1254
|
address: 'Adresse',
|
|
@@ -1088,160 +1256,88 @@ const frTranslations = {
|
|
|
1088
1256
|
name: 'Nom',
|
|
1089
1257
|
category: 'Catégorie',
|
|
1090
1258
|
close: 'Clôturer tous ces événements',
|
|
1259
|
+
closed: 'Tous clôturés',
|
|
1091
1260
|
comments: {
|
|
1092
|
-
name:
|
|
1093
|
-
placeholder: 'Écrivez votre commentaire'
|
|
1094
|
-
}
|
|
1261
|
+
name: "Commentaires de l'événement",
|
|
1262
|
+
placeholder: 'Écrivez votre commentaire'
|
|
1263
|
+
}
|
|
1095
1264
|
},
|
|
1096
1265
|
procedure: {
|
|
1097
1266
|
delete: 'Supprimer la procédure',
|
|
1098
1267
|
progress: 'Progression',
|
|
1099
|
-
noAction:
|
|
1268
|
+
noAction: "Pas d'action",
|
|
1100
1269
|
name: 'Procédure commune',
|
|
1101
1270
|
name1: 'Procédure',
|
|
1102
|
-
addAction: 'Ajouter une action'
|
|
1103
|
-
}
|
|
1271
|
+
addAction: 'Ajouter une action'
|
|
1272
|
+
}
|
|
1104
1273
|
},
|
|
1105
1274
|
category: {
|
|
1106
|
-
name:
|
|
1275
|
+
name: "Catégorie d'événement",
|
|
1107
1276
|
ALERT_MALFUNCTION: 'Alerte Dysfonctionnement',
|
|
1108
1277
|
REPORT: 'Signalement GRC',
|
|
1109
1278
|
OPERATOR_EVENT: 'Evènement Opérateur',
|
|
1110
1279
|
ALERT_LIMIT: 'Alerte Seuil',
|
|
1111
|
-
MANIFESTATION: 'Manifestation'
|
|
1280
|
+
MANIFESTATION: 'Manifestation'
|
|
1112
1281
|
},
|
|
1113
1282
|
criticality: {
|
|
1114
1283
|
name: 'Criticité',
|
|
1115
1284
|
LOW: 'Bas',
|
|
1116
1285
|
MEDIUM: 'Moyen',
|
|
1117
|
-
HIGH: 'Haut'
|
|
1286
|
+
HIGH: 'Haut'
|
|
1118
1287
|
},
|
|
1119
1288
|
filter: {
|
|
1120
1289
|
name: 'Filtrer',
|
|
1121
1290
|
choice: {
|
|
1122
|
-
all: 'Tous'
|
|
1291
|
+
all: 'Tous'
|
|
1123
1292
|
},
|
|
1124
1293
|
reset: 'Réinitialiser'
|
|
1125
1294
|
},
|
|
1295
|
+
close: {
|
|
1296
|
+
one: 'Êtes-vous sûr de vouloir clôturer cet événement ?',
|
|
1297
|
+
multi: 'Êtes-vous sûr de vouloir clôturer ces événements ?',
|
|
1298
|
+
comment: 'Commentaire de clôture'
|
|
1299
|
+
}
|
|
1126
1300
|
},
|
|
1127
1301
|
eventSummary: {
|
|
1128
1302
|
noContent: 'Aucun événement avec la criticité donnée',
|
|
1129
1303
|
statusLabels: {
|
|
1130
1304
|
NEW: 'Nouveaux',
|
|
1131
1305
|
IN_PROGRESS: 'En cours',
|
|
1132
|
-
DONE: 'Clôturés'
|
|
1306
|
+
DONE: 'Clôturés'
|
|
1133
1307
|
},
|
|
1134
1308
|
criticalityLabels: {
|
|
1135
1309
|
LOW: 'Bas',
|
|
1136
1310
|
MEDIUM: 'Moyen',
|
|
1137
1311
|
HIGH: 'Haut',
|
|
1138
|
-
ALL: 'Tous'
|
|
1139
|
-
}
|
|
1312
|
+
ALL: 'Tous'
|
|
1313
|
+
}
|
|
1140
1314
|
},
|
|
1141
1315
|
procedure: {
|
|
1142
1316
|
name: 'Procédure',
|
|
1143
|
-
progress: '% avancement procédure'
|
|
1317
|
+
progress: '% avancement procédure'
|
|
1144
1318
|
},
|
|
1145
1319
|
action: {
|
|
1146
1320
|
consult: 'Consulter',
|
|
1147
1321
|
close: 'Clotûrer',
|
|
1148
1322
|
send: 'Envoyer',
|
|
1149
1323
|
comment: 'Commenter',
|
|
1150
|
-
|
|
1151
|
-
|
|
1324
|
+
associate: 'Associer à une procédure',
|
|
1325
|
+
validate: 'Valider',
|
|
1326
|
+
cancel: 'Annuler'
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1152
1329
|
};
|
|
1153
1330
|
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
});
|
|
1331
|
+
const HypEventStatus = {
|
|
1332
|
+
values: ['NEW', 'IN_PROGRESS', 'DONE'],
|
|
1333
|
+
};
|
|
1158
1334
|
|
|
1159
1335
|
const HypEventType = { values: ['ALERT', 'REPORT', 'OPERATOR'] };
|
|
1160
1336
|
|
|
1161
|
-
const procedureForWriteAPI = (procedure) => ({
|
|
1162
|
-
...procedure,
|
|
1163
|
-
events: procedure.events.map(eventForWriteAPI)
|
|
1164
|
-
});
|
|
1165
|
-
|
|
1166
1337
|
/*
|
|
1167
1338
|
* Public API Surface of hypervisor
|
|
1168
1339
|
*/
|
|
1169
1340
|
|
|
1170
|
-
class EventService {
|
|
1171
|
-
constructor(httpClient, store) {
|
|
1172
|
-
this.httpClient = httpClient;
|
|
1173
|
-
this.store = store;
|
|
1174
|
-
}
|
|
1175
|
-
list(startWith = 0) {
|
|
1176
|
-
return this.store
|
|
1177
|
-
.select(HypSelectors.url)
|
|
1178
|
-
.pipe(withLatestFrom(this.store.select(EventSelectors.filters), this.store.select(EventSelectors.sort)), mergeMap(([url, filters, sort]) => {
|
|
1179
|
-
let params = new HttpParams();
|
|
1180
|
-
Object.keys(filters).forEach(filter => {
|
|
1181
|
-
filters[filter].forEach((filterValue) => {
|
|
1182
|
-
params = params.append(filter, filterValue);
|
|
1183
|
-
});
|
|
1184
|
-
});
|
|
1185
|
-
const pageSize = 20;
|
|
1186
|
-
params = params.set('page', (startWith / pageSize) + 1);
|
|
1187
|
-
if (sort) {
|
|
1188
|
-
params = params.set('sort', sort.field).set('order', sort.order);
|
|
1189
|
-
}
|
|
1190
|
-
return this.httpClient.get(encodeURI(`${url}/events`), { params });
|
|
1191
|
-
}));
|
|
1192
|
-
}
|
|
1193
|
-
get(id) {
|
|
1194
|
-
return this.store
|
|
1195
|
-
.select(HypSelectors.url)
|
|
1196
|
-
.pipe(mergeMap((url) => {
|
|
1197
|
-
return this.httpClient.get(encodeURI(`${url}/events/id/${id}`));
|
|
1198
|
-
}));
|
|
1199
|
-
}
|
|
1200
|
-
getProcedure(id) {
|
|
1201
|
-
return this.store
|
|
1202
|
-
.select(HypSelectors.url)
|
|
1203
|
-
.pipe(mergeMap((url) => {
|
|
1204
|
-
return this.httpClient.get(encodeURI(`${url}/procedures/id/${id}`));
|
|
1205
|
-
}));
|
|
1206
|
-
}
|
|
1207
|
-
save(event) {
|
|
1208
|
-
return this.store
|
|
1209
|
-
.select(HypSelectors.url)
|
|
1210
|
-
.pipe(mergeMap((url) => {
|
|
1211
|
-
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), eventForWriteAPI(event));
|
|
1212
|
-
}));
|
|
1213
|
-
}
|
|
1214
|
-
saveProcedure(procedure) {
|
|
1215
|
-
return this.store
|
|
1216
|
-
.select(HypSelectors.url)
|
|
1217
|
-
.pipe(mergeMap((url) => {
|
|
1218
|
-
return this.httpClient.post(encodeURI(`${url}/procedures`), procedureForWriteAPI(procedure));
|
|
1219
|
-
}));
|
|
1220
|
-
}
|
|
1221
|
-
status(event, status) {
|
|
1222
|
-
return this.store
|
|
1223
|
-
.select(HypSelectors.url)
|
|
1224
|
-
.pipe(mergeMap((url) => {
|
|
1225
|
-
return this.httpClient.put(encodeURI(`${url}/events/id/${event.id}/close`), { status });
|
|
1226
|
-
}));
|
|
1227
|
-
}
|
|
1228
|
-
statusProcedure(procedure, status) {
|
|
1229
|
-
return this.store
|
|
1230
|
-
.select(HypSelectors.url)
|
|
1231
|
-
.pipe(mergeMap((url) => {
|
|
1232
|
-
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}/close`), { status });
|
|
1233
|
-
}));
|
|
1234
|
-
}
|
|
1235
|
-
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 }); }
|
|
1236
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, providedIn: 'root' }); }
|
|
1237
|
-
}
|
|
1238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, decorators: [{
|
|
1239
|
-
type: Injectable,
|
|
1240
|
-
args: [{
|
|
1241
|
-
providedIn: 'root',
|
|
1242
|
-
}]
|
|
1243
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
1244
|
-
|
|
1245
1341
|
class EventEffects {
|
|
1246
1342
|
constructor(actions$, eventService, store) {
|
|
1247
1343
|
this.actions$ = actions$;
|
|
@@ -1254,10 +1350,10 @@ class EventEffects {
|
|
|
1254
1350
|
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 })])))));
|
|
1255
1351
|
this.close$ = createEffect(() => this.actions$.pipe(ofType(EventActions.status), debounceTime(200), mergeMap$1((action) => {
|
|
1256
1352
|
if (!!action.event) {
|
|
1257
|
-
return this.eventService.status(action.event, action.targetStatus).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
1353
|
+
return this.eventService.status(action.event, action.targetStatus, action.comment).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
1258
1354
|
}
|
|
1259
1355
|
else {
|
|
1260
|
-
return this.eventService.statusProcedure(action.procedure, action.targetStatus).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
1356
|
+
return this.eventService.statusProcedure(action.procedure, action.targetStatus, action.comment).pipe(map$1((event) => EventActions.statusSuccess()), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
1261
1357
|
}
|
|
1262
1358
|
})));
|
|
1263
1359
|
this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort, EventActions.filter), debounceTime(200), map$1(() => EventActions.load({}))));
|
|
@@ -1302,11 +1398,10 @@ class EventSummaryService {
|
|
|
1302
1398
|
this.store = store;
|
|
1303
1399
|
}
|
|
1304
1400
|
list() {
|
|
1305
|
-
return this.store
|
|
1306
|
-
.
|
|
1307
|
-
.pipe(withLatestFrom(this.store.select(EventSelectors.filters)), mergeMap(([url, filters]) => {
|
|
1401
|
+
return this.store.select(HypSelectors.url).pipe(withLatestFrom(this.store.select(EventSelectors.filters)), mergeMap(([url, filterSets]) => {
|
|
1402
|
+
const filters = filterSets[KNOWN_FILTER_SETS.EVENTS];
|
|
1308
1403
|
let params = new HttpParams();
|
|
1309
|
-
Object.keys(filters).forEach(filter => {
|
|
1404
|
+
Object.keys(filters).forEach((filter) => {
|
|
1310
1405
|
filters[filter].forEach((filterValue) => {
|
|
1311
1406
|
params = params.set(filter, filterValue);
|
|
1312
1407
|
});
|
|
@@ -1491,5 +1586,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
1491
1586
|
* Generated bundle index. Do not edit.
|
|
1492
1587
|
*/
|
|
1493
1588
|
|
|
1494
|
-
export { CATEGORIES_BY_TYPE, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventFiltersComponent, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, procedureForWriteAPI };
|
|
1589
|
+
export { CATEGORIES_BY_TYPE, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventFiltersComponent, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, KNOWN_FILTER_SETS, PAGE_SIZE_FETCH, ProgressDisplayComponent, PvyHypervisorModule, SCROLL_PX_TO_TRIGGER_FETCH_PAGE, StatusDisplayComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, procedureForWriteAPI };
|
|
1495
1590
|
//# sourceMappingURL=provoly-hypervisor.mjs.map
|