@provoly/dashboard 0.18.0 → 0.18.1
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/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.mjs +3 -3
- package/esm2022/lib/core/components/about/about.component.mjs +8 -3
- package/esm2022/lib/core/i18n/fr.translations.mjs +8 -8
- package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widget-factory.service.mjs +23 -4
- package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widgets-definition.model.mjs +1 -1
- package/esm2022/lib/dashboard/store/dashboard.effects.mjs +9 -6
- package/fesm2022/provoly-dashboard-admin.mjs +2 -2
- package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +40 -17
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/lib/core/components/about/about.component.d.ts +1 -0
- package/lib/dashboard/components/widgets/widget-instanciator/widget-factory.service.d.ts +6 -1
- package/lib/dashboard/components/widgets/widget-instanciator/widgets-definition.model.d.ts +2 -0
- package/lib/dashboard/store/dashboard.effects.d.ts +3 -1
- package/package.json +36 -36
- package/schematics/ng-add/index.js +13 -3
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/index.spec.js +15 -0
- package/schematics/ng-add/index.spec.js.map +1 -1
- package/styles/components/_a-chips.scss +15 -0
- package/styles/components/_o-about.scss +59 -0
- package/styles/components/_o-pry-admin-classes-customize.scss +0 -54
- package/styles/main.scss +2 -1
- package/styles-theme/components-theme/_o-pry-admin-classes-customize.theme.scss +1 -1
|
@@ -529,13 +529,13 @@ const enTranslations$1 = {
|
|
|
529
529
|
const frTranslations$1 = {
|
|
530
530
|
'@pry': {
|
|
531
531
|
about: {
|
|
532
|
-
front: 'Librairie front
|
|
533
|
-
ref: 'Référentiel
|
|
534
|
-
data: 'Données
|
|
535
|
-
replay: 'Rejeu
|
|
536
|
-
exec: 'Exécution
|
|
537
|
-
transfo: 'Transformation
|
|
538
|
-
monitor: 'Supervision
|
|
532
|
+
front: 'Librairie front',
|
|
533
|
+
ref: 'Référentiel',
|
|
534
|
+
data: 'Données',
|
|
535
|
+
replay: 'Rejeu',
|
|
536
|
+
exec: 'Exécution',
|
|
537
|
+
transfo: 'Transformation',
|
|
538
|
+
monitor: 'Supervision',
|
|
539
539
|
noVersion: 'Version non trouvée'
|
|
540
540
|
},
|
|
541
541
|
header: {
|
|
@@ -7363,14 +7363,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
|
7363
7363
|
|
|
7364
7364
|
const WIDGET_DEFINITION = new InjectionToken('Widgets definition');
|
|
7365
7365
|
class WidgetFactoryService {
|
|
7366
|
-
constructor(injector, reference) {
|
|
7366
|
+
constructor(injector, reference, store) {
|
|
7367
7367
|
this.injector = injector;
|
|
7368
|
+
this.store = store;
|
|
7368
7369
|
this.reference$ = new BehaviorSubject({
|
|
7369
7370
|
placeholder: { name: 'placeholder', component: WidgetPlaceholderComponent },
|
|
7370
7371
|
filler: { name: 'filler', component: WidgetFillerComponent }
|
|
7371
7372
|
});
|
|
7372
7373
|
this.moduleRefCache = {};
|
|
7374
|
+
this.datasources = [];
|
|
7373
7375
|
this.putDefinitions(reference);
|
|
7376
|
+
this.store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => (this.datasources = datasources));
|
|
7374
7377
|
}
|
|
7375
7378
|
resolveComponent(manifest) {
|
|
7376
7379
|
if (this.moduleRefCache[manifest.type]) {
|
|
@@ -7403,7 +7406,20 @@ class WidgetFactoryService {
|
|
|
7403
7406
|
isModuleLoaded(type) {
|
|
7404
7407
|
return this.reference$.pipe(map((componentDefs) => !!componentDefs[type]));
|
|
7405
7408
|
}
|
|
7406
|
-
|
|
7409
|
+
datasourcesToAutoLoad(manifest) {
|
|
7410
|
+
const widgetDefinition = this.reference$.getValue()[manifest.type];
|
|
7411
|
+
const datasourcesArray = Array.isArray(manifest.datasource ?? [])
|
|
7412
|
+
? (manifest.datasource ?? [])
|
|
7413
|
+
: [manifest.datasource];
|
|
7414
|
+
return datasourcesArray.filter((datasource) => {
|
|
7415
|
+
const matching = this.datasources.find((ds) => ds.id === datasource);
|
|
7416
|
+
return (widgetDefinition.autoLoadDatasource === undefined ||
|
|
7417
|
+
widgetDefinition.autoLoadDatasource === 'all' ||
|
|
7418
|
+
(widgetDefinition.autoLoadDatasource === 'geo' && DatasourceUtils.isGeo(matching)) ||
|
|
7419
|
+
(widgetDefinition.autoLoadDatasource === 'not-geo' && !DatasourceUtils.isGeo(matching)));
|
|
7420
|
+
});
|
|
7421
|
+
}
|
|
7422
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: WidgetFactoryService, deps: [{ token: i0.Injector }, { token: WIDGET_DEFINITION }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7407
7423
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: WidgetFactoryService, providedIn: 'root' }); }
|
|
7408
7424
|
}
|
|
7409
7425
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: WidgetFactoryService, decorators: [{
|
|
@@ -7414,7 +7430,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
|
7414
7430
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
7415
7431
|
type: Inject,
|
|
7416
7432
|
args: [WIDGET_DEFINITION]
|
|
7417
|
-
}] }]; } });
|
|
7433
|
+
}] }, { type: i1.Store }]; } });
|
|
7418
7434
|
|
|
7419
7435
|
class WidgetInstanciatorComponent extends SubscriptionnerDirective {
|
|
7420
7436
|
set widgetIndex(manifest) {
|
|
@@ -9005,12 +9021,17 @@ class PryAboutComponent {
|
|
|
9005
9021
|
}
|
|
9006
9022
|
return this.i18nService.instant('@pry.about.noVersion');
|
|
9007
9023
|
}
|
|
9024
|
+
hasVersion(value) {
|
|
9025
|
+
const backVersion = value;
|
|
9026
|
+
const frontVersion = value;
|
|
9027
|
+
return !!value && (!!backVersion.chartVersion || !!frontVersion.libVersion);
|
|
9028
|
+
}
|
|
9008
9029
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: PryAboutComponent, deps: [{ token: i1.Store }, { token: PryI18nService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9009
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: PryAboutComponent, selector: "pry-about", ngImport: i0, template: "<div class=\"info-icon description-container description\">\n
|
|
9030
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: PryAboutComponent, selector: "pry-about", ngImport: i0, template: "<div class=\"o-about\">\n <div class=\"info-icon description-container description\">\n <span class=\"info-text\">i</span>\n </div>\n <div class=\"description-tooltip title-tooltip\">\n <ng-container *ngFor=\"let version of (version$ | async) ?? {} | keyvalue\">\n <div class=\"o-about__line\">\n {{ '@pry.about.' + version.key | i18n }}\n <p class=\"a-chips -md\" [class.-not-found]=\"!hasVersion(version.value)\">\n {{ displayVersion(version.value) }}\n </p>\n </div>\n </ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
|
|
9010
9031
|
}
|
|
9011
9032
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: PryAboutComponent, decorators: [{
|
|
9012
9033
|
type: Component,
|
|
9013
|
-
args: [{ selector: 'pry-about', template: "<div class=\"info-icon description-container description\">\n
|
|
9034
|
+
args: [{ selector: 'pry-about', template: "<div class=\"o-about\">\n <div class=\"info-icon description-container description\">\n <span class=\"info-text\">i</span>\n </div>\n <div class=\"description-tooltip title-tooltip\">\n <ng-container *ngFor=\"let version of (version$ | async) ?? {} | keyvalue\">\n <div class=\"o-about__line\">\n {{ '@pry.about.' + version.key | i18n }}\n <p class=\"a-chips -md\" [class.-not-found]=\"!hasVersion(version.value)\">\n {{ displayVersion(version.value) }}\n </p>\n </div>\n </ng-container>\n </div>\n</div>\n" }]
|
|
9014
9035
|
}], ctorParameters: function () { return [{ type: i1.Store }, { type: PryI18nService }]; } });
|
|
9015
9036
|
|
|
9016
9037
|
const PRY_ABOUT_COMPONENTS = [PryAboutComponent];
|
|
@@ -10349,7 +10370,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
|
10349
10370
|
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
|
|
10350
10371
|
|
|
10351
10372
|
class DashboardEffects {
|
|
10352
|
-
constructor(dashboardInitService, actions$, store, manifestService, itemService, titleService, translateService, snackBar, router, refreshService, toolboxManifestService, busService, searchService, pryDialog, wmsService) {
|
|
10373
|
+
constructor(dashboardInitService, actions$, store, manifestService, itemService, titleService, translateService, snackBar, router, refreshService, toolboxManifestService, busService, searchService, pryDialog, wmsService, widgetFactoryService) {
|
|
10353
10374
|
this.dashboardInitService = dashboardInitService;
|
|
10354
10375
|
this.actions$ = actions$;
|
|
10355
10376
|
this.store = store;
|
|
@@ -10365,6 +10386,7 @@ class DashboardEffects {
|
|
|
10365
10386
|
this.searchService = searchService;
|
|
10366
10387
|
this.pryDialog = pryDialog;
|
|
10367
10388
|
this.wmsService = wmsService;
|
|
10389
|
+
this.widgetFactoryService = widgetFactoryService;
|
|
10368
10390
|
this.join$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.join), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.selectedItemIds), this.store.select(DashboardSelectors.presentation), this.store.select(DashboardSelectors.displayOptions)), filter$1(([action, rank, tenants, manifest, resultSets, display]) => rank === 0), map$1(([action, rank, tenants, manifest, resultSets, selectedIds, presentation, display]) => DashboardActions.updateManifestAfterTenantJoin({
|
|
10369
10391
|
tenants,
|
|
10370
10392
|
manifest: {
|
|
@@ -10426,8 +10448,9 @@ class DashboardEffects {
|
|
|
10426
10448
|
...new Set(manifest.windows
|
|
10427
10449
|
.map((winManifest) => (winManifest ?? {}).widgets ?? [])
|
|
10428
10450
|
.reduce((p, c) => [...p, ...c], [])
|
|
10429
|
-
.map((widManifest) => widManifest
|
|
10430
|
-
|
|
10451
|
+
.map((widManifest) => this.widgetFactoryService.datasourcesToAutoLoad(widManifest))
|
|
10452
|
+
.reduce((p, c) => [...p, ...c], []))
|
|
10453
|
+
]
|
|
10431
10454
|
.filter((resultSet) => !!resultSet &&
|
|
10432
10455
|
resultSet !== '' &&
|
|
10433
10456
|
(!resultSets[resultSet] ||
|
|
@@ -10674,12 +10697,12 @@ class DashboardEffects {
|
|
|
10674
10697
|
dashboardInitService.init();
|
|
10675
10698
|
refreshService.start();
|
|
10676
10699
|
}
|
|
10677
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DashboardEffects, deps: [{ token: DashboardInitService }, { token: i1$3.Actions }, { token: i1.Store }, { token: ManifestService }, { token: ItemService }, { token: PryTitleService }, { token: PryI18nService }, { token: PrySnackbarService }, { token: i2.Router }, { token: RefreshService }, { token: ToolboxManifestService }, { token: BusService }, { token: SearchService }, { token: PryDialogService }, { token: WmsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10700
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DashboardEffects, deps: [{ token: DashboardInitService }, { token: i1$3.Actions }, { token: i1.Store }, { token: ManifestService }, { token: ItemService }, { token: PryTitleService }, { token: PryI18nService }, { token: PrySnackbarService }, { token: i2.Router }, { token: RefreshService }, { token: ToolboxManifestService }, { token: BusService }, { token: SearchService }, { token: PryDialogService }, { token: WmsService }, { token: WidgetFactoryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10678
10701
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DashboardEffects }); }
|
|
10679
10702
|
}
|
|
10680
10703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DashboardEffects, decorators: [{
|
|
10681
10704
|
type: Injectable
|
|
10682
|
-
}], ctorParameters: function () { return [{ type: DashboardInitService }, { type: i1$3.Actions }, { type: i1.Store }, { type: ManifestService }, { type: ItemService }, { type: PryTitleService }, { type: PryI18nService }, { type: PrySnackbarService }, { type: i2.Router }, { type: RefreshService }, { type: ToolboxManifestService }, { type: BusService }, { type: SearchService }, { type: PryDialogService }, { type: WmsService }]; } });
|
|
10705
|
+
}], ctorParameters: function () { return [{ type: DashboardInitService }, { type: i1$3.Actions }, { type: i1.Store }, { type: ManifestService }, { type: ItemService }, { type: PryTitleService }, { type: PryI18nService }, { type: PrySnackbarService }, { type: i2.Router }, { type: RefreshService }, { type: ToolboxManifestService }, { type: BusService }, { type: SearchService }, { type: PryDialogService }, { type: WmsService }, { type: WidgetFactoryService }]; } });
|
|
10683
10706
|
|
|
10684
10707
|
const dashboardFeatureKey = '@pry/dashboard';
|
|
10685
10708
|
const dashboardInitialState = {
|