@provoly/hypervisor 0.0.70 → 0.0.71
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 +16 -6
- package/esm2022/src/lib/event/procedure-association-modal/procedure-association-modal.component.mjs +24 -13
- package/esm2022/src/lib/general/i18n/fr.translations.mjs +2 -2
- package/esm2022/src/lib/general/procedure-actions/actions-types.constant.mjs +2 -2
- package/esm2022/src/lib/procedure/model-detail/procedure-model-detail.component.mjs +3 -3
- package/esm2022/src/lib/procedure/model-list/procedure-list.component.mjs +3 -8
- package/esm2022/src/lib/store/event/event.service.mjs +2 -5
- package/esm2022/src/lib/store/procedure/procedure.service.mjs +5 -3
- package/fesm2022/provoly-hypervisor.mjs +341 -326
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/event/detail/event-detail.component.d.ts +4 -2
- package/src/lib/event/procedure-association-modal/procedure-association-modal.component.d.ts +4 -2
- package/src/lib/procedure/model-list/procedure-list.component.d.ts +1 -3
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Pipe, Component, Input, EventEmitter, Output, Inject, ViewContainerRef, ViewChild, model as model$1, ElementRef, ViewChildren, TemplateRef, ContentChildren, Directive, forwardRef, signal, computed, InjectionToken, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$3 from '@provoly/dashboard';
|
|
4
|
-
import { DEFAULT_ICON_URL, SubscriptionnerDirective, PRY_DIALOG_DATA,
|
|
4
|
+
import { FilterParamEncoder, DEFAULT_ICON_URL, SubscriptionnerDirective, PRY_DIALOG_DATA, PryI18nModule, PryCoreModule, PrySinceDateModule, PryIconModule, PrySelectModule, PryDatePickerModule } from '@provoly/dashboard';
|
|
5
5
|
import * as i1$1 from '@ngrx/store';
|
|
6
6
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
7
7
|
import * as i2 from '@angular/cdk/overlay';
|
|
8
8
|
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
9
9
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
10
|
-
import { mergeMap, of,
|
|
10
|
+
import { combineLatest, map, mergeMap, of, Subject, BehaviorSubject, debounceTime, switchMap, shareReplay, fromEvent, catchError as catchError$1, withLatestFrom, filter, auditTime, distinctUntilChanged } from 'rxjs';
|
|
11
11
|
import equal from 'fast-deep-equal/es6';
|
|
12
|
+
import { map as map$1, startWith, catchError, debounceTime as debounceTime$1, mergeMap as mergeMap$1 } from 'rxjs/operators';
|
|
12
13
|
import * as i1 from '@angular/common/http';
|
|
13
14
|
import { HttpParams } from '@angular/common/http';
|
|
14
15
|
import * as i1$4 from '@angular/forms';
|
|
@@ -20,7 +21,6 @@ import * as i4 from '@provoly/dashboard/components/checkbox';
|
|
|
20
21
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
21
22
|
import * as i2$1 from '@angular/router';
|
|
22
23
|
import { RouterLink } from '@angular/router';
|
|
23
|
-
import { map, startWith, debounceTime, catchError as catchError$1, mergeMap as mergeMap$1 } from 'rxjs/operators';
|
|
24
24
|
import * as i1$5 from '@ngrx/effects';
|
|
25
25
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
26
26
|
|
|
@@ -74,6 +74,84 @@ const padId = {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
const eventFeatureKey = '@hvy/event';
|
|
78
|
+
const eventInitialState = {
|
|
79
|
+
events: [],
|
|
80
|
+
noMoreEvents: false,
|
|
81
|
+
loading: false,
|
|
82
|
+
filters: {},
|
|
83
|
+
selectedIds: [],
|
|
84
|
+
details: {}
|
|
85
|
+
};
|
|
86
|
+
const internalReducer$3 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
|
|
87
|
+
...state,
|
|
88
|
+
loading: true
|
|
89
|
+
})), on(EventActions.loadSuccess, (state, { events, startingFrom }) => {
|
|
90
|
+
return {
|
|
91
|
+
...state,
|
|
92
|
+
loading: false,
|
|
93
|
+
noMoreEvents: events.length < 20,
|
|
94
|
+
events: [...state.events.slice(0, startingFrom), ...events]
|
|
95
|
+
};
|
|
96
|
+
}), on(EventActions.loadFailure, (state, action) => ({
|
|
97
|
+
...state,
|
|
98
|
+
loading: false,
|
|
99
|
+
events: []
|
|
100
|
+
})), on(EventActions.select, (state, { ids, cumulative }) => ({
|
|
101
|
+
...state,
|
|
102
|
+
selectedIds: !cumulative
|
|
103
|
+
? ids
|
|
104
|
+
: [...state.selectedIds, ...ids].reduce((p, c) => (p.indexOf(c) === -1 ? [...p, c] : p.filter((p1) => p1 !== c)), [])
|
|
105
|
+
})), on(EventActions.get, EventActions.getForProcedure, (state, _) => ({
|
|
106
|
+
...state,
|
|
107
|
+
details: {}
|
|
108
|
+
})), on(EventActions.getSuccess, (state, { event, procedure }) => ({
|
|
109
|
+
...state,
|
|
110
|
+
details: { event, procedure }
|
|
111
|
+
})), on(EventActions.sort, (state, { field, order }) => ({
|
|
112
|
+
...state,
|
|
113
|
+
events: [],
|
|
114
|
+
noMoreEvents: false,
|
|
115
|
+
sort: { field, order }
|
|
116
|
+
})), on(EventActions.filter, (state, { filters, filterSet }) => ({
|
|
117
|
+
...state,
|
|
118
|
+
events: [],
|
|
119
|
+
noMoreEvents: false,
|
|
120
|
+
filters: { ...state.filters, [filterSet]: filters }
|
|
121
|
+
})), on(EventActions.getTooltipInfo, (state, _) => ({
|
|
122
|
+
...state,
|
|
123
|
+
tooltip: undefined
|
|
124
|
+
})), on(EventActions.getTooltipInfoSuccess, (state, { event }) => ({
|
|
125
|
+
...state,
|
|
126
|
+
tooltip: event
|
|
127
|
+
})));
|
|
128
|
+
function eventReducer(state, action) {
|
|
129
|
+
return internalReducer$3(state, action);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const feature$3 = createFeatureSelector(eventFeatureKey);
|
|
133
|
+
const events = createSelector(feature$3, (state) => state.events);
|
|
134
|
+
const noMoreEvents = createSelector(feature$3, (state) => state.noMoreEvents);
|
|
135
|
+
const selectedIds = createSelector(feature$3, (state) => state.selectedIds);
|
|
136
|
+
const selectedEvents = createSelector(feature$3, (state) => state.events.filter((event) => state.selectedIds.includes(event.id)));
|
|
137
|
+
const loading$2 = createSelector(feature$3, (state) => state.loading);
|
|
138
|
+
const filters = createSelector(feature$3, (state) => state.filters);
|
|
139
|
+
const details = createSelector(feature$3, (state) => state.details);
|
|
140
|
+
const sort$1 = createSelector(feature$3, (state) => state.sort);
|
|
141
|
+
const tooltipInfo = createSelector(feature$3, (state) => state.tooltip);
|
|
142
|
+
const EventSelectors = {
|
|
143
|
+
feature: feature$3,
|
|
144
|
+
events,
|
|
145
|
+
selectedIds,
|
|
146
|
+
selectedEvents,
|
|
147
|
+
loading: loading$2,
|
|
148
|
+
filters,
|
|
149
|
+
details,
|
|
150
|
+
noMoreEvents,
|
|
151
|
+
sort: sort$1,
|
|
152
|
+
tooltipInfo
|
|
153
|
+
};
|
|
154
|
+
|
|
77
155
|
const HypervisorActions = {
|
|
78
156
|
setUrl: createAction('[Event] Set Backend Url', props())
|
|
79
157
|
};
|
|
@@ -82,40 +160,162 @@ const hypFeatureKey = '@hvy/general';
|
|
|
82
160
|
const hypInitialState = {
|
|
83
161
|
url: '/api/hypervisor',
|
|
84
162
|
};
|
|
85
|
-
const internalReducer$
|
|
163
|
+
const internalReducer$2 = createReducer(hypInitialState, on(HypervisorActions.setUrl, (state, action) => ({
|
|
86
164
|
...state,
|
|
87
165
|
url: action.url ?? state.url,
|
|
88
166
|
})));
|
|
89
167
|
function hypervisorReducer(state, action) {
|
|
90
|
-
return internalReducer$
|
|
168
|
+
return internalReducer$2(state, action);
|
|
91
169
|
}
|
|
92
170
|
|
|
93
|
-
const feature$
|
|
94
|
-
const url = createSelector(feature$
|
|
171
|
+
const feature$2 = createFeatureSelector(hypFeatureKey);
|
|
172
|
+
const url = createSelector(feature$2, (state) => state.url);
|
|
95
173
|
const HypSelectors = {
|
|
96
|
-
feature: feature$
|
|
174
|
+
feature: feature$2,
|
|
97
175
|
url
|
|
98
176
|
};
|
|
99
177
|
|
|
100
|
-
|
|
178
|
+
const ProcedureActions = {
|
|
179
|
+
load: createAction('[Procedure] Load Procedures', props()),
|
|
180
|
+
loadSuccess: createAction('[Procedure] (bus) Load Procedure Success', props()),
|
|
181
|
+
loadFailure: createAction('[Procedure] Load Procedures Failure', props()),
|
|
182
|
+
sort: createAction('[Procedure] Set Procedure List Sorting', props()),
|
|
183
|
+
setCategory: createAction('[Procedure] Set Category Value', props()),
|
|
184
|
+
model: createAction('[Procedure] Get Procedure Model', props()),
|
|
185
|
+
modelSuccess: createAction('[Procedure] Get Procedure Model Success', props()),
|
|
186
|
+
modelFailure: createAction('[Procedure] Get Procedure Model Failure', props()),
|
|
187
|
+
save: createAction('[Procedure] Save Procedure Model', props()),
|
|
188
|
+
saveSuccess: createAction('[Procedure] Save Procedure Model Success', props()),
|
|
189
|
+
saveFailure: createAction('[Procedure] Save Procedure Model Failure', props())
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const procedureFeatureKey = '@hvy/procedure';
|
|
193
|
+
const procedureInitialState = {
|
|
194
|
+
procedures: [],
|
|
195
|
+
noMoreProcedures: false,
|
|
196
|
+
loading: false
|
|
197
|
+
};
|
|
198
|
+
const internalReducer$1 = createReducer(procedureInitialState, on(ProcedureActions.load, (state) => ({
|
|
199
|
+
...state,
|
|
200
|
+
loading: true
|
|
201
|
+
})), on(ProcedureActions.loadSuccess, (state, { procedures, startingFrom }) => {
|
|
202
|
+
return {
|
|
203
|
+
...state,
|
|
204
|
+
loading: false,
|
|
205
|
+
noMoreProcedures: procedures.length < 20,
|
|
206
|
+
procedures: [...state.procedures.slice(0, startingFrom), ...procedures]
|
|
207
|
+
};
|
|
208
|
+
}), on(ProcedureActions.loadFailure, (state) => ({
|
|
209
|
+
...state,
|
|
210
|
+
loading: false,
|
|
211
|
+
procedures: [],
|
|
212
|
+
noMoreProcedures: false
|
|
213
|
+
})), on(ProcedureActions.sort, (state, { field, order }) => ({
|
|
214
|
+
...state,
|
|
215
|
+
procedures: [],
|
|
216
|
+
noMoreProcedures: false,
|
|
217
|
+
sort: { field, order }
|
|
218
|
+
})), on(ProcedureActions.model, (state) => ({
|
|
219
|
+
...state,
|
|
220
|
+
model: undefined,
|
|
221
|
+
loading: true
|
|
222
|
+
})), on(ProcedureActions.modelSuccess, (state, action) => ({
|
|
223
|
+
...state,
|
|
224
|
+
model: action.model,
|
|
225
|
+
loading: false
|
|
226
|
+
})), on(ProcedureActions.modelFailure, (state, action) => ({
|
|
227
|
+
...state,
|
|
228
|
+
model: undefined,
|
|
229
|
+
loading: false,
|
|
230
|
+
error: action.error
|
|
231
|
+
})), on(ProcedureActions.save, (state) => ({
|
|
232
|
+
...state,
|
|
233
|
+
loading: true
|
|
234
|
+
})), on(ProcedureActions.saveSuccess, (state, action) => ({
|
|
235
|
+
...state,
|
|
236
|
+
model: action.model,
|
|
237
|
+
loading: false
|
|
238
|
+
})), on(ProcedureActions.saveFailure, (state, action) => ({
|
|
239
|
+
...state,
|
|
240
|
+
loading: false,
|
|
241
|
+
error: action.error
|
|
242
|
+
})));
|
|
243
|
+
function procedureReducer(state, action) {
|
|
244
|
+
return internalReducer$1(state, action);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const feature$1 = createFeatureSelector(procedureFeatureKey);
|
|
248
|
+
const procedures = createSelector(feature$1, (state) => state.procedures);
|
|
249
|
+
const noMoreProcedures = createSelector(feature$1, (state) => state.noMoreProcedures);
|
|
250
|
+
const loading$1 = createSelector(feature$1, (state) => state.loading);
|
|
251
|
+
const sort = createSelector(feature$1, (state) => state.sort);
|
|
252
|
+
const model = createSelector(feature$1, (state) => state.model);
|
|
253
|
+
const ProcedureSelectors = {
|
|
254
|
+
feature: feature$1,
|
|
255
|
+
procedures,
|
|
256
|
+
loading: loading$1,
|
|
257
|
+
noMoreProcedures,
|
|
258
|
+
sort,
|
|
259
|
+
model
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const PROCEDURE_PAGE_SIZE_FETCH = { value: 20 };
|
|
263
|
+
class ProcedureService {
|
|
101
264
|
constructor(httpClient, store) {
|
|
102
265
|
this.httpClient = httpClient;
|
|
103
266
|
this.store = store;
|
|
104
267
|
}
|
|
105
|
-
|
|
106
|
-
return
|
|
107
|
-
.select(HypSelectors.url)
|
|
108
|
-
.
|
|
109
|
-
|
|
268
|
+
list(startWith = 0, pageSize = PROCEDURE_PAGE_SIZE_FETCH.value) {
|
|
269
|
+
return combineLatest([
|
|
270
|
+
this.store.select(HypSelectors.url),
|
|
271
|
+
this.store.select(ProcedureSelectors.sort),
|
|
272
|
+
this.store.select(EventSelectors.filters).pipe(map((filters) => filters['procedure'] ?? {}))
|
|
273
|
+
]).pipe(mergeMap(([url, sort, filters]) => {
|
|
274
|
+
let params = new HttpParams({ encoder: new FilterParamEncoder() });
|
|
275
|
+
Object.keys(filters).forEach((filter) => {
|
|
276
|
+
filters[filter].forEach((filterValue) => {
|
|
277
|
+
params = params.append(filter, filterValue);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
params = params.set('page', startWith / pageSize + 1);
|
|
281
|
+
if (sort)
|
|
282
|
+
params = params.set('sort', sort.field).set('order', sort.order);
|
|
283
|
+
return this.httpClient.get(encodeURI(`${url}/procedures/model`), { params });
|
|
110
284
|
}));
|
|
111
285
|
}
|
|
112
|
-
|
|
113
|
-
|
|
286
|
+
getTop10ByUsage(domain, nameSearch) {
|
|
287
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
288
|
+
let params = new HttpParams();
|
|
289
|
+
params = params.set('sort', 'useCount').set('order', 'DESC').set('pageSize', '10');
|
|
290
|
+
if (nameSearch)
|
|
291
|
+
params = params.set('name', nameSearch);
|
|
292
|
+
if (domain)
|
|
293
|
+
params = params.set('domain', domain);
|
|
294
|
+
return this.httpClient.get(encodeURI(`${url}/procedures/model`), { params });
|
|
295
|
+
}));
|
|
296
|
+
}
|
|
297
|
+
get(id) {
|
|
298
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
299
|
+
return this.httpClient.get(encodeURI(`${url}/procedures/model/id/${id}`));
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
save(model) {
|
|
303
|
+
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
304
|
+
if (!model.id) {
|
|
305
|
+
return this.httpClient.post(encodeURI(`${url}/procedures/model`), model);
|
|
306
|
+
}
|
|
307
|
+
return this.httpClient
|
|
308
|
+
.put(encodeURI(`${url}/procedures/model/id/${model.id}`), model)
|
|
309
|
+
.pipe(map(() => model));
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
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 }); }
|
|
313
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureService, providedIn: 'root' }); }
|
|
114
314
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type:
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureService, decorators: [{
|
|
116
316
|
type: Injectable,
|
|
117
317
|
args: [{
|
|
118
|
-
providedIn: 'root'
|
|
318
|
+
providedIn: 'root'
|
|
119
319
|
}]
|
|
120
320
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
121
321
|
|
|
@@ -150,6 +350,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
150
350
|
type: Input
|
|
151
351
|
}] } });
|
|
152
352
|
|
|
353
|
+
class ProcedureAssociationModalComponent extends SubscriptionnerDirective {
|
|
354
|
+
set events(events) {
|
|
355
|
+
this.eventsFromInput$.next(events);
|
|
356
|
+
}
|
|
357
|
+
constructor(store, procedureService, dialog) {
|
|
358
|
+
super();
|
|
359
|
+
this.store = store;
|
|
360
|
+
this.procedureService = procedureService;
|
|
361
|
+
this.dialog = dialog;
|
|
362
|
+
this.onDomainSelect$ = new Subject();
|
|
363
|
+
this.onProcedureSearch$ = new Subject();
|
|
364
|
+
this.eventsFromInput$ = new BehaviorSubject(null);
|
|
365
|
+
this.DOMAINS = DOMAINS.values;
|
|
366
|
+
this.selectedEvents$ = combineLatest([
|
|
367
|
+
this.eventsFromInput$,
|
|
368
|
+
this.store.select(EventSelectors.selectedEvents)
|
|
369
|
+
]).pipe(map$1(([eventsFromInput, eventsFromSelect]) => (eventsFromInput !== null ? eventsFromInput : eventsFromSelect)));
|
|
370
|
+
this.procedures$ = combineLatest([
|
|
371
|
+
this.onDomainSelect$.pipe(startWith()),
|
|
372
|
+
this.onProcedureSearch$.pipe(startWith(), debounceTime(500))
|
|
373
|
+
]).pipe(switchMap(([_, __]) => {
|
|
374
|
+
const search = typeof this.procedureSelectValue === 'string' && this.procedureSelectValue.length > 2
|
|
375
|
+
? this.procedureSelectValue
|
|
376
|
+
: undefined;
|
|
377
|
+
return this.procedureService.getTop10ByUsage(this.selectedDomain, search);
|
|
378
|
+
}), catchError(() => {
|
|
379
|
+
throw new Error('Procedure catalog problem');
|
|
380
|
+
}), shareReplay());
|
|
381
|
+
}
|
|
382
|
+
onDomainChange() {
|
|
383
|
+
this.onDomainSelect$.next();
|
|
384
|
+
this.procedureSelectValue = undefined;
|
|
385
|
+
}
|
|
386
|
+
selectedProcedureChange($event) {
|
|
387
|
+
this.procedureSelectValue = $event;
|
|
388
|
+
this.onProcedureSearch$.next();
|
|
389
|
+
}
|
|
390
|
+
associateProcedure() {
|
|
391
|
+
this.store.dispatch(EventActions.associateProcedure({ procedureId: this.procedureSelectValue.id }));
|
|
392
|
+
this.closeModal();
|
|
393
|
+
}
|
|
394
|
+
isProcedureSelected() {
|
|
395
|
+
return typeof this.procedureSelectValue === 'object';
|
|
396
|
+
}
|
|
397
|
+
closeModal() {
|
|
398
|
+
this.dialog.close();
|
|
399
|
+
}
|
|
400
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureAssociationModalComponent, deps: [{ token: i1$1.Store }, { token: ProcedureService }, { token: i1$3.PryDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
401
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureAssociationModalComponent, selector: "hvy-procedure-association-modal", inputs: { events: "events" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-association-modal u-display-flex -column -align-center\">\n <h3>{{ '@hvy.associationModal.title' | i18n }}</h3>\n <span class=\"o-hvy-association-modal__description\">{{ '@hvy.associationModal.description' | i18n }}</span>\n <div class=\"o-hvy-association-modal__content u-display-flex -justify-space-between\">\n @if (selectedEvents$ | async; as selectedEvents) {\n <div>\n <label>\u00C9v\u00E9nements li\u00E9s ({{ selectedEvents.length }}) :</label>\n <ul class=\"o-hvy-association-modal__events\">\n @for (event of selectedEvents; track event.id) {\n <li class=\"o-hvy-association-modal__event u-display-flex -align-center\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <div class=\"o-hvy-association-modal__event-detail u-display-flex -column\">\n <span class=\"o-hvy-association-modal__event-name\">{{ event.name }}</span>\n @if (event.equipment) {\n <span class=\"o-hvy-association-modal__equipment-name\">{{ event.equipment.name }}</span>\n }\n </div>\n </li>\n }\n </ul>\n </div>\n }\n <div class=\"o-hvy-association-modal__form\">\n <div class=\"m-form-label-field\">\n <label>{{ '@hvy.associationModal.categoryFilter' | i18n }}</label>\n <pry-select\n [items]=\"DOMAINS\"\n [(ngModel)]=\"selectedDomain\"\n (ngModelChange)=\"onDomainChange()\"\n [placeholder]=\"'@hvy.associationModal.domainPlaceholder' | i18n\"\n i18nPrefix=\"@hvy.event.domain.\"\n id=\"category-filter\"></pry-select>\n </div>\n <div class=\"m-form-label-field\">\n <label for=\"procedure-filter\">{{ '@hvy.associationModal.searchProcedure' | i18n }}<span class=\"text-error\">*</span> : </label>\n <pry-select\n [items]=\"procedures$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"procedureSelectValue\"\n (ngModelChange)=\"selectedProcedureChange($event)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.associationModal.procedurePlaceholder' | i18n\"\n id=\"procedure-filter\"></pry-select>\n </div>\n </div>\n </div>\n <div class=\"o-hvy-association-modal__buttons u-display-flex -justify-center\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"!isProcedureSelected()\" (click)=\"associateProcedure()\">{{ '@hvy.action.validate' | i18n }}</button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"closeModal()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "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: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
402
|
+
}
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureAssociationModalComponent, decorators: [{
|
|
404
|
+
type: Component,
|
|
405
|
+
args: [{ selector: 'hvy-procedure-association-modal', template: "<div class=\"o-hvy-association-modal u-display-flex -column -align-center\">\n <h3>{{ '@hvy.associationModal.title' | i18n }}</h3>\n <span class=\"o-hvy-association-modal__description\">{{ '@hvy.associationModal.description' | i18n }}</span>\n <div class=\"o-hvy-association-modal__content u-display-flex -justify-space-between\">\n @if (selectedEvents$ | async; as selectedEvents) {\n <div>\n <label>\u00C9v\u00E9nements li\u00E9s ({{ selectedEvents.length }}) :</label>\n <ul class=\"o-hvy-association-modal__events\">\n @for (event of selectedEvents; track event.id) {\n <li class=\"o-hvy-association-modal__event u-display-flex -align-center\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <div class=\"o-hvy-association-modal__event-detail u-display-flex -column\">\n <span class=\"o-hvy-association-modal__event-name\">{{ event.name }}</span>\n @if (event.equipment) {\n <span class=\"o-hvy-association-modal__equipment-name\">{{ event.equipment.name }}</span>\n }\n </div>\n </li>\n }\n </ul>\n </div>\n }\n <div class=\"o-hvy-association-modal__form\">\n <div class=\"m-form-label-field\">\n <label>{{ '@hvy.associationModal.categoryFilter' | i18n }}</label>\n <pry-select\n [items]=\"DOMAINS\"\n [(ngModel)]=\"selectedDomain\"\n (ngModelChange)=\"onDomainChange()\"\n [placeholder]=\"'@hvy.associationModal.domainPlaceholder' | i18n\"\n i18nPrefix=\"@hvy.event.domain.\"\n id=\"category-filter\"></pry-select>\n </div>\n <div class=\"m-form-label-field\">\n <label for=\"procedure-filter\">{{ '@hvy.associationModal.searchProcedure' | i18n }}<span class=\"text-error\">*</span> : </label>\n <pry-select\n [items]=\"procedures$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"procedureSelectValue\"\n (ngModelChange)=\"selectedProcedureChange($event)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.associationModal.procedurePlaceholder' | i18n\"\n id=\"procedure-filter\"></pry-select>\n </div>\n </div>\n </div>\n <div class=\"o-hvy-association-modal__buttons u-display-flex -justify-center\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"!isProcedureSelected()\" (click)=\"associateProcedure()\">{{ '@hvy.action.validate' | i18n }}</button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"closeModal()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n</div>\n" }]
|
|
406
|
+
}], ctorParameters: () => [{ type: i1$1.Store }, { type: ProcedureService }, { type: i1$3.PryDialogRef }], propDecorators: { events: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}] } });
|
|
409
|
+
|
|
410
|
+
class EquipmentService {
|
|
411
|
+
constructor(httpClient, store) {
|
|
412
|
+
this.httpClient = httpClient;
|
|
413
|
+
this.store = store;
|
|
414
|
+
}
|
|
415
|
+
findByName(name) {
|
|
416
|
+
return this.store
|
|
417
|
+
.select(HypSelectors.url)
|
|
418
|
+
.pipe(mergeMap((url) => {
|
|
419
|
+
return this.httpClient.get(encodeURI(`${url}/equipments/name/${name}`));
|
|
420
|
+
}));
|
|
421
|
+
}
|
|
422
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EquipmentService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
423
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EquipmentService, providedIn: 'root' }); }
|
|
424
|
+
}
|
|
425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EquipmentService, decorators: [{
|
|
426
|
+
type: Injectable,
|
|
427
|
+
args: [{
|
|
428
|
+
providedIn: 'root',
|
|
429
|
+
}]
|
|
430
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
431
|
+
|
|
153
432
|
class StatusDisplayComponent extends SubscriptionnerDirective {
|
|
154
433
|
static { this.idCounter = 0; }
|
|
155
434
|
set item(item) {
|
|
@@ -385,7 +664,7 @@ const ACTIONS_TYPES = {
|
|
|
385
664
|
EMAIL: {
|
|
386
665
|
display: HvyEmailActionDisplayComponent,
|
|
387
666
|
parameter: HvyEmailActionParameterComponent,
|
|
388
|
-
validator: (action) => !!action.name && !!action.email && action.
|
|
667
|
+
validator: (action) => !!action.name && !!action.email && action.email.match(HvyEmailActionParameterComponent.PATTERN)
|
|
389
668
|
}
|
|
390
669
|
}
|
|
391
670
|
};
|
|
@@ -641,7 +920,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
641
920
|
this.changeEquipment(request.index, request.equipmentName);
|
|
642
921
|
}
|
|
643
922
|
}
|
|
644
|
-
constructor(equipmentService, store, overlay, viewContainerRef, snackBar, i18nService) {
|
|
923
|
+
constructor(equipmentService, store, overlay, viewContainerRef, snackBar, i18nService, pryDialog) {
|
|
645
924
|
super();
|
|
646
925
|
this.equipmentService = equipmentService;
|
|
647
926
|
this.store = store;
|
|
@@ -649,6 +928,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
649
928
|
this.viewContainerRef = viewContainerRef;
|
|
650
929
|
this.snackBar = snackBar;
|
|
651
930
|
this.i18nService = i18nService;
|
|
931
|
+
this.pryDialog = pryDialog;
|
|
652
932
|
this.opened = [];
|
|
653
933
|
this.criticalities = HypEventCriticality.values;
|
|
654
934
|
this._events = [];
|
|
@@ -799,7 +1079,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
799
1079
|
if (value.length > 0) {
|
|
800
1080
|
this.equipmentService
|
|
801
1081
|
.findByName(value)
|
|
802
|
-
.pipe(catchError(() => {
|
|
1082
|
+
.pipe(catchError$1(() => {
|
|
803
1083
|
this._changeEquipmentProperty(index, {
|
|
804
1084
|
id: 'not-found',
|
|
805
1085
|
name: value,
|
|
@@ -937,13 +1217,21 @@ class EventDetailComponent extends SubscriptionnerDirective {
|
|
|
937
1217
|
}
|
|
938
1218
|
this._outputModifications();
|
|
939
1219
|
}
|
|
940
|
-
|
|
941
|
-
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]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n 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: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "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: ["mode", "actions"], outputs: ["modified"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
1220
|
+
openAssociationModal() {
|
|
1221
|
+
const ref = this.pryDialog.open(ProcedureAssociationModalComponent, {
|
|
1222
|
+
backdropClass: 'o-hvy-association-modal__backdrop'
|
|
1223
|
+
});
|
|
1224
|
+
if (!!ref && !!ref.component) {
|
|
1225
|
+
ref.component.events = this.events;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventDetailComponent, deps: [{ token: EquipmentService }, { token: i1$1.Store }, { token: i2.Overlay }, { token: i0.ViewContainerRef }, { token: i1$3.PrySnackbarService }, { token: i1$3.PryI18nService }, { token: i1$3.PryDialogService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1229
|
+
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]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n 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\" (click)=\"openAssociationModal()\">\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: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "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: ["mode", "actions"], outputs: ["modified"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }, { kind: "pipe", type: ForDatetimeLocalPipe, name: "forDateTimeLocal" }] }); }
|
|
942
1230
|
}
|
|
943
1231
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
944
1232
|
type: Component,
|
|
945
|
-
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]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n 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" }]
|
|
946
|
-
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i1$3.PrySnackbarService }, { type: i1$3.PryI18nService }], propDecorators: { modifiedEvents: [{
|
|
1233
|
+
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]=\"\n (event.equipment?.entity ? '@hvy.event.entity.' + event.equipment?.entity : '') | i18n\n \"\n readonly\n />\n </td>\n </tr>\n <tr>\n <td>{{ '@hvy.event.domain.name' | i18n }} :</td>\n <td>\n <pry-select\n [items]=\"DOMAINS\"\n [ngModel]=\"event.domain\"\n i18nPrefix=\"@hvy.event.domain.\"\n [class.-error]=\"hasError('domain', idx)\"\n (ngModelChange)=\"modifyEvent(idx, 'domain', $event)\"\n [disabled]=\"accessValue.domain\"\n ></pry-select>\n </td>\n </tr>\n <tr>\n <td>\n {{ '@hvy.event.startDate' | i18n }}\n @if (event.category === 'MANIFESTATION') {\n <span class=\"required\">*</span>\n }\n :\n </td>\n <td>\n <input\n type=\"datetime-local\"\n 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\" (click)=\"openAssociationModal()\">\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" }]
|
|
1234
|
+
}], ctorParameters: () => [{ type: EquipmentService }, { type: i1$1.Store }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i1$3.PrySnackbarService }, { type: i1$3.PryI18nService }, { type: i1$3.PryDialogService }], propDecorators: { modifiedEvents: [{
|
|
947
1235
|
type: Output
|
|
948
1236
|
}], modifiedProcedure: [{
|
|
949
1237
|
type: Output
|
|
@@ -964,90 +1252,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
964
1252
|
type: Input
|
|
965
1253
|
}] } });
|
|
966
1254
|
|
|
967
|
-
const eventFeatureKey = '@hvy/event';
|
|
968
|
-
const eventInitialState = {
|
|
969
|
-
events: [],
|
|
970
|
-
noMoreEvents: false,
|
|
971
|
-
loading: false,
|
|
972
|
-
filters: {},
|
|
973
|
-
selectedIds: [],
|
|
974
|
-
details: {}
|
|
975
|
-
};
|
|
976
|
-
const internalReducer$2 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
|
|
977
|
-
...state,
|
|
978
|
-
loading: true
|
|
979
|
-
})), on(EventActions.loadSuccess, (state, { events, startingFrom }) => {
|
|
980
|
-
return {
|
|
981
|
-
...state,
|
|
982
|
-
loading: false,
|
|
983
|
-
noMoreEvents: events.length < 20,
|
|
984
|
-
events: [...state.events.slice(0, startingFrom), ...events]
|
|
985
|
-
};
|
|
986
|
-
}), on(EventActions.loadFailure, (state, action) => ({
|
|
987
|
-
...state,
|
|
988
|
-
loading: false,
|
|
989
|
-
events: []
|
|
990
|
-
})), on(EventActions.select, (state, { ids, cumulative }) => ({
|
|
991
|
-
...state,
|
|
992
|
-
selectedIds: !cumulative
|
|
993
|
-
? ids
|
|
994
|
-
: [...state.selectedIds, ...ids].reduce((p, c) => (p.indexOf(c) === -1 ? [...p, c] : p.filter((p1) => p1 !== c)), [])
|
|
995
|
-
})), on(EventActions.get, EventActions.getForProcedure, (state, _) => ({
|
|
996
|
-
...state,
|
|
997
|
-
details: {}
|
|
998
|
-
})), on(EventActions.getSuccess, (state, { event, procedure }) => ({
|
|
999
|
-
...state,
|
|
1000
|
-
details: { event, procedure }
|
|
1001
|
-
})), on(EventActions.sort, (state, { field, order }) => ({
|
|
1002
|
-
...state,
|
|
1003
|
-
events: [],
|
|
1004
|
-
noMoreEvents: false,
|
|
1005
|
-
sort: { field, order }
|
|
1006
|
-
})), on(EventActions.filter, (state, { filters, filterSet }) => ({
|
|
1007
|
-
...state,
|
|
1008
|
-
events: [],
|
|
1009
|
-
noMoreEvents: false,
|
|
1010
|
-
filters: { ...state.filters, [filterSet]: filters }
|
|
1011
|
-
})), on(EventActions.getTooltipInfo, (state, _) => ({
|
|
1012
|
-
...state,
|
|
1013
|
-
tooltip: undefined
|
|
1014
|
-
})), on(EventActions.getTooltipInfoSuccess, (state, { event }) => ({
|
|
1015
|
-
...state,
|
|
1016
|
-
tooltip: event
|
|
1017
|
-
})));
|
|
1018
|
-
function eventReducer(state, action) {
|
|
1019
|
-
return internalReducer$2(state, action);
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
const feature$2 = createFeatureSelector(eventFeatureKey);
|
|
1023
|
-
const events = createSelector(feature$2, (state) => state.events);
|
|
1024
|
-
const noMoreEvents = createSelector(feature$2, (state) => state.noMoreEvents);
|
|
1025
|
-
const selectedIds = createSelector(feature$2, (state) => state.selectedIds);
|
|
1026
|
-
const selectedEvents = createSelector(feature$2, (state) => state.events.filter((event) => state.selectedIds.includes(event.id)));
|
|
1027
|
-
const loading$2 = createSelector(feature$2, (state) => state.loading);
|
|
1028
|
-
const filters = createSelector(feature$2, (state) => state.filters);
|
|
1029
|
-
const details = createSelector(feature$2, (state) => state.details);
|
|
1030
|
-
const sort$1 = createSelector(feature$2, (state) => state.sort);
|
|
1031
|
-
const tooltipInfo = createSelector(feature$2, (state) => state.tooltip);
|
|
1032
|
-
const EventSelectors = {
|
|
1033
|
-
feature: feature$2,
|
|
1034
|
-
events,
|
|
1035
|
-
selectedIds,
|
|
1036
|
-
selectedEvents,
|
|
1037
|
-
loading: loading$2,
|
|
1038
|
-
filters,
|
|
1039
|
-
details,
|
|
1040
|
-
noMoreEvents,
|
|
1041
|
-
sort: sort$1,
|
|
1042
|
-
tooltipInfo
|
|
1043
|
-
};
|
|
1044
|
-
|
|
1045
1255
|
const SCROLL_PX_TO_TRIGGER_FETCH_PAGE = { value: 200 };
|
|
1046
1256
|
class InfiniteScrollService {
|
|
1047
1257
|
constructor(store) {
|
|
1048
1258
|
this.store = store;
|
|
1049
1259
|
this.isEndOfPage = (scrollContainer, noMoreSelector) => {
|
|
1050
|
-
return fromEvent((scrollContainer), 'scroll').pipe(map((e) => {
|
|
1260
|
+
return fromEvent((scrollContainer), 'scroll').pipe(map$1((e) => {
|
|
1051
1261
|
const target = e.currentTarget;
|
|
1052
1262
|
return target.scrollHeight - target.offsetHeight - target.scrollTop;
|
|
1053
1263
|
}), withLatestFrom(this.store.select(noMoreSelector)), filter(([remaningScroll, noMore]) => !noMore && remaningScroll < SCROLL_PX_TO_TRIGGER_FETCH_PAGE.value), auditTime(200));
|
|
@@ -1116,7 +1326,7 @@ class EventListComponent extends SubscriptionnerDirective {
|
|
|
1116
1326
|
this.store.dispatch(EventActions.load({}));
|
|
1117
1327
|
this.events$ = this.store.select(EventSelectors.events);
|
|
1118
1328
|
this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
|
|
1119
|
-
this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map
|
|
1329
|
+
this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map(([events, selectedIds]) => events.length > 0 && events.filter((ev) => !selectedIds.includes(ev.id)).length === 0));
|
|
1120
1330
|
}
|
|
1121
1331
|
ngAfterViewInit() {
|
|
1122
1332
|
this.subscriptions.add(this.scroll.isEndOfPage(this.el.nativeElement, EventSelectors.noMoreEvents).subscribe(() => {
|
|
@@ -1193,7 +1403,7 @@ class ImmediateFiltersComponent extends SubscriptionnerDirective {
|
|
|
1193
1403
|
filter.filterSet = this.filterSet;
|
|
1194
1404
|
});
|
|
1195
1405
|
combineLatest(this.filters.map((filter) => filter.changed.pipe(startWith(undefined))))
|
|
1196
|
-
.pipe(debounceTime(this.delay), map(() => this.filters.map((filter) => filter.getParams()).reduce((p, c) => ({ ...p, ...c }), {})), distinctUntilChanged((b, a) => equal(b, a)))
|
|
1406
|
+
.pipe(debounceTime$1(this.delay), map$1(() => this.filters.map((filter) => filter.getParams()).reduce((p, c) => ({ ...p, ...c }), {})), distinctUntilChanged((b, a) => equal(b, a)))
|
|
1197
1407
|
.subscribe((filters) => {
|
|
1198
1408
|
this.store.dispatch(EventActions.filter({ filters, filterSet: this.filterSet }));
|
|
1199
1409
|
});
|
|
@@ -1426,194 +1636,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
1426
1636
|
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" }]
|
|
1427
1637
|
}], ctorParameters: () => [{ type: i1$1.Store }] });
|
|
1428
1638
|
|
|
1429
|
-
const ProcedureActions = {
|
|
1430
|
-
load: createAction('[Procedure] Load Procedures', props()),
|
|
1431
|
-
loadSuccess: createAction('[Procedure] (bus) Load Procedure Success', props()),
|
|
1432
|
-
loadFailure: createAction('[Procedure] Load Procedures Failure', props()),
|
|
1433
|
-
sort: createAction('[Procedure] Set Procedure List Sorting', props()),
|
|
1434
|
-
setCategory: createAction('[Procedure] Set Category Value', props()),
|
|
1435
|
-
model: createAction('[Procedure] Get Procedure Model', props()),
|
|
1436
|
-
modelSuccess: createAction('[Procedure] Get Procedure Model Success', props()),
|
|
1437
|
-
modelFailure: createAction('[Procedure] Get Procedure Model Failure', props()),
|
|
1438
|
-
save: createAction('[Procedure] Save Procedure Model', props()),
|
|
1439
|
-
saveSuccess: createAction('[Procedure] Save Procedure Model Success', props()),
|
|
1440
|
-
saveFailure: createAction('[Procedure] Save Procedure Model Failure', props())
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
const procedureFeatureKey = '@hvy/procedure';
|
|
1444
|
-
const procedureInitialState = {
|
|
1445
|
-
procedures: [],
|
|
1446
|
-
noMoreProcedures: false,
|
|
1447
|
-
loading: false
|
|
1448
|
-
};
|
|
1449
|
-
const internalReducer$1 = createReducer(procedureInitialState, on(ProcedureActions.load, (state) => ({
|
|
1450
|
-
...state,
|
|
1451
|
-
loading: true
|
|
1452
|
-
})), on(ProcedureActions.loadSuccess, (state, { procedures, startingFrom }) => {
|
|
1453
|
-
return {
|
|
1454
|
-
...state,
|
|
1455
|
-
loading: false,
|
|
1456
|
-
noMoreProcedures: procedures.length < 20,
|
|
1457
|
-
procedures: [...state.procedures.slice(0, startingFrom), ...procedures]
|
|
1458
|
-
};
|
|
1459
|
-
}), on(ProcedureActions.loadFailure, (state) => ({
|
|
1460
|
-
...state,
|
|
1461
|
-
loading: false,
|
|
1462
|
-
procedures: [],
|
|
1463
|
-
noMoreProcedures: false
|
|
1464
|
-
})), on(ProcedureActions.sort, (state, { field, order }) => ({
|
|
1465
|
-
...state,
|
|
1466
|
-
procedures: [],
|
|
1467
|
-
noMoreProcedures: false,
|
|
1468
|
-
sort: { field, order }
|
|
1469
|
-
})), on(ProcedureActions.model, (state) => ({
|
|
1470
|
-
...state,
|
|
1471
|
-
model: undefined,
|
|
1472
|
-
loading: true
|
|
1473
|
-
})), on(ProcedureActions.modelSuccess, (state, action) => ({
|
|
1474
|
-
...state,
|
|
1475
|
-
model: action.model,
|
|
1476
|
-
loading: false
|
|
1477
|
-
})), on(ProcedureActions.modelFailure, (state, action) => ({
|
|
1478
|
-
...state,
|
|
1479
|
-
model: undefined,
|
|
1480
|
-
loading: false,
|
|
1481
|
-
error: action.error
|
|
1482
|
-
})), on(ProcedureActions.save, (state) => ({
|
|
1483
|
-
...state,
|
|
1484
|
-
loading: true
|
|
1485
|
-
})), on(ProcedureActions.saveSuccess, (state, action) => ({
|
|
1486
|
-
...state,
|
|
1487
|
-
model: action.model,
|
|
1488
|
-
loading: false
|
|
1489
|
-
})), on(ProcedureActions.saveFailure, (state, action) => ({
|
|
1490
|
-
...state,
|
|
1491
|
-
loading: false,
|
|
1492
|
-
error: action.error
|
|
1493
|
-
})));
|
|
1494
|
-
function procedureReducer(state, action) {
|
|
1495
|
-
return internalReducer$1(state, action);
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
const feature$1 = createFeatureSelector(procedureFeatureKey);
|
|
1499
|
-
const procedures = createSelector(feature$1, (state) => state.procedures);
|
|
1500
|
-
const noMoreProcedures = createSelector(feature$1, (state) => state.noMoreProcedures);
|
|
1501
|
-
const loading$1 = createSelector(feature$1, (state) => state.loading);
|
|
1502
|
-
const sort = createSelector(feature$1, (state) => state.sort);
|
|
1503
|
-
const model = createSelector(feature$1, (state) => state.model);
|
|
1504
|
-
const ProcedureSelectors = {
|
|
1505
|
-
feature: feature$1,
|
|
1506
|
-
procedures,
|
|
1507
|
-
loading: loading$1,
|
|
1508
|
-
noMoreProcedures,
|
|
1509
|
-
sort,
|
|
1510
|
-
model
|
|
1511
|
-
};
|
|
1512
|
-
|
|
1513
|
-
const PROCEDURE_PAGE_SIZE_FETCH = { value: 20 };
|
|
1514
|
-
class ProcedureService {
|
|
1515
|
-
constructor(httpClient, store) {
|
|
1516
|
-
this.httpClient = httpClient;
|
|
1517
|
-
this.store = store;
|
|
1518
|
-
}
|
|
1519
|
-
list(startWith = 0, pageSize = PROCEDURE_PAGE_SIZE_FETCH.value) {
|
|
1520
|
-
return combineLatest([
|
|
1521
|
-
this.store.select(HypSelectors.url),
|
|
1522
|
-
this.store.select(ProcedureSelectors.sort),
|
|
1523
|
-
this.store.select(EventSelectors.filters).pipe(map$1((filters) => filters['procedure'] ?? {}))
|
|
1524
|
-
]).pipe(mergeMap(([url, sort, filters]) => {
|
|
1525
|
-
let params = new HttpParams({ encoder: new FilterParamEncoder() });
|
|
1526
|
-
Object.keys(filters).forEach((filter) => {
|
|
1527
|
-
filters[filter].forEach((filterValue) => {
|
|
1528
|
-
params = params.append(filter, filterValue);
|
|
1529
|
-
});
|
|
1530
|
-
});
|
|
1531
|
-
params = params.set('page', startWith / pageSize + 1);
|
|
1532
|
-
if (sort)
|
|
1533
|
-
params = params.set('sort', sort.field).set('order', sort.order);
|
|
1534
|
-
return this.httpClient.get(encodeURI(`${url}/procedures/model`), { params });
|
|
1535
|
-
}));
|
|
1536
|
-
}
|
|
1537
|
-
getTop10ByUsage(domain, nameSearch) {
|
|
1538
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1539
|
-
let params = new HttpParams();
|
|
1540
|
-
params = params.set('sort', 'useCount').set('order', 'desc').set('pageSize', '10');
|
|
1541
|
-
if (nameSearch)
|
|
1542
|
-
params = params.set('name', nameSearch);
|
|
1543
|
-
if (domain)
|
|
1544
|
-
params = params.set('domain', domain);
|
|
1545
|
-
return this.httpClient.get(encodeURI(`${url}/procedures/model`), { params });
|
|
1546
|
-
}));
|
|
1547
|
-
}
|
|
1548
|
-
get(id) {
|
|
1549
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1550
|
-
return this.httpClient.get(encodeURI(`${url}/procedures/model/id/${id}`));
|
|
1551
|
-
}));
|
|
1552
|
-
}
|
|
1553
|
-
save(model) {
|
|
1554
|
-
return this.store.select(HypSelectors.url).pipe(mergeMap((url) => {
|
|
1555
|
-
if (!model.id) {
|
|
1556
|
-
return this.httpClient.post(encodeURI(`${url}/procedures/model`), model);
|
|
1557
|
-
}
|
|
1558
|
-
return this.httpClient.put(encodeURI(`${url}/procedures/model/id/${model.id}`), model);
|
|
1559
|
-
}));
|
|
1560
|
-
}
|
|
1561
|
-
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 }); }
|
|
1562
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureService, providedIn: 'root' }); }
|
|
1563
|
-
}
|
|
1564
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureService, decorators: [{
|
|
1565
|
-
type: Injectable,
|
|
1566
|
-
args: [{
|
|
1567
|
-
providedIn: 'root'
|
|
1568
|
-
}]
|
|
1569
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Store }] });
|
|
1570
|
-
|
|
1571
|
-
class ProcedureAssociationModalComponent extends SubscriptionnerDirective {
|
|
1572
|
-
constructor(store, procedureService, dialog) {
|
|
1573
|
-
super();
|
|
1574
|
-
this.store = store;
|
|
1575
|
-
this.procedureService = procedureService;
|
|
1576
|
-
this.dialog = dialog;
|
|
1577
|
-
this.onDomainSelect$ = new Subject;
|
|
1578
|
-
this.onProcedureSearch$ = new Subject;
|
|
1579
|
-
this.DOMAINS = DOMAINS.values;
|
|
1580
|
-
this.selectedEvents$ = this.store.select(EventSelectors.selectedEvents);
|
|
1581
|
-
this.procedures$ = combineLatest([
|
|
1582
|
-
this.onDomainSelect$.pipe(startWith()),
|
|
1583
|
-
this.onProcedureSearch$.pipe(startWith(), debounceTime$1(500)),
|
|
1584
|
-
]).pipe(switchMap(([_, __]) => {
|
|
1585
|
-
const search = typeof this.procedureSelectValue === 'string' && this.procedureSelectValue.length > 2 ? this.procedureSelectValue : undefined;
|
|
1586
|
-
return this.procedureService.getTop10ByUsage(this.selectedDomain, search);
|
|
1587
|
-
}), catchError$1(() => {
|
|
1588
|
-
throw new Error('Procedure catalog not implemented yet');
|
|
1589
|
-
}));
|
|
1590
|
-
}
|
|
1591
|
-
onDomainChange() {
|
|
1592
|
-
this.onDomainSelect$.next();
|
|
1593
|
-
this.procedureSelectValue = undefined;
|
|
1594
|
-
}
|
|
1595
|
-
selectedProcedureChange($event) {
|
|
1596
|
-
this.procedureSelectValue = $event;
|
|
1597
|
-
this.onProcedureSearch$.next();
|
|
1598
|
-
}
|
|
1599
|
-
associateProcedure() {
|
|
1600
|
-
this.store.dispatch(EventActions.associateProcedure({ procedureId: this.procedureSelectValue.id }));
|
|
1601
|
-
this.closeModal();
|
|
1602
|
-
}
|
|
1603
|
-
isProcedureSelected() {
|
|
1604
|
-
return typeof this.procedureSelectValue === 'object';
|
|
1605
|
-
}
|
|
1606
|
-
closeModal() {
|
|
1607
|
-
this.dialog.close();
|
|
1608
|
-
}
|
|
1609
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureAssociationModalComponent, deps: [{ token: i1$1.Store }, { token: ProcedureService }, { token: i1$3.PryDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1610
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ProcedureAssociationModalComponent, selector: "hvy-procedure-association-modal", usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-association-modal u-display-flex -column -align-center\">\n <h3>{{ '@hvy.associationModal.title' | i18n }}</h3>\n <span class=\"o-hvy-association-modal__description\">{{ '@hvy.associationModal.description' | i18n }}</span>\n <div class=\"o-hvy-association-modal__content u-display-flex -justify-space-between\">\n @if (selectedEvents$ | async; as selectedEvents) {\n <div>\n <label>\u00C9v\u00E9nements li\u00E9s ({{ selectedEvents.length }}) :</label>\n <ul class=\"o-hvy-association-modal__events\">\n @for (event of selectedEvents; track event.id) {\n <li class=\"o-hvy-association-modal__event u-display-flex -align-center\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <div class=\"o-hvy-association-modal__event-detail u-display-flex -column\">\n <span class=\"o-hvy-association-modal__event-name\">{{ event.name }}</span>\n @if (event.equipment) {\n <span class=\"o-hvy-association-modal__equipment-name\">{{ event.equipment.name }}</span>\n }\n </div>\n </li>\n }\n </ul>\n </div>\n }\n <div class=\"o-hvy-association-modal__form\">\n <div class=\"m-form-label-field\">\n <label>{{ '@hvy.associationModal.categoryFilter' | i18n }}</label>\n <pry-select\n [items]=\"DOMAINS\"\n [(ngModel)]=\"selectedDomain\"\n (ngModelChange)=\"onDomainChange()\"\n [placeholder]=\"'@hvy.associationModal.domainPlaceholder' | i18n\"\n i18nPrefix=\"@hvy.event.domain.\"\n id=\"category-filter\"></pry-select>\n </div>\n <div class=\"m-form-label-field\">\n <label for=\"procedure-filter\">{{ '@hvy.associationModal.searchProcedure' | i18n }}<span class=\"text-error\">*</span> : </label>\n <pry-select\n [items]=\"procedures$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"procedureSelectValue\"\n (ngModelChange)=\"selectedProcedureChange($event)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.associationModal.procedurePlaceholder' | i18n\"\n id=\"procedure-filter\"></pry-select>\n </div>\n </div>\n </div>\n <div class=\"o-hvy-association-modal__buttons u-display-flex -justify-center\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"!isProcedureSelected()\" (click)=\"associateProcedure()\">{{ '@hvy.action.validate' | i18n }}</button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"closeModal()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "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: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
1611
|
-
}
|
|
1612
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureAssociationModalComponent, decorators: [{
|
|
1613
|
-
type: Component,
|
|
1614
|
-
args: [{ selector: 'hvy-procedure-association-modal', template: "<div class=\"o-hvy-association-modal u-display-flex -column -align-center\">\n <h3>{{ '@hvy.associationModal.title' | i18n }}</h3>\n <span class=\"o-hvy-association-modal__description\">{{ '@hvy.associationModal.description' | i18n }}</span>\n <div class=\"o-hvy-association-modal__content u-display-flex -justify-space-between\">\n @if (selectedEvents$ | async; as selectedEvents) {\n <div>\n <label>\u00C9v\u00E9nements li\u00E9s ({{ selectedEvents.length }}) :</label>\n <ul class=\"o-hvy-association-modal__events\">\n @for (event of selectedEvents; track event.id) {\n <li class=\"o-hvy-association-modal__event u-display-flex -align-center\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n <div class=\"o-hvy-association-modal__event-detail u-display-flex -column\">\n <span class=\"o-hvy-association-modal__event-name\">{{ event.name }}</span>\n @if (event.equipment) {\n <span class=\"o-hvy-association-modal__equipment-name\">{{ event.equipment.name }}</span>\n }\n </div>\n </li>\n }\n </ul>\n </div>\n }\n <div class=\"o-hvy-association-modal__form\">\n <div class=\"m-form-label-field\">\n <label>{{ '@hvy.associationModal.categoryFilter' | i18n }}</label>\n <pry-select\n [items]=\"DOMAINS\"\n [(ngModel)]=\"selectedDomain\"\n (ngModelChange)=\"onDomainChange()\"\n [placeholder]=\"'@hvy.associationModal.domainPlaceholder' | i18n\"\n i18nPrefix=\"@hvy.event.domain.\"\n id=\"category-filter\"></pry-select>\n </div>\n <div class=\"m-form-label-field\">\n <label for=\"procedure-filter\">{{ '@hvy.associationModal.searchProcedure' | i18n }}<span class=\"text-error\">*</span> : </label>\n <pry-select\n [items]=\"procedures$ | async\"\n bindLabel=\"name\"\n [(ngModel)]=\"procedureSelectValue\"\n (ngModelChange)=\"selectedProcedureChange($event)\"\n [autocomplete]=\"true\"\n [externalAutocompleteService]=\"true\"\n [placeholder]=\"'@hvy.associationModal.procedurePlaceholder' | i18n\"\n id=\"procedure-filter\"></pry-select>\n </div>\n </div>\n </div>\n <div class=\"o-hvy-association-modal__buttons u-display-flex -justify-center\">\n <button class=\"a-btn a-btn--primary\" [disabled]=\"!isProcedureSelected()\" (click)=\"associateProcedure()\">{{ '@hvy.action.validate' | i18n }}</button>\n <button class=\"a-btn a-btn--secondary\" (click)=\"closeModal()\">{{ '@hvy.action.cancel' | i18n }}</button>\n </div>\n</div>\n" }]
|
|
1615
|
-
}], ctorParameters: () => [{ type: i1$1.Store }, { type: ProcedureService }, { type: i1$3.PryDialogRef }] });
|
|
1616
|
-
|
|
1617
1639
|
const EventSummaryActions = {
|
|
1618
1640
|
load: createAction('[Event] Load Summaries'),
|
|
1619
1641
|
loadSuccess: createAction('[Event Api] Load Summaries Success', props()),
|
|
@@ -1735,10 +1757,7 @@ class EventService {
|
|
|
1735
1757
|
}
|
|
1736
1758
|
associateProcedure(procedureId) {
|
|
1737
1759
|
return this.store.select(HypSelectors.url).pipe(withLatestFrom(this.store.select(EventSelectors.selectedIds)), mergeMap(([url, selectedIds]) => {
|
|
1738
|
-
return this.httpClient.put(encodeURI(`${url}/procedures/model/id/${procedureId}`),
|
|
1739
|
-
id: procedureId,
|
|
1740
|
-
events: selectedIds
|
|
1741
|
-
});
|
|
1760
|
+
return this.httpClient.put(encodeURI(`${url}/procedures/model/id/${procedureId}/associate`), selectedIds);
|
|
1742
1761
|
}));
|
|
1743
1762
|
}
|
|
1744
1763
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventService, deps: [{ token: i1.HttpClient }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -1826,7 +1845,7 @@ class EventSummaryPageComponent extends SubscriptionnerDirective {
|
|
|
1826
1845
|
this.store.dispatch(EventSummaryActions.load());
|
|
1827
1846
|
this.selectedCriticality$ = this.store
|
|
1828
1847
|
.select(EventSelectors.filters)
|
|
1829
|
-
.pipe(map((filters) => (filters[KNOWN_FILTER_SETS.EVENTS] ?? {})['criticality']?.[0] ?? 'ALL'));
|
|
1848
|
+
.pipe(map$1((filters) => (filters[KNOWN_FILTER_SETS.EVENTS] ?? {})['criticality']?.[0] ?? 'ALL'));
|
|
1830
1849
|
this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
|
|
1831
1850
|
this.summaries = summaries;
|
|
1832
1851
|
}));
|
|
@@ -1879,7 +1898,6 @@ class ProcedureListComponent extends SubscriptionnerDirective {
|
|
|
1879
1898
|
this.scroll = scroll;
|
|
1880
1899
|
this.PROCEDURE_LINK = PROCEDURE_LINK;
|
|
1881
1900
|
this.search = '';
|
|
1882
|
-
this.search$ = new Subject();
|
|
1883
1901
|
this.DOMAINS = DOMAINS.values.map((d) => ({ key: d }));
|
|
1884
1902
|
this.padId = padId;
|
|
1885
1903
|
this.store.dispatch(ProcedureActions.load({}));
|
|
@@ -1890,18 +1908,15 @@ class ProcedureListComponent extends SubscriptionnerDirective {
|
|
|
1890
1908
|
this.store.dispatch(ProcedureActions.load({ next: true }));
|
|
1891
1909
|
}));
|
|
1892
1910
|
}
|
|
1893
|
-
emitSearch() {
|
|
1894
|
-
this.search$.next(this.search);
|
|
1895
|
-
}
|
|
1896
1911
|
goTo(procedure) {
|
|
1897
1912
|
return this.router.navigate(this.PROCEDURE_LINK.fn(procedure, this.store));
|
|
1898
1913
|
}
|
|
1899
1914
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureListComponent, deps: [{ token: i1$1.Store }, { token: i2$1.Router }, { token: InfiniteScrollService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1900
|
-
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\">{{
|
|
1915
|
+
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.name }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ '@hvy.event.domain.' + procedure.domain | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell -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$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1$3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: TextFilterComponent, selector: "hvy-text-filter" }, { 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: i1$3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
|
|
1901
1916
|
}
|
|
1902
1917
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureListComponent, decorators: [{
|
|
1903
1918
|
type: Component,
|
|
1904
|
-
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\">{{
|
|
1919
|
+
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.name }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ '@hvy.event.domain.' + procedure.domain | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell -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" }]
|
|
1905
1920
|
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i2$1.Router }, { type: InfiniteScrollService }], propDecorators: { scrollable: [{
|
|
1906
1921
|
type: ViewChild,
|
|
1907
1922
|
args: ['scrollable']
|
|
@@ -1974,11 +1989,11 @@ class ProcedureModelDetailComponent extends SubscriptionnerDirective {
|
|
|
1974
1989
|
this._outputModifications();
|
|
1975
1990
|
}
|
|
1976
1991
|
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 }); }
|
|
1977
|
-
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.name\"\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\n [actions]=\"model.actions\"\n (modified)=\"updateActions($event)\"\n mode=\"model\"\n ></hvy-procedure-actions>\n </div>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.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: ["mode", "actions"], outputs: ["modified"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
1992
|
+
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.name\"\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 }} ({{ model.actions.length }})</h3>\n <hvy-procedure-actions\n [actions]=\"model.actions\"\n (modified)=\"updateActions($event)\"\n mode=\"model\"\n ></hvy-procedure-actions>\n </div>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$3.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: ["mode", "actions"], outputs: ["modified"] }, { kind: "pipe", type: i1$3.I18nPipe, name: "i18n" }] }); }
|
|
1978
1993
|
}
|
|
1979
1994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureModelDetailComponent, decorators: [{
|
|
1980
1995
|
type: Component,
|
|
1981
|
-
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.name\"\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\n [actions]=\"model.actions\"\n (modified)=\"updateActions($event)\"\n mode=\"model\"\n ></hvy-procedure-actions>\n </div>\n }\n </div>\n </div>\n</div>\n" }]
|
|
1996
|
+
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.name\"\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 }} ({{ model.actions.length }})</h3>\n <hvy-procedure-actions\n [actions]=\"model.actions\"\n (modified)=\"updateActions($event)\"\n mode=\"model\"\n ></hvy-procedure-actions>\n </div>\n }\n </div>\n </div>\n</div>\n" }]
|
|
1982
1997
|
}], ctorParameters: () => [{ type: i1$1.Store }], propDecorators: { model: [{
|
|
1983
1998
|
type: Input
|
|
1984
1999
|
}], username: [{
|
|
@@ -2212,7 +2227,7 @@ const frTranslations = {
|
|
|
2212
2227
|
procedure: {
|
|
2213
2228
|
delete: 'Supprimer la procédure',
|
|
2214
2229
|
progress: 'Progression',
|
|
2215
|
-
noAction: "
|
|
2230
|
+
noAction: "Une procédure est une succession d'actions à réaliser selon l'ordre d'intervention",
|
|
2216
2231
|
name: 'Procédure commune',
|
|
2217
2232
|
name1: 'Procédure'
|
|
2218
2233
|
}
|
|
@@ -2354,29 +2369,29 @@ class EventEffects {
|
|
|
2354
2369
|
this.actions$ = actions$;
|
|
2355
2370
|
this.eventService = eventService;
|
|
2356
2371
|
this.store = store;
|
|
2357
|
-
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
|
|
2358
|
-
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
|
|
2359
|
-
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
|
|
2360
|
-
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
|
|
2361
|
-
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
|
|
2362
|
-
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: action.procedure })), catchError
|
|
2363
|
-
this.refreshAfterSave$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveSuccess, EventActions.statusSuccess), debounceTime(200), map((action) => !!action.procedure
|
|
2372
|
+
this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime$1(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$1((events) => EventActions.loadSuccess({ events, startingFrom: action.next ? stateEvents.length : 0 })), catchError((error) => [EventActions.loadFailure({ error: error })])))));
|
|
2373
|
+
this.getEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.get), debounceTime$1(200), mergeMap$1((action) => this.eventService.get(action.id).pipe(map$1((event) => EventActions.getSuccess({ event })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
2374
|
+
this.getEventByName$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getTooltipInfo), debounceTime$1(200), mergeMap$1((action) => this.eventService.getTooltipInfo(action.name).pipe(map$1((event) => EventActions.getTooltipInfoSuccess({ event })), catchError((error) => [EventActions.getTooltipInfoFailure({ error: error })])))));
|
|
2375
|
+
this.getForProcedureEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.getForProcedure), debounceTime$1(200), mergeMap$1((action) => this.eventService.getProcedure(action.id).pipe(map$1((procedure) => EventActions.getSuccess({ procedure })), catchError((error) => [EventActions.getFailure({ error: error })])))));
|
|
2376
|
+
this.saveEvent$ = createEffect(() => this.actions$.pipe(ofType(EventActions.save), debounceTime$1(200), mergeMap$1((action) => this.eventService.save(action.event).pipe(map$1((event) => EventActions.saveSuccess({ event })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
2377
|
+
this.saveProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveProcedure), debounceTime$1(200), mergeMap$1((action) => this.eventService.saveProcedure(action.procedure).pipe(map$1((procedure) => EventActions.saveSuccess({ procedure: action.procedure })), catchError((error) => [EventActions.saveFailure({ error: error })])))));
|
|
2378
|
+
this.refreshAfterSave$ = createEffect(() => this.actions$.pipe(ofType(EventActions.saveSuccess, EventActions.statusSuccess), debounceTime$1(200), map$1((action) => !!action.procedure
|
|
2364
2379
|
? EventActions.getForProcedure({ id: action.procedure.id })
|
|
2365
2380
|
: EventActions.get({ id: action.event.id }))));
|
|
2366
|
-
this.close$ = createEffect(() => this.actions$.pipe(ofType(EventActions.status), debounceTime(200), mergeMap$1((action) => {
|
|
2381
|
+
this.close$ = createEffect(() => this.actions$.pipe(ofType(EventActions.status), debounceTime$1(200), mergeMap$1((action) => {
|
|
2367
2382
|
if (!!action.event) {
|
|
2368
2383
|
return this.eventService.status(action.event, action.targetStatus, action.comment).pipe(mergeMap$1((event) => [
|
|
2369
2384
|
EventActions.statusSuccess({ event: action.event, procedure: action.procedure }),
|
|
2370
2385
|
EventActions.load({})
|
|
2371
|
-
]), catchError
|
|
2386
|
+
]), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
2372
2387
|
}
|
|
2373
2388
|
else {
|
|
2374
|
-
return this.eventService.statusProcedure(action.procedure, action.targetStatus, action.comment).pipe(mergeMap$1((event) => [EventActions.statusSuccess({ procedure: action.procedure }), EventActions.load({})]), catchError
|
|
2389
|
+
return this.eventService.statusProcedure(action.procedure, action.targetStatus, action.comment).pipe(mergeMap$1((event) => [EventActions.statusSuccess({ procedure: action.procedure }), EventActions.load({})]), catchError((error) => [EventActions.statusFailure({ error: error })]));
|
|
2375
2390
|
}
|
|
2376
2391
|
})));
|
|
2377
|
-
this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort), debounceTime(200), map(() => EventActions.load({}))));
|
|
2378
|
-
this.filter$ = createEffect(() => this.actions$.pipe(ofType(EventActions.filter), filter((action) => action.filterSet === KNOWN_FILTER_SETS.EVENTS), debounceTime(200), map(() => EventActions.load({}))));
|
|
2379
|
-
this.associateProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.associateProcedure), mergeMap$1((action) => this.eventService.associateProcedure(action.procedureId).pipe(map(() => EventActions.load({})), catchError
|
|
2392
|
+
this.sort$ = createEffect(() => this.actions$.pipe(ofType(EventActions.sort), debounceTime$1(200), map$1(() => EventActions.load({}))));
|
|
2393
|
+
this.filter$ = createEffect(() => this.actions$.pipe(ofType(EventActions.filter), filter((action) => action.filterSet === KNOWN_FILTER_SETS.EVENTS), debounceTime$1(200), map$1(() => EventActions.load({}))));
|
|
2394
|
+
this.associateProcedure$ = createEffect(() => this.actions$.pipe(ofType(EventActions.associateProcedure), mergeMap$1((action) => this.eventService.associateProcedure(action.procedureId).pipe(map$1(() => EventActions.load({})), catchError((error) => [EventActions.associateProcedureFailure({ error: error })])))));
|
|
2380
2395
|
}
|
|
2381
2396
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventEffects, deps: [{ token: i1$5.Actions }, { token: EventService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2382
2397
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventEffects }); }
|
|
@@ -2443,7 +2458,7 @@ class EventSummaryEffects {
|
|
|
2443
2458
|
constructor(actions$, eventSummaryService) {
|
|
2444
2459
|
this.actions$ = actions$;
|
|
2445
2460
|
this.eventSummaryService = eventSummaryService;
|
|
2446
|
-
this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime(200), mergeMap$1((action) => this.eventSummaryService.list().pipe(map((summaries) => EventSummaryActions.loadSuccess({ summaries })), catchError
|
|
2461
|
+
this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime$1(200), mergeMap$1((action) => this.eventSummaryService.list().pipe(map$1((summaries) => EventSummaryActions.loadSuccess({ summaries })), catchError((error) => [EventSummaryActions.loadFailure({ error: error })])))));
|
|
2447
2462
|
}
|
|
2448
2463
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventSummaryEffects, deps: [{ token: i1$5.Actions }, { token: EventSummaryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2449
2464
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EventSummaryEffects }); }
|
|
@@ -2457,10 +2472,10 @@ class ProcedureEffects {
|
|
|
2457
2472
|
this.actions$ = actions$;
|
|
2458
2473
|
this.procedureService = procedureService;
|
|
2459
2474
|
this.store = store;
|
|
2460
|
-
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
|
|
2461
|
-
this.sort$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.sort), debounceTime(200), map(() => ProcedureActions.load({}))));
|
|
2462
|
-
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
|
|
2463
|
-
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
|
|
2475
|
+
this.loadProcedures$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.load), debounceTime$1(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$1((procedures) => ProcedureActions.loadSuccess({ procedures, startingFrom: action.next ? stateProcedures.length : 0 })), catchError((error) => [ProcedureActions.loadFailure({ error: error })])))));
|
|
2476
|
+
this.sort$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.sort), debounceTime$1(200), map$1(() => ProcedureActions.load({}))));
|
|
2477
|
+
this.model$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.model), debounceTime$1(200), mergeMap$1((action) => this.procedureService.get(action.id).pipe(map$1((model) => ProcedureActions.modelSuccess({ model })), catchError((error) => [ProcedureActions.modelFailure({ error: error })])))));
|
|
2478
|
+
this.save$ = createEffect(() => this.actions$.pipe(ofType(ProcedureActions.save), debounceTime$1(200), mergeMap$1((action) => this.procedureService.save(action.model).pipe(map$1((model) => ProcedureActions.saveSuccess({ model })), catchError((error) => [ProcedureActions.saveFailure({ error: error })])))));
|
|
2464
2479
|
}
|
|
2465
2480
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureEffects, deps: [{ token: i1$5.Actions }, { token: ProcedureService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2466
2481
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ProcedureEffects }); }
|