@provoly/dashboard 0.12.0 → 0.12.2
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/README.md +1 -1
- package/dataset/i18n/en.translations.d.ts +3 -1
- package/dataset/i18n/fr.translations.d.ts +1 -0
- package/dataset/style/_o-pry-dataset.scss +2 -7
- package/esm2022/dataset/components/dataset-card/dataset-card.component.mjs +3 -3
- package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +3 -3
- package/esm2022/dataset/i18n/en.translations.mjs +4 -2
- package/esm2022/dataset/i18n/fr.translations.mjs +3 -2
- package/esm2022/dataset/style/css.component.mjs +2 -2
- package/esm2022/filters/date/date-filter.component.mjs +24 -8
- package/esm2022/filters/date/date-filter.module.mjs +7 -8
- package/esm2022/filters/date/public-api.mjs +1 -2
- package/esm2022/filters/number/number-filter.component.mjs +5 -4
- package/esm2022/filters/number/number-filter.module.mjs +5 -5
- package/esm2022/filters/text/text-filter.component.mjs +5 -4
- package/esm2022/filters/text/text-filter.module.mjs +5 -5
- package/esm2022/lib/core/components/modal-status/modal-status.component.mjs +40 -0
- package/esm2022/lib/core/components/modal-status/modal-status.module.mjs +28 -0
- package/esm2022/lib/core/core.module.mjs +2 -2
- package/esm2022/lib/core/i18n/en.translations.mjs +4 -1
- package/esm2022/lib/core/i18n/fr.translations.mjs +4 -1
- package/esm2022/lib/core/model/dataset.interface.mjs +1 -1
- package/esm2022/lib/core/model/manifest.interface.mjs +1 -1
- package/esm2022/lib/core/public-api.mjs +3 -3
- package/esm2022/lib/core/store/data-source/data-source.actions.mjs +5 -5
- package/esm2022/lib/core/store/data-source/data-source.effects.mjs +2 -2
- package/esm2022/lib/core/store/data-source/data-source.reducer.mjs +7 -7
- package/esm2022/lib/core/store/data-source/data-source.selectors.mjs +3 -3
- package/esm2022/lib/core/store/data-source/data-source.service.mjs +3 -3
- package/esm2022/lib/dashboard/store/dashboard.selectors.mjs +4 -1
- package/esm2022/lib/dashboard/store/manifest.service.mjs +10 -7
- package/esm2022/notification/components/notification/content/notification-content.component.mjs +1 -1
- package/esm2022/notification/style/css.component.mjs +2 -2
- package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +1 -1
- package/esm2022/presentation/style/css.component.mjs +2 -2
- package/esm2022/restitution/i18n/fr.translations.mjs +2 -2
- package/esm2022/restitution/style/css.component.mjs +2 -2
- package/esm2022/toolbox/components/automate-refresh/automate-refresh.component.mjs +103 -0
- package/esm2022/toolbox/components/clear-view/clear-view.component.mjs +9 -10
- package/esm2022/toolbox/components/drag-widgets/drag-widgets.component.mjs +8 -10
- package/esm2022/toolbox/components/edit-mode-toggle/edit-mode-toggle.component.mjs +7 -9
- package/esm2022/toolbox/components/filter-settings/filter-settings.component.mjs +8 -7
- package/esm2022/toolbox/components/launch-tab/launch-tab.component.mjs +9 -10
- package/esm2022/toolbox/components/refresh-datasets/refresh-datasets.component.mjs +39 -0
- package/esm2022/toolbox/components/save-view/save-view.component.mjs +9 -11
- package/esm2022/toolbox/components/select-grid-layout/select-grid-layout.component.mjs +10 -12
- package/esm2022/toolbox/components/toolbox-action/toolbox-action.component.mjs +29 -0
- package/esm2022/toolbox/components/toolbox-action-instanciator/toolbox-action-instanciator.component.mjs +44 -0
- package/esm2022/toolbox/components/toolbox.component.mjs +40 -12
- package/esm2022/toolbox/public-api.mjs +6 -1
- package/esm2022/toolbox/style/css.component.mjs +3 -3
- package/esm2022/toolbox/toolbox.model.mjs +59 -0
- package/esm2022/toolbox/toolbox.module.mjs +22 -6
- package/fesm2022/provoly-dashboard-dataset.mjs +11 -8
- package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-date.mjs +31 -23
- package/fesm2022/provoly-dashboard-filters-date.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-number.mjs +8 -7
- package/fesm2022/provoly-dashboard-filters-number.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-text.mjs +8 -7
- package/fesm2022/provoly-dashboard-filters-text.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-notification.mjs +2 -2
- package/fesm2022/provoly-dashboard-notification.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-presentation.mjs +3 -3
- package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-restitution.mjs +3 -3
- package/fesm2022/provoly-dashboard-restitution.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-toolbox.mjs +335 -68
- package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +126 -108
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/filters/date/date-filter.component.d.ts +1 -0
- package/filters/date/date-filter.module.d.ts +5 -6
- package/filters/date/public-api.d.ts +0 -1
- package/filters/number/number-filter.module.d.ts +1 -1
- package/filters/text/text-filter.module.d.ts +1 -1
- package/lib/core/components/{modalStatus/modalStatus.component.d.ts → modal-status/modal-status.component.d.ts} +10 -3
- package/lib/core/components/{modalStatus/modalStatus.module.d.ts → modal-status/modal-status.module.d.ts} +1 -1
- package/lib/core/core.module.d.ts +1 -1
- package/lib/core/i18n/en.translations.d.ts +3 -0
- package/lib/core/i18n/fr.translations.d.ts +3 -0
- package/lib/core/model/dataset.interface.d.ts +11 -4
- package/lib/core/model/manifest.interface.d.ts +1 -0
- package/lib/core/public-api.d.ts +2 -2
- package/lib/core/store/data-source/data-source.actions.d.ts +10 -10
- package/lib/core/store/data-source/data-source.effects.d.ts +4 -4
- package/lib/core/store/data-source/data-source.reducer.d.ts +2 -2
- package/lib/core/store/data-source/data-source.selectors.d.ts +1 -1
- package/lib/core/store/data-source/data-source.service.d.ts +2 -2
- package/lib/dashboard/store/dashboard.selectors.d.ts +8 -0
- package/lib/dashboard/store/manifest.service.d.ts +1 -0
- package/notification/style/_m-notifications.scss +1 -1
- package/package.json +1 -1
- package/presentation/style/_o-pry-presentation.scss +8 -0
- package/styles/components/_m-actions-list.scss +1 -0
- package/styles/components/_m-filter.scss +43 -0
- package/styles-theme/components-theme/_m-filter.theme.scss +12 -0
- package/styles-theme/main-theme.scss +2 -0
- package/toolbox/components/automate-refresh/automate-refresh.component.d.ts +30 -0
- package/toolbox/components/clear-view/clear-view.component.d.ts +3 -4
- package/toolbox/components/drag-widgets/drag-widgets.component.d.ts +3 -4
- package/toolbox/components/edit-mode-toggle/edit-mode-toggle.component.d.ts +3 -4
- package/toolbox/components/filter-settings/filter-settings.component.d.ts +3 -3
- package/toolbox/components/launch-tab/launch-tab.component.d.ts +3 -4
- package/toolbox/components/refresh-datasets/refresh-datasets.component.d.ts +14 -0
- package/toolbox/components/save-view/save-view.component.d.ts +4 -5
- package/toolbox/components/select-grid-layout/select-grid-layout.component.d.ts +4 -5
- package/toolbox/components/toolbox-action/toolbox-action.component.d.ts +13 -0
- package/toolbox/components/toolbox-action-instanciator/toolbox-action-instanciator.component.d.ts +17 -0
- package/toolbox/components/toolbox.component.d.ts +18 -3
- package/toolbox/public-api.d.ts +5 -0
- package/toolbox/style/_o-automate-refresh.scss +24 -0
- package/toolbox/style/_o-toolbox.scss +30 -0
- package/toolbox/style/css.component.d.ts +1 -1
- package/toolbox/toolbox.model.d.ts +10 -0
- package/toolbox/toolbox.module.d.ts +22 -18
- package/esm2022/filters/date/style/css.component.mjs +0 -11
- package/esm2022/lib/core/components/modalStatus/modalStatus.component.mjs +0 -35
- package/esm2022/lib/core/components/modalStatus/modalStatus.module.mjs +0 -28
- package/filters/date/style/_m-date.scss +0 -6
- package/filters/date/style/css.component.d.ts +0 -5
|
@@ -20,6 +20,7 @@ import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
|
20
20
|
import equal from 'fast-deep-equal/es6';
|
|
21
21
|
import { distinctUntilChanged, filter as filter$1, debounceTime as debounceTime$1, mergeMap as mergeMap$1, map as map$1, catchError, withLatestFrom, tap, delay } from 'rxjs/operators';
|
|
22
22
|
import { animation, style, animate, trigger, transition, useAnimation } from '@angular/animations';
|
|
23
|
+
import { v4 } from 'uuid';
|
|
23
24
|
import { GeoJSON } from 'ol/format';
|
|
24
25
|
import { fromLonLat } from 'ol/proj';
|
|
25
26
|
import * as i2$2 from '@angular/forms';
|
|
@@ -27,7 +28,6 @@ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
|
27
28
|
import * as i2$3 from '@ng-select/ng-select';
|
|
28
29
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
29
30
|
import { webSocket } from 'rxjs/webSocket';
|
|
30
|
-
import { v4 } from 'uuid';
|
|
31
31
|
import * as i8 from '@provoly/dashboard/components/checkbox';
|
|
32
32
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
33
33
|
|
|
@@ -261,6 +261,9 @@ const enTranslations$1 = {
|
|
|
261
261
|
launchIndication: 'Open this page in a',
|
|
262
262
|
chooseGrid: 'Change grid layout',
|
|
263
263
|
clear: 'Clear presentation',
|
|
264
|
+
refresh: 'Refresh',
|
|
265
|
+
automateRefresh: 'Automate refresh',
|
|
266
|
+
options: 'Options',
|
|
264
267
|
close: 'Close',
|
|
265
268
|
heatmap: 'Heatmap',
|
|
266
269
|
bubblemap: 'Bubbles',
|
|
@@ -584,6 +587,9 @@ const frTranslations$1 = {
|
|
|
584
587
|
launchIndication: 'Ouvrir cette page dans un',
|
|
585
588
|
chooseGrid: 'Changer la grille',
|
|
586
589
|
clear: "Vider l'affichage",
|
|
590
|
+
refresh: 'Actualiser',
|
|
591
|
+
automateRefresh: "Automatiser l'actualisation",
|
|
592
|
+
options: 'Options',
|
|
587
593
|
close: 'Fermer',
|
|
588
594
|
heatmap: 'Fréquentation',
|
|
589
595
|
bubblemap: 'Bulles',
|
|
@@ -2043,8 +2049,11 @@ const enTranslations = {
|
|
|
2043
2049
|
search: 'Search',
|
|
2044
2050
|
date: 'Date',
|
|
2045
2051
|
status: 'Status',
|
|
2052
|
+
versionHistory: 'Version history',
|
|
2046
2053
|
data: 'Data',
|
|
2047
2054
|
export: 'Export',
|
|
2055
|
+
api: 'API',
|
|
2056
|
+
returnToList: 'Back to catalog',
|
|
2048
2057
|
version: {
|
|
2049
2058
|
title: 'Title',
|
|
2050
2059
|
INDEXING: 'Loading',
|
|
@@ -2061,7 +2070,6 @@ const enTranslations = {
|
|
|
2061
2070
|
LOADING: '',
|
|
2062
2071
|
INDEXING: ''
|
|
2063
2072
|
},
|
|
2064
|
-
api: 'API',
|
|
2065
2073
|
error: {
|
|
2066
2074
|
title: 'List of errors',
|
|
2067
2075
|
close: 'Close'
|
|
@@ -2078,10 +2086,11 @@ const frTranslations = {
|
|
|
2078
2086
|
date: 'Date',
|
|
2079
2087
|
status: 'Statut',
|
|
2080
2088
|
data: 'Données',
|
|
2089
|
+
versionHistory: 'Historique de versions',
|
|
2081
2090
|
table: 'Tableau',
|
|
2082
2091
|
export: 'Export',
|
|
2083
2092
|
api: 'API',
|
|
2084
|
-
returnToList: '
|
|
2093
|
+
returnToList: 'Retour au catalogue',
|
|
2085
2094
|
version: {
|
|
2086
2095
|
title: 'Intitulé',
|
|
2087
2096
|
INDEXING: 'En chargement',
|
|
@@ -2166,10 +2175,10 @@ const DataSourceActions = {
|
|
|
2166
2175
|
activateDatasetVersion: createAction('[Dataset] Activate dataset version', props()),
|
|
2167
2176
|
activateDatasetVersionSuccess: createAction('[Dataset] Activate dataset version success', props()),
|
|
2168
2177
|
activateDatasetVersionFailure: createAction('[Dataset] Activate dataset version failure', props()),
|
|
2169
|
-
|
|
2170
|
-
getById: createAction('[Dataset
|
|
2171
|
-
getByIdSuccess: createAction('[Dataset
|
|
2172
|
-
getByIdFailure: createAction('[Dataset
|
|
2178
|
+
previews: {
|
|
2179
|
+
getById: createAction('[Dataset/Previews] get by id', props()),
|
|
2180
|
+
getByIdSuccess: createAction('[Dataset/Previews] get by id Success', props()),
|
|
2181
|
+
getByIdFailure: createAction('[Dataset/Previews] get by id Failure', props())
|
|
2173
2182
|
}
|
|
2174
2183
|
}
|
|
2175
2184
|
};
|
|
@@ -2186,7 +2195,7 @@ const initialDataSourceState = {
|
|
|
2186
2195
|
datasets: [],
|
|
2187
2196
|
datasetVersions: [],
|
|
2188
2197
|
selectedDatasetVersion: null,
|
|
2189
|
-
|
|
2198
|
+
previews: []
|
|
2190
2199
|
};
|
|
2191
2200
|
const dataSourceReducer = createReducer(initialDataSourceState, on(DataSourceActions.namedQuery.load, (state) => ({ ...state, error: undefined, isLoading: true })), on(DataSourceActions.namedQuery.loaded, (state, action) => ({ ...state, list: action.list, isLoading: false })), on(DataSourceActions.namedQuery.delete, (state, action) => ({ ...state, error: undefined, isLoading: false })), on(DataSourceActions.namedQuery.failure, (state, action) => ({ ...state, error: action.error, isLoading: false })), on(DataSourceActions.namedQuery.openEdit, (state, action) => ({
|
|
2192
2201
|
...state,
|
|
@@ -2248,17 +2257,17 @@ const dataSourceReducer = createReducer(initialDataSourceState, on(DataSourceAct
|
|
|
2248
2257
|
})), on(DataSourceActions.dataset.listVersionsFailure, (state, action) => ({
|
|
2249
2258
|
...state,
|
|
2250
2259
|
loading: false
|
|
2251
|
-
})), on(DataSourceActions.dataset.
|
|
2260
|
+
})), on(DataSourceActions.dataset.previews.getById, (state, action) => ({
|
|
2252
2261
|
...state,
|
|
2253
2262
|
loading: true
|
|
2254
|
-
})), on(DataSourceActions.dataset.
|
|
2263
|
+
})), on(DataSourceActions.dataset.previews.getByIdSuccess, (state, action) => ({
|
|
2255
2264
|
...state,
|
|
2256
|
-
|
|
2265
|
+
previews: action.previews,
|
|
2257
2266
|
loading: false
|
|
2258
|
-
})), on(DataSourceActions.dataset.
|
|
2267
|
+
})), on(DataSourceActions.dataset.previews.getByIdFailure, (state, action) => ({
|
|
2259
2268
|
...state,
|
|
2260
2269
|
error: action.error,
|
|
2261
|
-
|
|
2270
|
+
previews: [],
|
|
2262
2271
|
loading: false
|
|
2263
2272
|
})));
|
|
2264
2273
|
|
|
@@ -2319,7 +2328,7 @@ const matchingDatasetVersions = (datasetId) => {
|
|
|
2319
2328
|
}
|
|
2320
2329
|
return memoizeDatasetVersions[datasetId];
|
|
2321
2330
|
};
|
|
2322
|
-
const
|
|
2331
|
+
const datasetPreviews = createSelector(selectFeature, (state) => state?.previews ?? []);
|
|
2323
2332
|
const DataSourceSelectors = {
|
|
2324
2333
|
selectFeature,
|
|
2325
2334
|
getNamedQuery,
|
|
@@ -2340,15 +2349,19 @@ const DataSourceSelectors = {
|
|
|
2340
2349
|
datasetVersions,
|
|
2341
2350
|
selectedDatasetId,
|
|
2342
2351
|
matchingDatasetVersions,
|
|
2343
|
-
|
|
2352
|
+
datasetPreviews
|
|
2344
2353
|
};
|
|
2345
2354
|
|
|
2346
2355
|
class PryModalStatusComponent {
|
|
2347
2356
|
set version(version) {
|
|
2348
2357
|
this._version = version;
|
|
2349
2358
|
if (!!version) {
|
|
2350
|
-
this.store.dispatch(DataSourceActions.dataset.
|
|
2351
|
-
this.
|
|
2359
|
+
this.store.dispatch(DataSourceActions.dataset.previews.getById({ id: version.id }));
|
|
2360
|
+
this.datasetPreviews$ = this.store
|
|
2361
|
+
.select(DataSourceSelectors.datasetPreviews)
|
|
2362
|
+
.pipe(map((previews) => previews
|
|
2363
|
+
.map((preview) => preview.messages.map((message) => ({ ...message, level: preview.level, count: preview.count })))
|
|
2364
|
+
.flat()));
|
|
2352
2365
|
}
|
|
2353
2366
|
}
|
|
2354
2367
|
constructor(store) {
|
|
@@ -2359,11 +2372,11 @@ class PryModalStatusComponent {
|
|
|
2359
2372
|
this.gotoConsult.emit(this.version);
|
|
2360
2373
|
}
|
|
2361
2374
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: PryModalStatusComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2362
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: PryModalStatusComponent, selector: "pry-
|
|
2375
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: PryModalStatusComponent, selector: "pry-modal-status", inputs: { version: "version" }, outputs: { gotoConsult: "gotoConsult" }, ngImport: i0, template: "<div class=\"o-modal-wrapper\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\">{{ '@pry.dataset.error.title' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"goBack()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <table class=\"a-table\">\n <thead>\n <tr>\n <th>Type</th>\n <th>{{ '@pry.dataset.error.code' | i18n }}</th>\n <th>{{ '@pry.dataset.error.elements' | i18n }}</th>\n <th>{{ '@pry.dataset.error.message' | i18n }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let preview of datasetPreviews$ | async | slice : 0 : 5\">\n <td>\n {{ preview.level }}\n </td>\n <td>\n {{ preview.extractErrorCode }}\n </td>\n <td>\n {{ preview.count }}\n </td>\n <td>\n {{ preview.name }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
|
|
2363
2376
|
}
|
|
2364
2377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: PryModalStatusComponent, decorators: [{
|
|
2365
2378
|
type: Component,
|
|
2366
|
-
args: [{ selector: 'pry-
|
|
2379
|
+
args: [{ selector: 'pry-modal-status', template: "<div class=\"o-modal-wrapper\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\">{{ '@pry.dataset.error.title' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"goBack()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <table class=\"a-table\">\n <thead>\n <tr>\n <th>Type</th>\n <th>{{ '@pry.dataset.error.code' | i18n }}</th>\n <th>{{ '@pry.dataset.error.elements' | i18n }}</th>\n <th>{{ '@pry.dataset.error.message' | i18n }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let preview of datasetPreviews$ | async | slice : 0 : 5\">\n <td>\n {{ preview.level }}\n </td>\n <td>\n {{ preview.extractErrorCode }}\n </td>\n <td>\n {{ preview.count }}\n </td>\n <td>\n {{ preview.name }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n" }]
|
|
2367
2380
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { gotoConsult: [{
|
|
2368
2381
|
type: Output
|
|
2369
2382
|
}], version: [{
|
|
@@ -3611,6 +3624,95 @@ var DashboardGridLayout;
|
|
|
3611
3624
|
DashboardGridLayout["MANUAL"] = "0";
|
|
3612
3625
|
})(DashboardGridLayout || (DashboardGridLayout = {}));
|
|
3613
3626
|
|
|
3627
|
+
class ManifestService {
|
|
3628
|
+
constructor(httpClient, store, snackBar, translateService) {
|
|
3629
|
+
this.httpClient = httpClient;
|
|
3630
|
+
this.store = store;
|
|
3631
|
+
this.snackBar = snackBar;
|
|
3632
|
+
this.translateService = translateService;
|
|
3633
|
+
}
|
|
3634
|
+
list() {
|
|
3635
|
+
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/users/me/dashboards`))), catchError((error) => {
|
|
3636
|
+
if (error.error instanceof Error) {
|
|
3637
|
+
// A client-side or network error occurred
|
|
3638
|
+
console.error('A frontend error occurred:', error.error.message);
|
|
3639
|
+
this.snackBar.open({
|
|
3640
|
+
type: 'error',
|
|
3641
|
+
message: this.translateService.instant('@pry.manifest.get.errorFront', { msg: error.error.message })
|
|
3642
|
+
});
|
|
3643
|
+
}
|
|
3644
|
+
else {
|
|
3645
|
+
// The backend returned an unsuccessful response code.
|
|
3646
|
+
if (error.code !== 200) {
|
|
3647
|
+
console.error(`Backend returned code ${error.status}, body was: ${JSON.stringify(error.error)}`);
|
|
3648
|
+
}
|
|
3649
|
+
if (error.code >= 400) {
|
|
3650
|
+
this.snackBar.open({
|
|
3651
|
+
type: 'error',
|
|
3652
|
+
message: this.translateService.instant('@pry.manifest.get.errorBack', {
|
|
3653
|
+
code: error.status
|
|
3654
|
+
})
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
return of([]);
|
|
3659
|
+
}));
|
|
3660
|
+
}
|
|
3661
|
+
get(id) {
|
|
3662
|
+
return this.store
|
|
3663
|
+
.select(ConfigSelectors.refUrl)
|
|
3664
|
+
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/users/me/dashboards/id/${id}/manifest`))));
|
|
3665
|
+
}
|
|
3666
|
+
save(name, manifest, visibility, id, description, image, cover) {
|
|
3667
|
+
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.post(encodeURI(`${url}/users/me/dashboards`), {
|
|
3668
|
+
id: id === undefined || id.length === 0 ? v4() : id,
|
|
3669
|
+
name,
|
|
3670
|
+
description,
|
|
3671
|
+
manifest,
|
|
3672
|
+
image,
|
|
3673
|
+
visibility,
|
|
3674
|
+
cover,
|
|
3675
|
+
datasource: ManifestService.getDatasourcesUsedByManifest(manifest)
|
|
3676
|
+
})));
|
|
3677
|
+
}
|
|
3678
|
+
delete(id) {
|
|
3679
|
+
return this.store
|
|
3680
|
+
.select(ConfigSelectors.refUrl)
|
|
3681
|
+
.pipe(mergeMap((url) => this.httpClient.delete(encodeURI(`${url}/users/me/dashboards/id/${id}`))));
|
|
3682
|
+
}
|
|
3683
|
+
default(id) {
|
|
3684
|
+
return this.store.select(ConfigSelectors.refUrl).pipe(withLatestFrom(this.store.select(DashboardSelectors.manifestsList)), mergeMap(([url, manifests]) => {
|
|
3685
|
+
const actual = manifests.find((manifest) => manifest.id === id);
|
|
3686
|
+
if (!!actual && !actual.default) {
|
|
3687
|
+
return this.httpClient
|
|
3688
|
+
.put(encodeURI(`${url}/users/me/dashboards/id/${id}/default`), {})
|
|
3689
|
+
.pipe(map$1(() => true));
|
|
3690
|
+
}
|
|
3691
|
+
else {
|
|
3692
|
+
return this.httpClient
|
|
3693
|
+
.delete(encodeURI(`${url}/users/me/dashboards/default`), {})
|
|
3694
|
+
.pipe(map$1(() => false));
|
|
3695
|
+
}
|
|
3696
|
+
}));
|
|
3697
|
+
}
|
|
3698
|
+
static getDatasourcesUsedByManifest(manifest) {
|
|
3699
|
+
return [
|
|
3700
|
+
...new Set(manifest.windows
|
|
3701
|
+
.map((window) => window.widgets.map((widget) => widget.datasource))
|
|
3702
|
+
.flat(3)
|
|
3703
|
+
.filter((dataset) => !!dataset))
|
|
3704
|
+
];
|
|
3705
|
+
}
|
|
3706
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ManifestService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }, { token: PrySnackbarService }, { token: PryI18nService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3707
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ManifestService, providedIn: 'root' }); }
|
|
3708
|
+
}
|
|
3709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ManifestService, decorators: [{
|
|
3710
|
+
type: Injectable,
|
|
3711
|
+
args: [{
|
|
3712
|
+
providedIn: 'root'
|
|
3713
|
+
}]
|
|
3714
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1.Store }, { type: PrySnackbarService }, { type: PryI18nService }]; } });
|
|
3715
|
+
|
|
3614
3716
|
const NEW_WINDOW_TARGET = -1;
|
|
3615
3717
|
const feature$4 = createFeatureSelector('@pry/dashboard');
|
|
3616
3718
|
const manifests = createSelector(feature$4, (state) => state?.manifests);
|
|
@@ -3619,6 +3721,7 @@ const currentManifestId = createSelector(manifests, (manifests) => manifests.cur
|
|
|
3619
3721
|
const globalManifest = createSelector(manifests,
|
|
3620
3722
|
// @ts-ignore
|
|
3621
3723
|
(manifests) => ({ windows: [], ...manifests?.manifest } ?? { windows: [] }));
|
|
3724
|
+
const manifestDatasources = createSelector(globalManifest, (manifest) => ManifestService.getDatasourcesUsedByManifest(manifest));
|
|
3622
3725
|
const staticManifest = createSelector(manifests,
|
|
3623
3726
|
// @ts-ignore
|
|
3624
3727
|
(manifests) => ({ windows: [], ...manifests?.staticManifest } ?? { windows: [] }));
|
|
@@ -3694,6 +3797,7 @@ const DashboardSelectors = {
|
|
|
3694
3797
|
rank,
|
|
3695
3798
|
currentManifestId,
|
|
3696
3799
|
globalManifest,
|
|
3800
|
+
manifestDatasources,
|
|
3697
3801
|
refreshRates,
|
|
3698
3802
|
windowManifest,
|
|
3699
3803
|
widgetManifest,
|
|
@@ -3910,10 +4014,10 @@ class DataSourceService {
|
|
|
3910
4014
|
.select(ConfigSelectors.refUrl)
|
|
3911
4015
|
.pipe(switchMap((url) => this.httpClient.get(encodeURI(`${url}/dataset-versions`))));
|
|
3912
4016
|
}
|
|
3913
|
-
|
|
4017
|
+
getPreviews(id) {
|
|
3914
4018
|
return this.store
|
|
3915
4019
|
.select(ConfigSelectors.refUrl)
|
|
3916
|
-
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/
|
|
4020
|
+
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/dataset-versions/id/${id}/previews`))));
|
|
3917
4021
|
}
|
|
3918
4022
|
deactivateDatasetVersion(versionId) {
|
|
3919
4023
|
return this.store
|
|
@@ -4058,7 +4162,7 @@ class DataSourceEffects {
|
|
|
4058
4162
|
})), { dispatch: false });
|
|
4059
4163
|
this.deactivateDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.deactivateDatasetVersion), switchMap((action) => this.dataSourceService.deactivateDatasetVersion(action.id).pipe(map((datasetVersion) => DataSourceActions.dataset.deactivateDatasetVersionSuccess({ datasetVersion })), catchError((error) => [DataSourceActions.dataset.deactivateDatasetVersionFailure({ error })])))));
|
|
4060
4164
|
this.activateDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.activateDatasetVersion), switchMap((action) => this.dataSourceService.activateDatasetVersion(action.id).pipe(map((datasetVersion) => DataSourceActions.dataset.activateDatasetVersionSuccess({ datasetVersion })), catchError((error) => [DataSourceActions.dataset.activateDatasetVersionFailure({ error })])))));
|
|
4061
|
-
this.
|
|
4165
|
+
this.previewsGetById$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.previews.getById), switchMap((action) => this.dataSourceService.getPreviews(action.id).pipe(map((previews) => DataSourceActions.dataset.previews.getByIdSuccess({ previews })), catchError((error) => [DataSourceActions.dataset.previews.getByIdFailure({ error })])))));
|
|
4062
4166
|
}
|
|
4063
4167
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DataSourceEffects, deps: [{ token: i1$3.Actions }, { token: SearchService }, { token: DataSourceService }, { token: PrySnackbarService }, { token: PryI18nService }, { token: i1.Store }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4064
4168
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DataSourceEffects }); }
|
|
@@ -9172,92 +9276,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
|
9172
9276
|
args: ['filters', { read: ViewContainerRef }]
|
|
9173
9277
|
}] } });
|
|
9174
9278
|
|
|
9175
|
-
class ManifestService {
|
|
9176
|
-
constructor(httpClient, store, snackBar, translateService) {
|
|
9177
|
-
this.httpClient = httpClient;
|
|
9178
|
-
this.store = store;
|
|
9179
|
-
this.snackBar = snackBar;
|
|
9180
|
-
this.translateService = translateService;
|
|
9181
|
-
}
|
|
9182
|
-
list() {
|
|
9183
|
-
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/users/me/dashboards`))), catchError((error) => {
|
|
9184
|
-
if (error.error instanceof Error) {
|
|
9185
|
-
// A client-side or network error occurred
|
|
9186
|
-
console.error('A frontend error occurred:', error.error.message);
|
|
9187
|
-
this.snackBar.open({
|
|
9188
|
-
type: 'error',
|
|
9189
|
-
message: this.translateService.instant('@pry.manifest.get.errorFront', { msg: error.error.message })
|
|
9190
|
-
});
|
|
9191
|
-
}
|
|
9192
|
-
else {
|
|
9193
|
-
// The backend returned an unsuccessful response code.
|
|
9194
|
-
if (error.code !== 200) {
|
|
9195
|
-
console.error(`Backend returned code ${error.status}, body was: ${JSON.stringify(error.error)}`);
|
|
9196
|
-
}
|
|
9197
|
-
if (error.code >= 400) {
|
|
9198
|
-
this.snackBar.open({
|
|
9199
|
-
type: 'error',
|
|
9200
|
-
message: this.translateService.instant('@pry.manifest.get.errorBack', {
|
|
9201
|
-
code: error.status
|
|
9202
|
-
})
|
|
9203
|
-
});
|
|
9204
|
-
}
|
|
9205
|
-
}
|
|
9206
|
-
return of([]);
|
|
9207
|
-
}));
|
|
9208
|
-
}
|
|
9209
|
-
get(id) {
|
|
9210
|
-
return this.store
|
|
9211
|
-
.select(ConfigSelectors.refUrl)
|
|
9212
|
-
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/users/me/dashboards/id/${id}/manifest`))));
|
|
9213
|
-
}
|
|
9214
|
-
save(name, manifest, visibility, id, description, image, cover) {
|
|
9215
|
-
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.post(encodeURI(`${url}/users/me/dashboards`), {
|
|
9216
|
-
id: id === undefined || id.length === 0 ? v4() : id,
|
|
9217
|
-
name,
|
|
9218
|
-
description,
|
|
9219
|
-
manifest,
|
|
9220
|
-
image,
|
|
9221
|
-
visibility,
|
|
9222
|
-
cover,
|
|
9223
|
-
datasets: [
|
|
9224
|
-
...new Set(manifest.windows
|
|
9225
|
-
.map((window) => window.widgets.map((widget) => widget.datasource))
|
|
9226
|
-
.flat(3)
|
|
9227
|
-
.filter((dataset) => !!dataset))
|
|
9228
|
-
]
|
|
9229
|
-
})));
|
|
9230
|
-
}
|
|
9231
|
-
delete(id) {
|
|
9232
|
-
return this.store
|
|
9233
|
-
.select(ConfigSelectors.refUrl)
|
|
9234
|
-
.pipe(mergeMap((url) => this.httpClient.delete(encodeURI(`${url}/users/me/dashboards/id/${id}`))));
|
|
9235
|
-
}
|
|
9236
|
-
default(id) {
|
|
9237
|
-
return this.store.select(ConfigSelectors.refUrl).pipe(withLatestFrom(this.store.select(DashboardSelectors.manifestsList)), mergeMap(([url, manifests]) => {
|
|
9238
|
-
const actual = manifests.find((manifest) => manifest.id === id);
|
|
9239
|
-
if (!!actual && !actual.default) {
|
|
9240
|
-
return this.httpClient
|
|
9241
|
-
.put(encodeURI(`${url}/users/me/dashboards/id/${id}/default`), {})
|
|
9242
|
-
.pipe(map$1(() => true));
|
|
9243
|
-
}
|
|
9244
|
-
else {
|
|
9245
|
-
return this.httpClient
|
|
9246
|
-
.delete(encodeURI(`${url}/users/me/dashboards/default`), {})
|
|
9247
|
-
.pipe(map$1(() => false));
|
|
9248
|
-
}
|
|
9249
|
-
}));
|
|
9250
|
-
}
|
|
9251
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ManifestService, deps: [{ token: i1$2.HttpClient }, { token: i1.Store }, { token: PrySnackbarService }, { token: PryI18nService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9252
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ManifestService, providedIn: 'root' }); }
|
|
9253
|
-
}
|
|
9254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ManifestService, decorators: [{
|
|
9255
|
-
type: Injectable,
|
|
9256
|
-
args: [{
|
|
9257
|
-
providedIn: 'root'
|
|
9258
|
-
}]
|
|
9259
|
-
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1.Store }, { type: PrySnackbarService }, { type: PryI18nService }]; } });
|
|
9260
|
-
|
|
9261
9279
|
class DefaultViewGuard {
|
|
9262
9280
|
constructor(manifestService, router, store) {
|
|
9263
9281
|
this.manifestService = manifestService;
|