@provoly/hypervisor 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/lib/event/detail/event-detail.component.mjs +57 -10
- package/esm2022/src/lib/event-summary/item/event-summary-item.component.mjs +3 -3
- package/esm2022/src/lib/general/for-datetime-local-pipe/for-datetime-local.pipe.mjs +1 -1
- package/esm2022/src/lib/model/event/hyp-event-category.type.mjs +9 -2
- package/esm2022/src/lib/model/event/hyp-event-criticality.type.mjs +4 -2
- package/esm2022/src/lib/model/event/hyp-event-detail.interface.mjs +5 -2
- package/esm2022/src/lib/model/event/hyp-event-status.type.mjs +4 -2
- package/esm2022/src/lib/model/event/hyp-event-summary.interface.mjs +1 -1
- package/esm2022/src/lib/model/event/hyp-event-type.mjs +2 -7
- package/esm2022/src/lib/model/hyp-procedure.interface.mjs +6 -2
- package/esm2022/src/lib/store/equipment/equipment.service.mjs +2 -5
- package/esm2022/src/lib/store/event/event.effects.mjs +3 -3
- package/esm2022/src/lib/store/event/event.service.mjs +5 -3
- package/fesm2022/provoly-hypervisor.mjs +91 -30
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/event/detail/event-detail.component.d.ts +15 -2
- package/src/lib/general/for-datetime-local-pipe/for-datetime-local.pipe.d.ts +1 -1
- package/src/lib/model/event/hyp-event-category.type.d.ts +6 -1
- package/src/lib/model/event/hyp-event-criticality.type.d.ts +3 -1
- package/src/lib/model/event/hyp-event-detail.interface.d.ts +29 -2
- package/src/lib/model/event/hyp-event-status.type.d.ts +3 -1
- package/src/lib/model/event/hyp-event-summary.interface.d.ts +2 -2
- package/src/lib/model/event/hyp-event-type.d.ts +3 -5
- package/src/lib/model/hyp-procedure.interface.d.ts +35 -0
- package/src/lib/store/event/event.service.d.ts +2 -2
|
@@ -16,8 +16,8 @@ export class EventEffects {
|
|
|
16
16
|
this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime(200), withLatestFrom(this.store.select(EventSelectors.events), this.store.select(EventSelectors.noMoreEvents)), filter(([action, events, noMore]) => !noMore), mergeMap(([action, stateEvents]) => this.eventService.list(action.next ? stateEvents.length : 0).pipe(map((events) => EventActions.loadSuccess({ events, startingFrom: action.next ? stateEvents.length : 0 })), catchError((error) => [EventActions.loadFailure({ error: error })])))));
|
|
17
17
|
this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime(200), mergeMap((action) => this.eventService.get(action.id).pipe(map((event) => EventActions.getSuccess({ event })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
18
18
|
this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime(200), mergeMap((action) => this.eventService.getProcedure(action.id).pipe(map((procedure) => EventActions.getSuccess({ procedure })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
19
|
-
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap((action) => this.eventService.save(action.event).pipe(map((event) => EventActions.saveSuccess({ event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
20
|
-
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime(200), mergeMap((action) => this.eventService.saveProcedure(action.procedure).pipe(map((procedure) => EventActions.saveSuccess({ procedure })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
19
|
+
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap((action) => this.eventService.save(action.event).pipe(map((event) => EventActions.saveSuccess({ event: action.event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
20
|
+
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime(200), mergeMap((action) => this.eventService.saveProcedure(action.procedure).pipe(map((procedure) => EventActions.saveSuccess({ procedure: action.procedure })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
21
21
|
}
|
|
22
22
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, deps: [{ token: i1.Actions }, { token: i2.EventService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23
23
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
|
|
@@ -25,4 +25,4 @@ export class EventEffects {
|
|
|
25
25
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, decorators: [{
|
|
26
26
|
type: Injectable
|
|
27
27
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: i2.EventService }, { type: i3.Store }] });
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnQuZWZmZWN0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Byb3ZvbHkvaHlwZXJ2aXNvci9zcmMvbGliL3N0b3JlL2V2ZW50L2V2ZW50LmVmZmVjdHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQVcsWUFBWSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUM5RCxPQUFPLEVBQUUsVUFBVSxFQUFFLFlBQVksRUFBRSxHQUFHLEVBQUUsUUFBUSxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDekUsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRS9DLE9BQU8sRUFBRSxNQUFNLEV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JvcikgPT4gW0V2ZW50QWN0aW9ucy5zYXZlRmFpbHVyZSh7IGVycm9yOiBlcnJvciB9KV0pLFxuICAgICAgICApLFxuICAgICAgKSxcbiAgICApLFxuICApO1xuXG4gIGNvbnN0cnVjdG9yKFxuICAgIHByaXZhdGUgYWN0aW9ucyQ6IEFjdGlvbnMsXG4gICAgcHJpdmF0ZSBldmVudFNlcnZpY2U6IEV2ZW50U2VydmljZSxcbiAgICBwcml2YXRlIHN0b3JlOiBTdG9yZVxuICApIHtcbiAgfVxufVxuIl19
|
|
@@ -3,6 +3,8 @@ import { HttpParams } from '@angular/common/http';
|
|
|
3
3
|
import { mergeMap, withLatestFrom } from 'rxjs';
|
|
4
4
|
import { HypSelectors } from '../hypervisor/hypervisor.selectors';
|
|
5
5
|
import { EventSelectors } from './event.selectors';
|
|
6
|
+
import { eventForWriteAPI } from '../../model/event/hyp-event-detail.interface';
|
|
7
|
+
import { procedureForWriteAPI } from '../../model/hyp-procedure.interface';
|
|
6
8
|
import * as i0 from "@angular/core";
|
|
7
9
|
import * as i1 from "@angular/common/http";
|
|
8
10
|
import * as i2 from "@ngrx/store";
|
|
@@ -44,14 +46,14 @@ export class EventService {
|
|
|
44
46
|
return this.store
|
|
45
47
|
.select(HypSelectors.url)
|
|
46
48
|
.pipe(mergeMap((url) => {
|
|
47
|
-
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), event);
|
|
49
|
+
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), eventForWriteAPI(event));
|
|
48
50
|
}));
|
|
49
51
|
}
|
|
50
52
|
saveProcedure(procedure) {
|
|
51
53
|
return this.store
|
|
52
54
|
.select(HypSelectors.url)
|
|
53
55
|
.pipe(mergeMap((url) => {
|
|
54
|
-
return this.httpClient.post(encodeURI(`${url}/procedures`), procedure);
|
|
56
|
+
return this.httpClient.post(encodeURI(`${url}/procedures`), procedureForWriteAPI(procedure));
|
|
55
57
|
}));
|
|
56
58
|
}
|
|
57
59
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, deps: [{ token: i1.HttpClient }, { token: i2.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -63,4 +65,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
63
65
|
providedIn: 'root',
|
|
64
66
|
}]
|
|
65
67
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.Store }] });
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnQuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Byb3ZvbHkvaHlwZXJ2aXNvci9zcmMvbGliL3N0b3JlL2V2ZW50L2V2ZW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQWMsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDOUQsT0FBTyxFQUFFLFFBQVEsRUFBYyxjQUFjLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFFNUQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBQ2xFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNuRCxPQUFPLEVBQUUsZ0JBQWdCLEVBQW1CLE1BQU0sOENBQThDLENBQUM7QUFDakcsT0FBTyxFQUFnQixvQkFBb0IsRUFBRSxNQUFNLHFDQUFxQyxDQUFDOzs7O0FBS3pGLE1BQU0sT0FBTyxZQUFZO0lBQ3ZCLFl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9yZVxuICAgICAgLnNlbGVjdChIeXBTZWxlY3RvcnMudXJsKVxuICAgICAgLnBpcGUoXG4gICAgICAgIG1lcmdlTWFwKCh1cmwpID0+IHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5odHRwQ2xpZW50LnBvc3Q8dm9pZD4oZW5jb2RlVVJJKGAke3VybH0vZXZlbnRzLyR7ZXZlbnQudHlwZS50b0xvd2VyQ2FzZSgpfWApLCBldmVudEZvcldyaXRlQVBJKGV2ZW50KSk7XG4gICAgICAgIH0pLFxuICAgICAgKTtcbiAgfVxuXG4gIHNhdmVQcm9jZWR1cmUocHJvY2VkdXJlOiBIeXBQcm9jZWR1cmUpIHtcbiAgICByZXR1cm4gdGhpcy5zdG9yZVxuICAgICAgLnNlbGVjdChIeXBTZWxlY3RvcnMudXJsKVxuICAgICAgLnBpcGUoXG4gICAgICAgIG1lcmdlTWFwKCh1cmwpID0+IHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5odHRwQ2xpZW50LnBvc3Q8dm9pZD4oZW5jb2RlVVJJKGAke3VybH0vcHJvY2VkdXJlc2ApLCBwcm9jZWR1cmVGb3JXcml0ZUFQSShwcm9jZWR1cmUpKTtcbiAgICAgICAgfSksXG4gICAgICApO1xuICB9XG59XG4iXX0=
|
|
@@ -2,11 +2,11 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Pipe, Component, Input, EventEmitter, Output, InjectionToken, NgModule, Inject } from '@angular/core';
|
|
3
3
|
import * as i3 from '@provoly/dashboard';
|
|
4
4
|
import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
|
|
5
|
-
import * as i1 from '@angular/common/http';
|
|
6
|
-
import { HttpParams } from '@angular/common/http';
|
|
7
5
|
import { mergeMap, of, fromEvent, map, withLatestFrom, filter, auditTime } from 'rxjs';
|
|
8
6
|
import * as i1$1 from '@ngrx/store';
|
|
9
7
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
8
|
+
import * as i1 from '@angular/common/http';
|
|
9
|
+
import { HttpParams } from '@angular/common/http';
|
|
10
10
|
import * as i2 from '@provoly/dashboard/components/checkbox';
|
|
11
11
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
12
12
|
import * as i3$1 from '@angular/forms';
|
|
@@ -21,14 +21,23 @@ import { map as map$1, debounceTime, mergeMap as mergeMap$1, catchError } from '
|
|
|
21
21
|
import * as i1$3 from '@ngrx/effects';
|
|
22
22
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const HypEventCriticality = {
|
|
25
|
+
values: ['LOW', 'MEDIUM', 'HIGH'],
|
|
26
|
+
};
|
|
27
27
|
|
|
28
28
|
const DOMAINS = {
|
|
29
29
|
values: ['DOMAIN1', 'DOMAIN2'],
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
const HypEventCategory = {
|
|
33
|
+
values: ['ALERT_MALFUNCTION', 'REPORT', 'OPERATOR_EVENT', 'ALERT_LIMIT', 'MANIFESTATION'],
|
|
34
|
+
};
|
|
35
|
+
const CATEGORIES_BY_TYPE = {
|
|
36
|
+
'OPERATOR': ['OPERATOR_EVENT', 'MANIFESTATION'],
|
|
37
|
+
'ALERT': ['ALERT_MALFUNCTION', 'ALERT_LIMIT'],
|
|
38
|
+
'REPORT': ['REPORT'],
|
|
39
|
+
};
|
|
40
|
+
|
|
32
41
|
const HypervisorActions = {
|
|
33
42
|
setUrl: createAction('[Event] Set Backend Url', props())
|
|
34
43
|
};
|
|
@@ -61,9 +70,7 @@ class EquipmentService {
|
|
|
61
70
|
return this.store
|
|
62
71
|
.select(HypSelectors.url)
|
|
63
72
|
.pipe(mergeMap((url) => {
|
|
64
|
-
|
|
65
|
-
params = params.set('name', name);
|
|
66
|
-
return this.httpClient.get(encodeURI(`${url}/equipment`), { params });
|
|
73
|
+
return this.httpClient.get(encodeURI(`${url}/equipments/name/${name}`));
|
|
67
74
|
}));
|
|
68
75
|
}
|
|
69
76
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EquipmentService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -203,34 +210,40 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
203
210
|
super();
|
|
204
211
|
this.equipmentService = equipmentService;
|
|
205
212
|
this.opened = [];
|
|
206
|
-
this.
|
|
207
|
-
this.criticalities = HypEventCriticality;
|
|
213
|
+
this.criticalities = HypEventCriticality.values;
|
|
208
214
|
this._events = [];
|
|
209
215
|
this.eventModifications = [];
|
|
210
216
|
this.modifiedEvents = new EventEmitter();
|
|
211
217
|
this.procedureModifications = {};
|
|
212
218
|
this.modifiedProcedure = new EventEmitter();
|
|
213
219
|
this.DOMAINS = DOMAINS.values;
|
|
220
|
+
this.eventErrors = new EventEmitter();
|
|
221
|
+
this.errors = [];
|
|
214
222
|
}
|
|
215
223
|
get events() {
|
|
216
224
|
return this._events.map((evt, idx) => ({ ...evt, ...(this.eventModifications[idx] ?? {}) }));
|
|
217
225
|
}
|
|
218
226
|
get procedure() {
|
|
219
|
-
return this._procedure ? ({
|
|
227
|
+
return this._procedure ? ({
|
|
228
|
+
...this._procedure, ...(this.procedureModifications ?? {}),
|
|
229
|
+
events: this.events,
|
|
230
|
+
}) : undefined;
|
|
220
231
|
}
|
|
221
232
|
toggle(i) {
|
|
222
233
|
this.opened[i] = !this.opened[i];
|
|
223
234
|
}
|
|
224
235
|
modifyEvent(index, prop, $event) {
|
|
236
|
+
const isDate = prop.indexOf('Date') > -1;
|
|
225
237
|
// @ts-ignore
|
|
226
238
|
const newValue = $event instanceof Event ? $event.target?.value : $event;
|
|
239
|
+
const correctedValue = !isDate ? newValue : `${newValue}:00.000000Z`;
|
|
227
240
|
// @ts-ignore
|
|
228
|
-
if (this.
|
|
241
|
+
if (this.events[index][prop] !== correctedValue) {
|
|
229
242
|
if (!this.eventModifications[index]) {
|
|
230
243
|
this.eventModifications[index] = {};
|
|
231
244
|
}
|
|
232
245
|
// @ts-ignore
|
|
233
|
-
this.eventModifications[index][prop] =
|
|
246
|
+
this.eventModifications[index][prop] = correctedValue;
|
|
234
247
|
this._outputModifications();
|
|
235
248
|
}
|
|
236
249
|
}
|
|
@@ -291,19 +304,60 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
291
304
|
});
|
|
292
305
|
}
|
|
293
306
|
_outputModifications() {
|
|
294
|
-
this.
|
|
307
|
+
this.validateEvents(this.events);
|
|
308
|
+
this.modifiedEvents.next(this.events.map((ev, idx) => [this.eventModifications[idx], ev]));
|
|
295
309
|
this.modifiedProcedure.next(this.procedure ? [this.procedureModifications, this.procedure] : undefined);
|
|
296
310
|
}
|
|
311
|
+
validateEvents(events) {
|
|
312
|
+
this.errors = [];
|
|
313
|
+
events.forEach(event => {
|
|
314
|
+
const eventErrors = [];
|
|
315
|
+
if (!event.name || event.name.length === 0) {
|
|
316
|
+
eventErrors.push({ field: 'name', code: 'required' });
|
|
317
|
+
}
|
|
318
|
+
if (!event.category || event.category.length === 0) {
|
|
319
|
+
eventErrors.push({ field: 'category', code: 'required' });
|
|
320
|
+
}
|
|
321
|
+
if (!event.criticality || event.criticality.length === 0) {
|
|
322
|
+
eventErrors.push({ field: 'criticality', code: 'required' });
|
|
323
|
+
}
|
|
324
|
+
if (!event.description || event.description.length === 0) {
|
|
325
|
+
eventErrors.push({ field: 'description', code: 'required' });
|
|
326
|
+
}
|
|
327
|
+
if (event.category === 'MANIFESTATION') {
|
|
328
|
+
if (!event.startDate || event.startDate.length === 0) {
|
|
329
|
+
eventErrors.push({ field: 'startDate', code: 'required' });
|
|
330
|
+
}
|
|
331
|
+
if (!event.endDate || event.endDate.length === 0) {
|
|
332
|
+
eventErrors.push({ field: 'endDate', code: 'required' });
|
|
333
|
+
}
|
|
334
|
+
if ((event.startDate?.localeCompare(event.endDate ?? '') ?? 0) > 0) {
|
|
335
|
+
eventErrors.push({ field: 'startDate', code: 'before' });
|
|
336
|
+
eventErrors.push({ field: 'endDate', code: 'after' });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
this.errors.push(eventErrors);
|
|
340
|
+
});
|
|
341
|
+
this.eventErrors.next(this.errors);
|
|
342
|
+
}
|
|
343
|
+
hasError(prop, idx) {
|
|
344
|
+
return this.errors[idx]?.find(err => err.field === prop) ?? false;
|
|
345
|
+
}
|
|
346
|
+
categories(event) {
|
|
347
|
+
return CATEGORIES_BY_TYPE[event.type];
|
|
348
|
+
}
|
|
297
349
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
298
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure", cancelModifications: "cancelModifications" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.log.name' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\" [items]=\"categories\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.startDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.startDate | forDateTimeLocal\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.endDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.endDate | forDateTimeLocal\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i2.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
350
|
+
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.log.name' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i2.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["event", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
299
351
|
}
|
|
300
352
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
301
353
|
type: Component,
|
|
302
|
-
args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.log.name' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\" [items]=\"categories\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.startDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.startDate | forDateTimeLocal\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.endDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.endDate | forDateTimeLocal\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
354
|
+
args: [{ selector: 'hvy-event-detail', template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ '@hvy.event.log.name' | i18n }}</h1>\n <button class=\"a-btn a-btn--secondary -fix-right\">{{ '@hvy.event.log.event.close' | i18n }}</button>\n </div>\n <div class=\"o-hvy-events-detail__header__split\">\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</button>\n </div>\n </div>\n <div class=\"o-hvy-events-detail__container\">\n <div class=\"o-hvy-events-detail__container__scrollable\">\n <div class=\"o-hvy-events-detail__events\">\n @for (event of events;track event.id;let idx = $index) {\n <div class=\"o-hvy-events-detail__events__event\">\n <div class=\"o-hvy-events-detail__events__event__header\">\n <pry-icon [iconSvg]=\"!opened[idx] ? 'chevron_bottom' : 'chevron_top'\" (click)=\"toggle(idx)\"></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <hvy-status-display [event]=\"event\" [modifiable]=\"true\"></hvy-status-display>\n </div>\n <div class=\"o-hvy-events-detail__events__event__content\">\n <div>{{ '@hvy.event.log.event.description' | i18n }}: {{ event.description }}</div>\n <div>{{ '@hvy.event.log.event.address' | i18n }}: {{ event.address }}</div>\n @if (opened[idx]) {\n @if (access(event);as accessValue) {\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span></td>\n <td><input type=\"text\" class=\"a-form-field\" [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\" [readonly]=\"accessValue.name\"></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\" [disabled]=\"accessValue.category\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span></td>\n <td>\n <pry-select [ngModel]=\"event.criticality\" [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span></td>\n <td><textarea [ngModel]=\"event.description\" class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"></textarea></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }}</td>\n <td><textarea [ngModel]=\"event.address\" class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"></textarea></td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.externalSourceRef ?? ''\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\" (change)=\"modifyEvent(idx, 'source', $event)\"></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }}</td>\n <td>\n <input type=\"text\" class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }}</td>\n <td><input type=\"text\" class=\"a-form-field\" [value]=\"event.equipment?.entity ?? ''\"\n readonly></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}</td>\n <td>\n <pry-select [items]=\"DOMAINS\" [ngModel]=\"event.domain\" i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\" (change)=\"modifyEvent(idx, 'startDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n </td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\" (change)=\"modifyEvent(idx, 'endDate', $event)\">\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\" readonly>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }}</td>\n <td>\n <input type=\"datetime-local\" class=\"a-form-field\" [value]=\"event.closeDate | forDateTimeLocal\"\n readonly>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }}</h3>\n <textarea [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\">{{ '@hvy.action.send' | i18n }}</button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>{{ '@hvy.event.log.procedure.name' | i18n }}</h2>\n </div>\n <div>\n <p>{{ procedure.name }}</p>\n </div>\n <div class=\"o-hvy-events-detail__procedure__progress\">\n <p>{{ '@hvy.event.log.procedure.progress' | i18n }}</p>\n <hvy-progress-display [progress]=\"procedure.progress\"></hvy-progress-display>\n </div>\n <div class=\"o-hvy-events-detail__procedure__actions\">\n @for (action of procedure.actions;track action.id) {\n <div class=\"o-hvy-events-detail__procedure__actions__action\">\n <pry-icon iconSvg=\"six_dot\"></pry-icon>\n <pry-checkbox [ngModel]=\"action.status === 'DONE'\"></pry-checkbox>\n <div>{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div>\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
303
355
|
}], ctorParameters: () => [{ type: EquipmentService }], propDecorators: { modifiedEvents: [{
|
|
304
356
|
type: Output
|
|
305
357
|
}], modifiedProcedure: [{
|
|
306
358
|
type: Output
|
|
359
|
+
}], eventErrors: [{
|
|
360
|
+
type: Output
|
|
307
361
|
}], events: [{
|
|
308
362
|
type: Input
|
|
309
363
|
}], procedure: [{
|
|
@@ -471,11 +525,11 @@ class EventSummaryItemComponent {
|
|
|
471
525
|
this.EVENT_LINK = EVENT_LINK;
|
|
472
526
|
}
|
|
473
527
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
474
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: { event: "event", linkBase: "linkBase" }, ngImport: i0, template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.
|
|
528
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: { event: "event", linkBase: "linkBase" }, ngImport: i0, template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.serviceTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.serviceCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
|
|
475
529
|
}
|
|
476
530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, decorators: [{
|
|
477
531
|
type: Component,
|
|
478
|
-
args: [{ selector: 'hvy-event-summary-item', template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.
|
|
532
|
+
args: [{ selector: 'hvy-event-summary-item', template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"EVENT_LINK.fn(event, store)\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.serviceTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.serviceCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n" }]
|
|
479
533
|
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { event: [{
|
|
480
534
|
type: Input,
|
|
481
535
|
args: [{ required: true }]
|
|
@@ -731,14 +785,21 @@ const frTranslations = {
|
|
|
731
785
|
},
|
|
732
786
|
};
|
|
733
787
|
|
|
734
|
-
const
|
|
788
|
+
const eventForWriteAPI = (event) => ({
|
|
789
|
+
...event,
|
|
790
|
+
equipmentId: event.equipment?.id
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
const HypEventStatus = {
|
|
794
|
+
values: ['NEW', 'IN_PROGRESS', 'DONE'],
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
const HypEventType = { values: ['ALERT', 'REPORT', 'OPERATOR'] };
|
|
735
798
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
HypEventType[HypEventType["OPERATOR"] = 2] = "OPERATOR";
|
|
741
|
-
})(HypEventType || (HypEventType = {}));
|
|
799
|
+
const procedureForWriteAPI = (procedure) => ({
|
|
800
|
+
...procedure,
|
|
801
|
+
events: procedure.events.map(eventForWriteAPI)
|
|
802
|
+
});
|
|
742
803
|
|
|
743
804
|
/*
|
|
744
805
|
* Public API Surface of hypervisor
|
|
@@ -782,14 +843,14 @@ class EventService {
|
|
|
782
843
|
return this.store
|
|
783
844
|
.select(HypSelectors.url)
|
|
784
845
|
.pipe(mergeMap((url) => {
|
|
785
|
-
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), event);
|
|
846
|
+
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), eventForWriteAPI(event));
|
|
786
847
|
}));
|
|
787
848
|
}
|
|
788
849
|
saveProcedure(procedure) {
|
|
789
850
|
return this.store
|
|
790
851
|
.select(HypSelectors.url)
|
|
791
852
|
.pipe(mergeMap((url) => {
|
|
792
|
-
return this.httpClient.post(encodeURI(`${url}/procedures`), procedure);
|
|
853
|
+
return this.httpClient.post(encodeURI(`${url}/procedures`), procedureForWriteAPI(procedure));
|
|
793
854
|
}));
|
|
794
855
|
}
|
|
795
856
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -810,8 +871,8 @@ class EventEffects {
|
|
|
810
871
|
this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime(200), withLatestFrom(this.store.select(EventSelectors.events), this.store.select(EventSelectors.noMoreEvents)), filter(([action, events, noMore]) => !noMore), mergeMap$1(([action, stateEvents]) => this.eventService.list(action.next ? stateEvents.length : 0).pipe(map$1((events) => EventActions.loadSuccess({ events, startingFrom: action.next ? stateEvents.length : 0 })), catchError((error) => [EventActions.loadFailure({ error: error })])))));
|
|
811
872
|
this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime(200), mergeMap$1((action) => this.eventService.get(action.id).pipe(map$1((event) => EventActions.getSuccess({ event })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
812
873
|
this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.getProcedure(action.id).pipe(map$1((procedure) => EventActions.getSuccess({ procedure })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
813
|
-
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map$1((event) => EventActions.saveSuccess({ event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
814
|
-
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.saveProcedure(action.procedure).pipe(map$1((procedure) => EventActions.saveSuccess({ procedure })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
874
|
+
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map$1((event) => EventActions.saveSuccess({ event: action.event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
875
|
+
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 })])))));
|
|
815
876
|
}
|
|
816
877
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, deps: [{ token: i1$3.Actions }, { token: EventService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
817
878
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
|
|
@@ -1016,5 +1077,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
1016
1077
|
* Generated bundle index. Do not edit.
|
|
1017
1078
|
*/
|
|
1018
1079
|
|
|
1019
|
-
export { DOMAINS, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer };
|
|
1080
|
+
export { CATEGORIES_BY_TYPE, DOMAINS, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, procedureForWriteAPI };
|
|
1020
1081
|
//# sourceMappingURL=provoly-hypervisor.mjs.map
|