@provoly/hypervisor 0.0.61 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/lib/event/detail/event-detail.component.mjs +18 -73
- package/esm2022/src/lib/event/filters/choice/choice-filter.component.mjs +2 -1
- package/esm2022/src/lib/event/filters/date/date-filter.component.mjs +2 -1
- package/esm2022/src/lib/event/filters/hvy-unit-filter.class.mjs +6 -3
- package/esm2022/src/lib/event/filters/on/click/event-filters.component.mjs +35 -0
- package/esm2022/src/lib/event/filters/on/immediate/immediate-filters.component.mjs +40 -0
- package/esm2022/src/lib/event/filters/text/text-filter.component.mjs +4 -3
- package/esm2022/src/lib/event/public-api.mjs +3 -2
- package/esm2022/src/lib/general/i18n/en.translations.mjs +22 -5
- package/esm2022/src/lib/general/i18n/fr.translations.mjs +17 -4
- package/esm2022/src/lib/general/procedure-actions/procedure-actions.component.mjs +90 -0
- package/esm2022/src/lib/hypervisor.module.mjs +14 -9
- package/esm2022/src/lib/model/procedure/hyp-procedure-model.interface.mjs +1 -1
- package/esm2022/src/lib/procedure/model-detail/procedure-model-detail.component.mjs +93 -0
- package/esm2022/src/lib/procedure/model-list/procedure-column-order.component.mjs +23 -0
- package/esm2022/src/lib/procedure/model-list/procedure-list.component.mjs +56 -0
- package/esm2022/src/lib/procedure/public-api.mjs +4 -4
- package/esm2022/src/lib/store/event/event.service.mjs +5 -2
- package/esm2022/src/lib/store/procedure/procedure.actions.mjs +6 -3
- package/esm2022/src/lib/store/procedure/procedure.effects.mjs +3 -1
- package/esm2022/src/lib/store/procedure/procedure.reducer.mjs +12 -1
- package/esm2022/src/lib/store/procedure/procedure.service.mjs +14 -1
- package/fesm2022/provoly-hypervisor.mjs +318 -114
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/event/detail/event-detail.component.d.ts +1 -14
- package/src/lib/event/filters/hvy-unit-filter.class.d.ts +3 -1
- package/src/lib/event/filters/{event-filters.component.d.ts → on/click/event-filters.component.d.ts} +1 -1
- package/src/lib/event/filters/on/immediate/immediate-filters.component.d.ts +15 -0
- package/src/lib/event/public-api.d.ts +2 -1
- package/src/lib/general/i18n/en.translations.d.ts +18 -1
- package/src/lib/general/i18n/fr.translations.d.ts +14 -1
- package/src/lib/general/procedure-actions/procedure-actions.component.d.ts +31 -0
- package/src/lib/hypervisor.module.d.ts +14 -12
- package/src/lib/model/procedure/hyp-procedure-model.interface.d.ts +2 -1
- package/src/lib/procedure/model-detail/procedure-model-detail.component.d.ts +36 -0
- package/src/lib/procedure/{list → model-list}/procedure-list.component.d.ts +3 -3
- package/src/lib/procedure/public-api.d.ts +3 -3
- package/src/lib/store/procedure/procedure.actions.d.ts +21 -6
- package/src/lib/store/procedure/procedure.effects.d.ts +10 -0
- package/src/lib/store/procedure/procedure.service.d.ts +2 -0
- package/styles/components/_index.scss +1 -0
- package/styles/components/_o-hvy-procedure-detail.scss +43 -0
- package/esm2022/src/lib/event/filters/event-filters.component.mjs +0 -35
- package/esm2022/src/lib/procedure/detail/procedure-detail.component.mjs +0 -14
- package/esm2022/src/lib/procedure/list/procedure-column-order.component.mjs +0 -24
- package/esm2022/src/lib/procedure/list/procedure-list.component.mjs +0 -56
- package/src/lib/procedure/detail/procedure-detail.component.d.ts +0 -8
- /package/src/lib/procedure/{list → model-list}/procedure-column-order.component.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Pipe, Component, Input, EventEmitter, Output, TemplateRef, ViewChild, ContentChildren, Directive, forwardRef, signal, computed, InjectionToken, NgModule, Inject } from '@angular/core';
|
|
2
|
+
import { Injectable, Pipe, Component, Input, EventEmitter, Output, model as model$1, TemplateRef, ViewChild, ContentChildren, Directive, forwardRef, signal, computed, InjectionToken, NgModule, Inject } from '@angular/core';
|
|
3
3
|
import * as i3 from '@provoly/dashboard';
|
|
4
4
|
import { DEFAULT_ICON_URL, SubscriptionnerDirective, FilterParamEncoder, PryI18nModule, PryCoreModule, PrySinceDateModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
|
|
5
5
|
import * as i1$1 from '@ngrx/store';
|
|
@@ -7,19 +7,20 @@ import { createAction, props, createReducer, on, createFeatureSelector, createSe
|
|
|
7
7
|
import * as i3$1 from '@angular/cdk/overlay';
|
|
8
8
|
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
9
9
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
10
|
-
import { mergeMap, of, fromEvent, catchError, withLatestFrom, filter, auditTime, combineLatest, map as map$1, BehaviorSubject, Subject, debounceTime, switchMap } from 'rxjs';
|
|
10
|
+
import { mergeMap, of, fromEvent, catchError, withLatestFrom, filter, auditTime, combineLatest, map as map$1, distinctUntilChanged, BehaviorSubject, Subject, debounceTime as debounceTime$1, switchMap } from 'rxjs';
|
|
11
11
|
import equal from 'fast-deep-equal/es6';
|
|
12
12
|
import * as i1 from '@angular/common/http';
|
|
13
13
|
import { HttpParams } from '@angular/common/http';
|
|
14
|
-
import * as i4 from '@provoly/dashboard/components/checkbox';
|
|
15
|
-
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
16
14
|
import * as i5 from '@angular/forms';
|
|
17
15
|
import { FormsModule } from '@angular/forms';
|
|
18
16
|
import * as i1$2 from '@angular/common';
|
|
19
17
|
import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe, JsonPipe } from '@angular/common';
|
|
18
|
+
import { v4 } from 'uuid';
|
|
19
|
+
import * as i4 from '@provoly/dashboard/components/checkbox';
|
|
20
|
+
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
20
21
|
import * as i2 from '@angular/router';
|
|
21
22
|
import { RouterLink } from '@angular/router';
|
|
22
|
-
import { map, startWith, catchError as catchError$1,
|
|
23
|
+
import { map, startWith, debounceTime, catchError as catchError$1, mergeMap as mergeMap$1 } from 'rxjs/operators';
|
|
23
24
|
import * as i1$3 from '@ngrx/effects';
|
|
24
25
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
25
26
|
|
|
@@ -217,6 +218,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
217
218
|
type: Input
|
|
218
219
|
}] } });
|
|
219
220
|
|
|
221
|
+
const ACTIONS_TYPES = {
|
|
222
|
+
values: ['CSU', 'DOUTE', 'SMS', 'AUTRE', 'SERVICE', 'EMAIL']
|
|
223
|
+
};
|
|
224
|
+
class ProcedureActionsComponent extends SubscriptionnerDirective {
|
|
225
|
+
constructor() {
|
|
226
|
+
super(...arguments);
|
|
227
|
+
this.moveStart = 0;
|
|
228
|
+
this.moveInitialIndex = 0;
|
|
229
|
+
this.initialActionList = [];
|
|
230
|
+
this.previousOffset = 0;
|
|
231
|
+
this.actions = [];
|
|
232
|
+
this.tmpActions = [];
|
|
233
|
+
this.modified = new EventEmitter();
|
|
234
|
+
this.ACTIONS_TYPES = ACTIONS_TYPES.values;
|
|
235
|
+
this.model = model$1;
|
|
236
|
+
}
|
|
237
|
+
static { this.CARD_HEIGHT = 75; }
|
|
238
|
+
onMouseDown($event) {
|
|
239
|
+
this.dragTarget = $event.target;
|
|
240
|
+
}
|
|
241
|
+
dragStart($event, action, index) {
|
|
242
|
+
if (this.dragTarget && this.dragTarget.style.maskImage.indexOf('six_dot') > -1) {
|
|
243
|
+
this.movingAction = action;
|
|
244
|
+
this.moveStart = $event.clientY;
|
|
245
|
+
this.moveInitialIndex = index;
|
|
246
|
+
this.initialActionList = [...this.actions];
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
$event.preventDefault();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
move($event) {
|
|
253
|
+
$event.preventDefault();
|
|
254
|
+
if (this.movingAction) {
|
|
255
|
+
const offsetInCards = Math.round(($event.clientY - this.moveStart) / ProcedureActionsComponent.CARD_HEIGHT);
|
|
256
|
+
if (this.previousOffset !== offsetInCards) {
|
|
257
|
+
this.previousOffset = offsetInCards;
|
|
258
|
+
const newIndex = Math.min(Math.max(this.moveInitialIndex + offsetInCards, 0), this.initialActionList.length - 1);
|
|
259
|
+
const newActions = [...this.initialActionList];
|
|
260
|
+
const element = newActions.splice(this.moveInitialIndex, 1)[0];
|
|
261
|
+
newActions.splice(newIndex, 0, element);
|
|
262
|
+
this.modified.next(newActions);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
drop($event) {
|
|
267
|
+
$event.preventDefault();
|
|
268
|
+
this.move($event);
|
|
269
|
+
this.movingAction = undefined;
|
|
270
|
+
}
|
|
271
|
+
allowDrop($event) {
|
|
272
|
+
$event.preventDefault();
|
|
273
|
+
}
|
|
274
|
+
toggleActionStatus(index, $event) {
|
|
275
|
+
$event.preventDefault();
|
|
276
|
+
const newActions = [...this.actions];
|
|
277
|
+
if (newActions[index].status !== 'DONE') {
|
|
278
|
+
newActions[index] = {
|
|
279
|
+
...newActions[index],
|
|
280
|
+
status: newActions[index].status === 'NEW' ? 'IN_PREGRESS' : 'NEW'
|
|
281
|
+
};
|
|
282
|
+
this.modified.next(newActions);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
add() {
|
|
286
|
+
this.tmpActions.push({ type: '', status: 'NEW', id: v4() });
|
|
287
|
+
}
|
|
288
|
+
updateNew(idx, prop, $event) {
|
|
289
|
+
// @ts-ignore
|
|
290
|
+
this.tmpActions[idx][prop] = $event;
|
|
291
|
+
}
|
|
292
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureActionsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureActionsComponent, selector: "hvy-procedure-actions", inputs: { actions: "actions" }, outputs: { modified: "modified" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"o-hvy-events-detail__procedure__actions\"\n (drag)=\"move($event)\"\n (drop)=\"drop($event)\"\n (dragover)=\"allowDrop($event)\"\n>\n @for (action of actions; track action.id; let idx = $index) {\n <div\n class=\"o-hvy-events-detail__procedure__actions__action\"\n [draggable]=\"true\"\n (dragstart)=\"dragStart($event, action, idx)\"\n (mousedown)=\"onMouseDown($event)\"\n >\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox\n [ngModel]=\"action.status !== 'NEW'\"\n (click)=\"toggleActionStatus(idx, $event)\"\n [disabled]=\"action.status === 'DONE'\"\n ></pry-checkbox>\n <div [class.-done]=\"action.status === 'DONE'\">{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n }\n @for (action of tmpActions; track action.id; let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action-tmp\">\n <pry-select\n [ngModel]=\"action.type\"\n [items]=\"ACTIONS_TYPES\"\n (ngModelChange)=\"updateNew(idx, 'type', $event)\"\n i18nPrefix=\"@hvy.procedure.action.\"\n ></pry-select>\n </div>\n }\n @if (tmpActions.length === 0 && actions.length === 0) {\n <div>{{ '@hvy.event.log.procedure.noAction' | i18n }}</div>\n }\n <div class=\"o-hvy-events-detail__procedure__button\">\n <button class=\"a-btn a-btn--primary\" (click)=\"add()\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.procedure.action.add' | i18n }}\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i4.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
294
|
+
}
|
|
295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureActionsComponent, decorators: [{
|
|
296
|
+
type: Component,
|
|
297
|
+
args: [{ selector: 'hvy-procedure-actions', template: "<div\n class=\"o-hvy-events-detail__procedure__actions\"\n (drag)=\"move($event)\"\n (drop)=\"drop($event)\"\n (dragover)=\"allowDrop($event)\"\n>\n @for (action of actions; track action.id; let idx = $index) {\n <div\n class=\"o-hvy-events-detail__procedure__actions__action\"\n [draggable]=\"true\"\n (dragstart)=\"dragStart($event, action, idx)\"\n (mousedown)=\"onMouseDown($event)\"\n >\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox\n [ngModel]=\"action.status !== 'NEW'\"\n (click)=\"toggleActionStatus(idx, $event)\"\n [disabled]=\"action.status === 'DONE'\"\n ></pry-checkbox>\n <div [class.-done]=\"action.status === 'DONE'\">{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n }\n @for (action of tmpActions; track action.id; let idx = $index) {\n <div class=\"o-hvy-events-detail__procedure__actions__action-tmp\">\n <pry-select\n [ngModel]=\"action.type\"\n [items]=\"ACTIONS_TYPES\"\n (ngModelChange)=\"updateNew(idx, 'type', $event)\"\n i18nPrefix=\"@hvy.procedure.action.\"\n ></pry-select>\n </div>\n }\n @if (tmpActions.length === 0 && actions.length === 0) {\n <div>{{ '@hvy.event.log.procedure.noAction' | i18n }}</div>\n }\n <div class=\"o-hvy-events-detail__procedure__button\">\n <button class=\"a-btn a-btn--primary\" (click)=\"add()\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.procedure.action.add' | i18n }}\n </button>\n </div>\n</div>\n" }]
|
|
298
|
+
}], propDecorators: { actions: [{
|
|
299
|
+
type: Input
|
|
300
|
+
}], modified: [{
|
|
301
|
+
type: Output
|
|
302
|
+
}] } });
|
|
303
|
+
|
|
220
304
|
class ForDatetimeLocalPipe {
|
|
221
305
|
constructor(store) {
|
|
222
306
|
this.store = store;
|
|
@@ -235,7 +319,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
235
319
|
}], ctorParameters: () => [{ type: i1$1.Store }] });
|
|
236
320
|
|
|
237
321
|
class EventDetailComponent extends SubscriptionnerDirective {
|
|
238
|
-
static { this.CARD_HEIGHT = 75; }
|
|
239
322
|
set events(events) {
|
|
240
323
|
this._events = events.filter((ev) => !!ev);
|
|
241
324
|
this.eventModifications = new Array(this._events.length);
|
|
@@ -276,10 +359,6 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
276
359
|
this.errors = [];
|
|
277
360
|
this.canCloseSome = false;
|
|
278
361
|
this.newComentContent = '';
|
|
279
|
-
this.moveStart = 0;
|
|
280
|
-
this.moveInitialIndex = 0;
|
|
281
|
-
this.initialActionList = [];
|
|
282
|
-
this.previousOffset = 0;
|
|
283
362
|
this.changeStatusContext = {
|
|
284
363
|
comment: '',
|
|
285
364
|
events: [],
|
|
@@ -540,78 +619,28 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
540
619
|
}
|
|
541
620
|
this.changeStatusContext.comment = '';
|
|
542
621
|
}
|
|
543
|
-
onMouseDown($event) {
|
|
544
|
-
this.dragTarget = $event.target;
|
|
545
|
-
}
|
|
546
|
-
dragStart($event, action, index) {
|
|
547
|
-
if (this.dragTarget && this.dragTarget.style.maskImage.indexOf('six_dot') > -1) {
|
|
548
|
-
this.movingAction = action;
|
|
549
|
-
this.moveStart = $event.clientY;
|
|
550
|
-
this.moveInitialIndex = index;
|
|
551
|
-
this.initialActionList = [...this.procedure.actions];
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
$event.preventDefault();
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
move($event) {
|
|
558
|
-
$event.preventDefault();
|
|
559
|
-
if (this.movingAction) {
|
|
560
|
-
const offsetInCards = Math.round(($event.clientY - this.moveStart) / EventDetailComponent.CARD_HEIGHT);
|
|
561
|
-
if (this.previousOffset !== offsetInCards) {
|
|
562
|
-
this.previousOffset = offsetInCards;
|
|
563
|
-
const newIndex = Math.min(Math.max(this.moveInitialIndex + offsetInCards, 0), this.initialActionList.length - 1);
|
|
564
|
-
const newActions = [...this.initialActionList];
|
|
565
|
-
const element = newActions.splice(this.moveInitialIndex, 1)[0];
|
|
566
|
-
newActions.splice(newIndex, 0, element);
|
|
567
|
-
if (equal(newActions, this._procedure.actions)) {
|
|
568
|
-
delete this.procedureModifications.actions;
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
this.procedureModifications.actions = newActions;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
drop($event) {
|
|
577
|
-
$event.preventDefault();
|
|
578
|
-
this.move($event);
|
|
579
|
-
this.movingAction = undefined;
|
|
580
|
-
this._outputModifications();
|
|
581
|
-
}
|
|
582
|
-
allowDrop($event) {
|
|
583
|
-
$event.preventDefault();
|
|
584
|
-
}
|
|
585
622
|
confirmDisabled() {
|
|
586
623
|
return this.changeStatusContext.comment.length === 0;
|
|
587
624
|
}
|
|
588
|
-
toggleActionStatus(index, $event) {
|
|
589
|
-
$event.preventDefault();
|
|
590
|
-
const newActions = [...this.procedure.actions];
|
|
591
|
-
if (newActions[index].status !== 'DONE') {
|
|
592
|
-
newActions[index] = {
|
|
593
|
-
...newActions[index],
|
|
594
|
-
status: newActions[index].status === 'NEW' ? 'IN_PREGRESS' : 'NEW'
|
|
595
|
-
};
|
|
596
|
-
if (equal(newActions, this._procedure.actions)) {
|
|
597
|
-
delete this.procedureModifications.actions;
|
|
598
|
-
}
|
|
599
|
-
else {
|
|
600
|
-
this.procedureModifications.actions = newActions;
|
|
601
|
-
}
|
|
602
|
-
this._outputModifications();
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
625
|
get calculatedProgress() {
|
|
606
626
|
return Math.round((this.procedure.actions.filter((action) => action.status === 'DONE').length / this.procedure.actions.length) *
|
|
607
627
|
100);
|
|
608
628
|
}
|
|
629
|
+
modifiedActions($event) {
|
|
630
|
+
if (equal($event, this._procedure.actions)) {
|
|
631
|
+
delete this.procedureModifications.actions;
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
this.procedureModifications.actions = $event;
|
|
635
|
+
}
|
|
636
|
+
this._outputModifications();
|
|
637
|
+
}
|
|
609
638
|
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: i3$1.Overlay }, { token: i0.ViewContainerRef }, { token: i3.PrySnackbarService }, { token: i3.PryI18nService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
610
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { title: "title", events: "events", procedure: "procedure", cancelModifications: "cancelModifications", equipmentName: "equipmentName" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors" }, viewQueries: [{ propertyName: "confirmDialog", first: true, predicate: ["confirmDialog"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ title ?? '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n @if (canCloseSome) {\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) {\n <div\n class=\"a-tooltip\"\n [attr.data-tooltip]=\"'... TODO: get closing comment ...'\"\n data-tooltip-position=\"bottom\"\n >\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 (canCloseSome) {\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</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 <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\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 />\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 <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 ></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 ></textarea>\n </td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\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 ?? ''\"\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 <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\"\n />\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]=\"event.equipment?.entity ?? ''\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }} :</h3>\n <textarea\n [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"\n ></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"newComentContent.length === 0\">\n {{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>\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 <div\n class=\"o-hvy-events-detail__procedure__actions\"\n (drag)=\"move($event)\"\n (drop)=\"drop($event)\"\n (dragover)=\"allowDrop($event)\"\n >\n @for (action of procedure.actions; track action.id; let idx = $index) {\n <div\n class=\"o-hvy-events-detail__procedure__actions__action\"\n [draggable]=\"true\"\n (dragstart)=\"dragStart($event, action, idx)\"\n (mousedown)=\"onMouseDown($event)\"\n >\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox\n [ngModel]=\"action.status !== 'NEW'\"\n (click)=\"toggleActionStatus(idx, $event)\"\n [disabled]=\"action.status === 'DONE'\"\n ></pry-checkbox>\n <div [class.-done]=\"action.status === 'DONE'\">{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure__button\">\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n } @else {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #confirmDialog>\n <div\n class=\"o-hvy-close-confirm__dialog\"\n aria-labelledby=\"confirm\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <h2>\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: "component", type: i4.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["item", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
639
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { title: "title", events: "events", procedure: "procedure", cancelModifications: "cancelModifications", equipmentName: "equipmentName" }, outputs: { modifiedEvents: "modifiedEvents", modifiedProcedure: "modifiedProcedure", eventErrors: "eventErrors" }, viewQueries: [{ propertyName: "confirmDialog", first: true, predicate: ["confirmDialog"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-events-detail\">\n <div class=\"o-hvy-events-detail__header\">\n <div class=\"o-hvy-events-detail__header__split\">\n <h1>{{ title ?? '@hvy.event.detail' | i18n }}</h1>\n @if (events.length > 1) {\n @if (canCloseSome) {\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) {\n <div\n class=\"a-tooltip\"\n [attr.data-tooltip]=\"'... TODO: get closing comment ...'\"\n data-tooltip-position=\"bottom\"\n >\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 (canCloseSome) {\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</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 <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\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 />\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 <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 ></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 ></textarea>\n </td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\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 ?? ''\"\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 <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\"\n />\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]=\"event.equipment?.entity ?? ''\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }} :</h3>\n <textarea\n [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"\n ></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"newComentContent.length === 0\">\n {{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>\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 [actions]=\"procedure.actions\"\n (modified)=\"modifiedActions($event)\"\n ></hvy-procedure-actions>\n } @else {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #confirmDialog>\n <div\n class=\"o-hvy-close-confirm__dialog\"\n aria-labelledby=\"confirm\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <h2>\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: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "component", type: StatusDisplayComponent, selector: "hvy-status-display", inputs: ["item", "modifiable"], outputs: ["modified"] }, { kind: "component", type: ProgressDisplayComponent, selector: "hvy-progress-display", inputs: ["progress"] }, { kind: "component", type: ProcedureActionsComponent, selector: "hvy-procedure-actions", inputs: ["actions"], outputs: ["modified"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
611
640
|
}
|
|
612
641
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
613
642
|
type: Component,
|
|
614
|
-
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) {\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) {\n <div\n class=\"a-tooltip\"\n [attr.data-tooltip]=\"'... TODO: get closing comment ...'\"\n data-tooltip-position=\"bottom\"\n >\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 (canCloseSome) {\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</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 <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\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 />\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 <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 ></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 ></textarea>\n </td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\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 ?? ''\"\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 <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\"\n />\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]=\"event.equipment?.entity ?? ''\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }} :</h3>\n <textarea\n [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"\n ></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"newComentContent.length === 0\">\n {{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>\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 <div\n class=\"o-hvy-events-detail__procedure__actions\"\n (drag)=\"move($event)\"\n (drop)=\"drop($event)\"\n (dragover)=\"allowDrop($event)\"\n >\n @for (action of procedure.actions; track action.id; let idx = $index) {\n <div\n class=\"o-hvy-events-detail__procedure__actions__action\"\n [draggable]=\"true\"\n (dragstart)=\"dragStart($event, action, idx)\"\n (mousedown)=\"onMouseDown($event)\"\n >\n <pry-icon iconSvg=\"six_dot\" #handle></pry-icon>\n <pry-checkbox\n [ngModel]=\"action.status !== 'NEW'\"\n (click)=\"toggleActionStatus(idx, $event)\"\n [disabled]=\"action.status === 'DONE'\"\n ></pry-checkbox>\n <div [class.-done]=\"action.status === 'DONE'\">{{ action.name }}</div>\n <pry-icon iconSvg=\"more_horiz\"></pry-icon>\n </div>\n } @empty {\n <div>\n {{ '@hvy.event.log.procedure.noAction' | i18n }}\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure__button\">\n <button class=\"a-btn a-btn--primary\">\n <pry-icon iconSvg=\"add\"></pry-icon>\n {{ '@hvy.event.log.procedure.addAction' | i18n }}\n </button>\n </div>\n } @else {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #confirmDialog>\n <div\n class=\"o-hvy-close-confirm__dialog\"\n aria-labelledby=\"confirm\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <h2>\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" }]
|
|
643
|
+
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) {\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) {\n <div\n class=\"a-tooltip\"\n [attr.data-tooltip]=\"'... TODO: get closing comment ...'\"\n data-tooltip-position=\"bottom\"\n >\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 (canCloseSome) {\n <button class=\"a-btn a-btn--secondary\">{{ '@hvy.event.log.procedure.delete' | i18n }}</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 <hvy-status-display\n [item]=\"event\"\n [modifiable]=\"event.status !== 'DONE'\"\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 />\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 <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 ></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 ></textarea>\n </td>\n </tr>\n @if (['ALERT', 'REPORT'].includes(event.type)) {\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 ?? ''\"\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 <input\n type=\"text\"\n class=\"a-form-field\"\n [value]=\"event.equipment?.name ?? ''\"\n [class.-error]=\"hasError('equipment', idx)\"\n [readonly]=\"accessValue.eqName\"\n (change)=\"changeEquipment(idx, $event)\"\n />\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]=\"event.equipment?.entity ?? ''\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\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 step=\"1\"\n class=\"a-form-field\"\n [value]=\"event.closeDate | forDateTimeLocal\"\n readonly\n />\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"o-hvy-events-detail__events__event__content__comments\">\n <h3>{{ '@hvy.event.log.event.comments.name' | i18n }} :</h3>\n <textarea\n [placeholder]=\"('@hvy.event.log.event.comments.placeholder' | i18n) + '...'\"\n [(ngModel)]=\"newComentContent\"\n ></textarea>\n <div class=\"o-hvy-events-detail__events__event__content__comments__button\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"newComentContent.length === 0\">\n {{ '@hvy.action.comment' | i18n }}\n </button>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n <div class=\"o-hvy-events-detail__procedure\">\n <div class=\"o-hvy-events-detail__procedure__header\">\n <h2>\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 [actions]=\"procedure.actions\"\n (modified)=\"modifiedActions($event)\"\n ></hvy-procedure-actions>\n } @else {\n <button class=\"a-btn a-btn--secondary\" [disabled]=\"!canAssociateProcedure\">\n {{ '@hvy.action.associate' | i18n }}\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #confirmDialog>\n <div\n class=\"o-hvy-close-confirm__dialog\"\n aria-labelledby=\"confirm\"\n tabindex=\"-1\"\n id=\"choice\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <h2>\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" }]
|
|
615
644
|
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }, { type: i3$1.Overlay }, { type: i0.ViewContainerRef }, { type: i3.PrySnackbarService }, { type: i3.PryI18nService }], propDecorators: { modifiedEvents: [{
|
|
616
645
|
type: Output
|
|
617
646
|
}], modifiedProcedure: [{
|
|
@@ -850,6 +879,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
850
879
|
args: ['filter', { descendants: true }]
|
|
851
880
|
}] } });
|
|
852
881
|
|
|
882
|
+
class ImmediateFiltersComponent extends SubscriptionnerDirective {
|
|
883
|
+
constructor(store) {
|
|
884
|
+
super();
|
|
885
|
+
this.store = store;
|
|
886
|
+
this.filterSet = 'global';
|
|
887
|
+
this.delay = 400;
|
|
888
|
+
}
|
|
889
|
+
ngAfterViewInit() {
|
|
890
|
+
this.filters.forEach((filter) => {
|
|
891
|
+
filter.filterSet = this.filterSet;
|
|
892
|
+
});
|
|
893
|
+
combineLatest(this.filters.map((filter) => filter.changed.pipe(startWith(undefined))))
|
|
894
|
+
.pipe(debounceTime(this.delay), map(() => this.filters.map((filter) => filter.getParams()).reduce((p, c) => ({ ...p, ...c }), {})), distinctUntilChanged((b, a) => equal(b, a)))
|
|
895
|
+
.subscribe((filters) => {
|
|
896
|
+
this.store.dispatch(EventActions.filter({ filters, filterSet: this.filterSet }));
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ImmediateFiltersComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
900
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ImmediateFiltersComponent, selector: "hvy-immediate-filters", inputs: { filterSet: "filterSet", delay: "delay" }, queries: [{ propertyName: "filters", predicate: ["filter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n</div>\n" }); }
|
|
901
|
+
}
|
|
902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ImmediateFiltersComponent, decorators: [{
|
|
903
|
+
type: Component,
|
|
904
|
+
args: [{ selector: 'hvy-immediate-filters', template: "<div class=\"o-hvy-event-filters\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
905
|
+
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { filterSet: [{
|
|
906
|
+
type: Input
|
|
907
|
+
}], delay: [{
|
|
908
|
+
type: Input
|
|
909
|
+
}], filters: [{
|
|
910
|
+
type: ContentChildren,
|
|
911
|
+
args: ['filter', { descendants: true }]
|
|
912
|
+
}] } });
|
|
913
|
+
|
|
853
914
|
class HvyUnitFilterComponent extends SubscriptionnerDirective {
|
|
854
915
|
set filterSet(filterSet) {
|
|
855
916
|
this._filterSet$.next(filterSet);
|
|
@@ -861,17 +922,20 @@ class HvyUnitFilterComponent extends SubscriptionnerDirective {
|
|
|
861
922
|
super();
|
|
862
923
|
this.prop = 'no-prop-defined';
|
|
863
924
|
this._filterSet$ = new BehaviorSubject('global');
|
|
925
|
+
this.changed = new EventEmitter();
|
|
864
926
|
}
|
|
865
927
|
getParams() {
|
|
866
928
|
throw new Error('Must use sub implementation');
|
|
867
929
|
}
|
|
868
930
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HvyUnitFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
869
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: HvyUnitFilterComponent, inputs: { prop: "prop", filterSet: "filterSet" }, usesInheritance: true, ngImport: i0 }); }
|
|
931
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: HvyUnitFilterComponent, inputs: { prop: "prop", filterSet: "filterSet" }, outputs: { changed: "changed" }, usesInheritance: true, ngImport: i0 }); }
|
|
870
932
|
}
|
|
871
933
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HvyUnitFilterComponent, decorators: [{
|
|
872
934
|
type: Directive
|
|
873
935
|
}], ctorParameters: () => [], propDecorators: { prop: [{
|
|
874
936
|
type: Input
|
|
937
|
+
}], changed: [{
|
|
938
|
+
type: Output
|
|
875
939
|
}], filterSet: [{
|
|
876
940
|
type: Input
|
|
877
941
|
}] } });
|
|
@@ -894,6 +958,7 @@ class DateFilterComponent extends HvyUnitFilterComponent {
|
|
|
894
958
|
triggerChange($event) {
|
|
895
959
|
// @ts-ignore
|
|
896
960
|
this.value = $event instanceof Event ? $event.target?.value : $event;
|
|
961
|
+
this.changed.next();
|
|
897
962
|
}
|
|
898
963
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DateFilterComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
899
964
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: DateFilterComponent, selector: "hvy-date-filter", providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => DateFilterComponent) }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-date-filters\">\n <input type=\"date\" class=\"a-form-field\"\n [value]=\"value\"\n (change)=\"triggerChange($event)\">\n</div>\n" }); }
|
|
@@ -1007,6 +1072,7 @@ class ChoiceFilterComponent extends HvyUnitFilterComponent {
|
|
|
1007
1072
|
if (!this.inhibate || this.inhibate !== this.filterSet) {
|
|
1008
1073
|
this.triggerInhibate();
|
|
1009
1074
|
this.value.set(value);
|
|
1075
|
+
this.changed.next();
|
|
1010
1076
|
}
|
|
1011
1077
|
}
|
|
1012
1078
|
triggerInhibate() {
|
|
@@ -1048,13 +1114,14 @@ class TextFilterComponent extends HvyUnitFilterComponent {
|
|
|
1048
1114
|
triggerChange($event) {
|
|
1049
1115
|
// @ts-ignore
|
|
1050
1116
|
this.value = $event instanceof Event ? $event.target?.value : $event;
|
|
1117
|
+
this.changed.next();
|
|
1051
1118
|
}
|
|
1052
1119
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TextFilterComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1053
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: TextFilterComponent, selector: "hvy-text-filter", providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => TextFilterComponent) }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-text-filters\">\n <input\n class=\"a-form-field o-hvy-text-filters__search-input\"\n type=\"text\"\n [value]=\"value\"\n (
|
|
1120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: TextFilterComponent, selector: "hvy-text-filter", providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => TextFilterComponent) }], usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-text-filters\">\n <input\n class=\"a-form-field o-hvy-text-filters__search-input\"\n type=\"text\"\n [value]=\"value\"\n (input)=\"triggerChange($event)\"\n placeholder=\"{{ '@hvy.action.search' | i18n }}...\"\n />\n <pry-icon iconSvg=\"search\" class=\"o-hvy-text-filters__search-icon\"></pry-icon>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
1054
1121
|
}
|
|
1055
1122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TextFilterComponent, decorators: [{
|
|
1056
1123
|
type: Component,
|
|
1057
|
-
args: [{ selector: 'hvy-text-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => TextFilterComponent) }], template: "<div class=\"o-hvy-text-filters\">\n <input\n class=\"a-form-field o-hvy-text-filters__search-input\"\n type=\"text\"\n [value]=\"value\"\n (
|
|
1124
|
+
args: [{ selector: 'hvy-text-filter', providers: [{ provide: HvyUnitFilterComponent, useExisting: forwardRef(() => TextFilterComponent) }], template: "<div class=\"o-hvy-text-filters\">\n <input\n class=\"a-form-field o-hvy-text-filters__search-input\"\n type=\"text\"\n [value]=\"value\"\n (input)=\"triggerChange($event)\"\n placeholder=\"{{ '@hvy.action.search' | i18n }}...\"\n />\n <pry-icon iconSvg=\"search\" class=\"o-hvy-text-filters__search-icon\"></pry-icon>\n</div>\n" }]
|
|
1058
1125
|
}], ctorParameters: () => [{ type: i1$1.Store }] });
|
|
1059
1126
|
|
|
1060
1127
|
const ProcedureActions = {
|
|
@@ -1064,8 +1131,11 @@ const ProcedureActions = {
|
|
|
1064
1131
|
sort: createAction('[Procedure] Set Procedure List Sorting', props()),
|
|
1065
1132
|
setCategory: createAction('[Procedure] Set Category Value', props()),
|
|
1066
1133
|
model: createAction('[Procedure] Get Procedure Model', props()),
|
|
1067
|
-
modelSuccess: createAction('[Procedure] Get Procedure Model', props()),
|
|
1068
|
-
modelFailure: createAction('[Procedure] Get Procedure Model', props())
|
|
1134
|
+
modelSuccess: createAction('[Procedure] Get Procedure Model Success', props()),
|
|
1135
|
+
modelFailure: createAction('[Procedure] Get Procedure Model Failure', props()),
|
|
1136
|
+
save: createAction('[Procedure] Save Procedure Model', props()),
|
|
1137
|
+
saveSuccess: createAction('[Procedure] Save Procedure Model Success', props()),
|
|
1138
|
+
saveFailure: createAction('[Procedure] Save Procedure Model Failure', props())
|
|
1069
1139
|
};
|
|
1070
1140
|
|
|
1071
1141
|
const procedureFeatureKey = '@hvy/procedure';
|
|
@@ -1107,6 +1177,17 @@ const internalReducer$1 = createReducer(procedureInitialState, on(ProcedureActio
|
|
|
1107
1177
|
model: undefined,
|
|
1108
1178
|
loading: false,
|
|
1109
1179
|
error: action.error
|
|
1180
|
+
})), on(ProcedureActions.save, (state) => ({
|
|
1181
|
+
...state,
|
|
1182
|
+
loading: true
|
|
1183
|
+
})), on(ProcedureActions.saveSuccess, (state, action) => ({
|
|
1184
|
+
...state,
|
|
1185
|
+
model: action.model,
|
|
1186
|
+
loading: false
|
|
1187
|
+
})), on(ProcedureActions.saveFailure, (state, action) => ({
|
|
1188
|
+
...state,
|
|
1189
|
+
loading: false,
|
|
1190
|
+
error: action.error
|
|
1110
1191
|
})));
|
|
1111
1192
|
function procedureReducer(state, action) {
|
|
1112
1193
|
return internalReducer$1(state, action);
|
|
@@ -1162,6 +1243,19 @@ class ProcedureService {
|
|
|
1162
1243
|
return this.httpClient.get(encodeURI(`${url}/procedures/model`), { params });
|
|
1163
1244
|
}));
|
|
1164
1245
|
}
|
|
1246
|
+
get(id) {
|
|
1247
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1248
|
+
return this.httpClient.get(encodeURI(`${url}/procedures/model/id/${id}`));
|
|
1249
|
+
}));
|
|
1250
|
+
}
|
|
1251
|
+
save(model) {
|
|
1252
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1253
|
+
if (!!model.id) {
|
|
1254
|
+
return this.httpClient.post(encodeURI(`${url}/procedures/model`), model);
|
|
1255
|
+
}
|
|
1256
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/model`), model);
|
|
1257
|
+
}));
|
|
1258
|
+
}
|
|
1165
1259
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1166
1260
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureService, providedIn: 'root' }); }
|
|
1167
1261
|
}
|
|
@@ -1184,7 +1278,7 @@ class ProcedureAssociationModalComponent extends SubscriptionnerDirective {
|
|
|
1184
1278
|
this.selectedEvents$ = this.store.select(EventSelectors.selectedEvents);
|
|
1185
1279
|
this.procedures$ = combineLatest([
|
|
1186
1280
|
this.onDomainSelect$.pipe(startWith()),
|
|
1187
|
-
this.onProcedureSearch$.pipe(startWith(), debounceTime(500)),
|
|
1281
|
+
this.onProcedureSearch$.pipe(startWith(), debounceTime$1(500)),
|
|
1188
1282
|
]).pipe(switchMap(([_, __]) => {
|
|
1189
1283
|
const search = typeof this.procedureSelectValue === 'string' && this.procedureSelectValue.length > 2 ? this.procedureSelectValue : undefined;
|
|
1190
1284
|
return this.procedureService.getTop10ByUsage(this.selectedDomain, search);
|
|
@@ -1316,12 +1410,15 @@ class EventService {
|
|
|
1316
1410
|
delete toSend.id;
|
|
1317
1411
|
}
|
|
1318
1412
|
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1413
|
+
if (!!toSend.id) {
|
|
1414
|
+
return this.httpClient.put(encodeURI(`${url}/events/${event.type.toLowerCase()}/id/${toSend.id}`), eventForWriteAPI(event));
|
|
1415
|
+
}
|
|
1319
1416
|
return this.httpClient.post(encodeURI(`${url}/events/${event.type.toLowerCase()}`), eventForWriteAPI(event));
|
|
1320
1417
|
}));
|
|
1321
1418
|
}
|
|
1322
1419
|
saveProcedure(procedure) {
|
|
1323
1420
|
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1324
|
-
return this.httpClient.post(encodeURI(`${url}/procedures`), procedureForWriteAPI(procedure));
|
|
1421
|
+
return this.httpClient.post(encodeURI(`${url}/procedures/id/${procedure.id}`), procedureForWriteAPI(procedure));
|
|
1325
1422
|
}));
|
|
1326
1423
|
}
|
|
1327
1424
|
status(event, status, comment) {
|
|
@@ -1456,10 +1553,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
1456
1553
|
class ProcedureColumnOrderComponent extends ColumnOrderComponent {
|
|
1457
1554
|
constructor(store) {
|
|
1458
1555
|
super(store);
|
|
1459
|
-
this.subscriptions.add(this.store.select(ProcedureSelectors.sort).subscribe(sort => this.sortValue = sort));
|
|
1556
|
+
this.subscriptions.add(this.store.select(ProcedureSelectors.sort).subscribe((sort) => (this.sortValue = sort)));
|
|
1460
1557
|
}
|
|
1461
1558
|
sort(order) {
|
|
1462
|
-
throw Error('Sort not implemented.');
|
|
1463
1559
|
this.store.dispatch(ProcedureActions.sort({ field: this.field, order }));
|
|
1464
1560
|
}
|
|
1465
1561
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureColumnOrderComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -1471,7 +1567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
1471
1567
|
}], ctorParameters: () => [{ type: i1$1.Store }] });
|
|
1472
1568
|
|
|
1473
1569
|
const PROCEDURE_LINK = {
|
|
1474
|
-
fn: (procedure, store) => ['./', procedure.id]
|
|
1570
|
+
fn: (procedure, store) => ['./', padId.fn(procedure.id)]
|
|
1475
1571
|
};
|
|
1476
1572
|
class ProcedureListComponent extends SubscriptionnerDirective {
|
|
1477
1573
|
constructor(store, router, scroll) {
|
|
@@ -1499,24 +1595,97 @@ class ProcedureListComponent extends SubscriptionnerDirective {
|
|
|
1499
1595
|
return this.router.navigate(this.PROCEDURE_LINK.fn(procedure, this.store));
|
|
1500
1596
|
}
|
|
1501
1597
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureListComponent, deps: [{ token: i1$1.Store }, { token: i2.Router }, { token: InfiniteScrollService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1502
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureListComponent, selector: "hvy-procedure-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-
|
|
1598
|
+
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=\"useCount\"\n >{{ '@hvy.procedure.useCount' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"title\">{{ '@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=\"creator\">{{\n '@hvy.procedure.author' | i18n\n }}</hvy-procedure-column-order>\n </th>\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=\"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\">{{ procedure.useCount }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.title }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.domain }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ procedure.creator }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ padId.fn(procedure.id) }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.creationDate | date: 'dd/mm/YYYY HH:MM' }}</td>\n <td class=\"o-hvy-events-table__line__cell\">\n {{ procedure.lastModificationDate | date: 'dd/mm/YYYY HH:MM' }}\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.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: TextFilterComponent, selector: "hvy-text-filter" }, { kind: "component", type: ChoiceFilterComponent, selector: "hvy-choice-filter", inputs: ["label", "i18nPrefix", "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: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
|
|
1503
1599
|
}
|
|
1504
1600
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureListComponent, decorators: [{
|
|
1505
1601
|
type: Component,
|
|
1506
|
-
args: [{ selector: 'hvy-procedure-list', template: "<div class=\"o-procedure-list\">\n <div class=\"m-form-label-field o-procedure-list__action\">\n <hvy-
|
|
1602
|
+
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=\"useCount\"\n >{{ '@hvy.procedure.useCount' | i18n }}\n </hvy-procedure-column-order>\n </th>\n <th>\n <hvy-procedure-column-order field=\"title\">{{ '@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=\"creator\">{{\n '@hvy.procedure.author' | i18n\n }}</hvy-procedure-column-order>\n </th>\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=\"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\">{{ procedure.useCount }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.title }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.domain }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ procedure.creator }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ padId.fn(procedure.id) }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ procedure.creationDate | date: 'dd/mm/YYYY HH:MM' }}</td>\n <td class=\"o-hvy-events-table__line__cell\">\n {{ procedure.lastModificationDate | date: 'dd/mm/YYYY HH:MM' }}\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" }]
|
|
1507
1603
|
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i2.Router }, { type: InfiniteScrollService }], propDecorators: { scrollable: [{
|
|
1508
1604
|
type: ViewChild,
|
|
1509
1605
|
args: ['scrollable']
|
|
1510
1606
|
}] } });
|
|
1511
1607
|
|
|
1512
|
-
class
|
|
1513
|
-
|
|
1514
|
-
|
|
1608
|
+
class ProcedureModelDetailComponent extends SubscriptionnerDirective {
|
|
1609
|
+
set cancelModifications(evt) {
|
|
1610
|
+
this.modifications = {};
|
|
1611
|
+
this._outputModifications();
|
|
1612
|
+
}
|
|
1613
|
+
get modifiedModel() {
|
|
1614
|
+
return { ...this.model, ...(this.modifications ?? {}) };
|
|
1615
|
+
}
|
|
1616
|
+
constructor(store) {
|
|
1617
|
+
super();
|
|
1618
|
+
this.store = store;
|
|
1619
|
+
this.username = 'xxx';
|
|
1620
|
+
this.modifications = {};
|
|
1621
|
+
this.errors = [];
|
|
1622
|
+
this.eventErrors = new EventEmitter();
|
|
1623
|
+
this.modified = new EventEmitter();
|
|
1624
|
+
this.DOMAINS = DOMAINS.values;
|
|
1625
|
+
}
|
|
1626
|
+
hasError(prop) {
|
|
1627
|
+
return this.errors.find((err) => err.field === prop) ?? false;
|
|
1628
|
+
}
|
|
1629
|
+
validate(model) {
|
|
1630
|
+
if (!!model) {
|
|
1631
|
+
this.errors = [];
|
|
1632
|
+
if (!model.title || model.title.length === 0) {
|
|
1633
|
+
this.errors.push({ field: 'title', code: 'required' });
|
|
1634
|
+
}
|
|
1635
|
+
if (!model.domain || model.domain.length === 0) {
|
|
1636
|
+
this.errors.push({ field: 'domain', code: 'required' });
|
|
1637
|
+
}
|
|
1638
|
+
if (!model.description || model.description.length === 0) {
|
|
1639
|
+
this.errors.push({ field: 'description', code: 'required' });
|
|
1640
|
+
}
|
|
1641
|
+
this.eventErrors.next(this.errors);
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
modify(prop, $event) {
|
|
1645
|
+
// @ts-ignore
|
|
1646
|
+
const newValue = $event instanceof Event ? $event.target?.value : $event;
|
|
1647
|
+
// @ts-ignore
|
|
1648
|
+
if (this.model[prop] !== newValue) {
|
|
1649
|
+
// @ts-ignore
|
|
1650
|
+
this.modifications[prop] = newValue;
|
|
1651
|
+
this._outputModifications();
|
|
1652
|
+
}
|
|
1653
|
+
else {
|
|
1654
|
+
// @ts-ignore
|
|
1655
|
+
delete this.modifications[prop];
|
|
1656
|
+
this._outputModifications();
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
_outputModifications() {
|
|
1660
|
+
this.validate(this.modifiedModel);
|
|
1661
|
+
this.modified.next([this.modifications, this.modifiedModel]);
|
|
1662
|
+
}
|
|
1663
|
+
updateActions($event) {
|
|
1664
|
+
if (equal($event, this.model?.actions)) {
|
|
1665
|
+
delete this.modifications.actions;
|
|
1666
|
+
}
|
|
1667
|
+
else {
|
|
1668
|
+
this.modifications.actions = $event;
|
|
1669
|
+
}
|
|
1670
|
+
this._outputModifications();
|
|
1671
|
+
}
|
|
1672
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureModelDetailComponent, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1673
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureModelDetailComponent, selector: "hvy-procedure-model-detail", inputs: { model: "model", username: "username", title: "title", cancelModifications: "cancelModifications" }, outputs: { eventErrors: "eventErrors", modified: "modified" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-procedure-detail\">\n <h1>{{ title ?? '@hvy.procedure.detail' | i18n }}</h1>\n <div class=\"o-hvy-procedure-detail__container\">\n <div class=\"o-hvy-procedure-detail__container__scrollable\">\n @if (modifiedModel; as model) {\n <div class=\"o-hvy-procedure-detail__form\">\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.procedure.title' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('title')\"\n [value]=\"model.title\"\n (change)=\"modify('title', $event)\"\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.procedure.description' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <textarea\n [ngModel]=\"model.description\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('description')\"\n (ngModelChange)=\"modify('description', $event)\"\n ></textarea>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"model.domain\"\n i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain')\"\n (ngModelChange)=\"modify('domain', $event)\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.procedure.creator' | i18n }} :</td>\n <td>\n <input type=\"text\" class=\"a-form-field\" [value]=\"model.creator\" readonly />\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"o-hvy-procedure-detail__actions\">\n <h3>{{ '@hvy.procedure.actions' | i18n }}</h3>\n <hvy-procedure-actions [actions]=\"model.actions\" (modified)=\"updateActions($event)\"></hvy-procedure-actions>\n </div>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "component", type: ProcedureActionsComponent, selector: "hvy-procedure-actions", inputs: ["actions"], outputs: ["modified"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
1515
1674
|
}
|
|
1516
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type:
|
|
1675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureModelDetailComponent, decorators: [{
|
|
1517
1676
|
type: Component,
|
|
1518
|
-
args: [{ selector: 'hvy-procedure-detail', template: "<div class=\"o-hvy-procedure-detail\"></div>\n" }]
|
|
1519
|
-
}], propDecorators: { model: [{
|
|
1677
|
+
args: [{ selector: 'hvy-procedure-model-detail', template: "<div class=\"o-hvy-procedure-detail\">\n <h1>{{ title ?? '@hvy.procedure.detail' | i18n }}</h1>\n <div class=\"o-hvy-procedure-detail__container\">\n <div class=\"o-hvy-procedure-detail__container__scrollable\">\n @if (modifiedModel; as model) {\n <div class=\"o-hvy-procedure-detail__form\">\n <table>\n <tbody>\n <tr>\n <td>{{ '@hvy.procedure.title' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <input\n type=\"text\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('title')\"\n [value]=\"model.title\"\n (change)=\"modify('title', $event)\"\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.procedure.description' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <textarea\n [ngModel]=\"model.description\"\n class=\"a-form-field\"\n [class.-error]=\"hasError('description')\"\n (ngModelChange)=\"modify('description', $event)\"\n ></textarea>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }}<span class=\"required\">*</span> :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"model.domain\"\n i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain')\"\n (ngModelChange)=\"modify('domain', $event)\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.procedure.creator' | i18n }} :</td>\n <td>\n <input type=\"text\" class=\"a-form-field\" [value]=\"model.creator\" readonly />\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"o-hvy-procedure-detail__actions\">\n <h3>{{ '@hvy.procedure.actions' | i18n }}</h3>\n <hvy-procedure-actions [actions]=\"model.actions\" (modified)=\"updateActions($event)\"></hvy-procedure-actions>\n </div>\n }\n </div>\n </div>\n</div>\n" }]
|
|
1678
|
+
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { model: [{
|
|
1679
|
+
type: Input
|
|
1680
|
+
}], username: [{
|
|
1681
|
+
type: Input
|
|
1682
|
+
}], title: [{
|
|
1683
|
+
type: Input
|
|
1684
|
+
}], eventErrors: [{
|
|
1685
|
+
type: Output
|
|
1686
|
+
}], modified: [{
|
|
1687
|
+
type: Output
|
|
1688
|
+
}], cancelModifications: [{
|
|
1520
1689
|
type: Input
|
|
1521
1690
|
}] } });
|
|
1522
1691
|
|
|
@@ -1536,7 +1705,8 @@ const enTranslations = {
|
|
|
1536
1705
|
name: 'Status',
|
|
1537
1706
|
NEW: 'Open',
|
|
1538
1707
|
IN_PROGRESS: 'In progress',
|
|
1539
|
-
DONE: 'Done'
|
|
1708
|
+
DONE: 'Done',
|
|
1709
|
+
ASKED: 'Asked'
|
|
1540
1710
|
},
|
|
1541
1711
|
address: 'Address',
|
|
1542
1712
|
source: 'External reference',
|
|
@@ -1561,6 +1731,7 @@ const enTranslations = {
|
|
|
1561
1731
|
detail: 'Information',
|
|
1562
1732
|
mandatory: '* Mandatory fields',
|
|
1563
1733
|
name: 'Name',
|
|
1734
|
+
id: 'Identifier',
|
|
1564
1735
|
category: 'Category',
|
|
1565
1736
|
close: 'Close all events',
|
|
1566
1737
|
closed: 'All closed',
|
|
@@ -1574,8 +1745,7 @@ const enTranslations = {
|
|
|
1574
1745
|
progress: 'Progress',
|
|
1575
1746
|
noAction: 'No actions',
|
|
1576
1747
|
name: 'Common procedure',
|
|
1577
|
-
name1: 'Procedure'
|
|
1578
|
-
addAction: 'Add action'
|
|
1748
|
+
name1: 'Procedure'
|
|
1579
1749
|
}
|
|
1580
1750
|
},
|
|
1581
1751
|
category: {
|
|
@@ -1606,6 +1776,11 @@ const enTranslations = {
|
|
|
1606
1776
|
multi: 'Close events',
|
|
1607
1777
|
comment: 'Close comment'
|
|
1608
1778
|
},
|
|
1779
|
+
installDate: 'Installation date',
|
|
1780
|
+
managed: 'Managed equipment',
|
|
1781
|
+
prm: 'PRM contract number',
|
|
1782
|
+
presenceSensor: 'Presence sensor',
|
|
1783
|
+
parent: 'Parent',
|
|
1609
1784
|
consult: 'Consult {{howMany}} event{{plural}}'
|
|
1610
1785
|
},
|
|
1611
1786
|
eventSummary: {
|
|
@@ -1639,7 +1814,18 @@ const enTranslations = {
|
|
|
1639
1814
|
missingProperty: 'Missing property',
|
|
1640
1815
|
noContent: 'No existing procedures found',
|
|
1641
1816
|
domain: 'Domain',
|
|
1642
|
-
catalog: 'Procedure catalog'
|
|
1817
|
+
catalog: 'Procedure catalog',
|
|
1818
|
+
description: 'Description',
|
|
1819
|
+
creator: 'Creator',
|
|
1820
|
+
action: {
|
|
1821
|
+
add: 'Add new Action',
|
|
1822
|
+
CSU: 'Call CSU',
|
|
1823
|
+
DOUTE: 'Ask for doubt removal',
|
|
1824
|
+
SMS: 'Send a SMS',
|
|
1825
|
+
AUTRE: 'Other',
|
|
1826
|
+
SERVICE: 'Ask service',
|
|
1827
|
+
EMAIL: 'Send an email'
|
|
1828
|
+
}
|
|
1643
1829
|
},
|
|
1644
1830
|
associationModal: {
|
|
1645
1831
|
title: 'Link a procedure',
|
|
@@ -1703,6 +1889,7 @@ const frTranslations = {
|
|
|
1703
1889
|
detail: 'Informations',
|
|
1704
1890
|
mandatory: '* Champs obligatoires',
|
|
1705
1891
|
name: 'Nom',
|
|
1892
|
+
id: 'Identifiant',
|
|
1706
1893
|
category: 'Catégorie',
|
|
1707
1894
|
close: 'Clôturer tous ces événements',
|
|
1708
1895
|
closed: 'Tous clôturés',
|
|
@@ -1716,8 +1903,7 @@ const frTranslations = {
|
|
|
1716
1903
|
progress: 'Progression',
|
|
1717
1904
|
noAction: "Pas d'action",
|
|
1718
1905
|
name: 'Procédure commune',
|
|
1719
|
-
name1: 'Procédure'
|
|
1720
|
-
addAction: 'Ajouter une action'
|
|
1906
|
+
name1: 'Procédure'
|
|
1721
1907
|
}
|
|
1722
1908
|
},
|
|
1723
1909
|
category: {
|
|
@@ -1786,7 +1972,20 @@ const frTranslations = {
|
|
|
1786
1972
|
missingProperty: 'Propriété manquante',
|
|
1787
1973
|
noContent: "Aucune procédure n'a été créée.",
|
|
1788
1974
|
domain: 'Métier',
|
|
1789
|
-
catalog: 'Bibliothèque des procédures'
|
|
1975
|
+
catalog: 'Bibliothèque des procédures',
|
|
1976
|
+
detail: "Détail d'une procédure",
|
|
1977
|
+
actions: 'Actions associées',
|
|
1978
|
+
description: 'Description',
|
|
1979
|
+
creator: 'Créateur',
|
|
1980
|
+
action: {
|
|
1981
|
+
add: 'Ajouter une Action',
|
|
1982
|
+
CSU: 'Appeler le CSU',
|
|
1983
|
+
DOUTE: 'Demander une levée de doute',
|
|
1984
|
+
SMS: 'Envoyer un SMS',
|
|
1985
|
+
AUTRE: 'Autre',
|
|
1986
|
+
SERVICE: 'Demander une intervention',
|
|
1987
|
+
EMAIL: 'Envoyer un email'
|
|
1988
|
+
}
|
|
1790
1989
|
},
|
|
1791
1990
|
associationModal: {
|
|
1792
1991
|
title: 'Associer à une procédure',
|
|
@@ -1821,16 +2020,16 @@ class EventEffects {
|
|
|
1821
2020
|
this.actions$ = actions$;
|
|
1822
2021
|
this.eventService = eventService;
|
|
1823
2022
|
this.store = store;
|
|
1824
|
-
this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime
|
|
1825
|
-
this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime
|
|
1826
|
-
this.getEventByName$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getTooltipInfo), debounceTime
|
|
1827
|
-
this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime
|
|
1828
|
-
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime
|
|
1829
|
-
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime
|
|
1830
|
-
this.refreshAfterSave$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveSuccess, EventActions.statusSuccess), debounceTime
|
|
2023
|
+
this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime(200), withLatestFrom(this.store.select(EventSelectors.events), this.store.select(EventSelectors.noMoreEvents)), filter(([action, events, noMore]) => !action.next || (action.next && !noMore)), mergeMap$1(([action, stateEvents]) => this.eventService.list(action.next ? stateEvents.length : 0).pipe(map((events) => EventActions.loadSuccess({ events, startingFrom: action.next ? stateEvents.length : 0 })), catchError$1((error) => [EventActions.loadFailure({ error: error })])))));
|
|
2024
|
+
this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime(200), mergeMap$1((action) => this.eventService.get(action.id).pipe(map((event) => EventActions.getSuccess({ event })), catchError$1((error) => [EventActions.getFailure({ error: error })])))));
|
|
2025
|
+
this.getEventByName$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getTooltipInfo), debounceTime(200), mergeMap$1((action) => this.eventService.getTooltipInfo(action.name).pipe(map((event) => EventActions.getTooltipInfoSuccess({ event })), catchError$1((error) => [EventActions.getTooltipInfoFailure({ error: error })])))));
|
|
2026
|
+
this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.getProcedure(action.id).pipe(map((procedure) => EventActions.getSuccess({ procedure })), catchError$1((error) => [EventActions.getFailure({ error: error })])))));
|
|
2027
|
+
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map((event) => EventActions.saveSuccess({ event })), catchError$1((error) => [EventActions.saveFailure({ error: error })])))));
|
|
2028
|
+
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime(200), mergeMap$1((action) => this.eventService.saveProcedure(action.procedure).pipe(map((procedure) => EventActions.saveSuccess({ procedure })), catchError$1((error) => [EventActions.saveFailure({ error: error })])))));
|
|
2029
|
+
this.refreshAfterSave$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveSuccess, EventActions.statusSuccess), debounceTime(200), map((action) => !!action.procedure
|
|
1831
2030
|
? EventActions.getForProcedure({ id: action.procedure.id })
|
|
1832
2031
|
: EventActions.get({ id: action.event.id }))));
|
|
1833
|
-
this.close$ = createEffect(() => this.actions$.pipe(ofType(EventActions.status), debounceTime
|
|
2032
|
+
this.close$ = createEffect(() => this.actions$.pipe(ofType(EventActions.status), debounceTime(200), mergeMap$1((action) => {
|
|
1834
2033
|
if (!!action.event) {
|
|
1835
2034
|
return this.eventService.status(action.event, action.targetStatus, action.comment).pipe(mergeMap$1((event) => [
|
|
1836
2035
|
EventActions.statusSuccess({ event: action.event, procedure: action.procedure }),
|
|
@@ -1841,8 +2040,8 @@ class EventEffects {
|
|
|
1841
2040
|
return this.eventService.statusProcedure(action.procedure, action.targetStatus, action.comment).pipe(mergeMap$1((event) => [EventActions.statusSuccess({ procedure: action.procedure }), EventActions.load({})]), catchError$1((error) => [EventActions.statusFailure({ error: error })]));
|
|
1842
2041
|
}
|
|
1843
2042
|
})));
|
|
1844
|
-
this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort), debounceTime
|
|
1845
|
-
this.filter$ = createEffect(() => this.actions$.pipe(ofType(EventActions.filter), filter((action) => action.filterSet === KNOWN_FILTER_SETS.EVENTS), debounceTime
|
|
2043
|
+
this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort), debounceTime(200), map(() => EventActions.load({}))));
|
|
2044
|
+
this.filter$ = createEffect(() => this.actions$.pipe(ofType(EventActions.filter), filter((action) => action.filterSet === KNOWN_FILTER_SETS.EVENTS), debounceTime(200), map(() => EventActions.load({}))));
|
|
1846
2045
|
this.associateProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.associateProcedure), mergeMap$1((action) => this.eventService.associateProcedure(action.procedureId).pipe(map(() => EventActions.load({})), catchError$1((error) => [EventActions.associateProcedureFailure({ error: error })])))));
|
|
1847
2046
|
}
|
|
1848
2047
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventEffects, deps: [{ token: i1$3.Actions }, { token: EventService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -1910,7 +2109,7 @@ class EventSummaryEffects {
|
|
|
1910
2109
|
constructor(actions$, eventSummaryService) {
|
|
1911
2110
|
this.actions$ = actions$;
|
|
1912
2111
|
this.eventSummaryService = eventSummaryService;
|
|
1913
|
-
this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime
|
|
2112
|
+
this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime(200), mergeMap$1((action) => this.eventSummaryService.list().pipe(map((summaries) => EventSummaryActions.loadSuccess({ summaries })), catchError$1((error) => [EventSummaryActions.loadFailure({ error: error })])))));
|
|
1914
2113
|
}
|
|
1915
2114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventSummaryEffects, deps: [{ token: i1$3.Actions }, { token: EventSummaryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1916
2115
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventSummaryEffects }); }
|
|
@@ -1924,8 +2123,10 @@ class ProcedureEffects {
|
|
|
1924
2123
|
this.actions$ = actions$;
|
|
1925
2124
|
this.procedureService = procedureService;
|
|
1926
2125
|
this.store = store;
|
|
1927
|
-
this.loadProcedures$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.load), debounceTime
|
|
1928
|
-
this.sort$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.sort), debounceTime
|
|
2126
|
+
this.loadProcedures$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.load), debounceTime(200), withLatestFrom(this.store.select(ProcedureSelectors.procedures), this.store.select(ProcedureSelectors.noMoreProcedures)), filter(([action, stateProcedures, noMore]) => !noMore), mergeMap$1(([action, stateProcedures]) => this.procedureService.list(action.next ? stateProcedures.length : 0).pipe(map((procedures) => ProcedureActions.loadSuccess({ procedures, startingFrom: action.next ? stateProcedures.length : 0 })), catchError$1((error) => [ProcedureActions.loadFailure({ error: error })])))));
|
|
2127
|
+
this.sort$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.sort), debounceTime(200), map(() => ProcedureActions.load({}))));
|
|
2128
|
+
this.model$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.model), debounceTime(200), mergeMap$1((action) => this.procedureService.get(action.id).pipe(map((model) => ProcedureActions.modelSuccess({ model })), catchError$1((error) => [ProcedureActions.modelFailure({ error: error })])))));
|
|
2129
|
+
this.save$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.save), debounceTime(200), mergeMap$1((action) => this.procedureService.save(action.model).pipe(map((model) => ProcedureActions.saveSuccess({ model })), catchError$1((error) => [ProcedureActions.saveFailure({ error: error })])))));
|
|
1929
2130
|
}
|
|
1930
2131
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureEffects, deps: [{ token: i1$3.Actions }, { token: ProcedureService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1931
2132
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureEffects }); }
|
|
@@ -1954,7 +2155,8 @@ const components = [
|
|
|
1954
2155
|
ProcedureListComponent,
|
|
1955
2156
|
ProcedureColumnOrderComponent,
|
|
1956
2157
|
ProcedureAssociationModalComponent,
|
|
1957
|
-
|
|
2158
|
+
ProcedureModelDetailComponent,
|
|
2159
|
+
ImmediateFiltersComponent
|
|
1958
2160
|
];
|
|
1959
2161
|
class PvyHypervisorModule {
|
|
1960
2162
|
static forRoot(options) {
|
|
@@ -1991,7 +2193,8 @@ class PvyHypervisorModule {
|
|
|
1991
2193
|
ProcedureListComponent,
|
|
1992
2194
|
ProcedureColumnOrderComponent,
|
|
1993
2195
|
ProcedureAssociationModalComponent,
|
|
1994
|
-
|
|
2196
|
+
ProcedureModelDetailComponent,
|
|
2197
|
+
ImmediateFiltersComponent, ProcedureActionsComponent], imports: [i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$1.StoreFeatureModule, i1$3.EffectsFeatureModule, NgForOf,
|
|
1995
2198
|
AsyncPipe,
|
|
1996
2199
|
PryI18nModule,
|
|
1997
2200
|
PryCoreModule,
|
|
@@ -2024,7 +2227,8 @@ class PvyHypervisorModule {
|
|
|
2024
2227
|
ProcedureListComponent,
|
|
2025
2228
|
ProcedureColumnOrderComponent,
|
|
2026
2229
|
ProcedureAssociationModalComponent,
|
|
2027
|
-
|
|
2230
|
+
ProcedureModelDetailComponent,
|
|
2231
|
+
ImmediateFiltersComponent] }); }
|
|
2028
2232
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: PvyHypervisorModule, imports: [StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
|
|
2029
2233
|
StoreModule.forFeature(eventFeatureKey, eventReducer),
|
|
2030
2234
|
StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
|
|
@@ -2042,7 +2246,7 @@ class PvyHypervisorModule {
|
|
|
2042
2246
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: PvyHypervisorModule, decorators: [{
|
|
2043
2247
|
type: NgModule,
|
|
2044
2248
|
args: [{
|
|
2045
|
-
declarations: [...components],
|
|
2249
|
+
declarations: [...components, ProcedureActionsComponent],
|
|
2046
2250
|
imports: [
|
|
2047
2251
|
StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
|
|
2048
2252
|
StoreModule.forFeature(eventFeatureKey, eventReducer),
|
|
@@ -2080,5 +2284,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
2080
2284
|
* Generated bundle index. Do not edit.
|
|
2081
2285
|
*/
|
|
2082
2286
|
|
|
2083
|
-
export { CATEGORIES_BY_TYPE, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, 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, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, KNOWN_FILTER_SETS, PAGE_SIZE_FETCH, PROCEDURE_LINK, PROCEDURE_PAGE_SIZE_FETCH, ProcedureActions, ProcedureAssociationModalComponent, ProcedureColumnOrderComponent,
|
|
2287
|
+
export { CATEGORIES_BY_TYPE, ChoiceFilterComponent, ColumnOrderComponent, DOMAINS, DateFilterComponent, 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, HypEventCategory, HypEventCriticality, HypEventStatus, HypEventType, HypSelectors, HypervisorActions, HypervisorEffects, HypervisorService, IconDisplayComponent, ImmediateFiltersComponent, KNOWN_FILTER_SETS, PAGE_SIZE_FETCH, PROCEDURE_LINK, PROCEDURE_PAGE_SIZE_FETCH, ProcedureActions, 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 };
|
|
2084
2288
|
//# sourceMappingURL=provoly-hypervisor.mjs.map
|