@provoly/hypervisor 0.0.117 → 0.0.119
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/add-event/add-event.component.mjs +59 -0
- package/esm2022/src/lib/event/detail/event-detail.component.mjs +155 -48
- package/esm2022/src/lib/event/detail/event-details-tooltip.component.mjs +19 -0
- package/esm2022/src/lib/event/procedure-association-modal/procedure-association-modal.component.mjs +2 -2
- package/esm2022/src/lib/event/public-api.mjs +3 -1
- package/esm2022/src/lib/general/display-date.function.mjs +4 -0
- package/esm2022/src/lib/general/i18n/fr.translations.mjs +14 -2
- package/esm2022/src/lib/general/last-events/last-events.component.mjs +26 -0
- package/esm2022/src/lib/general/public-api.mjs +3 -1
- package/esm2022/src/lib/hypervisor.module.mjs +16 -4
- package/esm2022/src/lib/model/event/hyp-event-detail.interface.mjs +3 -2
- package/esm2022/src/lib/model/event/hyp-event.interface.mjs +1 -1
- package/esm2022/src/lib/procedure/model-list/procedure-list.component.mjs +3 -3
- package/esm2022/src/lib/store/equipment/equipment.service.mjs +1 -1
- package/esm2022/src/lib/store/event/event.actions.mjs +4 -2
- package/esm2022/src/lib/store/event/event.effects.mjs +2 -1
- package/esm2022/src/lib/store/event/event.service.mjs +23 -1
- package/fesm2022/provoly-hypervisor.mjs +445 -207
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/event/detail/add-event/add-event.component.d.ts +21 -0
- package/src/lib/event/detail/event-detail.component.d.ts +28 -6
- package/src/lib/event/detail/event-details-tooltip.component.d.ts +15 -0
- package/src/lib/event/procedure-association-modal/procedure-association-modal.component.d.ts +1 -1
- package/src/lib/event/public-api.d.ts +2 -0
- package/src/lib/general/display-date.function.d.ts +1 -0
- package/src/lib/general/i18n/fr.translations.d.ts +12 -0
- package/src/lib/general/last-events/last-events.component.d.ts +11 -0
- package/src/lib/general/public-api.d.ts +2 -0
- package/src/lib/hypervisor.module.d.ts +12 -9
- package/src/lib/model/event/hyp-event-detail.interface.d.ts +1 -0
- package/src/lib/model/event/hyp-event.interface.d.ts +4 -0
- package/src/lib/model/procedure/hyp-procedure.interface.d.ts +1 -0
- package/src/lib/store/equipment/equipment.service.d.ts +2 -1
- package/src/lib/store/event/event.actions.d.ts +12 -0
- package/src/lib/store/event/event.effects.d.ts +7 -0
- package/src/lib/store/event/event.service.d.ts +3 -0
- package/styles/components/_index.scss +2 -0
- package/styles/components/_o-hvy-event-detail-add.scss +34 -0
- package/styles/components/_o-hvy-event-detail.scss +36 -0
- package/styles/components/_o-hvy-event-summary-list.scss +4 -0
- package/styles/components/_o-hvy-last-events.scss +74 -0
- package/styles/components/_o-hvy-procedure-list.scss +4 -3
|
@@ -7,7 +7,7 @@ import { createAction, props, createReducer, on, createFeatureSelector, createSe
|
|
|
7
7
|
import * as i2 from '@angular/cdk/overlay';
|
|
8
8
|
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
9
9
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
10
|
-
import { combineLatest, map, mergeMap, of,
|
|
10
|
+
import { combineLatest, map, mergeMap, of, BehaviorSubject, Subject, debounceTime, switchMap, shareReplay, fromEvent, withLatestFrom, filter, auditTime, distinctUntilChanged } from 'rxjs';
|
|
11
11
|
import equal from 'fast-deep-equal/es6';
|
|
12
12
|
import { map as map$1, startWith, catchError, debounceTime as debounceTime$1, mergeMap as mergeMap$1 } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/common/http';
|
|
@@ -47,6 +47,7 @@ const EventActions = {
|
|
|
47
47
|
getTooltipInfoFailure: createAction('[Event Api] Load tooltip info Failure', props()),
|
|
48
48
|
save: createAction('[Event] Save Event', props()),
|
|
49
49
|
saveProcedure: createAction('[Event] Save Procedure and linked Events', props()),
|
|
50
|
+
addEventToProcedure: createAction('[Event] Add event to procedure', props()),
|
|
50
51
|
saveSuccess: createAction('[Event] Save success', props()),
|
|
51
52
|
saveFailure: createAction('[Event] Save failure', props()),
|
|
52
53
|
status: createAction('[Event] Close Event or Procedure', props()),
|
|
@@ -55,7 +56,8 @@ const EventActions = {
|
|
|
55
56
|
sort: createAction('[Event] set log event sorting', props()),
|
|
56
57
|
associateProcedure: createAction('[Event] Associate Procedure to Event', props()),
|
|
57
58
|
associateProcedureSuccess: createAction('[Event] Associate Procedure to Event Success', props()),
|
|
58
|
-
associateProcedureFailure: createAction('[Event] Associate Procedure to Event Failure', props())
|
|
59
|
+
associateProcedureFailure: createAction('[Event] Associate Procedure to Event Failure', props()),
|
|
60
|
+
export: createAction('[Event] Export events', props())
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
const padId = {
|
|
@@ -380,7 +382,7 @@ class ProcedureAssociationModalComponent extends SubscriptionnerDirective {
|
|
|
380
382
|
this.store = store;
|
|
381
383
|
this.procedureService = procedureService;
|
|
382
384
|
this.dialog = dialog;
|
|
383
|
-
this.onDomainSelect$ = new
|
|
385
|
+
this.onDomainSelect$ = new BehaviorSubject(undefined);
|
|
384
386
|
this.onProcedureSearch$ = new Subject();
|
|
385
387
|
this.eventsFromInput$ = new BehaviorSubject(null);
|
|
386
388
|
this.eventsForAction = [];
|
|
@@ -446,6 +448,275 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
446
448
|
type: Input
|
|
447
449
|
}] } });
|
|
448
450
|
|
|
451
|
+
const displayDate = (endDate) => {
|
|
452
|
+
return new Date(endDate).toLocaleDateString();
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
class StatusDisplayComponent extends SubscriptionnerDirective {
|
|
456
|
+
static { this.idCounter = 0; }
|
|
457
|
+
set item(item) {
|
|
458
|
+
this._item = item;
|
|
459
|
+
this.updateTargetStatuses();
|
|
460
|
+
}
|
|
461
|
+
set modifiable(modifiable) {
|
|
462
|
+
this._modifiable = modifiable;
|
|
463
|
+
this.updateTargetStatuses();
|
|
464
|
+
}
|
|
465
|
+
get modifiable() {
|
|
466
|
+
return this._modifiable && !this.readonly;
|
|
467
|
+
}
|
|
468
|
+
get item() {
|
|
469
|
+
return this._item;
|
|
470
|
+
}
|
|
471
|
+
trigger(status) {
|
|
472
|
+
this.modified.next(status);
|
|
473
|
+
this.targetsDisplayed = false;
|
|
474
|
+
}
|
|
475
|
+
updateTargetStatuses() {
|
|
476
|
+
this.targetStatuses = this.modifiable && this.item.status !== 'DONE' ? ['DONE'] : [];
|
|
477
|
+
}
|
|
478
|
+
toggle() {
|
|
479
|
+
window.dispatchEvent(new CustomEvent('status-display-opening', { detail: this.id }));
|
|
480
|
+
this.targetsDisplayed = this.targetStatuses.length > 0 && !this.targetsDisplayed;
|
|
481
|
+
}
|
|
482
|
+
constructor() {
|
|
483
|
+
super();
|
|
484
|
+
this.id = StatusDisplayComponent.idCounter++;
|
|
485
|
+
this.modified = new EventEmitter();
|
|
486
|
+
this.targetStatuses = [];
|
|
487
|
+
this.targetsDisplayed = false;
|
|
488
|
+
this._modifiable = false;
|
|
489
|
+
this.type = 'event';
|
|
490
|
+
this.readonly = null;
|
|
491
|
+
this.subscriptions.add(fromEvent(window, 'status-display-opening').subscribe((event) => {
|
|
492
|
+
if (event.detail !== this.id) {
|
|
493
|
+
this.targetsDisplayed = false;
|
|
494
|
+
}
|
|
495
|
+
}));
|
|
496
|
+
}
|
|
497
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: StatusDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
498
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: { type: "type", readonly: "readonly", item: "item", modifiable: "modifiable" }, outputs: { modified: "modified" }, usesInheritance: true, ngImport: i0, template: "<span\n class=\"a-chip -{{ item.status }} a-chip-status -{{ type }}\"\n [class.-modifiable]=\"_modifiable\"\n [class.-readonly]=\"readonly\"\n (click)=\"toggle()\"\n>\n {{ '@hvy.' + type + '.status.' + item.status | i18n }}\n @if (targetStatuses.length > 0) {\n <pry-icon iconSvg=\"caret_bottom_rounded\" [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)\">\n {{ '@hvy.' + type + '.status.' + status | i18n }}\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
499
|
+
}
|
|
500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: StatusDisplayComponent, decorators: [{
|
|
501
|
+
type: Component,
|
|
502
|
+
args: [{ selector: 'hvy-status-display', template: "<span\n class=\"a-chip -{{ item.status }} a-chip-status -{{ type }}\"\n [class.-modifiable]=\"_modifiable\"\n [class.-readonly]=\"readonly\"\n (click)=\"toggle()\"\n>\n {{ '@hvy.' + type + '.status.' + item.status | i18n }}\n @if (targetStatuses.length > 0) {\n <pry-icon iconSvg=\"caret_bottom_rounded\" [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)\">\n {{ '@hvy.' + type + '.status.' + status | i18n }}\n </div>\n }\n </div>\n}\n" }]
|
|
503
|
+
}], ctorParameters: () => [], propDecorators: { modified: [{
|
|
504
|
+
type: Output
|
|
505
|
+
}], type: [{
|
|
506
|
+
type: Input
|
|
507
|
+
}], readonly: [{
|
|
508
|
+
type: Input
|
|
509
|
+
}], item: [{
|
|
510
|
+
type: Input
|
|
511
|
+
}], modifiable: [{
|
|
512
|
+
type: Input
|
|
513
|
+
}] } });
|
|
514
|
+
|
|
515
|
+
class LastEventsComponent extends SubscriptionnerDirective {
|
|
516
|
+
constructor() {
|
|
517
|
+
super(...arguments);
|
|
518
|
+
this.displayDate = displayDate;
|
|
519
|
+
this.services = [];
|
|
520
|
+
this.events = [];
|
|
521
|
+
}
|
|
522
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LastEventsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
523
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: LastEventsComponent, selector: "hvy-last-events", inputs: { services: "services", events: "events" }, usesInheritance: true, ngImport: i0, template: "@if (events.length > 0) {\n <div class=\"o-hvy-last-events__events\">\n <h3>{{ '@chh.event.lastEvents' | i18n }} ({{ events.length }})</h3>\n @for (event of events; track event.id) {\n <div class=\"o-hvy-last-events__events__item\">\n <div class=\"o-hvy-last-events__events__item__icon\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"o-hvy-last-events__events__item__title\">\n <span>{{ event.name }}</span>\n </div>\n <div class=\"o-hvy-last-events__events__item__descr\">\n <span> {{ event.description }}</span>\n </div>\n <div class=\"o-hvy-last-events__events__item__status\">\n <hvy-status-display [item]=\"event\"></hvy-status-display>\n </div>\n </div>\n }\n </div>\n}\n@if (services.length > 0) {\n <div class=\"o-hvy-last-events__services\">\n <h3>{{ '@chh.event.services' | i18n }} ({{ services.length }})</h3>\n @for (service of services; track service.id) {\n <div class=\"o-hvy-last-events__services__item\">\n <div class=\"o-hvy-last-events__services__item__icon\">\n <pry-icon iconSvg=\"service\"></pry-icon>\n </div>\n <div class=\"o-hvy-last-events__services__item__title\">\n <span>{{ service.externalId }} - {{ '@chh.intervention.' + service.category | i18n }}</span>\n </div>\n <div class=\"o-hvy-last-events__services__item__descr\">\n <span>{{ '@chh.event.description' | i18n }}: {{ service.description }}</span>\n </div>\n <div class=\"o-hvy-last-events__services__item__date\">\n @if (service.status === 'ASKED') {\n <span>{{ '@chh.event.startDate' | i18n }} : {{ displayDate(service.startDate) }}</span>\n }\n @if (service.status === 'IN_PROGRESS') {\n <span>{{ '@chh.event.endPlannedDate' | i18n }} : {{ displayDate(service.endDate) }}</span>\n }\n @if (service.status === 'DONE') {\n <span>{{ '@chh.event.endDate' | i18n }} : {{ displayDate(service.endDate) }}</span>\n }\n </div>\n <div class=\"o-hvy-last-events__services__item__status\">\n <hvy-status-display [item]=\"service\" type=\"service\"></hvy-status-display>\n </div>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["type", "readonly", "item", "modifiable"], outputs: ["modified"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
524
|
+
}
|
|
525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LastEventsComponent, decorators: [{
|
|
526
|
+
type: Component,
|
|
527
|
+
args: [{ selector: 'hvy-last-events', template: "@if (events.length > 0) {\n <div class=\"o-hvy-last-events__events\">\n <h3>{{ '@chh.event.lastEvents' | i18n }} ({{ events.length }})</h3>\n @for (event of events; track event.id) {\n <div class=\"o-hvy-last-events__events__item\">\n <div class=\"o-hvy-last-events__events__item__icon\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"o-hvy-last-events__events__item__title\">\n <span>{{ event.name }}</span>\n </div>\n <div class=\"o-hvy-last-events__events__item__descr\">\n <span> {{ event.description }}</span>\n </div>\n <div class=\"o-hvy-last-events__events__item__status\">\n <hvy-status-display [item]=\"event\"></hvy-status-display>\n </div>\n </div>\n }\n </div>\n}\n@if (services.length > 0) {\n <div class=\"o-hvy-last-events__services\">\n <h3>{{ '@chh.event.services' | i18n }} ({{ services.length }})</h3>\n @for (service of services; track service.id) {\n <div class=\"o-hvy-last-events__services__item\">\n <div class=\"o-hvy-last-events__services__item__icon\">\n <pry-icon iconSvg=\"service\"></pry-icon>\n </div>\n <div class=\"o-hvy-last-events__services__item__title\">\n <span>{{ service.externalId }} - {{ '@chh.intervention.' + service.category | i18n }}</span>\n </div>\n <div class=\"o-hvy-last-events__services__item__descr\">\n <span>{{ '@chh.event.description' | i18n }}: {{ service.description }}</span>\n </div>\n <div class=\"o-hvy-last-events__services__item__date\">\n @if (service.status === 'ASKED') {\n <span>{{ '@chh.event.startDate' | i18n }} : {{ displayDate(service.startDate) }}</span>\n }\n @if (service.status === 'IN_PROGRESS') {\n <span>{{ '@chh.event.endPlannedDate' | i18n }} : {{ displayDate(service.endDate) }}</span>\n }\n @if (service.status === 'DONE') {\n <span>{{ '@chh.event.endDate' | i18n }} : {{ displayDate(service.endDate) }}</span>\n }\n </div>\n <div class=\"o-hvy-last-events__services__item__status\">\n <hvy-status-display [item]=\"service\" type=\"service\"></hvy-status-display>\n </div>\n </div>\n }\n </div>\n}\n" }]
|
|
528
|
+
}], propDecorators: { services: [{
|
|
529
|
+
type: Input
|
|
530
|
+
}], events: [{
|
|
531
|
+
type: Input
|
|
532
|
+
}] } });
|
|
533
|
+
|
|
534
|
+
class HvyEventDetailsTooltipComponent {
|
|
535
|
+
constructor(data) {
|
|
536
|
+
this.data = data;
|
|
537
|
+
}
|
|
538
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HvyEventDetailsTooltipComponent, deps: [{ token: PRY_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
539
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: HvyEventDetailsTooltipComponent, selector: "hvy-event-detail-tooltip", ngImport: i0, template: "<div class=\"o-hvy-event-detail-tooltip\">\n <hvy-last-events [events]=\"data.events ?? []\" [services]=\"data.services ?? []\"></hvy-last-events>\n</div>\n", dependencies: [{ kind: "component", type: LastEventsComponent, selector: "hvy-last-events", inputs: ["services", "events"] }] }); }
|
|
540
|
+
}
|
|
541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HvyEventDetailsTooltipComponent, decorators: [{
|
|
542
|
+
type: Component,
|
|
543
|
+
args: [{ selector: 'hvy-event-detail-tooltip', template: "<div class=\"o-hvy-event-detail-tooltip\">\n <hvy-last-events [events]=\"data.events ?? []\" [services]=\"data.services ?? []\"></hvy-last-events>\n</div>\n" }]
|
|
544
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
545
|
+
type: Inject,
|
|
546
|
+
args: [PRY_DIALOG_DATA]
|
|
547
|
+
}] }] });
|
|
548
|
+
|
|
549
|
+
const eventForWriteAPI = (event) => ({
|
|
550
|
+
...event,
|
|
551
|
+
equipmentId: event.equipment?.id,
|
|
552
|
+
parent: typeof event.parent === 'object' ? event.parent.id : event.parent
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
const procedureForWriteAPI = (procedure) => ({
|
|
556
|
+
...procedure,
|
|
557
|
+
events: procedure.events.map(eventForWriteAPI)
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
const PAGE_SIZE_FETCH = { value: 20 };
|
|
561
|
+
const KNOWN_FILTER_SETS = {
|
|
562
|
+
EVENTS: 'events',
|
|
563
|
+
SUMMARY: 'summary'
|
|
564
|
+
};
|
|
565
|
+
class EventService {
|
|
566
|
+
constructor(httpClient, store) {
|
|
567
|
+
this.httpClient = httpClient;
|
|
568
|
+
this.store = store;
|
|
569
|
+
}
|
|
570
|
+
list(startWith = 0, pageSize = PAGE_SIZE_FETCH.value) {
|
|
571
|
+
return this.store.select(HypSelectors.url).pipe(withLatestFrom(this.store.select(EventSelectors.filters), this.store.select(EventSelectors.sort)), mergeMap(([url, filterSets, sort]) => {
|
|
572
|
+
const filters = filterSets[KNOWN_FILTER_SETS.EVENTS] ?? {};
|
|
573
|
+
let params = new HttpParams();
|
|
574
|
+
Object.keys(filters).forEach((filter) => {
|
|
575
|
+
filters[filter].forEach((filterValue) => {
|
|
576
|
+
params = params.append(filter, filterValue);
|
|
577
|
+
});
|
|
578
|
+
});
|
|
579
|
+
params = params.set('page', startWith / pageSize + 1);
|
|
580
|
+
if (sort) {
|
|
581
|
+
params = params.set('sort', sort.field).set('order', sort.order);
|
|
582
|
+
}
|
|
583
|
+
return this.httpClient.get(encodeURI(`${url}/events`), { params });
|
|
584
|
+
}));
|
|
585
|
+
}
|
|
586
|
+
get(id) {
|
|
587
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
588
|
+
return this.httpClient.get(encodeURI(`${url}/events/id/${id}`));
|
|
589
|
+
}));
|
|
590
|
+
}
|
|
591
|
+
getTooltipInfo(name) {
|
|
592
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
593
|
+
return this.httpClient.get(encodeURI(`${url}/equipments/name/${name}`));
|
|
594
|
+
}));
|
|
595
|
+
}
|
|
596
|
+
getProcedure(id) {
|
|
597
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
598
|
+
return this.httpClient.get(encodeURI(`${url}/procedures/id/${id}`));
|
|
599
|
+
}));
|
|
600
|
+
}
|
|
601
|
+
save(event) {
|
|
602
|
+
const toSend = { ...event };
|
|
603
|
+
if (event.id < 0) {
|
|
604
|
+
delete toSend.id;
|
|
605
|
+
}
|
|
606
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
607
|
+
if (!!toSend.id) {
|
|
608
|
+
return this.httpClient.put(encodeURI(`${url}/events/id/${toSend.id}`), eventForWriteAPI(event));
|
|
609
|
+
}
|
|
610
|
+
return this.httpClient.post(encodeURI(`${url}/events`), eventForWriteAPI(event));
|
|
611
|
+
}));
|
|
612
|
+
}
|
|
613
|
+
saveProcedure(procedure) {
|
|
614
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
615
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}`), procedureForWriteAPI(procedure));
|
|
616
|
+
}));
|
|
617
|
+
}
|
|
618
|
+
addEventToProcedure(eventId, procedure) {
|
|
619
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
620
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}/associate/event/id/${eventId}`), {});
|
|
621
|
+
}));
|
|
622
|
+
}
|
|
623
|
+
status(event, status, comment) {
|
|
624
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
625
|
+
return this.httpClient.put(encodeURI(`${url}/events/id/${event.id}/close`), {
|
|
626
|
+
id: v4(),
|
|
627
|
+
message: comment
|
|
628
|
+
});
|
|
629
|
+
}));
|
|
630
|
+
}
|
|
631
|
+
statusProcedure(procedure, status, comment) {
|
|
632
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
633
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}/close`), {
|
|
634
|
+
id: v4(),
|
|
635
|
+
message: comment
|
|
636
|
+
});
|
|
637
|
+
}));
|
|
638
|
+
}
|
|
639
|
+
associateProcedure(procedureId, eventIds) {
|
|
640
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
641
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/model/id/${procedureId}/associate`), eventIds);
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
644
|
+
export(archived) {
|
|
645
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
646
|
+
return this.httpClient.get(encodeURI(`${url}/events/export?archived=${archived}`), {
|
|
647
|
+
observe: 'response',
|
|
648
|
+
responseType: 'arraybuffer'
|
|
649
|
+
});
|
|
650
|
+
}));
|
|
651
|
+
}
|
|
652
|
+
search(search) {
|
|
653
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
654
|
+
let params = new HttpParams();
|
|
655
|
+
params = params.set('sort', 'name').set('order', 'DESC').set('pageSize', '10');
|
|
656
|
+
if (search)
|
|
657
|
+
params = params.set('search', search);
|
|
658
|
+
return this.httpClient.get(encodeURI(`${url}/events`), { params });
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
661
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
662
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, providedIn: 'root' }); }
|
|
663
|
+
}
|
|
664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, decorators: [{
|
|
665
|
+
type: Injectable,
|
|
666
|
+
args: [{
|
|
667
|
+
providedIn: 'root'
|
|
668
|
+
}]
|
|
669
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
670
|
+
|
|
671
|
+
class HvyEventAddEventComponent {
|
|
672
|
+
constructor(dialog, data, eventService) {
|
|
673
|
+
this.dialog = dialog;
|
|
674
|
+
this.data = data;
|
|
675
|
+
this.eventService = eventService;
|
|
676
|
+
this.onEventSearch$ = new Subject();
|
|
677
|
+
this.eventSelectValue = undefined;
|
|
678
|
+
this.events$ = this.onEventSearch$.pipe(startWith(), debounceTime(500)).pipe(switchMap(() => {
|
|
679
|
+
const search = typeof this.eventSelectValue === 'string' && this.eventSelectValue.length > 2
|
|
680
|
+
? this.eventSelectValue
|
|
681
|
+
: undefined;
|
|
682
|
+
return this.eventService.search(search).pipe(map$1((events) => events.map((event) => {
|
|
683
|
+
const regex = RegExp(`(${search})` ?? '(/-/-/)', 'gid');
|
|
684
|
+
const html = `${padId.fn(event.id)} - ${event.name}`;
|
|
685
|
+
return {
|
|
686
|
+
...event,
|
|
687
|
+
html: html.replaceAll(regex, (matched, capture1) => `<b>${capture1}</b>`)
|
|
688
|
+
};
|
|
689
|
+
})));
|
|
690
|
+
}), catchError(() => {
|
|
691
|
+
throw new Error('Search Equipment problem');
|
|
692
|
+
}), shareReplay());
|
|
693
|
+
}
|
|
694
|
+
selectedEventChange($event) {
|
|
695
|
+
this.onEventSearch$.next();
|
|
696
|
+
if (typeof $event === 'object') {
|
|
697
|
+
this.eventToAdd = $event;
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
this.eventToAdd = undefined;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
closeModal() {
|
|
704
|
+
this.dialog.close({ value: 'cancel' });
|
|
705
|
+
}
|
|
706
|
+
add() {
|
|
707
|
+
this.dialog.close({ value: 'add', event: this.eventToAdd });
|
|
708
|
+
}
|
|
709
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HvyEventAddEventComponent, deps: [{ token: i1$3.PryDialogRef }, { token: PRY_DIALOG_DATA }, { token: EventService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
710
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: HvyEventAddEventComponent, selector: "hvy-add-event", ngImport: i0, template: "<div class=\"o-hvy-event-detail-add\">\n <h3>{{ '@hvy.event.add.title' | i18n }}</h3>\n <p>{{ '@hvy.event.add.description' | i18n }}</p>\n\n <div class=\"o-hvy-event-detail-add__container\">\n <label for=\"event\">{{ '@hvy.event.add.search' | i18n }}<span class=\"required\">*</span> :</label>\n <pry-select\n [items]=\"events$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"eventSelectValue\"\n (ngModelChange)=\"selectedEventChange($event)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.parentEvent.placeholder' | i18n\"\n id=\"event\"\n [template]=\"templateOption\"\n class=\"o-hvy-event-detail-add__event\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </div>\n\n <div class=\"o-hvy-event-detail-add__buttons\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"!eventToAdd\" (click)=\"add()\">\n {{ '@hvy.action.validate' | i18n }}\n </button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"closeModal()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
711
|
+
}
|
|
712
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HvyEventAddEventComponent, decorators: [{
|
|
713
|
+
type: Component,
|
|
714
|
+
args: [{ selector: 'hvy-add-event', template: "<div class=\"o-hvy-event-detail-add\">\n <h3>{{ '@hvy.event.add.title' | i18n }}</h3>\n <p>{{ '@hvy.event.add.description' | i18n }}</p>\n\n <div class=\"o-hvy-event-detail-add__container\">\n <label for=\"event\">{{ '@hvy.event.add.search' | i18n }}<span class=\"required\">*</span> :</label>\n <pry-select\n [items]=\"events$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"eventSelectValue\"\n (ngModelChange)=\"selectedEventChange($event)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.parentEvent.placeholder' | i18n\"\n id=\"event\"\n [template]=\"templateOption\"\n class=\"o-hvy-event-detail-add__event\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </div>\n\n <div class=\"o-hvy-event-detail-add__buttons\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"!eventToAdd\" (click)=\"add()\">\n {{ '@hvy.action.validate' | i18n }}\n </button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"closeModal()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n</div>\n" }]
|
|
715
|
+
}], ctorParameters: () => [{ type: i1$3.PryDialogRef }, { type: undefined, decorators: [{
|
|
716
|
+
type: Inject,
|
|
717
|
+
args: [PRY_DIALOG_DATA]
|
|
718
|
+
}] }, { type: EventService }] });
|
|
719
|
+
|
|
449
720
|
class EquipmentService {
|
|
450
721
|
constructor(httpClient, store) {
|
|
451
722
|
this.httpClient = httpClient;
|
|
@@ -508,66 +779,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
508
779
|
}]
|
|
509
780
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
510
781
|
|
|
511
|
-
class StatusDisplayComponent extends SubscriptionnerDirective {
|
|
512
|
-
static { this.idCounter = 0; }
|
|
513
|
-
set item(item) {
|
|
514
|
-
this._item = item;
|
|
515
|
-
this.updateTargetStatuses();
|
|
516
|
-
}
|
|
517
|
-
set modifiable(modifiable) {
|
|
518
|
-
this._modifiable = modifiable;
|
|
519
|
-
this.updateTargetStatuses();
|
|
520
|
-
}
|
|
521
|
-
get modifiable() {
|
|
522
|
-
return this._modifiable && !this.readonly;
|
|
523
|
-
}
|
|
524
|
-
get item() {
|
|
525
|
-
return this._item;
|
|
526
|
-
}
|
|
527
|
-
trigger(status) {
|
|
528
|
-
this.modified.next(status);
|
|
529
|
-
this.targetsDisplayed = false;
|
|
530
|
-
}
|
|
531
|
-
updateTargetStatuses() {
|
|
532
|
-
this.targetStatuses = this.modifiable && this.item.status !== 'DONE' ? ['DONE'] : [];
|
|
533
|
-
}
|
|
534
|
-
toggle() {
|
|
535
|
-
window.dispatchEvent(new CustomEvent('status-display-opening', { detail: this.id }));
|
|
536
|
-
this.targetsDisplayed = this.targetStatuses.length > 0 && !this.targetsDisplayed;
|
|
537
|
-
}
|
|
538
|
-
constructor() {
|
|
539
|
-
super();
|
|
540
|
-
this.id = StatusDisplayComponent.idCounter++;
|
|
541
|
-
this.modified = new EventEmitter();
|
|
542
|
-
this.targetStatuses = [];
|
|
543
|
-
this.targetsDisplayed = false;
|
|
544
|
-
this._modifiable = false;
|
|
545
|
-
this.type = 'event';
|
|
546
|
-
this.readonly = null;
|
|
547
|
-
this.subscriptions.add(fromEvent(window, 'status-display-opening').subscribe((event) => {
|
|
548
|
-
if (event.detail !== this.id) {
|
|
549
|
-
this.targetsDisplayed = false;
|
|
550
|
-
}
|
|
551
|
-
}));
|
|
552
|
-
}
|
|
553
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: StatusDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
554
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: { type: "type", readonly: "readonly", item: "item", modifiable: "modifiable" }, outputs: { modified: "modified" }, usesInheritance: true, ngImport: i0, template: "<span\n class=\"a-chip -{{ item.status }} a-chip-status -{{ type }}\"\n [class.-modifiable]=\"_modifiable\"\n [class.-readonly]=\"readonly\"\n (click)=\"toggle()\"\n>\n {{ '@hvy.' + type + '.status.' + item.status | i18n }}\n @if (targetStatuses.length > 0) {\n <pry-icon iconSvg=\"caret_bottom_rounded\" [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)\">\n {{ '@hvy.' + type + '.status.' + status | i18n }}\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
555
|
-
}
|
|
556
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: StatusDisplayComponent, decorators: [{
|
|
557
|
-
type: Component,
|
|
558
|
-
args: [{ selector: 'hvy-status-display', template: "<span\n class=\"a-chip -{{ item.status }} a-chip-status -{{ type }}\"\n [class.-modifiable]=\"_modifiable\"\n [class.-readonly]=\"readonly\"\n (click)=\"toggle()\"\n>\n {{ '@hvy.' + type + '.status.' + item.status | i18n }}\n @if (targetStatuses.length > 0) {\n <pry-icon iconSvg=\"caret_bottom_rounded\" [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)\">\n {{ '@hvy.' + type + '.status.' + status | i18n }}\n </div>\n }\n </div>\n}\n" }]
|
|
559
|
-
}], ctorParameters: () => [], propDecorators: { modified: [{
|
|
560
|
-
type: Output
|
|
561
|
-
}], type: [{
|
|
562
|
-
type: Input
|
|
563
|
-
}], readonly: [{
|
|
564
|
-
type: Input
|
|
565
|
-
}], item: [{
|
|
566
|
-
type: Input
|
|
567
|
-
}], modifiable: [{
|
|
568
|
-
type: Input
|
|
569
|
-
}] } });
|
|
570
|
-
|
|
571
782
|
class ProgressDisplayComponent {
|
|
572
783
|
constructor() {
|
|
573
784
|
this._progress = 50;
|
|
@@ -1276,6 +1487,14 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1276
1487
|
this.opened = this._events.length === 1 ? [true] : [];
|
|
1277
1488
|
this.canCloseSome = this._events.filter((ev) => ev.status !== 'DONE').length > 0;
|
|
1278
1489
|
this.comments$ = this.triggerComment$.pipe(mergeMap(() => combineLatest(this._events.map((event) => this.commentsService.get(event.id, 'events').pipe(map$1((comments) => ({ [event.id]: comments }))))).pipe(map$1((all) => all.reduce((p, c) => ({ ...p, ...c }), {})))), startWith({}), shareReplay());
|
|
1490
|
+
this._events.forEach((ev, idx) => {
|
|
1491
|
+
if (ev.equipment && ev.equipment.id && ev.equipment.id.length > 0) {
|
|
1492
|
+
this.selectedEquipmentChange(ev.equipment, idx);
|
|
1493
|
+
}
|
|
1494
|
+
if (ev.parent && ev.parent.id) {
|
|
1495
|
+
this.selectedParentChange(ev.parent, idx);
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1279
1498
|
}
|
|
1280
1499
|
set procedure(procedure) {
|
|
1281
1500
|
this._procedure = procedure;
|
|
@@ -1291,7 +1510,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1291
1510
|
this.selectedEquipmentChange(request.equipmentName, request.index);
|
|
1292
1511
|
}
|
|
1293
1512
|
}
|
|
1294
|
-
constructor(equipmentService, store, overlay, viewContainerRef, i18nService, pryDialog, commentsService) {
|
|
1513
|
+
constructor(equipmentService, store, overlay, viewContainerRef, i18nService, pryDialog, commentsService, eventService) {
|
|
1295
1514
|
super();
|
|
1296
1515
|
this.equipmentService = equipmentService;
|
|
1297
1516
|
this.store = store;
|
|
@@ -1300,6 +1519,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1300
1519
|
this.i18nService = i18nService;
|
|
1301
1520
|
this.pryDialog = pryDialog;
|
|
1302
1521
|
this.commentsService = commentsService;
|
|
1522
|
+
this.eventService = eventService;
|
|
1303
1523
|
this.opened = [];
|
|
1304
1524
|
this.criticalities = HypEventCriticality.values;
|
|
1305
1525
|
this._events = [];
|
|
@@ -1309,6 +1529,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1309
1529
|
this.modifiedProcedure = new EventEmitter();
|
|
1310
1530
|
this.DOMAINS = DOMAINS.values;
|
|
1311
1531
|
this.eventErrors = new EventEmitter();
|
|
1532
|
+
this.addedEvent = new EventEmitter();
|
|
1312
1533
|
this.errors = [];
|
|
1313
1534
|
this.canCloseSome = false;
|
|
1314
1535
|
this.changeStatusContext = {
|
|
@@ -1323,11 +1544,16 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1323
1544
|
this.comfirmDialogOpened = new EventEmitter();
|
|
1324
1545
|
this.triggerComment$ = new BehaviorSubject(undefined);
|
|
1325
1546
|
this.onEquipmentSearch$ = new Subject();
|
|
1547
|
+
this.equipmentSelectValue = [];
|
|
1548
|
+
this.onEventSearch$ = new Subject();
|
|
1549
|
+
this.eventSelectValue = [];
|
|
1326
1550
|
this.padId = padId;
|
|
1327
1551
|
this.subCategories = [undefined, ...HypEventSubCategory.values['ANOMALY']];
|
|
1328
|
-
this.
|
|
1329
|
-
|
|
1330
|
-
|
|
1552
|
+
this.equipmentsEvents = [];
|
|
1553
|
+
this.equipments$ = this.onEquipmentSearch$.pipe(startWith(), debounceTime(500)).pipe(switchMap((index) => {
|
|
1554
|
+
const search = typeof this.equipmentSelectValue[index] === 'string' &&
|
|
1555
|
+
this.equipmentSelectValue[index].length > 2
|
|
1556
|
+
? this.equipmentSelectValue[index]
|
|
1331
1557
|
: undefined;
|
|
1332
1558
|
return this.equipmentService.search(search).pipe(map$1((equipments) => equipments.map((equipment) => {
|
|
1333
1559
|
const regex = RegExp(`(${search})` ?? '(/-/-/)', 'gid');
|
|
@@ -1340,6 +1566,21 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1340
1566
|
}), catchError(() => {
|
|
1341
1567
|
throw new Error('Search Equipment problem');
|
|
1342
1568
|
}), shareReplay());
|
|
1569
|
+
this.events$ = this.onEventSearch$.pipe(startWith(), debounceTime(500)).pipe(switchMap((index) => {
|
|
1570
|
+
const search = typeof this.eventSelectValue[index] === 'string' && this.eventSelectValue[index].length > 2
|
|
1571
|
+
? this.eventSelectValue[index]
|
|
1572
|
+
: undefined;
|
|
1573
|
+
return this.eventService.list().pipe(map$1((events) => events.map((event) => {
|
|
1574
|
+
const regex = RegExp(`(${search})` ?? '(/-/-/)', 'gid');
|
|
1575
|
+
const html = `${padId.fn(event.id)} - ${event.name}`;
|
|
1576
|
+
return {
|
|
1577
|
+
...event,
|
|
1578
|
+
html: html.replaceAll(regex, (matched, capture1) => `<b>${capture1}</b>`)
|
|
1579
|
+
};
|
|
1580
|
+
})));
|
|
1581
|
+
}), catchError(() => {
|
|
1582
|
+
throw new Error('Search Equipment problem');
|
|
1583
|
+
}), shareReplay());
|
|
1343
1584
|
}
|
|
1344
1585
|
get events() {
|
|
1345
1586
|
return this._events.map((evt, idx) => ({ ...evt, ...(this.eventModifications[idx] ?? {}) }));
|
|
@@ -1388,37 +1629,23 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1388
1629
|
}
|
|
1389
1630
|
}
|
|
1390
1631
|
access(event) {
|
|
1391
|
-
|
|
1632
|
+
const readonly = this.readonly ||
|
|
1392
1633
|
event.status === 'DONE' ||
|
|
1393
|
-
(['LIMIT', 'OUTOFORDER', 'ANOMALY'].includes(event.category) && event.externalSourceRef)
|
|
1394
|
-
return {
|
|
1395
|
-
name: true,
|
|
1396
|
-
category: true,
|
|
1397
|
-
subCategory: true,
|
|
1398
|
-
criticality: true,
|
|
1399
|
-
description: true,
|
|
1400
|
-
address: true,
|
|
1401
|
-
source: true,
|
|
1402
|
-
domain: true,
|
|
1403
|
-
eqName: true,
|
|
1404
|
-
eqEntity: true,
|
|
1405
|
-
startDate: true,
|
|
1406
|
-
endDate: true
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1634
|
+
(['LIMIT', 'OUTOFORDER', 'ANOMALY'].includes(event.category) && event.externalSourceRef !== 'Hyperviseur');
|
|
1409
1635
|
return {
|
|
1410
|
-
name:
|
|
1411
|
-
category:
|
|
1412
|
-
subCategory:
|
|
1413
|
-
criticality:
|
|
1414
|
-
description:
|
|
1415
|
-
address:
|
|
1636
|
+
name: readonly,
|
|
1637
|
+
category: readonly,
|
|
1638
|
+
subCategory: readonly,
|
|
1639
|
+
criticality: readonly,
|
|
1640
|
+
description: readonly,
|
|
1641
|
+
address: readonly,
|
|
1416
1642
|
source: true,
|
|
1417
|
-
domain:
|
|
1418
|
-
eqName:
|
|
1419
|
-
eqEntity:
|
|
1420
|
-
startDate:
|
|
1421
|
-
endDate:
|
|
1643
|
+
domain: readonly,
|
|
1644
|
+
eqName: readonly,
|
|
1645
|
+
eqEntity: readonly,
|
|
1646
|
+
startDate: readonly,
|
|
1647
|
+
endDate: readonly,
|
|
1648
|
+
parent: readonly
|
|
1422
1649
|
};
|
|
1423
1650
|
}
|
|
1424
1651
|
_outputModifications() {
|
|
@@ -1582,8 +1809,8 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1582
1809
|
});
|
|
1583
1810
|
}
|
|
1584
1811
|
selectedEquipmentChange($event, index) {
|
|
1585
|
-
this.equipmentSelectValue = $event;
|
|
1586
|
-
this.onEquipmentSearch$.next();
|
|
1812
|
+
this.equipmentSelectValue[index] = $event;
|
|
1813
|
+
this.onEquipmentSearch$.next(index);
|
|
1587
1814
|
if (typeof $event === 'object') {
|
|
1588
1815
|
if (this._events[index].equipment?.name !== $event.name) {
|
|
1589
1816
|
if (!this.eventModifications[index]) {
|
|
@@ -1603,20 +1830,105 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
1603
1830
|
this._outputModifications();
|
|
1604
1831
|
}
|
|
1605
1832
|
}
|
|
1833
|
+
this.populateEquipment($event, index);
|
|
1834
|
+
}
|
|
1835
|
+
else {
|
|
1836
|
+
this.populateEquipment(undefined, index);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
populateEquipment($event, index) {
|
|
1840
|
+
this.equipmentsEvents[index] = {};
|
|
1841
|
+
if ($event) {
|
|
1842
|
+
this.equipmentService.findByName($event.name).subscribe((equip) => {
|
|
1843
|
+
this.equipmentsEvents[index].events = equip.events;
|
|
1844
|
+
this.equipmentsEvents[index].services = equip.services;
|
|
1845
|
+
});
|
|
1606
1846
|
}
|
|
1607
1847
|
}
|
|
1608
|
-
|
|
1609
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { title: "title", me: "me", readonly: "readonly", readonlyProcedure: "readonlyProcedure", enableEditActions: "enableEditActions", events: "events", procedure: "procedure", cancelModifications: "cancelModifications", equipmentName: "equipmentName" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors", comfirmDialogOpened: "comfirmDialogOpened" }, 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>{{ title ?? '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n @if (canCloseSome && !readonly) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\" (click)=\"closeAll()\">\n {{ (canCloseSome ? '@hvy.event.log.event.close' : '@hvy.event.log.event.closed') | i18n }}\n </button>\n }\n @if (!canCloseSome && closeComment && closeComment.length > 0) {\n <div class=\"a-tooltip\" [attr.data-tooltip]=\"closeComment\" 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 @if (procedure && !readonly) {\n <button class=\"a-btn a-btn--secondary\" (click)=\"openDeleteModal()\" [disabled]=\"readonlyProcedure\">\n {{ '@hvy.event.log.procedure.delete' | i18n }}\n </button>\n }\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\n iconSvg=\"arrow_down_rounded\"\n [class.-rotated]=\"opened[idx]\"\n (click)=\"toggle(idx)\"\n [width]=\"10\"\n [height]=\"10\"\n ></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <div class=\"o-hvy-events-detail__events__event__header__comment\">\n @if (comments$ && comments$ | async; as comments) {\n @if (comments[event.id]?.length ?? 0 > 0) {\n <span>{{\n ((comments[event.id]?.length ?? 0) > 1 ? '@hvy.event.comment.heads' : '@hvy.event.comment.head')\n | i18n: { nb: comments[event.id]?.length }\n }}</span>\n }\n }\n </div>\n <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\n [readonly]=\"readonly\"\n (modified)=\"changeStatus($event, event)\"\n ></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 <div class=\"o-hvy-events-detail__events__event__content__header\">\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <span class=\"required\">{{ '@hvy.event.log.event.mandatory' | i18n }}</span>\n </div>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\"\n [readonly]=\"accessValue.name\"\n [maxLength]=\"50\"\n />\n </td>\n </tr>\n @if (event.id > 0) {\n <tr>\n <td>{{ '@hvy.event.log.event.id' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input type=\"text\" class=\"a-form-field\" [value]=\"padId.fn(event.id)\" [readonly]=\"true\" />\n </td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\"\n [disabled]=\"accessValue.category\"\n ></pry-select>\n </td>\n </tr>\n @if (event.category === 'ANOMALY') {\n <tr>\n <td>{{ '@hvy.event.subCategory.name' | i18n }} :</td>\n <td>\n <pry-select\n [ngModel]=\"event.subCategory\"\n [items]=\"subCategories\"\n [class.-error]=\"hasError('subCategory', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'subCategory', $event)\"\n i18nPrefix=\"@hvy.event.subCategory.\"\n [disabled]=\"accessValue.subCategory\"\n ></pry-select>\n </td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.criticality\"\n [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <textarea\n [ngModel]=\"event.description\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }} :</td>\n <td>\n <textarea\n [ngModel]=\"event.address\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n </tr>\n @if (event.category !== 'MANIFESTATION') {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.externalSourceRef ?? ('@hvy.event.hypervisor' | i18n)\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\"\n (change)=\"modifyEvent(idx, 'source', $event)\"\n />\n </td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"equipments$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"equipmentSelectValue\"\n (ngModelChange)=\"selectedEquipmentChange($event, idx)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.equipmentPlaceholder' | i18n\"\n id=\"procedure-filter\"\n [template]=\"templateOption\"\n [class.-error]=\"hasError('equipment', idx)\"\n [disabled]=\"accessValue.eqName\"\n class=\"o-hvy-events-detail__events__event__content__equipment\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('equipment', idx)\"\n [value]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n 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 :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\"\n (change)=\"modifyEvent(idx, 'startDate', $event)\"\n />\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 :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\"\n (change)=\"modifyEvent(idx, 'endDate', $event)\"\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n </tbody>\n </table>\n <hvy-comments\n [comments]=\"(comments$ | async) ? (comments$ | async)![event.id] : []\"\n (commented)=\"updateComment(event, $event)\"\n [readonly]=\"readonly\"\n [type]=\"'events'\"\n [me]=\"me\"\n ></hvy-comments>\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>\n {{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}\n </h2>\n </div>\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__description\">\n <p>{{ procedure.description }}</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]=\"calculatedProgress\"></hvy-progress-display>\n </div>\n <hvy-procedure-actions\n [readonly]=\"readonlyProcedure || readonly\"\n [enableEditActions]=\"enableEditActions\"\n [actions]=\"procedure.actions\"\n (modified)=\"modifiedActions($event)\"\n [me]=\"me\"\n ></hvy-procedure-actions>\n } @else {\n @if (!readonly) {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\" (click)=\"openAssociationModal()\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n } @else {\n <span class=\"o-hvy-events-detail__procedure__empty\">{{ '@hvy.event.log.procedure.none' | i18n }}</span>\n }\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>\n {{\n (changeStatusContext.events.length === 1 ? '@hvy.event.close.oneTitle' : '@hvy.event.close.multiTitle') | i18n\n }}\n </h2>\n <p>{{ (changeStatusContext.events.length === 1 ? '@hvy.event.close.one' : '@hvy.event.close.multi') | i18n }}</p>\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\" [maxLength]=\"255\"></textarea>\n </div>\n <div class=\"o-hvy-close-confirm__dialog__actions\">\n <button class=\"a-btn a-btn--primary\" (click)=\"confirmedClose()\" [disabled]=\"confirmDisabled()\">\n {{ '@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: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "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: ["type", "readonly", "item", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "component", type: HvyCommentsComponent, selector: "hvy-comments", inputs: ["readonly", "me", "type", "displayEmpty", "comments", "trigger"], outputs: ["commented"] }, { kind: "component", type: ProcedureActionsComponent, selector: "hvy-procedure-actions", inputs: ["mode", "me", "readonly", "enableEditActions", "actions"], outputs: ["modified"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
1848
|
+
toggleDetailsTooltip(idx) {
|
|
1849
|
+
if (!this.tooltipRef) {
|
|
1850
|
+
let idxOpened = 0;
|
|
1851
|
+
for (let i = 0; i < idx; i++) {
|
|
1852
|
+
if (this.opened[i]) {
|
|
1853
|
+
idxOpened++;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
this.tooltipRef = this.pryDialog.open(HvyEventDetailsTooltipComponent, {
|
|
1857
|
+
data: this.equipmentsEvents[idx] ?? { events: [], services: [] },
|
|
1858
|
+
overlayConfig: {
|
|
1859
|
+
positionStrategy: this.overlay
|
|
1860
|
+
.position()
|
|
1861
|
+
.flexibleConnectedTo(this.detailHoverIcon.get(idxOpened))
|
|
1862
|
+
.withPositions([
|
|
1863
|
+
{
|
|
1864
|
+
originX: 'end',
|
|
1865
|
+
originY: 'bottom',
|
|
1866
|
+
overlayX: 'start',
|
|
1867
|
+
overlayY: 'top'
|
|
1868
|
+
}
|
|
1869
|
+
])
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
else {
|
|
1874
|
+
this.tooltipRef.close();
|
|
1875
|
+
this.tooltipRef = undefined;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
selectedParentChange($event, index) {
|
|
1879
|
+
this.eventSelectValue[index] = $event;
|
|
1880
|
+
this.onEventSearch$.next(index);
|
|
1881
|
+
if (typeof $event === 'object') {
|
|
1882
|
+
if (this._events[index].parent?.id !== $event.id) {
|
|
1883
|
+
if (!this.eventModifications[index]) {
|
|
1884
|
+
this.eventModifications[index] = {};
|
|
1885
|
+
}
|
|
1886
|
+
this.eventModifications[index].parent = { id: $event.id, name: $event.name };
|
|
1887
|
+
this._outputModifications();
|
|
1888
|
+
}
|
|
1889
|
+
else {
|
|
1890
|
+
if (!!this.eventModifications[index]) {
|
|
1891
|
+
// @ts-ignore
|
|
1892
|
+
delete this.eventModifications[index].parent;
|
|
1893
|
+
if (Object.keys(this.eventModifications[index]).length === 0) {
|
|
1894
|
+
delete this.eventModifications[index];
|
|
1895
|
+
}
|
|
1896
|
+
this._outputModifications();
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
addOneEvent() {
|
|
1902
|
+
const ref = this.pryDialog.open(HvyEventAddEventComponent, {
|
|
1903
|
+
data: { procedure: this.procedure },
|
|
1904
|
+
backdropClass: 'backdrop-dark',
|
|
1905
|
+
overlayConfig: {
|
|
1906
|
+
positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically()
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
ref.closeValue.subscribe((value) => {
|
|
1910
|
+
switch (value.value) {
|
|
1911
|
+
case 'add':
|
|
1912
|
+
this.addedEvent.next(value.event);
|
|
1913
|
+
break;
|
|
1914
|
+
}
|
|
1915
|
+
ref.close();
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }, { token: i1$1.Store }, { token: i2.Overlay }, { token: i0.ViewContainerRef }, { token: i1$3.PryI18nService }, { token: i1$3.PryDialogService }, { token: HypCommentsService }, { token: EventService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1919
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { title: "title", me: "me", readonly: "readonly", readonlyProcedure: "readonlyProcedure", enableEditActions: "enableEditActions", events: "events", procedure: "procedure", cancelModifications: "cancelModifications", equipmentName: "equipmentName" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors", addedEvent: "addedEvent", comfirmDialogOpened: "comfirmDialogOpened" }, viewQueries: [{ propertyName: "confirmDialog", first: true, predicate: ["confirmDialog"], descendants: true, read: TemplateRef }, { propertyName: "detailHoverIcon", predicate: ["detailHoverIcon"], descendants: true, read: ElementRef }], 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>{{ title ?? '@hvy.event.detail' | i18n }}</h1>\n @if (procedure) {\n <button class=\"add-button\" [disabled]=\"readonly\" (click)=\"addOneEvent()\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n </button>\n }\n @if (events.length > 1) {\n @if (canCloseSome && !readonly) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\" (click)=\"closeAll()\">\n {{ (canCloseSome ? '@hvy.event.log.event.close' : '@hvy.event.log.event.closed') | i18n }}\n </button>\n }\n @if (!canCloseSome && closeComment && closeComment.length > 0) {\n <div class=\"a-tooltip\" [attr.data-tooltip]=\"closeComment\" 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 @if (procedure && !readonly) {\n <button class=\"a-btn a-btn--secondary\" (click)=\"openDeleteModal()\" [disabled]=\"readonlyProcedure\">\n {{ '@hvy.event.log.procedure.delete' | i18n }}\n </button>\n }\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\n iconSvg=\"arrow_down_rounded\"\n [class.-rotated]=\"opened[idx]\"\n (click)=\"toggle(idx)\"\n [width]=\"10\"\n [height]=\"10\"\n ></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <div class=\"o-hvy-events-detail__events__event__header__comment\">\n @if (comments$ && comments$ | async; as comments) {\n @if (comments[event.id]?.length ?? 0 > 0) {\n <span>{{\n ((comments[event.id]?.length ?? 0) > 1 ? '@hvy.event.comment.heads' : '@hvy.event.comment.head')\n | i18n: { nb: comments[event.id]?.length }\n }}</span>\n }\n }\n </div>\n <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\n [readonly]=\"readonly\"\n (modified)=\"changeStatus($event, event)\"\n ></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 <div class=\"o-hvy-events-detail__events__event__content__header\">\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <span class=\"required\">{{ '@hvy.event.log.event.mandatory' | i18n }}</span>\n </div>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\"\n [readonly]=\"accessValue.name\"\n [maxLength]=\"50\"\n />\n </td>\n <td></td>\n </tr>\n @if (event.id > 0) {\n <tr>\n <td>{{ '@hvy.event.log.event.id' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input type=\"text\" class=\"a-form-field\" [value]=\"padId.fn(event.id)\" [readonly]=\"true\" />\n </td>\n <td></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\"\n [disabled]=\"accessValue.category\"\n ></pry-select>\n </td>\n <td></td>\n </tr>\n @if (event.category === 'ANOMALY') {\n <tr>\n <td>{{ '@hvy.event.subCategory.name' | i18n }} :</td>\n <td>\n <pry-select\n [ngModel]=\"event.subCategory\"\n [items]=\"subCategories\"\n [class.-error]=\"hasError('subCategory', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'subCategory', $event)\"\n i18nPrefix=\"@hvy.event.subCategory.\"\n [disabled]=\"accessValue.subCategory\"\n ></pry-select>\n </td>\n <td></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.criticality\"\n [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"\n ></pry-select>\n </td>\n <td></td>\n </tr>\n\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <textarea\n [ngModel]=\"event.description\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }} :</td>\n <td>\n <textarea\n [ngModel]=\"event.address\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n <td></td>\n </tr>\n @if (event.category !== 'MANIFESTATION') {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.externalSourceRef ?? ('@hvy.event.hypervisor' | i18n)\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\"\n (change)=\"modifyEvent(idx, 'source', $event)\"\n />\n </td>\n <td></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"equipments$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"equipmentSelectValue[idx]\"\n (ngModelChange)=\"selectedEquipmentChange($event, idx)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.equipmentPlaceholder' | i18n\"\n id=\"procedure-filter\"\n [template]=\"templateOption\"\n [class.-error]=\"hasError('equipment', idx)\"\n [disabled]=\"accessValue.eqName\"\n class=\"o-hvy-events-detail__events__event__content__equipment\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </td>\n <td>\n @if (event.equipment && event.equipment.id.length > 0) {\n <pry-icon\n iconSvg=\"i\"\n #detailHoverIcon\n (mouseenter)=\"toggleDetailsTooltip(idx)\"\n (mouseleave)=\"toggleDetailsTooltip(idx)\"\n ></pry-icon>\n }\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('equipment', idx)\"\n [value]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n 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 <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.parentEvent.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"events$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"eventSelectValue[idx]\"\n (ngModelChange)=\"selectedParentChange($event, idx)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.parentEvent.placeholder' | i18n\"\n id=\"parent\"\n [template]=\"templateParent\"\n [disabled]=\"accessValue.parent\"\n class=\"o-hvy-events-detail__events__event__content__equipment\"\n ></pry-select>\n <ng-template #templateParent let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </td>\n <td></td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\"\n (change)=\"modifyEvent(idx, 'startDate', $event)\"\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\"\n (change)=\"modifyEvent(idx, 'endDate', $event)\"\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n <td></td>\n </tr>\n </tbody>\n </table>\n <hvy-comments\n [comments]=\"(comments$ | async) ? (comments$ | async)![event.id] : []\"\n (commented)=\"updateComment(event, $event)\"\n [readonly]=\"readonly\"\n [type]=\"'events'\"\n [me]=\"me\"\n ></hvy-comments>\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>\n {{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}\n </h2>\n </div>\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__description\">\n <p>{{ procedure.description }}</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]=\"calculatedProgress\"></hvy-progress-display>\n </div>\n <hvy-procedure-actions\n [readonly]=\"readonlyProcedure || readonly\"\n [enableEditActions]=\"enableEditActions\"\n [actions]=\"procedure.actions\"\n (modified)=\"modifiedActions($event)\"\n [me]=\"me\"\n ></hvy-procedure-actions>\n } @else {\n @if (!readonly) {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\" (click)=\"openAssociationModal()\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n } @else {\n <span class=\"o-hvy-events-detail__procedure__empty\">{{ '@hvy.event.log.procedure.none' | i18n }}</span>\n }\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>\n {{\n (changeStatusContext.events.length === 1 ? '@hvy.event.close.oneTitle' : '@hvy.event.close.multiTitle') | i18n\n }}\n </h2>\n <p>{{ (changeStatusContext.events.length === 1 ? '@hvy.event.close.one' : '@hvy.event.close.multi') | i18n }}</p>\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\" [maxLength]=\"255\"></textarea>\n </div>\n <div class=\"o-hvy-close-confirm__dialog__actions\">\n <button class=\"a-btn a-btn--primary\" (click)=\"confirmedClose()\" [disabled]=\"confirmDisabled()\">\n {{ '@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: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "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: ["type", "readonly", "item", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "component", type: HvyCommentsComponent, selector: "hvy-comments", inputs: ["readonly", "me", "type", "displayEmpty", "comments", "trigger"], outputs: ["commented"] }, { kind: "component", type: ProcedureActionsComponent, selector: "hvy-procedure-actions", inputs: ["mode", "me", "readonly", "enableEditActions", "actions"], outputs: ["modified"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
1610
1920
|
}
|
|
1611
1921
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
1612
1922
|
type: Component,
|
|
1613
|
-
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>{{ title ?? '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n @if (canCloseSome && !readonly) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\" (click)=\"closeAll()\">\n {{ (canCloseSome ? '@hvy.event.log.event.close' : '@hvy.event.log.event.closed') | i18n }}\n </button>\n }\n @if (!canCloseSome && closeComment && closeComment.length > 0) {\n <div class=\"a-tooltip\" [attr.data-tooltip]=\"closeComment\" 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 @if (procedure && !readonly) {\n <button class=\"a-btn a-btn--secondary\" (click)=\"openDeleteModal()\" [disabled]=\"readonlyProcedure\">\n {{ '@hvy.event.log.procedure.delete' | i18n }}\n </button>\n }\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\n iconSvg=\"arrow_down_rounded\"\n [class.-rotated]=\"opened[idx]\"\n (click)=\"toggle(idx)\"\n [width]=\"10\"\n [height]=\"10\"\n ></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <div class=\"o-hvy-events-detail__events__event__header__comment\">\n @if (comments$ && comments$ | async; as comments) {\n @if (comments[event.id]?.length ?? 0 > 0) {\n <span>{{\n ((comments[event.id]?.length ?? 0) > 1 ? '@hvy.event.comment.heads' : '@hvy.event.comment.head')\n | i18n: { nb: comments[event.id]?.length }\n }}</span>\n }\n }\n </div>\n <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\n [readonly]=\"readonly\"\n (modified)=\"changeStatus($event, event)\"\n ></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 <div class=\"o-hvy-events-detail__events__event__content__header\">\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <span class=\"required\">{{ '@hvy.event.log.event.mandatory' | i18n }}</span>\n </div>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\"\n [readonly]=\"accessValue.name\"\n [maxLength]=\"50\"\n />\n </td>\n </tr>\n @if (event.id > 0) {\n <tr>\n <td>{{ '@hvy.event.log.event.id' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input type=\"text\" class=\"a-form-field\" [value]=\"padId.fn(event.id)\" [readonly]=\"true\" />\n </td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\"\n [disabled]=\"accessValue.category\"\n ></pry-select>\n </td>\n </tr>\n @if (event.category === 'ANOMALY') {\n <tr>\n <td>{{ '@hvy.event.subCategory.name' | i18n }} :</td>\n <td>\n <pry-select\n [ngModel]=\"event.subCategory\"\n [items]=\"subCategories\"\n [class.-error]=\"hasError('subCategory', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'subCategory', $event)\"\n i18nPrefix=\"@hvy.event.subCategory.\"\n [disabled]=\"accessValue.subCategory\"\n ></pry-select>\n </td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.criticality\"\n [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <textarea\n [ngModel]=\"event.description\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }} :</td>\n <td>\n <textarea\n [ngModel]=\"event.address\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n </tr>\n @if (event.category !== 'MANIFESTATION') {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.externalSourceRef ?? ('@hvy.event.hypervisor' | i18n)\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\"\n (change)=\"modifyEvent(idx, 'source', $event)\"\n />\n </td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"equipments$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"equipmentSelectValue\"\n (ngModelChange)=\"selectedEquipmentChange($event, idx)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.equipmentPlaceholder' | i18n\"\n id=\"procedure-filter\"\n [template]=\"templateOption\"\n [class.-error]=\"hasError('equipment', idx)\"\n [disabled]=\"accessValue.eqName\"\n class=\"o-hvy-events-detail__events__event__content__equipment\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('equipment', idx)\"\n [value]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n 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 :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\"\n (change)=\"modifyEvent(idx, 'startDate', $event)\"\n />\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 :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\"\n (change)=\"modifyEvent(idx, 'endDate', $event)\"\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n </tbody>\n </table>\n <hvy-comments\n [comments]=\"(comments$ | async) ? (comments$ | async)![event.id] : []\"\n (commented)=\"updateComment(event, $event)\"\n [readonly]=\"readonly\"\n [type]=\"'events'\"\n [me]=\"me\"\n ></hvy-comments>\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>\n {{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}\n </h2>\n </div>\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__description\">\n <p>{{ procedure.description }}</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]=\"calculatedProgress\"></hvy-progress-display>\n </div>\n <hvy-procedure-actions\n [readonly]=\"readonlyProcedure || readonly\"\n [enableEditActions]=\"enableEditActions\"\n [actions]=\"procedure.actions\"\n (modified)=\"modifiedActions($event)\"\n [me]=\"me\"\n ></hvy-procedure-actions>\n } @else {\n @if (!readonly) {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\" (click)=\"openAssociationModal()\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n } @else {\n <span class=\"o-hvy-events-detail__procedure__empty\">{{ '@hvy.event.log.procedure.none' | i18n }}</span>\n }\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>\n {{\n (changeStatusContext.events.length === 1 ? '@hvy.event.close.oneTitle' : '@hvy.event.close.multiTitle') | i18n\n }}\n </h2>\n <p>{{ (changeStatusContext.events.length === 1 ? '@hvy.event.close.one' : '@hvy.event.close.multi') | i18n }}</p>\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\" [maxLength]=\"255\"></textarea>\n </div>\n <div class=\"o-hvy-close-confirm__dialog__actions\">\n <button class=\"a-btn a-btn--primary\" (click)=\"confirmedClose()\" [disabled]=\"confirmDisabled()\">\n {{ '@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" }]
|
|
1614
|
-
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i1$3.PryI18nService }, { type: i1$3.PryDialogService }, { type: HypCommentsService }], propDecorators: { modifiedEvents: [{
|
|
1923
|
+
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>{{ title ?? '@hvy.event.detail' | i18n }}</h1>\n @if (procedure) {\n <button class=\"add-button\" [disabled]=\"readonly\" (click)=\"addOneEvent()\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n </button>\n }\n @if (events.length > 1) {\n @if (canCloseSome && !readonly) {\n <button class=\"a-btn a-btn--secondary -fix-right\" [disabled]=\"!canCloseSome\" (click)=\"closeAll()\">\n {{ (canCloseSome ? '@hvy.event.log.event.close' : '@hvy.event.log.event.closed') | i18n }}\n </button>\n }\n @if (!canCloseSome && closeComment && closeComment.length > 0) {\n <div class=\"a-tooltip\" [attr.data-tooltip]=\"closeComment\" 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 @if (procedure && !readonly) {\n <button class=\"a-btn a-btn--secondary\" (click)=\"openDeleteModal()\" [disabled]=\"readonlyProcedure\">\n {{ '@hvy.event.log.procedure.delete' | i18n }}\n </button>\n }\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\n iconSvg=\"arrow_down_rounded\"\n [class.-rotated]=\"opened[idx]\"\n (click)=\"toggle(idx)\"\n [width]=\"10\"\n [height]=\"10\"\n ></pry-icon>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <h2>{{ event.name }}</h2>\n <div class=\"o-hvy-events-detail__events__event__header__comment\">\n @if (comments$ && comments$ | async; as comments) {\n @if (comments[event.id]?.length ?? 0 > 0) {\n <span>{{\n ((comments[event.id]?.length ?? 0) > 1 ? '@hvy.event.comment.heads' : '@hvy.event.comment.head')\n | i18n: { nb: comments[event.id]?.length }\n }}</span>\n }\n }\n </div>\n <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\n [readonly]=\"readonly\"\n (modified)=\"changeStatus($event, event)\"\n ></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 <div class=\"o-hvy-events-detail__events__event__content__header\">\n <h3>{{ '@hvy.event.log.event.detail' | i18n }}</h3>\n <span class=\"required\">{{ '@hvy.event.log.event.mandatory' | i18n }}</span>\n </div>\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.event.log.event.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('name', idx)\"\n [value]=\"event.name\"\n (change)=\"modifyEvent(idx, 'name', $event)\"\n [readonly]=\"accessValue.name\"\n [maxLength]=\"50\"\n />\n </td>\n <td></td>\n </tr>\n @if (event.id > 0) {\n <tr>\n <td>{{ '@hvy.event.log.event.id' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input type=\"text\" class=\"a-form-field\" [value]=\"padId.fn(event.id)\" [readonly]=\"true\" />\n </td>\n <td></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.log.event.category' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.category\"\n [items]=\"categories(event)\"\n [class.-error]=\"hasError('category', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'category', $event)\"\n i18nPrefix=\"@hvy.event.category.\"\n [disabled]=\"accessValue.category\"\n ></pry-select>\n </td>\n <td></td>\n </tr>\n @if (event.category === 'ANOMALY') {\n <tr>\n <td>{{ '@hvy.event.subCategory.name' | i18n }} :</td>\n <td>\n <pry-select\n [ngModel]=\"event.subCategory\"\n [items]=\"subCategories\"\n [class.-error]=\"hasError('subCategory', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'subCategory', $event)\"\n i18nPrefix=\"@hvy.event.subCategory.\"\n [disabled]=\"accessValue.subCategory\"\n ></pry-select>\n </td>\n <td></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.criticality.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [ngModel]=\"event.criticality\"\n [items]=\"criticalities\"\n [class.-error]=\"hasError('criticality', idx)\"\n i18nPrefix=\"@hvy.event.criticality.\"\n [disabled]=\"accessValue.criticality\"\n (ngModelChange)=\"modifyEvent(idx, 'criticality', $event)\"\n ></pry-select>\n </td>\n <td></td>\n </tr>\n\n <tr>\n <td>{{ '@hvy.event.log.event.description' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <textarea\n [ngModel]=\"event.description\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('description', idx)\"\n [readonly]=\"accessValue.description\"\n (ngModelChange)=\"modifyEvent(idx, 'description', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.log.event.address' | i18n }} :</td>\n <td>\n <textarea\n [ngModel]=\"event.address\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('address', idx)\"\n [readonly]=\"accessValue.address\"\n (ngModelChange)=\"modifyEvent(idx, 'address', $event)\"\n [maxLength]=\"256\"\n ></textarea>\n </td>\n <td></td>\n </tr>\n @if (event.category !== 'MANIFESTATION') {\n <tr>\n <td>{{ '@hvy.event.source' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.externalSourceRef ?? ('@hvy.event.hypervisor' | i18n)\"\n [class.-error]=\"hasError('source', idx)\"\n [readonly]=\"accessValue.source\"\n (change)=\"modifyEvent(idx, 'source', $event)\"\n />\n </td>\n <td></td>\n </tr>\n }\n <tr>\n <td>{{ '@hvy.event.equipment' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"equipments$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"equipmentSelectValue[idx]\"\n (ngModelChange)=\"selectedEquipmentChange($event, idx)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.equipmentPlaceholder' | i18n\"\n id=\"procedure-filter\"\n [template]=\"templateOption\"\n [class.-error]=\"hasError('equipment', idx)\"\n [disabled]=\"accessValue.eqName\"\n class=\"o-hvy-events-detail__events__event__content__equipment\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </td>\n <td>\n @if (event.equipment && event.equipment.id.length > 0) {\n <pry-icon\n iconSvg=\"i\"\n #detailHoverIcon\n (mouseenter)=\"toggleDetailsTooltip(idx)\"\n (mouseleave)=\"toggleDetailsTooltip(idx)\"\n ></pry-icon>\n }\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.equipmentEntity' | i18n }} :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('equipment', idx)\"\n [value]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n 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 <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.parentEvent.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"events$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"eventSelectValue[idx]\"\n (ngModelChange)=\"selectedParentChange($event, idx)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.event.parentEvent.placeholder' | i18n\"\n id=\"parent\"\n [template]=\"templateParent\"\n [disabled]=\"accessValue.parent\"\n class=\"o-hvy-events-detail__events__event__content__equipment\"\n ></pry-select>\n <ng-template #templateParent let-item=\"item\">\n <div class=\"u-display-flex -column\">\n <span [innerHTML]=\"item.html\"></span>\n </div>\n </ng-template>\n </td>\n <td></td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.startDate | forDateTimeLocal\"\n [class.-error]=\"hasError('startDate', idx)\"\n [readonly]=\"accessValue.startDate\"\n (change)=\"modifyEvent(idx, 'startDate', $event)\"\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.endDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.endDate | forDateTimeLocal\"\n [class.-error]=\"hasError('endDate', idx)\"\n [readonly]=\"accessValue.endDate\"\n (change)=\"modifyEvent(idx, 'endDate', $event)\"\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.creationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.creationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.lastModificationDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.lastModificationDate | forDateTimeLocal\"\n readonly\n />\n </td>\n <td></td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.closeDate' | i18n }} :</td>\n <td>\n <input\n type=\"datetime-local\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n <td></td>\n </tr>\n </tbody>\n </table>\n <hvy-comments\n [comments]=\"(comments$ | async) ? (comments$ | async)![event.id] : []\"\n (commented)=\"updateComment(event, $event)\"\n [readonly]=\"readonly\"\n [type]=\"'events'\"\n [me]=\"me\"\n ></hvy-comments>\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>\n {{ (events.length === 1 ? '@hvy.event.log.procedure.name1' : '@hvy.event.log.procedure.name') | i18n }}\n </h2>\n </div>\n @if (procedure) {\n <div class=\"o-hvy-events-detail__procedure__description\">\n <p>{{ procedure.description }}</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]=\"calculatedProgress\"></hvy-progress-display>\n </div>\n <hvy-procedure-actions\n [readonly]=\"readonlyProcedure || readonly\"\n [enableEditActions]=\"enableEditActions\"\n [actions]=\"procedure.actions\"\n (modified)=\"modifiedActions($event)\"\n [me]=\"me\"\n ></hvy-procedure-actions>\n } @else {\n @if (!readonly) {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\" (click)=\"openAssociationModal()\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n } @else {\n <span class=\"o-hvy-events-detail__procedure__empty\">{{ '@hvy.event.log.procedure.none' | i18n }}</span>\n }\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>\n {{\n (changeStatusContext.events.length === 1 ? '@hvy.event.close.oneTitle' : '@hvy.event.close.multiTitle') | i18n\n }}\n </h2>\n <p>{{ (changeStatusContext.events.length === 1 ? '@hvy.event.close.one' : '@hvy.event.close.multi') | i18n }}</p>\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\" [maxLength]=\"255\"></textarea>\n </div>\n <div class=\"o-hvy-close-confirm__dialog__actions\">\n <button class=\"a-btn a-btn--primary\" (click)=\"confirmedClose()\" [disabled]=\"confirmDisabled()\">\n {{ '@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" }]
|
|
1924
|
+
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i1$3.PryI18nService }, { type: i1$3.PryDialogService }, { type: HypCommentsService }, { type: EventService }], propDecorators: { modifiedEvents: [{
|
|
1615
1925
|
type: Output
|
|
1616
1926
|
}], modifiedProcedure: [{
|
|
1617
1927
|
type: Output
|
|
1618
1928
|
}], eventErrors: [{
|
|
1619
1929
|
type: Output
|
|
1930
|
+
}], addedEvent: [{
|
|
1931
|
+
type: Output
|
|
1620
1932
|
}], title: [{
|
|
1621
1933
|
type: Input
|
|
1622
1934
|
}], me: [{
|
|
@@ -1632,6 +1944,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
1632
1944
|
args: ['confirmDialog', { read: TemplateRef }]
|
|
1633
1945
|
}], comfirmDialogOpened: [{
|
|
1634
1946
|
type: Output
|
|
1947
|
+
}], detailHoverIcon: [{
|
|
1948
|
+
type: ViewChildren,
|
|
1949
|
+
args: ['detailHoverIcon', { read: ElementRef }]
|
|
1635
1950
|
}], events: [{
|
|
1636
1951
|
type: Input
|
|
1637
1952
|
}], procedure: [{
|
|
@@ -2131,105 +2446,6 @@ const EventSummarySelectors = {
|
|
|
2131
2446
|
loading
|
|
2132
2447
|
};
|
|
2133
2448
|
|
|
2134
|
-
const eventForWriteAPI = (event) => ({
|
|
2135
|
-
...event,
|
|
2136
|
-
equipmentId: event.equipment?.id
|
|
2137
|
-
});
|
|
2138
|
-
|
|
2139
|
-
const procedureForWriteAPI = (procedure) => ({
|
|
2140
|
-
...procedure,
|
|
2141
|
-
events: procedure.events.map(eventForWriteAPI)
|
|
2142
|
-
});
|
|
2143
|
-
|
|
2144
|
-
const PAGE_SIZE_FETCH = { value: 20 };
|
|
2145
|
-
const KNOWN_FILTER_SETS = {
|
|
2146
|
-
EVENTS: 'events',
|
|
2147
|
-
SUMMARY: 'summary'
|
|
2148
|
-
};
|
|
2149
|
-
class EventService {
|
|
2150
|
-
constructor(httpClient, store) {
|
|
2151
|
-
this.httpClient = httpClient;
|
|
2152
|
-
this.store = store;
|
|
2153
|
-
}
|
|
2154
|
-
list(startWith = 0, pageSize = PAGE_SIZE_FETCH.value) {
|
|
2155
|
-
return this.store.select(HypSelectors.url).pipe(withLatestFrom(this.store.select(EventSelectors.filters), this.store.select(EventSelectors.sort)), mergeMap(([url, filterSets, sort]) => {
|
|
2156
|
-
const filters = filterSets[KNOWN_FILTER_SETS.EVENTS] ?? {};
|
|
2157
|
-
let params = new HttpParams();
|
|
2158
|
-
Object.keys(filters).forEach((filter) => {
|
|
2159
|
-
filters[filter].forEach((filterValue) => {
|
|
2160
|
-
params = params.append(filter, filterValue);
|
|
2161
|
-
});
|
|
2162
|
-
});
|
|
2163
|
-
params = params.set('page', startWith / pageSize + 1);
|
|
2164
|
-
if (sort) {
|
|
2165
|
-
params = params.set('sort', sort.field).set('order', sort.order);
|
|
2166
|
-
}
|
|
2167
|
-
return this.httpClient.get(encodeURI(`${url}/events`), { params });
|
|
2168
|
-
}));
|
|
2169
|
-
}
|
|
2170
|
-
get(id) {
|
|
2171
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2172
|
-
return this.httpClient.get(encodeURI(`${url}/events/id/${id}`));
|
|
2173
|
-
}));
|
|
2174
|
-
}
|
|
2175
|
-
getTooltipInfo(name) {
|
|
2176
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2177
|
-
return this.httpClient.get(encodeURI(`${url}/equipments/name/${name}`));
|
|
2178
|
-
}));
|
|
2179
|
-
}
|
|
2180
|
-
getProcedure(id) {
|
|
2181
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2182
|
-
return this.httpClient.get(encodeURI(`${url}/procedures/id/${id}`));
|
|
2183
|
-
}));
|
|
2184
|
-
}
|
|
2185
|
-
save(event) {
|
|
2186
|
-
const toSend = { ...event };
|
|
2187
|
-
if (event.id < 0) {
|
|
2188
|
-
delete toSend.id;
|
|
2189
|
-
}
|
|
2190
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2191
|
-
if (!!toSend.id) {
|
|
2192
|
-
return this.httpClient.put(encodeURI(`${url}/events/id/${toSend.id}`), eventForWriteAPI(event));
|
|
2193
|
-
}
|
|
2194
|
-
return this.httpClient.post(encodeURI(`${url}/events`), eventForWriteAPI(event));
|
|
2195
|
-
}));
|
|
2196
|
-
}
|
|
2197
|
-
saveProcedure(procedure) {
|
|
2198
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2199
|
-
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}`), procedureForWriteAPI(procedure));
|
|
2200
|
-
}));
|
|
2201
|
-
}
|
|
2202
|
-
status(event, status, comment) {
|
|
2203
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2204
|
-
return this.httpClient.put(encodeURI(`${url}/events/id/${event.id}/close`), {
|
|
2205
|
-
id: v4(),
|
|
2206
|
-
message: comment
|
|
2207
|
-
});
|
|
2208
|
-
}));
|
|
2209
|
-
}
|
|
2210
|
-
statusProcedure(procedure, status, comment) {
|
|
2211
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2212
|
-
return this.httpClient.put(encodeURI(`${url}/procedures/id/${procedure.id}/close`), {
|
|
2213
|
-
id: v4(),
|
|
2214
|
-
message: comment
|
|
2215
|
-
});
|
|
2216
|
-
}));
|
|
2217
|
-
}
|
|
2218
|
-
associateProcedure(procedureId, eventIds) {
|
|
2219
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
2220
|
-
return this.httpClient.put(encodeURI(`${url}/procedures/model/id/${procedureId}/associate`), eventIds);
|
|
2221
|
-
}));
|
|
2222
|
-
}
|
|
2223
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2224
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, providedIn: 'root' }); }
|
|
2225
|
-
}
|
|
2226
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, decorators: [{
|
|
2227
|
-
type: Injectable,
|
|
2228
|
-
args: [{
|
|
2229
|
-
providedIn: 'root'
|
|
2230
|
-
}]
|
|
2231
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
2232
|
-
|
|
2233
2449
|
const HypEventStatus = {
|
|
2234
2450
|
values: ['NEW', 'IN_PROGRESS', 'DONE', 'ARCHIVED']
|
|
2235
2451
|
};
|
|
@@ -2381,11 +2597,11 @@ class ProcedureListComponent extends SubscriptionnerDirective {
|
|
|
2381
2597
|
return this.router.navigate(this.PROCEDURE_LINK.fn(procedure, this.store));
|
|
2382
2598
|
}
|
|
2383
2599
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureListComponent, deps: [{ token: i1$1.Store }, { token: i2$1.Router }, { token: InfiniteScrollService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2384
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureListComponent, selector: "hvy-procedure-model-list", viewQueries: [{ propertyName: "scrollable", first: true, predicate: ["scrollable"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-procedure-list\">\n <div class=\"m-form-label-field o-procedure-list__action\">\n <hvy-immediate-filters [filterSet]=\"'procedure'\">\n <hvy-text-filter prop=\"search\" #filter></hvy-text-filter>\n <hvy-choice-filter\n i18nPrefix=\"@hvy.event.domain.\"\n label=\"@hvy.event.domain.name\"\n [choices]=\"DOMAINS\"\n prop=\"domain\"\n #filter\n ></hvy-choice-filter>\n </hvy-immediate-filters>\n </div>\n <div class=\"o-procedure-list__table\" #scrollable>\n <table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <hvy-procedure-column-order field=\"
|
|
2600
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureListComponent, selector: "hvy-procedure-model-list", viewQueries: [{ propertyName: "scrollable", first: true, predicate: ["scrollable"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-procedure-list\">\n <div class=\"m-form-label-field o-procedure-list__action\">\n <hvy-immediate-filters [filterSet]=\"'procedure'\">\n <hvy-text-filter prop=\"search\" #filter></hvy-text-filter>\n <hvy-choice-filter\n i18nPrefix=\"@hvy.event.domain.\"\n label=\"@hvy.event.domain.name\"\n [choices]=\"DOMAINS\"\n prop=\"domain\"\n #filter\n ></hvy-choice-filter>\n </hvy-immediate-filters>\n </div>\n <div class=\"o-procedure-list__table\" #scrollable>\n <table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <hvy-procedure-column-order field=\"id\">{{ '@hvy.procedure.id' | i18n }}</hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"name\">{{ '@hvy.procedure.title' | i18n }}</hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"domain\">{{ '@hvy.procedure.domain' | i18n }}</hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"useCount\"\n >{{ '@hvy.procedure.useCount' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"creator\"\n >{{ '@hvy.procedure.author' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"creationDate\"\n >{{ '@hvy.event.creationDate' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"lastModificationDate\">\n <span>{{ '@hvy.event.lastModificationDate' | i18n }}</span></hvy-procedure-column-order\n >\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (procedure of procedures$ | async; track procedure.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"goTo(procedure)\">\n <td class=\"o-hvy-events-table__line__cell\">{{ padId.fn(procedure.id) }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.name }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ '@hvy.event.domain.' + procedure.domain | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.useCount }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ procedure.creator }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.creationDate | displayLocaleDatetime }}</td>\n <td class=\"o-hvy-events-table__line__cell\">\n {{ procedure.lastModificationDate | displayLocaleDatetime }}\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"PROCEDURE_LINK.fn(procedure, store)\">\n <div class=\"consult-link\">\n <pry-icon iconSvg=\"eye\" [height]=\"30\" [width]=\"40\"></pry-icon>\n </div>\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.procedure.noContent' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\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: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: TextFilterComponent, selector: "hvy-text-filter", inputs: ["placeholder"] }, { kind: "component", type: ChoiceFilterComponent, selector: "hvy-choice-filter", inputs: ["allLabel", "label", "i18nPrefix", "addNonLeaves", "choices"] }, { kind: "component", type: ProcedureColumnOrderComponent, selector: "hvy-procedure-column-order" }, { kind: "component", type: ImmediateFiltersComponent, selector: "hvy-immediate-filters", inputs: ["filterSet", "delay"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }, { kind: "pipe", type: DisplayLocaleDateTime, name: "displayLocaleDatetime" }] }); }
|
|
2385
2601
|
}
|
|
2386
2602
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureListComponent, decorators: [{
|
|
2387
2603
|
type: Component,
|
|
2388
|
-
args: [{ selector: 'hvy-procedure-model-list', template: "<div class=\"o-procedure-list\">\n <div class=\"m-form-label-field o-procedure-list__action\">\n <hvy-immediate-filters [filterSet]=\"'procedure'\">\n <hvy-text-filter prop=\"search\" #filter></hvy-text-filter>\n <hvy-choice-filter\n i18nPrefix=\"@hvy.event.domain.\"\n label=\"@hvy.event.domain.name\"\n [choices]=\"DOMAINS\"\n prop=\"domain\"\n #filter\n ></hvy-choice-filter>\n </hvy-immediate-filters>\n </div>\n <div class=\"o-procedure-list__table\" #scrollable>\n <table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <hvy-procedure-column-order field=\"
|
|
2604
|
+
args: [{ selector: 'hvy-procedure-model-list', template: "<div class=\"o-procedure-list\">\n <div class=\"m-form-label-field o-procedure-list__action\">\n <hvy-immediate-filters [filterSet]=\"'procedure'\">\n <hvy-text-filter prop=\"search\" #filter></hvy-text-filter>\n <hvy-choice-filter\n i18nPrefix=\"@hvy.event.domain.\"\n label=\"@hvy.event.domain.name\"\n [choices]=\"DOMAINS\"\n prop=\"domain\"\n #filter\n ></hvy-choice-filter>\n </hvy-immediate-filters>\n </div>\n <div class=\"o-procedure-list__table\" #scrollable>\n <table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th>\n <hvy-procedure-column-order field=\"id\">{{ '@hvy.procedure.id' | i18n }}</hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"name\">{{ '@hvy.procedure.title' | i18n }}</hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"domain\">{{ '@hvy.procedure.domain' | i18n }}</hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"useCount\"\n >{{ '@hvy.procedure.useCount' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"creator\"\n >{{ '@hvy.procedure.author' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"creationDate\"\n >{{ '@hvy.event.creationDate' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"lastModificationDate\">\n <span>{{ '@hvy.event.lastModificationDate' | i18n }}</span></hvy-procedure-column-order\n >\n </th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (procedure of procedures$ | async; track procedure.id) {\n <tr class=\"o-hvy-events-table__line\" (click)=\"goTo(procedure)\">\n <td class=\"o-hvy-events-table__line__cell\">{{ padId.fn(procedure.id) }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.name }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ '@hvy.event.domain.' + procedure.domain | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.useCount }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ procedure.creator }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.creationDate | displayLocaleDatetime }}</td>\n <td class=\"o-hvy-events-table__line__cell\">\n {{ procedure.lastModificationDate | displayLocaleDatetime }}\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"PROCEDURE_LINK.fn(procedure, store)\">\n <div class=\"consult-link\">\n <pry-icon iconSvg=\"eye\" [height]=\"30\" [width]=\"40\"></pry-icon>\n </div>\n </a>\n </td>\n </tr>\n } @empty {\n <tr>\n <td class=\"o-hvy-events-table__empty\" colspan=\"50\">\n <div>{{ '@hvy.procedure.noContent' | i18n }}</div>\n <div>\n <ng-content></ng-content>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n</div>\n" }]
|
|
2389
2605
|
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Router }, { type: InfiniteScrollService }], propDecorators: { scrollable: [{
|
|
2390
2606
|
type: ViewChild,
|
|
2391
2607
|
args: ['scrollable']
|
|
@@ -2803,6 +3019,10 @@ const frTranslations = {
|
|
|
2803
3019
|
prm: 'N° du contrat PRM',
|
|
2804
3020
|
presenceSensor: 'Capteur de présence',
|
|
2805
3021
|
parent: 'Parent',
|
|
3022
|
+
parentEvent: {
|
|
3023
|
+
name: 'Événement parent',
|
|
3024
|
+
placeholder: 'Recherchez par identifiant ou nom'
|
|
3025
|
+
},
|
|
2806
3026
|
consult: 'Consulter {{howMany}} événement{{plural}}',
|
|
2807
3027
|
entity: {
|
|
2808
3028
|
NOTFOUND: 'Équipement inconnu'
|
|
@@ -2815,7 +3035,15 @@ const frTranslations = {
|
|
|
2815
3035
|
head: '{{nb}} commentaire',
|
|
2816
3036
|
heads: '{{nb}} commentaires'
|
|
2817
3037
|
},
|
|
2818
|
-
equipmentPlaceholder: 'Recherchez par référence ou famille'
|
|
3038
|
+
equipmentPlaceholder: 'Recherchez par référence ou famille',
|
|
3039
|
+
export: {
|
|
3040
|
+
filename: 'Hyperviseur_Export_Journal_Evenements'
|
|
3041
|
+
},
|
|
3042
|
+
add: {
|
|
3043
|
+
title: 'Ajouter un événement',
|
|
3044
|
+
description: 'L’événement s’ajoutera au groupe d’événements et sera associé à la procédure commune.',
|
|
3045
|
+
search: 'Rechercher un événement'
|
|
3046
|
+
}
|
|
2819
3047
|
},
|
|
2820
3048
|
eventSummary: {
|
|
2821
3049
|
from: 'Du',
|
|
@@ -2974,6 +3202,7 @@ class EventEffects {
|
|
|
2974
3202
|
this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime$1(200), mergeMap$1((action) => this.eventService.getProcedure(action.id).pipe(map$1((procedure) => EventActions.getSuccess({ procedure })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
2975
3203
|
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime$1(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map$1((event) => EventActions.saveSuccess({ event: event ?? action.event, creation: action.event.id < 0 })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
2976
3204
|
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime$1(200), mergeMap$1((action) => this.eventService.saveProcedure(action.procedure).pipe(map$1((procedure) => EventActions.saveSuccess({ procedure: action.procedure, creation: false })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
3205
|
+
this.addEventToProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.addEventToProcedure), debounceTime$1(200), mergeMap$1((action) => this.eventService.addEventToProcedure(action.eventId, action.procedure).pipe(map$1(() => EventActions.saveSuccess({ procedure: action.procedure, creation: false })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
2977
3206
|
this.refreshAfterSave$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveSuccess, EventActions.statusSuccess), debounceTime$1(200), map$1((action) => !!action.procedure
|
|
2978
3207
|
? EventActions.getForProcedure({ id: action.procedure.id })
|
|
2979
3208
|
: EventActions.get({ id: action.event.id }))));
|
|
@@ -3121,7 +3350,10 @@ const components = [
|
|
|
3121
3350
|
HvyServiceActionParameterComponent,
|
|
3122
3351
|
HvyServiceActionDisplayComponent,
|
|
3123
3352
|
DisplayLocaleDateTime,
|
|
3124
|
-
HvyCommentsComponent
|
|
3353
|
+
HvyCommentsComponent,
|
|
3354
|
+
LastEventsComponent,
|
|
3355
|
+
HvyEventDetailsTooltipComponent,
|
|
3356
|
+
HvyEventAddEventComponent
|
|
3125
3357
|
];
|
|
3126
3358
|
class PvyHypervisorModule {
|
|
3127
3359
|
static forRoot(options) {
|
|
@@ -3174,7 +3406,10 @@ class PvyHypervisorModule {
|
|
|
3174
3406
|
HvyServiceActionParameterComponent,
|
|
3175
3407
|
HvyServiceActionDisplayComponent,
|
|
3176
3408
|
DisplayLocaleDateTime,
|
|
3177
|
-
HvyCommentsComponent,
|
|
3409
|
+
HvyCommentsComponent,
|
|
3410
|
+
LastEventsComponent,
|
|
3411
|
+
HvyEventDetailsTooltipComponent,
|
|
3412
|
+
HvyEventAddEventComponent, ProcedureActionsComponent], imports: [i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$5.EffectsFeatureModule, NgForOf,
|
|
3178
3413
|
AsyncPipe,
|
|
3179
3414
|
PryI18nModule,
|
|
3180
3415
|
PryCoreModule,
|
|
@@ -3227,7 +3462,10 @@ class PvyHypervisorModule {
|
|
|
3227
3462
|
HvyServiceActionParameterComponent,
|
|
3228
3463
|
HvyServiceActionDisplayComponent,
|
|
3229
3464
|
DisplayLocaleDateTime,
|
|
3230
|
-
HvyCommentsComponent
|
|
3465
|
+
HvyCommentsComponent,
|
|
3466
|
+
LastEventsComponent,
|
|
3467
|
+
HvyEventDetailsTooltipComponent,
|
|
3468
|
+
HvyEventAddEventComponent] }); }
|
|
3231
3469
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: PvyHypervisorModule, imports: [StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
|
|
3232
3470
|
StoreModule.forFeature(eventFeatureKey, eventReducer),
|
|
3233
3471
|
StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
|
|
@@ -3290,5 +3528,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
3290
3528
|
* Generated bundle index. Do not edit.
|
|
3291
3529
|
*/
|
|
3292
3530
|
|
|
3293
|
-
export { ACTIONS_TYPES, CategoryBackground, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, DisplayLocaleDateTime, ENTITIES, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventColumnOrderComponent, EventDetailComponent, EventEffects, EventFiltersComponent, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HvyActionMenuComponent, HvyActionParameterComponent, HvyBaseParameterActionComponent, HvyCommentsComponent, HvyCreateServiceComponent, HvyEmailActionDisplayComponent, HvyEmailActionParameterComponent, HvyNoParamsActionDisplayComponent, HvyOtherActionDisplayComponent, HvyOtherActionParameterComponent, HvyPhoneActionDisplayComponent, HvyPhoneActionParameterComponent, HvyServiceActionDisplayComponent, HvyServiceActionParameterComponent, HypCommentsService, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventSubCategory, HypEventType, HypSelectors, HypServiceStatus, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ImmediateFiltersComponent, KNOWN_FILTER_SETS, PAGE_SIZE_FETCH, PROCEDURE_LINK, PROCEDURE_PAGE_SIZE_FETCH, ProcedureActions, ProcedureActionsComponent, ProcedureAssociationModalComponent, ProcedureColumnOrderComponent, ProcedureEffects, ProcedureListComponent, ProcedureModelDetailComponent, ProcedureSelectors, ProcedureService, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, TextFilterComponent, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, padId, procedureFeatureKey, procedureForWriteAPI, procedureInitialState, procedureReducer };
|
|
3531
|
+
export { ACTIONS_TYPES, CategoryBackground, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, DisplayLocaleDateTime, ENTITIES, EVENT_LINK, EVENT_TO_ICON, EquipmentService, EventActions, EventColumnOrderComponent, EventDetailComponent, EventEffects, EventFiltersComponent, EventIconPipe, EventListComponent, EventSelectors, EventService, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, ForDatetimeLocalPipe, HYP_BASE_CONFIG, HvyActionMenuComponent, HvyActionParameterComponent, HvyBaseParameterActionComponent, HvyCommentsComponent, HvyCreateServiceComponent, HvyEmailActionDisplayComponent, HvyEmailActionParameterComponent, HvyEventAddEventComponent, HvyEventDetailsTooltipComponent, HvyNoParamsActionDisplayComponent, HvyOtherActionDisplayComponent, HvyOtherActionParameterComponent, HvyPhoneActionDisplayComponent, HvyPhoneActionParameterComponent, HvyServiceActionDisplayComponent, HvyServiceActionParameterComponent, HypCommentsService, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventSubCategory, HypEventType, HypSelectors, HypServiceStatus, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ImmediateFiltersComponent, KNOWN_FILTER_SETS, LastEventsComponent, PAGE_SIZE_FETCH, PROCEDURE_LINK, PROCEDURE_PAGE_SIZE_FETCH, ProcedureActions, ProcedureActionsComponent, ProcedureAssociationModalComponent, ProcedureColumnOrderComponent, ProcedureEffects, ProcedureListComponent, ProcedureModelDetailComponent, ProcedureSelectors, ProcedureService, ProgressDisplayComponent, PvyHypervisorModule, StatusDisplayComponent, TextFilterComponent, displayDate, enTranslations, eventFeatureKey, eventForWriteAPI, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations, hypFeatureKey, hypInitialState, hypervisorReducer, padId, procedureFeatureKey, procedureForWriteAPI, procedureInitialState, procedureReducer };
|
|
3294
3532
|
//# sourceMappingURL=provoly-hypervisor.mjs.map
|