@provoly/hypervisor 0.0.5 → 0.0.7
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/public-api.mjs +2 -1
- package/esm2022/src/lib/event/detail/event-detail.component.mjs +5 -5
- package/esm2022/src/lib/event/list/event-list.component.mjs +15 -5
- package/esm2022/src/lib/event/public-api.mjs +1 -2
- package/esm2022/src/lib/event-summary/item/event-summary-item.component.mjs +6 -8
- package/esm2022/src/lib/event-summary/list/event-summary-list.component.mjs +4 -5
- package/esm2022/src/lib/event-summary/page/event-summary-page.component.mjs +48 -0
- package/esm2022/src/lib/event-summary/public-api.mjs +2 -1
- package/esm2022/src/lib/general/i18n/en.translations.mjs +12 -4
- package/esm2022/src/lib/general/i18n/fr.translations.mjs +12 -4
- package/esm2022/src/lib/general/icon-display/icon-display.component.mjs +16 -0
- package/esm2022/src/lib/general/icon-pipe/event-icon.pipe.mjs +25 -0
- package/esm2022/src/lib/general/public-api.mjs +3 -1
- package/esm2022/src/lib/hypervisor.module.mjs +67 -16
- package/esm2022/src/lib/model/hyp-event-category.type.mjs +2 -0
- package/esm2022/src/lib/model/hyp-event-criticality.type.mjs +7 -0
- package/esm2022/src/lib/model/hyp-event-detail.interface.mjs +2 -0
- package/esm2022/src/lib/model/hyp-event-status.type.mjs +2 -0
- package/esm2022/src/lib/model/hyp-event-summary.interface.mjs +2 -0
- package/esm2022/src/lib/model/hyp-event-type.mjs +7 -0
- package/esm2022/src/lib/model/hyp-event.interface.mjs +2 -13
- package/esm2022/src/lib/model/hyp-procedure.interface.mjs +2 -0
- package/esm2022/src/lib/model/public-api.mjs +8 -2
- package/esm2022/src/lib/store/event/event.actions.mjs +2 -4
- package/esm2022/src/lib/store/event/event.effects.mjs +1 -2
- package/esm2022/src/lib/store/event/event.reducer.mjs +6 -13
- package/esm2022/src/lib/store/event/event.selectors.mjs +3 -3
- package/esm2022/src/lib/store/event/event.service.mjs +2 -16
- package/esm2022/src/lib/store/event-summary/event-summary.actions.mjs +7 -0
- package/esm2022/src/lib/store/event-summary/event-summary.const.mjs +6 -0
- package/esm2022/src/lib/store/event-summary/event-summary.effects.mjs +20 -0
- package/esm2022/src/lib/store/event-summary/event-summary.reducer.mjs +23 -0
- package/esm2022/src/lib/store/event-summary/event-summary.selectors.mjs +11 -0
- package/esm2022/src/lib/store/event-summary/event-summary.service.mjs +36 -0
- package/esm2022/src/lib/store/event-summary/public-api.mjs +5 -0
- package/esm2022/src/lib/store/hypervisor/hypervisor.reducer.mjs +3 -3
- package/fesm2022/provoly-hypervisor.mjs +285 -112
- package/fesm2022/provoly-hypervisor.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/lib/event/detail/event-detail.component.d.ts +3 -3
- package/src/lib/event/list/event-list.component.d.ts +3 -1
- package/src/lib/event/public-api.d.ts +0 -1
- package/src/lib/event-summary/item/event-summary-item.component.d.ts +2 -2
- package/src/lib/event-summary/list/event-summary-list.component.d.ts +2 -2
- package/src/lib/event-summary/page/event-summary-page.component.d.ts +17 -0
- package/src/lib/event-summary/public-api.d.ts +1 -0
- package/src/lib/general/i18n/en.translations.d.ts +10 -2
- package/src/lib/general/i18n/fr.translations.d.ts +10 -2
- package/src/lib/general/icon-display/icon-display.component.d.ts +7 -0
- package/src/lib/{event → general}/icon-pipe/event-icon.pipe.d.ts +3 -2
- package/src/lib/general/public-api.d.ts +2 -0
- package/src/lib/hypervisor.module.d.ts +14 -6
- package/src/lib/model/hyp-event-category.type.d.ts +2 -0
- package/src/lib/model/hyp-event-criticality.type.d.ts +5 -0
- package/src/lib/model/hyp-event-detail.interface.d.ts +14 -0
- package/src/lib/model/hyp-event-status.type.d.ts +1 -0
- package/src/lib/model/hyp-event-summary.interface.d.ts +19 -0
- package/src/lib/model/hyp-event-type.d.ts +5 -0
- package/src/lib/model/hyp-event.interface.d.ts +2 -40
- package/src/lib/model/{hyp-process.interface.d.ts → hyp-procedure.interface.d.ts} +1 -1
- package/src/lib/model/public-api.d.ts +7 -1
- package/src/lib/store/event/event.actions.d.ts +7 -11
- package/src/lib/store/event/event.effects.d.ts +0 -5
- package/src/lib/store/event/event.reducer.d.ts +2 -2
- package/src/lib/store/event/event.selectors.d.ts +1 -1
- package/src/lib/store/event/event.service.d.ts +1 -2
- package/src/lib/store/event-summary/event-summary.actions.d.ts +14 -0
- package/src/lib/store/event-summary/event-summary.const.d.ts +14 -0
- package/src/lib/store/event-summary/event-summary.effects.d.ts +15 -0
- package/src/lib/store/event-summary/event-summary.reducer.d.ts +9 -0
- package/src/lib/store/event-summary/event-summary.selectors.d.ts +6 -0
- package/src/lib/store/event-summary/event-summary.service.d.ts +13 -0
- package/src/lib/store/event-summary/public-api.d.ts +4 -0
- package/src/lib/store/hypervisor/hypervisor.reducer.d.ts +1 -1
- package/styles/components/_index.scss +9 -0
- package/styles/components/_m-hvy-event-summary-item.scss +105 -6
- package/styles/components/_o-hvy-event-summary-list.scss +45 -3
- package/styles/components/_o-hvy-event-summary-page.scss +48 -0
- package/styles/components/_o-hvy-events-table.scss +1 -1
- package/styles/main.scss +1 -4
- package/esm2022/src/lib/event/icon-pipe/event-icon.pipe.mjs +0 -26
- package/esm2022/src/lib/model/hyp-process.interface.mjs +0 -2
|
@@ -1,76 +1,59 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Input, Pipe, InjectionToken, Injectable, NgModule, Inject } from '@angular/core';
|
|
3
|
-
import { of, withLatestFrom, mergeMap } from 'rxjs';
|
|
4
|
-
import * as i3 from '@provoly/dashboard';
|
|
5
|
-
import { DEFAULT_ICON_URL, PryCoreModule, PryIconModule, PryI18nModule } from '@provoly/dashboard';
|
|
6
3
|
import * as i1 from '@ngrx/store';
|
|
7
4
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import * as
|
|
5
|
+
import * as i1$1 from '@angular/common';
|
|
6
|
+
import { NgForOf, AsyncPipe, NgStyle, DatePipe, KeyValuePipe } from '@angular/common';
|
|
7
|
+
import * as i3$1 from '@provoly/dashboard/components/checkbox';
|
|
8
|
+
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
9
|
+
import * as i4 from '@angular/forms';
|
|
10
|
+
import { FormsModule } from '@angular/forms';
|
|
11
|
+
import * as i2 from '@angular/router';
|
|
11
12
|
import { RouterLink } from '@angular/router';
|
|
12
|
-
import * as
|
|
13
|
+
import * as i3 from '@provoly/dashboard';
|
|
14
|
+
import { DEFAULT_ICON_URL, SubscriptionnerDirective, PryI18nModule, PryCoreModule, PryIconModule, PrySelectModule } from '@provoly/dashboard';
|
|
15
|
+
import { of, withLatestFrom, mergeMap } from 'rxjs';
|
|
16
|
+
import * as i8 from '@provoly/dashboard/components/sinceDate';
|
|
17
|
+
import { PrySinceDateModule } from '@provoly/dashboard/components/sinceDate';
|
|
18
|
+
import { map, debounceTime, mergeMap as mergeMap$1, catchError } from 'rxjs/operators';
|
|
19
|
+
import * as i1$3 from '@ngrx/effects';
|
|
13
20
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
14
|
-
import
|
|
15
|
-
import * as i1$1 from '@angular/common/http';
|
|
21
|
+
import * as i1$2 from '@angular/common/http';
|
|
16
22
|
import { HttpParams } from '@angular/common/http';
|
|
17
23
|
|
|
18
24
|
class EventDetailComponent {
|
|
19
25
|
constructor() {
|
|
20
26
|
this.events = [];
|
|
21
|
-
this.
|
|
27
|
+
this.procedure = undefined;
|
|
22
28
|
}
|
|
23
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events",
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventDetailComponent, selector: "hvy-event-detail", inputs: { events: "events", procedure: "procedure" }, ngImport: i0, template: "<h1> TODO </h1>\n<p>Events: {{ events.length }}</p>\n<p>Procedure: {{ procedure }}</p>\n" }); }
|
|
25
31
|
}
|
|
26
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventDetailComponent, decorators: [{
|
|
27
33
|
type: Component,
|
|
28
|
-
args: [{ selector: 'hvy-event-detail', template: "<h1> TODO </h1>\n<p>Events: {{ events.length }}</p>\n<p>
|
|
34
|
+
args: [{ selector: 'hvy-event-detail', template: "<h1> TODO </h1>\n<p>Events: {{ events.length }}</p>\n<p>Procedure: {{ procedure }}</p>\n" }]
|
|
29
35
|
}], propDecorators: { events: [{
|
|
30
36
|
type: Input
|
|
31
|
-
}],
|
|
37
|
+
}], procedure: [{
|
|
32
38
|
type: Input
|
|
33
39
|
}] } });
|
|
34
40
|
|
|
35
|
-
const EVENT_TO_ICON = {
|
|
36
|
-
fn: (event, store) => of(DEFAULT_ICON_URL),
|
|
37
|
-
};
|
|
38
|
-
class EventIconPipe {
|
|
39
|
-
constructor(store) {
|
|
40
|
-
this.store = store;
|
|
41
|
-
}
|
|
42
|
-
transform(value, ...args) {
|
|
43
|
-
return EVENT_TO_ICON.fn(value, this.store);
|
|
44
|
-
}
|
|
45
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
46
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, isStandalone: true, name: "eventIcon" }); }
|
|
47
|
-
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, decorators: [{
|
|
49
|
-
type: Pipe,
|
|
50
|
-
args: [{
|
|
51
|
-
name: 'eventIcon',
|
|
52
|
-
standalone: true
|
|
53
|
-
}]
|
|
54
|
-
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
55
|
-
|
|
56
41
|
const EventActions = {
|
|
57
42
|
load: createAction('[Event] Load Events'),
|
|
58
43
|
loadSuccess: createAction('[Event Api] (bus) Load Events Success', props()),
|
|
59
44
|
loadFailure: createAction('[Event Api] Load Events Failure', props()),
|
|
60
45
|
filter: createAction('[Event Api] Set filters', props()),
|
|
61
|
-
|
|
62
|
-
loadSummariesSuccess: createAction('[Event Api] Load Summaries Success', props()),
|
|
63
|
-
loadSummariesFailure: createAction('[Event Api] Load Summaries Failure', props())
|
|
46
|
+
select: createAction('[Event Api] Select', props()),
|
|
64
47
|
};
|
|
65
48
|
|
|
66
49
|
const eventFeatureKey = '@hvy/event';
|
|
67
|
-
const eventInitialState
|
|
50
|
+
const eventInitialState = {
|
|
68
51
|
events: [],
|
|
69
|
-
summaries: { NEW: { events: [], count: 0 }, IN_PROGRESS: { events: [], count: 0 }, DONE: { events: [], count: 0 } },
|
|
70
52
|
loading: false,
|
|
71
|
-
filters: {}
|
|
53
|
+
filters: {},
|
|
54
|
+
selectedIds: []
|
|
72
55
|
};
|
|
73
|
-
const internalReducer$
|
|
56
|
+
const internalReducer$2 = createReducer(eventInitialState, on(EventActions.load, (state, action) => ({
|
|
74
57
|
...state,
|
|
75
58
|
loading: true
|
|
76
59
|
})), on(EventActions.loadSuccess, (state, { events }) => ({
|
|
@@ -81,51 +64,122 @@ const internalReducer$1 = createReducer(eventInitialState$1, on(EventActions.loa
|
|
|
81
64
|
...state,
|
|
82
65
|
loading: false,
|
|
83
66
|
events: []
|
|
84
|
-
})), on(EventActions.loadSummaries, (state, action) => ({
|
|
85
|
-
...state,
|
|
86
|
-
loading: true
|
|
87
|
-
})), on(EventActions.loadSummariesSuccess, (state, { summaries }) => ({
|
|
88
|
-
...state,
|
|
89
|
-
loading: false,
|
|
90
|
-
summaries
|
|
91
|
-
})), on(EventActions.loadSummariesFailure, (state, action) => ({
|
|
92
|
-
...state,
|
|
93
|
-
loading: false
|
|
94
67
|
})), on(EventActions.filter, (state, { filters }) => ({
|
|
95
68
|
...state,
|
|
96
69
|
filters
|
|
70
|
+
})), on(EventActions.select, (state, { ids, cumulative }) => ({
|
|
71
|
+
...state,
|
|
72
|
+
selectedIds: !cumulative ? ids : [...state.selectedIds, ...ids].reduce((p, c) => p.indexOf(c) === -1 ? [...p, c] : p.filter(p1 => p1 !== c), [])
|
|
97
73
|
})));
|
|
98
74
|
function eventReducer(state, action) {
|
|
99
|
-
return internalReducer$
|
|
75
|
+
return internalReducer$2(state, action);
|
|
100
76
|
}
|
|
101
77
|
|
|
102
|
-
const feature$
|
|
103
|
-
const events = createSelector(feature$
|
|
104
|
-
const
|
|
105
|
-
const loading = createSelector(feature$
|
|
106
|
-
const filters = createSelector(feature$
|
|
78
|
+
const feature$2 = createFeatureSelector(eventFeatureKey);
|
|
79
|
+
const events = createSelector(feature$2, (state) => state.events);
|
|
80
|
+
const selectedIds = createSelector(feature$2, (state) => state.selectedIds);
|
|
81
|
+
const loading$1 = createSelector(feature$2, (state) => state.loading);
|
|
82
|
+
const filters = createSelector(feature$2, (state) => state.filters);
|
|
107
83
|
const EventSelectors = {
|
|
108
|
-
feature: feature$
|
|
84
|
+
feature: feature$2,
|
|
109
85
|
events,
|
|
110
|
-
|
|
111
|
-
loading,
|
|
86
|
+
selectedIds,
|
|
87
|
+
loading: loading$1,
|
|
112
88
|
filters
|
|
113
89
|
};
|
|
114
90
|
|
|
91
|
+
const EVENT_TO_ICON = {
|
|
92
|
+
fn: (event, store) => of(DEFAULT_ICON_URL),
|
|
93
|
+
};
|
|
94
|
+
class EventIconPipe {
|
|
95
|
+
constructor(store) {
|
|
96
|
+
this.store = store;
|
|
97
|
+
}
|
|
98
|
+
transform(value, ...args) {
|
|
99
|
+
return EVENT_TO_ICON.fn(value, this.store);
|
|
100
|
+
}
|
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
102
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, name: "eventIcon" }); }
|
|
103
|
+
}
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventIconPipe, decorators: [{
|
|
105
|
+
type: Pipe,
|
|
106
|
+
args: [{
|
|
107
|
+
name: 'eventIcon'
|
|
108
|
+
}]
|
|
109
|
+
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
110
|
+
|
|
111
|
+
class IconDisplayComponent {
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: { event: "event" }, ngImport: i0, template: "<div class=\"\n m-hvy-event-summary-item__event-icon-container\n -hvy-{{ event.criticality.toString().toLowerCase()}}\n -hvy-{{event.type.toString().toLowerCase()}}\n \">\n <span\n class=\"m-hvy-event-summary-item__event-icon a-icon\"\n [ngStyle]=\"{\n 'mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')',\n '-webkit-mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')'\n }\"\n aria-hidden=\"true\"\n focusable=\"false\"\n ></span>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.GetSecuredImagePipe, name: "getSecuredImage" }, { kind: "pipe", type: EventIconPipe, name: "eventIcon" }] }); }
|
|
114
|
+
}
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: IconDisplayComponent, decorators: [{
|
|
116
|
+
type: Component,
|
|
117
|
+
args: [{ selector: 'hvy-icon-display', template: "<div class=\"\n m-hvy-event-summary-item__event-icon-container\n -hvy-{{ event.criticality.toString().toLowerCase()}}\n -hvy-{{event.type.toString().toLowerCase()}}\n \">\n <span\n class=\"m-hvy-event-summary-item__event-icon a-icon\"\n [ngStyle]=\"{\n 'mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')',\n '-webkit-mask-image': 'url(' + (event | eventIcon | async | getSecuredImage | async) + ')'\n }\"\n aria-hidden=\"true\"\n focusable=\"false\"\n ></span>\n</div>\n" }]
|
|
118
|
+
}], propDecorators: { event: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}] } });
|
|
121
|
+
|
|
115
122
|
class EventListComponent {
|
|
116
123
|
constructor(store) {
|
|
117
124
|
this.store = store;
|
|
118
125
|
this.store.dispatch(EventActions.load());
|
|
119
126
|
this.events$ = this.store.select(EventSelectors.events);
|
|
127
|
+
this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
|
|
128
|
+
}
|
|
129
|
+
select(event, $event) {
|
|
130
|
+
this.store.dispatch(EventActions.select({ ids: [event.id], cumulative: true }));
|
|
131
|
+
$event.preventDefault();
|
|
132
|
+
$event.stopPropagation();
|
|
120
133
|
}
|
|
121
134
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
122
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventListComponent, selector: "hvy-event-list", ngImport: i0, template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th></th>\n <th>{{ '@hvy.event.criticality' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.type.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>{{ '@hvy.event.date' | i18n }}</th>\n <th>{{ '@hvy.event.dateM' | i18n }}</th>\n <th>{{ '@hvy.event.status' | i18n }}</th>\n <th>{{ '@hvy.
|
|
135
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventListComponent, selector: "hvy-event-list", ngImport: i0, template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th></th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.type.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>{{ '@hvy.event.date' | i18n }}</th>\n <th>{{ '@hvy.event.dateM' | i18n }}</th>\n <th>{{ '@hvy.event.status.name' | i18n }}</th>\n <th>{{ '@hvy.procedure.name' | i18n }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"o-hvy-events-table__line\" *ngFor=\"let event of events$|async\">\n <td class=\"o-hvy-events-table__line__cell\" (click)=\"select(event, $event)\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__name__main\">{{ event.name }}</div>\n <div>{{ event.equipmentReference ? event.equipmentReference : '' }}</div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.type.' + event.type | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.status.' + event.status | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.procedureProgress }} %</td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"[event.id]\"><th>{{ '@hvy.action.consult' | i18n }}</th></a>\n </td>\n </tr>\n </tbody>\n</table>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3$1.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i8.PrySinceDatePipe, name: "sinceDate" }] }); }
|
|
123
136
|
}
|
|
124
137
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventListComponent, decorators: [{
|
|
125
138
|
type: Component,
|
|
126
|
-
args: [{ selector: 'hvy-event-list', template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th></th>\n <th>{{ '@hvy.event.criticality' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.type.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>{{ '@hvy.event.date' | i18n }}</th>\n <th>{{ '@hvy.event.dateM' | i18n }}</th>\n <th>{{ '@hvy.event.status' | i18n }}</th>\n <th>{{ '@hvy.
|
|
139
|
+
args: [{ selector: 'hvy-event-list', template: "<table class=\"o-hvy-events-table\">\n <thead>\n <tr class=\"o-hvy-events-table__header\">\n <th></th>\n <th>{{ '@hvy.event.criticality.name' | i18n }}</th>\n <th>{{ '@hvy.event.name' | i18n }}</th>\n <th>{{ '@hvy.event.type.name' | i18n }}</th>\n <th>{{ '@hvy.event.address' | i18n }}</th>\n <th>{{ '@hvy.event.date' | i18n }}</th>\n <th>{{ '@hvy.event.dateM' | i18n }}</th>\n <th>{{ '@hvy.event.status.name' | i18n }}</th>\n <th>{{ '@hvy.procedure.name' | i18n }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"o-hvy-events-table__line\" *ngFor=\"let event of events$|async\">\n <td class=\"o-hvy-events-table__line__cell\" (click)=\"select(event, $event)\">\n <pry-checkbox [ngModel]=\"(selectedIds$|async)!.includes(event.id)\"></pry-checkbox>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </td>\n <td class=\"o-hvy-events-table__line__cell\">\n <div class=\"o-hvy-events-table__line__name__main\">{{ event.name }}</div>\n <div>{{ event.equipmentReference ? event.equipmentReference : '' }}</div>\n </td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.type.' + event.type | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.address }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.creationDate| sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.lastModificationDate | sinceDate: { onlyLocale: true } }}</td>\n <td class=\"o-hvy-events-table__line__cell -centered\">{{ '@hvy.event.status.' + event.status | i18n }}</td>\n <td class=\"o-hvy-events-table__line__cell\">{{ event.procedureProgress }} %</td>\n <td class=\"o-hvy-events-table__line__cell\">\n <a [routerLink]=\"[event.id]\"><th>{{ '@hvy.action.consult' | i18n }}</th></a>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
|
|
127
140
|
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
128
141
|
|
|
142
|
+
const EventSummaryActions = {
|
|
143
|
+
load: createAction('[Event] Load Summaries'),
|
|
144
|
+
loadSuccess: createAction('[Event Api] Load Summaries Success', props()),
|
|
145
|
+
loadFailure: createAction('[Event Api] Load Summaries Failure', props())
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const emptySummaries = {
|
|
149
|
+
NEW: { events: [], count: 0 },
|
|
150
|
+
IN_PROGRESS: { events: [], count: 0 },
|
|
151
|
+
DONE: { events: [], count: 0 }
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const eventSummaryFeatureKey = '@hvy/event-summary';
|
|
155
|
+
const eventSummaryInitialState = {
|
|
156
|
+
summaries: { ...emptySummaries },
|
|
157
|
+
loading: false,
|
|
158
|
+
};
|
|
159
|
+
const internalReducer$1 = createReducer(eventSummaryInitialState, on(EventSummaryActions.load, (state, action) => ({
|
|
160
|
+
...state,
|
|
161
|
+
loading: true
|
|
162
|
+
})), on(EventSummaryActions.loadSuccess, (state, { summaries }) => ({
|
|
163
|
+
...state,
|
|
164
|
+
loading: false,
|
|
165
|
+
summaries
|
|
166
|
+
})), on(EventSummaryActions.loadFailure, (state, action) => ({
|
|
167
|
+
...state,
|
|
168
|
+
loading: false
|
|
169
|
+
})));
|
|
170
|
+
function eventSummaryReducer(state, action) {
|
|
171
|
+
return internalReducer$1(state, action);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const feature$1 = createFeatureSelector(eventSummaryFeatureKey);
|
|
175
|
+
const summaries = createSelector(feature$1, (state) => state.summaries);
|
|
176
|
+
const loading = createSelector(feature$1, (state) => state.loading);
|
|
177
|
+
const EventSummarySelectors = {
|
|
178
|
+
feature: feature$1,
|
|
179
|
+
summaries,
|
|
180
|
+
loading
|
|
181
|
+
};
|
|
182
|
+
|
|
129
183
|
class EventSummaryItemComponent {
|
|
130
184
|
constructor() {
|
|
131
185
|
this.linkBase = [];
|
|
@@ -135,11 +189,11 @@ class EventSummaryItemComponent {
|
|
|
135
189
|
this.linkFragments = this.linkFragments.length > 0 ? [...this.linkBase, this.event.id] : ['list', this.event.id];
|
|
136
190
|
}
|
|
137
191
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
138
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent,
|
|
192
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: { event: "event", linkBase: "linkBase" }, ngImport: i0, template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"linkFragments\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.interventionRequestTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.interventionRequestCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconDisplayComponent, selector: "hvy-icon-display", inputs: ["event"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] }); }
|
|
139
193
|
}
|
|
140
194
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryItemComponent, decorators: [{
|
|
141
195
|
type: Component,
|
|
142
|
-
args: [{
|
|
196
|
+
args: [{ selector: 'hvy-event-summary-item', template: "<div class=\"m-hvy-event-summary-item\" [routerLink]=\"linkFragments\">\n <div class=\"m-hvy-event-summary-item__title\">\n <h4>\n {{ event.name }}\n </h4>\n </div>\n <div class=\"m-hvy-event-summary-item__content\">\n <span>\n {{\n event.manifestation ?\n (event.manifestation.startDate | date : 'dd/MM HH:MM') + ' - ' + (event.manifestation.endDate | date : 'dd/MM HH:MM') :\n event.interventionRequestTitle\n }}\n </span>\n </div>\n <div class=\"m-hvy-event-summary-item__footer\">\n <div class=\"m-hvy-event-summary-item__icons\">\n <span class=\"m-hvy-event-summary-item__intervention-counter\">{{ event.interventionRequestCount }}</span>\n <hvy-icon-display [event]=\"event\"></hvy-icon-display>\n </div>\n <div class=\"m-hvy-event-summary-item__date\">\n <span>\n {{ event.lastModificationDate | date : 'd MMMM . HH:MM' }}\n </span>\n </div>\n </div>\n</div>\n" }]
|
|
143
197
|
}], propDecorators: { event: [{
|
|
144
198
|
type: Input,
|
|
145
199
|
args: [{ required: true }]
|
|
@@ -165,13 +219,13 @@ class EventSummaryListComponent {
|
|
|
165
219
|
this.router.navigate([...this.consultLink]);
|
|
166
220
|
this.store.dispatch(EventActions.filter({ filters: { status: [status] } }));
|
|
167
221
|
}
|
|
168
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1.Store }, { token: i2
|
|
169
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryListComponent,
|
|
222
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, deps: [{ token: i1.Store }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
223
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: { events: "events", totalEventCount: "totalEventCount", status: "status", consultLink: "consultLink", itemLinkBase: "itemLinkBase" }, ngImport: i0, template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n Consulter\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: EventSummaryItemComponent, selector: "hvy-event-summary-item", inputs: ["event", "linkBase"] }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
170
224
|
}
|
|
171
225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryListComponent, decorators: [{
|
|
172
226
|
type: Component,
|
|
173
|
-
args: [{
|
|
174
|
-
}], ctorParameters: () => [{ type: i1.Store }, { type: i2
|
|
227
|
+
args: [{ selector: 'hvy-event-summary-list', template: "<div class=\"o-hvy-event-summary-list -hvy-{{status.toLowerCase()}}\">\n <div class=\"o-hvy-event-summary-list__header\">\n <h3 class=\"o-hvy-event-summary-list__title\">\n {{ '@hvy.eventSummary.statusLabels.' + status | i18n }}\n </h3>\n <span class=\"o-hvy-event-summary-list__counter\">\n {{ totalEventCount }}\n </span>\n </div>\n <div class=\"o-hvy-event-summary-list__content\">\n @for (event of events; track event.id) {\n <hvy-event-summary-item\n [event]=\"event\"\n [linkBase]=\"itemLinkBase\">\n </hvy-event-summary-item>\n } @empty {\n <span class=\"o-hvy-event-summary-list__no-content\">\n {{ '@hvy.eventSummary.noContent' | i18n }}\n </span>\n }\n </div>\n <div class=\"o-hvy-event-summary-list__footer\">\n <button class=\"o-hvy-event-summary-list__footer-button\" (click)=\"filterAndRoute(status)\">\n Consulter\n <pry-icon iconSvg=\"arrow\"></pry-icon>\n </button>\n </div>\n</div>\n" }]
|
|
228
|
+
}], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }], propDecorators: { events: [{
|
|
175
229
|
type: Input
|
|
176
230
|
}], totalEventCount: [{
|
|
177
231
|
type: Input
|
|
@@ -183,6 +237,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
183
237
|
type: Input
|
|
184
238
|
}] } });
|
|
185
239
|
|
|
240
|
+
class EventSummaryPageComponent extends SubscriptionnerDirective {
|
|
241
|
+
constructor(store) {
|
|
242
|
+
super();
|
|
243
|
+
this.store = store;
|
|
244
|
+
this.pageTitle = '';
|
|
245
|
+
this.summaries = {
|
|
246
|
+
NEW: { events: [], count: 0 },
|
|
247
|
+
IN_PROGRESS: { events: [], count: 0 },
|
|
248
|
+
DONE: { events: [], count: 0 },
|
|
249
|
+
};
|
|
250
|
+
this.criticalityList = ["LOW", "MEDIUM", "HIGH", "ALL"];
|
|
251
|
+
this.store.dispatch(EventSummaryActions.load());
|
|
252
|
+
this.selectedCriticality$ = this.store.select(EventSelectors.filters).pipe(map((filters) => filters['criticality']?.[0] ?? 'ALL'));
|
|
253
|
+
this.subscriptions.add(this.store.select(EventSummarySelectors.summaries).subscribe((summaries) => {
|
|
254
|
+
this.summaries = summaries;
|
|
255
|
+
}));
|
|
256
|
+
}
|
|
257
|
+
filterByCriticality($event) {
|
|
258
|
+
$event === 'ALL' ? this.store.dispatch(EventActions.filter({ filters: { criticality: [] } })) :
|
|
259
|
+
this.store.dispatch(EventActions.filter({ filters: { criticality: [$event] } }));
|
|
260
|
+
this.store.dispatch(EventSummaryActions.load());
|
|
261
|
+
}
|
|
262
|
+
asIsOrder() {
|
|
263
|
+
return 0;
|
|
264
|
+
}
|
|
265
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
266
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EventSummaryPageComponent, selector: "hvy-event-summary-page", inputs: { pageTitle: "pageTitle" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality' | i18n }} : </label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: asIsOrder; track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared"] }, { kind: "component", type: EventSummaryListComponent, selector: "hvy-event-summary-list", inputs: ["events", "totalEventCount", "status", "consultLink", "itemLinkBase"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }] }); }
|
|
267
|
+
}
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryPageComponent, decorators: [{
|
|
269
|
+
type: Component,
|
|
270
|
+
args: [{ selector: 'hvy-event-summary-page', template: "<div class=\"o-hvy-event-summary-page\">\n <div class=\"o-hvy-event-summary-page__header\">\n @if (pageTitle) {\n <h3 class=\"o-hvy-event-summary-page__title\">{{ pageTitle }}</h3>\n }\n <div class=\"m-filter__input-wrapper m-filter__input-wrapper--dropdown\">\n <label class=\"a-label m-filter__label\" for=\"criticality-filter\">{{ '@hvy.event.criticality' | i18n }} : </label>\n <pry-select\n id=\"criticality-filter\"\n class=\"o-hvy-event-summary-page__filter\"\n [items]=\"criticalityList\"\n [ngModel]=\"selectedCriticality$ | async\"\n (ngModelChange)=\"filterByCriticality($event)\"\n [translate]=\"true\"\n i18nPrefix=\"@hvy.eventSummary.criticalityLabels.\"\n >\n </pry-select>\n </div>\n </div>\n <div class=\"o-hvy-event-summary-page__content\">\n @for (summaryList of summaries | keyvalue: asIsOrder; track summaryList.key) {\n <hvy-event-summary-list\n class=\"o-hvy-event-summary-page__summary-list\"\n [status]=\"summaryList.key\"\n [totalEventCount]=\"summaryList.value.count\"\n [events]=\"summaryList.value.events\">\n </hvy-event-summary-list>\n }\n </div>\n</div>\n" }]
|
|
271
|
+
}], ctorParameters: () => [{ type: i1.Store }], propDecorators: { pageTitle: [{
|
|
272
|
+
type: Input
|
|
273
|
+
}] } });
|
|
274
|
+
|
|
186
275
|
const HYP_BASE_CONFIG = new InjectionToken('base config');
|
|
187
276
|
|
|
188
277
|
const enTranslations = {
|
|
@@ -196,10 +285,15 @@ const enTranslations = {
|
|
|
196
285
|
REPORT: "Report",
|
|
197
286
|
OPERATOR: "Operator",
|
|
198
287
|
},
|
|
288
|
+
status: {
|
|
289
|
+
name: 'Status',
|
|
290
|
+
NEW: 'Open',
|
|
291
|
+
IN_PROGRESS: 'In progress',
|
|
292
|
+
DONE: 'Done',
|
|
293
|
+
},
|
|
199
294
|
address: 'Address',
|
|
200
295
|
date: 'Effect date',
|
|
201
296
|
dateM: 'Modification date',
|
|
202
|
-
status: 'Status',
|
|
203
297
|
},
|
|
204
298
|
eventSummary: {
|
|
205
299
|
noContent: 'No event with given criticality',
|
|
@@ -215,9 +309,12 @@ const enTranslations = {
|
|
|
215
309
|
ALL: 'All'
|
|
216
310
|
},
|
|
217
311
|
},
|
|
218
|
-
|
|
219
|
-
name: '
|
|
312
|
+
procedure: {
|
|
313
|
+
name: 'Procedure',
|
|
220
314
|
},
|
|
315
|
+
action: {
|
|
316
|
+
consult: "Consult"
|
|
317
|
+
}
|
|
221
318
|
},
|
|
222
319
|
};
|
|
223
320
|
|
|
@@ -232,15 +329,20 @@ const frTranslations = {
|
|
|
232
329
|
REPORT: "Signalement",
|
|
233
330
|
OPERATOR: "Opérateur",
|
|
234
331
|
},
|
|
332
|
+
status: {
|
|
333
|
+
name: 'Statut',
|
|
334
|
+
NEW: 'Nouveau',
|
|
335
|
+
IN_PROGRESS: 'En cours',
|
|
336
|
+
DONE: 'Clôturé',
|
|
337
|
+
},
|
|
235
338
|
address: 'Adresse',
|
|
236
339
|
date: 'Date d\'effet',
|
|
237
340
|
dateM: 'Date de modification',
|
|
238
|
-
status: 'Statut'
|
|
239
341
|
},
|
|
240
342
|
eventSummary: {
|
|
241
343
|
noContent: 'Aucun évènement avec la criticité donnée',
|
|
242
344
|
statusLabels: {
|
|
243
|
-
NEW: '
|
|
345
|
+
NEW: 'Nouveaux',
|
|
244
346
|
IN_PROGRESS: 'En cours',
|
|
245
347
|
DONE: 'Clôturés',
|
|
246
348
|
},
|
|
@@ -251,9 +353,12 @@ const frTranslations = {
|
|
|
251
353
|
ALL: 'Tous'
|
|
252
354
|
},
|
|
253
355
|
},
|
|
254
|
-
|
|
356
|
+
procedure: {
|
|
255
357
|
name: 'Procédure',
|
|
256
358
|
},
|
|
359
|
+
action: {
|
|
360
|
+
consult: "Consulter"
|
|
361
|
+
}
|
|
257
362
|
}
|
|
258
363
|
};
|
|
259
364
|
|
|
@@ -263,6 +368,7 @@ var HypEventCriticality;
|
|
|
263
368
|
HypEventCriticality[HypEventCriticality["MEDIUM"] = 1] = "MEDIUM";
|
|
264
369
|
HypEventCriticality[HypEventCriticality["HIGH"] = 2] = "HIGH";
|
|
265
370
|
})(HypEventCriticality || (HypEventCriticality = {}));
|
|
371
|
+
|
|
266
372
|
var HypEventType;
|
|
267
373
|
(function (HypEventType) {
|
|
268
374
|
HypEventType[HypEventType["ALERT"] = 0] = "ALERT";
|
|
@@ -279,10 +385,10 @@ const HypervisorActions = {
|
|
|
279
385
|
};
|
|
280
386
|
|
|
281
387
|
const hypFeatureKey = '@hvy/general';
|
|
282
|
-
const
|
|
388
|
+
const hypInitialState = {
|
|
283
389
|
url: '/api/hypervisor',
|
|
284
390
|
};
|
|
285
|
-
const internalReducer = createReducer(
|
|
391
|
+
const internalReducer = createReducer(hypInitialState, on(HypervisorActions.setUrl, (state, action) => ({
|
|
286
392
|
...state,
|
|
287
393
|
url: action.url ?? state.url,
|
|
288
394
|
})));
|
|
@@ -312,24 +418,10 @@ class EventService {
|
|
|
312
418
|
params = params.set(filter, filterValue);
|
|
313
419
|
});
|
|
314
420
|
});
|
|
315
|
-
return this.httpClient.get(encodeURI(`${url}/
|
|
421
|
+
return this.httpClient.get(encodeURI(`${url}/events`), { params });
|
|
316
422
|
}));
|
|
317
423
|
}
|
|
318
|
-
|
|
319
|
-
return this.store
|
|
320
|
-
.select(HypSelectors.url)
|
|
321
|
-
.pipe(withLatestFrom(this.store.select(EventSelectors.filters)), mergeMap(([url, filters]) => {
|
|
322
|
-
let params = new HttpParams();
|
|
323
|
-
Object.keys(filters).forEach(filter => {
|
|
324
|
-
filters[filter].forEach((filterValue) => {
|
|
325
|
-
params = params.set(filter, filterValue);
|
|
326
|
-
});
|
|
327
|
-
});
|
|
328
|
-
console.log(params);
|
|
329
|
-
return this.httpClient.get(encodeURI(`${url}/events/summary`), { params });
|
|
330
|
-
}));
|
|
331
|
-
}
|
|
332
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
424
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
333
425
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, providedIn: 'root' }); }
|
|
334
426
|
}
|
|
335
427
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventService, decorators: [{
|
|
@@ -337,28 +429,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
337
429
|
args: [{
|
|
338
430
|
providedIn: 'root'
|
|
339
431
|
}]
|
|
340
|
-
}], ctorParameters: () => [{ type: i1$
|
|
432
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
|
|
341
433
|
|
|
342
434
|
class EventEffects {
|
|
343
435
|
constructor(actions$, eventService) {
|
|
344
436
|
this.actions$ = actions$;
|
|
345
437
|
this.eventService = eventService;
|
|
346
438
|
this.loadEvents$ = createEffect(() => this.actions$.pipe(ofType(EventActions.load), debounceTime(200), mergeMap$1((action) => this.eventService.list().pipe(map((events) => EventActions.loadSuccess({ events })), catchError((error) => [EventActions.loadFailure({ error: error })])))));
|
|
347
|
-
this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventActions.loadSummaries), debounceTime(200), mergeMap$1((action) => this.eventService.listSummaries().pipe(map((summaries) => EventActions.loadSummariesSuccess({ summaries })), catchError((error) => [EventActions.loadSummariesFailure({ error: error })])))));
|
|
348
439
|
}
|
|
349
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, deps: [{ token: i1$
|
|
440
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, deps: [{ token: i1$3.Actions }, { token: EventService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
350
441
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects }); }
|
|
351
442
|
}
|
|
352
443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventEffects, decorators: [{
|
|
353
444
|
type: Injectable
|
|
354
|
-
}], ctorParameters: () => [{ type: i1$
|
|
445
|
+
}], ctorParameters: () => [{ type: i1$3.Actions }, { type: EventService }] });
|
|
355
446
|
|
|
356
447
|
class HypervisorService {
|
|
357
448
|
constructor(httpClient, store) {
|
|
358
449
|
this.httpClient = httpClient;
|
|
359
450
|
this.store = store;
|
|
360
451
|
}
|
|
361
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, deps: [{ token: i1$
|
|
452
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
362
453
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, providedIn: 'root' }); }
|
|
363
454
|
}
|
|
364
455
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorService, decorators: [{
|
|
@@ -366,23 +457,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
366
457
|
args: [{
|
|
367
458
|
providedIn: 'root'
|
|
368
459
|
}]
|
|
369
|
-
}], ctorParameters: () => [{ type: i1$
|
|
460
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
|
|
370
461
|
|
|
371
462
|
class HypervisorEffects {
|
|
372
463
|
constructor(actions$, eventService) {
|
|
373
464
|
this.actions$ = actions$;
|
|
374
465
|
this.eventService = eventService;
|
|
375
466
|
}
|
|
376
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorEffects, deps: [{ token: i1$
|
|
467
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorEffects, deps: [{ token: i1$3.Actions }, { token: HypervisorService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
377
468
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorEffects }); }
|
|
378
469
|
}
|
|
379
470
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: HypervisorEffects, decorators: [{
|
|
380
471
|
type: Injectable
|
|
381
|
-
}], ctorParameters: () => [{ type: i1$
|
|
472
|
+
}], ctorParameters: () => [{ type: i1$3.Actions }, { type: HypervisorService }] });
|
|
473
|
+
|
|
474
|
+
class EventSummaryService {
|
|
475
|
+
constructor(httpClient, store) {
|
|
476
|
+
this.httpClient = httpClient;
|
|
477
|
+
this.store = store;
|
|
478
|
+
}
|
|
479
|
+
list() {
|
|
480
|
+
return this.store
|
|
481
|
+
.select(HypSelectors.url)
|
|
482
|
+
.pipe(withLatestFrom(this.store.select(EventSelectors.filters)), mergeMap(([url, filters]) => {
|
|
483
|
+
let params = new HttpParams();
|
|
484
|
+
Object.keys(filters).forEach(filter => {
|
|
485
|
+
filters[filter].forEach((filterValue) => {
|
|
486
|
+
params = params.set(filter, filterValue);
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
return this.httpClient.get(encodeURI(`${url}/events/summary`), { params });
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
492
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
493
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, providedIn: 'root' }); }
|
|
494
|
+
}
|
|
495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryService, decorators: [{
|
|
496
|
+
type: Injectable,
|
|
497
|
+
args: [{
|
|
498
|
+
providedIn: 'root'
|
|
499
|
+
}]
|
|
500
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Store }] });
|
|
501
|
+
|
|
502
|
+
class EventSummaryEffects {
|
|
503
|
+
constructor(actions$, eventSummaryService) {
|
|
504
|
+
this.actions$ = actions$;
|
|
505
|
+
this.eventSummaryService = eventSummaryService;
|
|
506
|
+
this.loadSummaries$ = createEffect(() => this.actions$.pipe(ofType(EventSummaryActions.load), debounceTime(200), mergeMap$1((action) => this.eventSummaryService.list().pipe(map((summaries) => EventSummaryActions.loadSuccess({ summaries })), catchError((error) => [EventSummaryActions.loadFailure({ error: error })])))));
|
|
507
|
+
}
|
|
508
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryEffects, deps: [{ token: i1$3.Actions }, { token: EventSummaryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
509
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryEffects }); }
|
|
510
|
+
}
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EventSummaryEffects, decorators: [{
|
|
512
|
+
type: Injectable
|
|
513
|
+
}], ctorParameters: () => [{ type: i1$3.Actions }, { type: EventSummaryService }] });
|
|
382
514
|
|
|
383
515
|
const components = [
|
|
384
516
|
EventDetailComponent,
|
|
385
|
-
EventListComponent
|
|
517
|
+
EventListComponent,
|
|
518
|
+
IconDisplayComponent,
|
|
519
|
+
EventSummaryItemComponent,
|
|
520
|
+
EventSummaryListComponent,
|
|
521
|
+
EventSummaryPageComponent,
|
|
522
|
+
EventIconPipe
|
|
386
523
|
];
|
|
387
524
|
class PvyHypervisorModule {
|
|
388
525
|
static forRoot(options) {
|
|
@@ -403,20 +540,46 @@ class PvyHypervisorModule {
|
|
|
403
540
|
}
|
|
404
541
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, deps: [{ token: HYP_BASE_CONFIG }, { token: i1.Store }, { token: i3.PryI18nService }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
405
542
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, declarations: [EventDetailComponent,
|
|
406
|
-
EventListComponent
|
|
543
|
+
EventListComponent,
|
|
544
|
+
IconDisplayComponent,
|
|
545
|
+
EventSummaryItemComponent,
|
|
546
|
+
EventSummaryListComponent,
|
|
547
|
+
EventSummaryPageComponent,
|
|
548
|
+
EventIconPipe], imports: [i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1$3.EffectsFeatureModule, NgForOf,
|
|
407
549
|
AsyncPipe,
|
|
408
550
|
PryI18nModule,
|
|
409
551
|
PryCoreModule,
|
|
410
552
|
AsyncPipe,
|
|
411
553
|
PryCoreModule,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
554
|
+
NgStyle,
|
|
555
|
+
PryCheckboxModule,
|
|
556
|
+
FormsModule,
|
|
557
|
+
RouterLink,
|
|
558
|
+
PrySinceDateModule,
|
|
559
|
+
DatePipe,
|
|
560
|
+
PryIconModule,
|
|
561
|
+
KeyValuePipe,
|
|
562
|
+
PrySelectModule,
|
|
563
|
+
FormsModule], exports: [EventDetailComponent,
|
|
564
|
+
EventListComponent,
|
|
565
|
+
IconDisplayComponent,
|
|
566
|
+
EventSummaryItemComponent,
|
|
567
|
+
EventSummaryListComponent,
|
|
568
|
+
EventSummaryPageComponent,
|
|
569
|
+
EventIconPipe] }); }
|
|
570
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, imports: [StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
|
|
571
|
+
StoreModule.forFeature(eventFeatureKey, eventReducer),
|
|
572
|
+
StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
|
|
573
|
+
EffectsModule.forFeature([EventEffects, EventSummaryEffects, HypervisorEffects]),
|
|
417
574
|
PryI18nModule,
|
|
418
575
|
PryCoreModule,
|
|
419
|
-
PryCoreModule
|
|
576
|
+
PryCoreModule,
|
|
577
|
+
PryCheckboxModule,
|
|
578
|
+
FormsModule,
|
|
579
|
+
PrySinceDateModule,
|
|
580
|
+
PryIconModule,
|
|
581
|
+
PrySelectModule,
|
|
582
|
+
FormsModule] }); }
|
|
420
583
|
}
|
|
421
584
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PvyHypervisorModule, decorators: [{
|
|
422
585
|
type: NgModule,
|
|
@@ -425,16 +588,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
425
588
|
...components,
|
|
426
589
|
],
|
|
427
590
|
imports: [
|
|
428
|
-
StoreModule.forFeature(eventFeatureKey, eventReducer),
|
|
429
591
|
StoreModule.forFeature(hypFeatureKey, hypervisorReducer),
|
|
430
|
-
|
|
592
|
+
StoreModule.forFeature(eventFeatureKey, eventReducer),
|
|
593
|
+
StoreModule.forFeature(eventSummaryFeatureKey, eventSummaryReducer),
|
|
594
|
+
EffectsModule.forFeature([EventEffects, EventSummaryEffects, HypervisorEffects]),
|
|
431
595
|
NgForOf,
|
|
432
596
|
AsyncPipe,
|
|
433
597
|
PryI18nModule,
|
|
434
598
|
PryCoreModule,
|
|
435
599
|
AsyncPipe,
|
|
436
600
|
PryCoreModule,
|
|
437
|
-
|
|
601
|
+
NgStyle,
|
|
602
|
+
PryCheckboxModule,
|
|
603
|
+
FormsModule,
|
|
604
|
+
RouterLink,
|
|
605
|
+
PrySinceDateModule,
|
|
606
|
+
DatePipe,
|
|
607
|
+
PryIconModule,
|
|
608
|
+
KeyValuePipe,
|
|
609
|
+
PrySelectModule,
|
|
610
|
+
FormsModule
|
|
438
611
|
],
|
|
439
612
|
exports: [
|
|
440
613
|
...components
|
|
@@ -453,5 +626,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
453
626
|
* Generated bundle index. Do not edit.
|
|
454
627
|
*/
|
|
455
628
|
|
|
456
|
-
export { EVENT_TO_ICON, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventSummaryItemComponent, EventSummaryListComponent, HYP_BASE_CONFIG, HypEventCriticality, PvyHypervisorModule, enTranslations, eventFeatureKey, eventInitialState
|
|
629
|
+
export { EVENT_TO_ICON, EventActions, EventDetailComponent, EventEffects, EventIconPipe, EventListComponent, EventSelectors, EventSummaryActions, EventSummaryEffects, EventSummaryItemComponent, EventSummaryListComponent, EventSummaryPageComponent, EventSummarySelectors, HYP_BASE_CONFIG, HypEventCriticality, HypEventType, IconDisplayComponent, PvyHypervisorModule, enTranslations, eventFeatureKey, eventInitialState, eventReducer, eventSummaryFeatureKey, eventSummaryInitialState, eventSummaryReducer, frTranslations };
|
|
457
630
|
//# sourceMappingURL=provoly-hypervisor.mjs.map
|