@provoly/dashboard 0.11.1 → 0.11.3
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/lib/core/components/modalStatus/modalStatus.component.mjs +3 -3
- package/esm2022/lib/core/errors/http-error-interceptor.service.mjs +13 -9
- package/esm2022/lib/core/store/search/search.service.mjs +13 -15
- package/esm2022/lib/dashboard/store/manifest.service.mjs +5 -3
- package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +7 -2
- package/esm2022/widgets/widget-aggregated-chart/service/backend-aggregation.service.mjs +7 -16
- package/fesm2022/provoly-dashboard-presentation.mjs +7 -2
- package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs +5 -14
- package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +30 -27
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/lib/core/store/search/search.service.d.ts +6 -6
- package/package.json +1 -1
- package/widgets/widget-aggregated-chart/service/backend-aggregation.service.d.ts +3 -3
|
@@ -3,7 +3,7 @@ import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { CommonModule, AsyncPipe } from '@angular/common';
|
|
5
5
|
import * as i1$2 from '@angular/common/http';
|
|
6
|
-
import { HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
6
|
+
import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { InjectionToken, Injectable, Directive, Optional, Inject, Input, Component, Pipe, ChangeDetectionStrategy, HostBinding, SecurityContext, NgModule, EventEmitter, Output, TemplateRef, ViewChild, Injector, HostListener, forwardRef, ContentChildren, ViewContainerRef, createNgModule } from '@angular/core';
|
|
9
9
|
import * as i2 from '@angular/router';
|
|
@@ -2350,11 +2350,11 @@ class PryModalStatusComponent {
|
|
|
2350
2350
|
this.gotoConsult.emit(this.version);
|
|
2351
2351
|
}
|
|
2352
2352
|
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 }); }
|
|
2353
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: PryModalStatusComponent, selector: "pry-modalStatus", inputs: { version: "version" }, outputs: { gotoConsult: "gotoConsult" }, ngImport: i0, template: "<div class=\"o-modal-wrapper\">\n <div>\n <h2>{{ '@pry.dataset.error.title' | i18n }}</h2>\n
|
|
2353
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: PryModalStatusComponent, selector: "pry-modalStatus", 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>{{ '@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 error of datasetErrors$ | async | slice : 0 : 5\">\n <td>\n {{ error.code }}\n </td>\n <td>\n {{ error.line }}\n </td>\n <td>\n {{ error.message }}\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" }] }); }
|
|
2354
2354
|
}
|
|
2355
2355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: PryModalStatusComponent, decorators: [{
|
|
2356
2356
|
type: Component,
|
|
2357
|
-
args: [{ selector: 'pry-modalStatus', template: "<div class=\"o-modal-wrapper\">\n <div>\n <h2>{{ '@pry.dataset.error.title' | i18n }}</h2>\n
|
|
2357
|
+
args: [{ selector: 'pry-modalStatus', 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>{{ '@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 error of datasetErrors$ | async | slice : 0 : 5\">\n <td>\n {{ error.code }}\n </td>\n <td>\n {{ error.line }}\n </td>\n <td>\n {{ error.message }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n" }]
|
|
2358
2358
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { gotoConsult: [{
|
|
2359
2359
|
type: Output
|
|
2360
2360
|
}], version: [{
|
|
@@ -3759,34 +3759,31 @@ class SearchService {
|
|
|
3759
3759
|
* @param quickOrder if it has to be applied
|
|
3760
3760
|
*/
|
|
3761
3761
|
getItems(id, quickOrder) {
|
|
3762
|
-
const params = this.
|
|
3763
|
-
let filterFormed = this.getItemsFilter(id);
|
|
3762
|
+
const params = this.getItemsFilter(id, this.getOrder(quickOrder));
|
|
3764
3763
|
if (!id) {
|
|
3765
3764
|
console.warn('Not sending items request with no datasource attached.');
|
|
3766
3765
|
return of({ items: {}, relations: [] });
|
|
3767
3766
|
}
|
|
3768
|
-
return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/data-sources/id/${id}/items
|
|
3767
|
+
return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/data-sources/id/${id}/items`), { params })), map((rs) => this.applyTransformations('current', rs)));
|
|
3769
3768
|
}
|
|
3770
|
-
getItemsSerializedParams(id, quickOrder) {
|
|
3771
|
-
return JSON.stringify(this.
|
|
3769
|
+
getItemsSerializedParams(id, quickOrder = {}) {
|
|
3770
|
+
return JSON.stringify(this.getItemsFilter(id, this.getOrder(quickOrder[id])));
|
|
3772
3771
|
}
|
|
3773
|
-
getItemsFilter(id) {
|
|
3774
|
-
let
|
|
3772
|
+
getItemsFilter(id, cumulative) {
|
|
3773
|
+
let params = cumulative ?? new HttpParams();
|
|
3775
3774
|
if (this.filters[id]) {
|
|
3776
|
-
filterFormed = [];
|
|
3777
3775
|
this.filters[id]
|
|
3778
3776
|
.filter((filter) => filter.value !== null && filter.value !== undefined)
|
|
3779
3777
|
.forEach((filter) => {
|
|
3780
|
-
|
|
3778
|
+
params = params.append('filter', `${filter.attribute},${filter.operator},${filter.value}`);
|
|
3781
3779
|
});
|
|
3782
|
-
filterFormed = '?' + filterFormed.join('&');
|
|
3783
3780
|
}
|
|
3784
|
-
return
|
|
3781
|
+
return params;
|
|
3785
3782
|
}
|
|
3786
|
-
|
|
3787
|
-
|
|
3783
|
+
getOrder(quickOrder, cumulative) {
|
|
3784
|
+
let params = cumulative ?? new HttpParams();
|
|
3788
3785
|
if (quickOrder) {
|
|
3789
|
-
params
|
|
3786
|
+
params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
|
|
3790
3787
|
}
|
|
3791
3788
|
return params;
|
|
3792
3789
|
}
|
|
@@ -8174,17 +8171,21 @@ class PryHttpErrorInterceptorService {
|
|
|
8174
8171
|
if (!message) {
|
|
8175
8172
|
message = error.message;
|
|
8176
8173
|
}
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8174
|
+
if (error.status >= 400) {
|
|
8175
|
+
this.snackbar.open({
|
|
8176
|
+
message: 'Statut: ' + error.status + '. Erreur: ' + message,
|
|
8177
|
+
type: 'error'
|
|
8178
|
+
});
|
|
8179
|
+
}
|
|
8181
8180
|
console.error(error);
|
|
8182
8181
|
}
|
|
8183
8182
|
else {
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8183
|
+
if (error.status >= 400) {
|
|
8184
|
+
this.snackbar.open({
|
|
8185
|
+
message: this.translateService.instant('@pry.errors.codes.' + error.status),
|
|
8186
|
+
type: 'error'
|
|
8187
|
+
});
|
|
8188
|
+
}
|
|
8188
8189
|
}
|
|
8189
8190
|
return throwError(() => error);
|
|
8190
8191
|
}));
|
|
@@ -9204,8 +9205,10 @@ class ManifestService {
|
|
|
9204
9205
|
}
|
|
9205
9206
|
else {
|
|
9206
9207
|
// The backend returned an unsuccessful response code.
|
|
9207
|
-
|
|
9208
|
-
|
|
9208
|
+
if (error.code !== 200) {
|
|
9209
|
+
console.error(`Backend returned code ${error.status}, body was: ${JSON.stringify(error.error)}`);
|
|
9210
|
+
}
|
|
9211
|
+
if (error.code >= 400) {
|
|
9209
9212
|
this.snackBar.open({
|
|
9210
9213
|
type: 'error',
|
|
9211
9214
|
message: this.translateService.instant('@pry.manifest.get.errorBack', {
|