@provoly/dashboard 1.4.18 → 1.4.19
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/admin/components/admin-classes/admin-classes-view/admin-attributes-edit/admin-attributes-edit.component.d.ts +2 -3
- package/admin/components/admin-classes/admin-classes-view/admin-attributes-new/admin-attributes-new.component.d.ts +2 -3
- package/admin/components/admin-classes/store/admin-class.effects.d.ts +22 -8
- package/admin/components/admin-dataset/store/admin-dataset.effects.d.ts +13 -5
- package/admin/components/admin-fields/store/fields.effects.d.ts +7 -5
- package/admin/store/admin.effects.d.ts +3 -1
- package/esm2022/admin/components/admin-abac-rules/admin-abac-rules-edit/admin-abac-rules-edit.component.mjs +3 -3
- package/esm2022/admin/components/admin-abac-rules/admin-abac-rules-new/admin-abac-rules-new.component.mjs +3 -3
- package/esm2022/admin/components/admin-abac-rules/admin-abac-rules-view/admin-abac-rules-view.component.mjs +3 -3
- package/esm2022/admin/components/admin-classes/admin-classes-customize/admin-classes-customize.component.mjs +4 -4
- package/esm2022/admin/components/admin-classes/admin-classes-customize/symbol/admin-classes-customize-symbol.component.mjs +2 -2
- package/esm2022/admin/components/admin-classes/admin-classes-edit/admin-classes-edit.component.mjs +2 -2
- package/esm2022/admin/components/admin-classes/admin-classes-form/admin-classes-form.component.mjs +2 -2
- package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-edit/admin-attributes-edit.component.mjs +5 -6
- package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.mjs +3 -3
- package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-new/admin-attributes-new.component.mjs +5 -6
- package/esm2022/admin/components/admin-classes/admin-classes-view/admin-classes-view.component.mjs +4 -4
- package/esm2022/admin/components/admin-classes/admin-classes.component.mjs +3 -3
- package/esm2022/admin/components/admin-classes/store/admin-class.effects.mjs +14 -13
- package/esm2022/admin/components/admin-dataset/admin-dataset.component.mjs +3 -3
- package/esm2022/admin/components/admin-dataset/admin-form-dataset/admin-form-dataset.component.mjs +3 -3
- package/esm2022/admin/components/admin-dataset/store/admin-dataset.effects.mjs +7 -8
- package/esm2022/admin/components/admin-environment/store/environment.effects.mjs +2 -2
- package/esm2022/admin/components/admin-fields/admin-fields-edit/admin-fields-edit.component.mjs +2 -2
- package/esm2022/admin/components/admin-fields/admin-fields-form/admin-fields-form.component.mjs +2 -2
- package/esm2022/admin/components/admin-fields/admin-fields.component.mjs +4 -4
- package/esm2022/admin/components/admin-fields/store/fields.effects.mjs +7 -10
- package/esm2022/admin/components/admin-links/admin-links-new/admin-links-new.component.mjs +3 -3
- package/esm2022/admin/components/admin-links/admin-links.component.mjs +3 -3
- package/esm2022/admin/components/admin-links/store/links.effects.mjs +2 -2
- package/esm2022/admin/components/admin-menu/admin-menu.component.mjs +2 -2
- package/esm2022/admin/components/admin-metadata/admin-metadata.component.mjs +2 -2
- package/esm2022/admin/components/admin-metadata-rules/store/metadata-rules.effects.mjs +2 -2
- package/esm2022/admin/components/admin-metadata-user/store/admin-metadata-user.effects.mjs +2 -2
- package/esm2022/admin/components/admin-predicates/store/predicates.effects.mjs +2 -2
- package/esm2022/admin/components/admin-relation-types/admin-relation-types.component.mjs +2 -2
- package/esm2022/admin/components/admin-user/store/admin-user.effects.mjs +2 -2
- package/esm2022/admin/components/shared/add-category-modal/add-category-modal.component.mjs +2 -2
- package/esm2022/admin/store/admin.effects.mjs +2 -2
- package/esm2022/components/metadata-editor/store/metadata.effects.mjs +2 -2
- package/esm2022/components/text-editor/component/text-editor.component.mjs +2 -2
- package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +3 -4
- package/esm2022/dataset/components/dataset.component.mjs +4 -4
- package/esm2022/filters/autocomplete/autocomplete.component.mjs +4 -4
- package/esm2022/filters/number/number-filter.component.mjs +2 -2
- package/esm2022/filters/text/text-filter.component.mjs +2 -2
- package/esm2022/import/components/form/import-form.component.mjs +2 -2
- package/esm2022/import/components/list/import-list.component.mjs +2 -2
- package/esm2022/import/store/import.effects.mjs +2 -2
- package/esm2022/lib/core/components/select/select.component.mjs +2 -2
- package/esm2022/lib/core/components/share/access-rights-share-modal/access-rights-share-modal.component.mjs +3 -3
- package/esm2022/lib/core/components/snackbar/snackbar.service.mjs +2 -2
- package/esm2022/lib/core/components/upload/upload.component.mjs +2 -2
- package/esm2022/lib/core/errors/http-error-interceptor.service.mjs +2 -2
- package/esm2022/lib/core/model/filter.interface.mjs +1 -1
- package/esm2022/lib/core/store/aggregation/backend-aggregation.service.mjs +3 -4
- package/esm2022/lib/core/store/category/category.actions.mjs +3 -3
- package/esm2022/lib/core/store/category/category.effects.mjs +10 -6
- package/esm2022/lib/core/store/class/class.actions.mjs +3 -3
- package/esm2022/lib/core/store/class/class.effects.mjs +10 -6
- package/esm2022/lib/core/store/config/config.actions.mjs +2 -2
- package/esm2022/lib/core/store/config/config.effects.mjs +13 -8
- package/esm2022/lib/core/store/config/open-map-tiles.service.mjs +2 -2
- package/esm2022/lib/core/store/data-source/data-source.actions.mjs +8 -8
- package/esm2022/lib/core/store/data-source/data-source.effects.mjs +21 -21
- package/esm2022/lib/core/store/field/field.actions.mjs +3 -3
- package/esm2022/lib/core/store/field/field.effects.mjs +10 -6
- package/esm2022/lib/core/store/image/image.effects.mjs +2 -2
- package/esm2022/lib/core/store/item/item.effects.mjs +2 -2
- package/esm2022/lib/core/store/relation-types/relation-types.actions.mjs +4 -4
- package/esm2022/lib/core/store/relation-types/relation-types.effects.mjs +11 -10
- package/esm2022/lib/core/store/search/search.actions.mjs +1 -1
- package/esm2022/lib/core/store/search/search.effects.mjs +3 -2
- package/esm2022/lib/core/store/search/search.selectors.mjs +3 -1
- package/esm2022/lib/core/store/search/search.service.mjs +4 -9
- package/esm2022/lib/dashboard/action-bus/effect/action-bus.effects.mjs +2 -2
- package/esm2022/lib/dashboard/components/context-menu/context-menu.component.mjs +2 -2
- package/esm2022/lib/dashboard/components/dashboard.component.mjs +8 -9
- package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-list/datasource-list.component.mjs +3 -4
- package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-selector.component.mjs +2 -2
- package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widget-instanciator.component.mjs +2 -2
- package/esm2022/lib/dashboard/store/dashboard.effects.mjs +2 -2
- package/esm2022/lib/dashboard/store/manifest.service.mjs +2 -2
- package/esm2022/lib/dashboard/store/refresh.service.mjs +2 -2
- package/esm2022/lib/dashboard/store/wms.service.mjs +2 -2
- package/esm2022/notification/components/notification/content/notification-content.component.mjs +2 -2
- package/esm2022/pipeline/components/pipeline-editor/pipeline-editor.component.mjs +3 -5
- package/esm2022/pipeline/factory/pipeline-component-factory.service.mjs +2 -2
- package/esm2022/pipeline/store/pipeline.effects.mjs +2 -2
- package/esm2022/pipeline-components/input-datasource/component/input-datasource.component.mjs +2 -3
- package/esm2022/pipeline-components/input-datasource/input-datasource.module.mjs +2 -2
- package/esm2022/pipeline-components/output-dataset/component/output-dataset.component.mjs +2 -2
- package/esm2022/pipeline-components/output-dataset/output-dataset.module.mjs +2 -2
- package/esm2022/restitution/components/restitution/restitution.component.mjs +5 -5
- package/esm2022/search/search-fulltext/store/search-fulltext.effects.mjs +2 -2
- package/esm2022/search/search-home/search-home.component.mjs +3 -4
- package/esm2022/search/search-mono-class/components/search-mono-class/search-mono-class.component.mjs +2 -2
- package/esm2022/search/search-mono-class/components/search-order/search-order.component.mjs +2 -2
- package/esm2022/search/search-mono-class/components/search-select-attribute/search-select-attribute.component.mjs +1 -1
- package/esm2022/search/search-mono-class/store/search-mono-class.effects.mjs +2 -2
- package/esm2022/search/search-multi-class/store/search-multi-class.effects.mjs +2 -2
- package/esm2022/search/search-tools/search-tools.component.mjs +5 -6
- package/esm2022/toolbox/components/filter-settings/filter-settings.component.mjs +2 -2
- package/esm2022/toolbox/components/named-query/named-query.component.mjs +2 -2
- package/esm2022/toolbox/components/select-grid-layout/select-grid-layout.component.mjs +2 -2
- package/esm2022/toolbox/components/toolbox.component.mjs +2 -2
- package/esm2022/tooltips/attribute/attribute-tooltip.component.mjs +2 -2
- package/esm2022/widgets/widget-analytic/component/widget-analytic.component.mjs +2 -2
- package/esm2022/widgets/widget-chart/component/widget-chart.component.mjs +2 -2
- package/esm2022/widgets/widget-detail/component/widget-detail.component.mjs +2 -2
- package/esm2022/widgets/widget-graph/component/widget-graph.component.mjs +10 -13
- package/esm2022/widgets/widget-image/component/widget-image.component.mjs +2 -2
- package/esm2022/widgets/widget-table/component/widget-table.component.mjs +3 -3
- package/esm2022/widgets/widget-table/get-value/get-value.pipe.mjs +2 -2
- package/esm2022/widgets/widget-table/resizable/resizable.directive.mjs +2 -2
- package/esm2022/widgets/widget-template/component/widget-template.component.mjs +2 -2
- package/esm2022/widgets/widget-tile/component/widget-tile.component.mjs +2 -2
- package/esm2022/widgets/widget-vega/component/widget-vega.component.mjs +2 -2
- package/fesm2022/provoly-dashboard-admin.mjs +121 -123
- package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-metadata-editor.mjs +12 -13
- package/fesm2022/provoly-dashboard-components-metadata-editor.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-text-editor.mjs +1 -2
- package/fesm2022/provoly-dashboard-components-text-editor.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-dataset.mjs +5 -6
- package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-autocomplete.mjs +3 -3
- package/fesm2022/provoly-dashboard-filters-autocomplete.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-number.mjs +1 -2
- package/fesm2022/provoly-dashboard-filters-number.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-text.mjs +1 -2
- package/fesm2022/provoly-dashboard-filters-text.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-import.mjs +5 -6
- package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-notification.mjs +3 -4
- package/fesm2022/provoly-dashboard-notification.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-pipeline-components-input-datasource.mjs +2 -3
- package/fesm2022/provoly-dashboard-pipeline-components-input-datasource.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-pipeline-components-output-dataset.mjs +2 -2
- package/fesm2022/provoly-dashboard-pipeline-components-output-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-pipeline.mjs +16 -18
- package/fesm2022/provoly-dashboard-pipeline.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-restitution.mjs +4 -4
- package/fesm2022/provoly-dashboard-restitution.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-search.mjs +19 -20
- package/fesm2022/provoly-dashboard-search.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-toolbox.mjs +3 -4
- package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-tooltips-attribute.mjs +1 -2
- package/fesm2022/provoly-dashboard-tooltips-attribute.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-analytic.mjs +1 -2
- package/fesm2022/provoly-dashboard-widgets-widget-analytic.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-chart.mjs +1 -2
- package/fesm2022/provoly-dashboard-widgets-widget-chart.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-detail.mjs +1 -2
- package/fesm2022/provoly-dashboard-widgets-widget-detail.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-graph.mjs +8 -12
- package/fesm2022/provoly-dashboard-widgets-widget-graph.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-image.mjs +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-image.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-table.mjs +2 -3
- package/fesm2022/provoly-dashboard-widgets-widget-table.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-template.mjs +1 -2
- package/fesm2022/provoly-dashboard-widgets-widget-template.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs +1 -2
- package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs +1 -2
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +978 -972
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/lib/core/model/filter.interface.d.ts +1 -0
- package/lib/core/store/category/category.actions.d.ts +7 -3
- package/lib/core/store/category/category.effects.d.ts +4 -2
- package/lib/core/store/class/class.actions.d.ts +7 -3
- package/lib/core/store/class/class.effects.d.ts +4 -2
- package/lib/core/store/config/config.actions.d.ts +5 -1
- package/lib/core/store/config/config.effects.d.ts +12 -4
- package/lib/core/store/data-source/data-source.actions.d.ts +23 -11
- package/lib/core/store/data-source/data-source.effects.d.ts +23 -15
- package/lib/core/store/field/field.actions.d.ts +7 -3
- package/lib/core/store/field/field.effects.d.ts +4 -2
- package/lib/core/store/relation-types/relation-types.actions.d.ts +9 -5
- package/lib/core/store/relation-types/relation-types.effects.d.ts +8 -6
- package/lib/core/store/search/search.actions.d.ts +2 -0
- package/lib/core/store/search/search.selectors.d.ts +5 -0
- package/lib/core/store/search/search.service.d.ts +1 -1
- package/package.json +41 -41
- package/search/search-mono-class/store/search-mono-class.effects.d.ts +1 -1
- package/widgets/widget-graph/component/widget-graph.component.d.ts +2 -5
|
@@ -3,7 +3,7 @@ import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
|
3
3
|
import * as i3 from '@angular/common';
|
|
4
4
|
import { CommonModule, AsyncPipe, DOCUMENT } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@angular/common/http';
|
|
6
|
-
import { HttpHeaders,
|
|
6
|
+
import { HttpHeaders, HttpParams, HttpUrlEncodingCodec, 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, NgModule, Injector, EventEmitter, Output, TemplateRef, ViewChild, SecurityContext, ContentChildren, forwardRef, HostListener, ViewContainerRef, ViewChildren, ViewEncapsulation, createNgModule } from '@angular/core';
|
|
9
9
|
import * as i2 from '@angular/router';
|
|
@@ -12,13 +12,12 @@ import * as i1$2 from '@ngrx/effects';
|
|
|
12
12
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
13
13
|
import * as i1 from '@ngrx/store';
|
|
14
14
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
15
|
-
import { of, Subscription, filter, combineLatest, debounceTime, BehaviorSubject, map, Subject, windowTime, switchMap, mergeMap, from as from$1,
|
|
15
|
+
import { of, Subscription, filter, combineLatest, debounceTime, BehaviorSubject, map, Subject, windowTime, switchMap, distinctUntilChanged, mergeMap, from as from$1, withLatestFrom, catchError, forkJoin, startWith, tap, throwError, take, combineLatestWith, merge, groupBy, EMPTY, share, ReplaySubject, delay, fromEvent, auditTime, interval } from 'rxjs';
|
|
16
16
|
import * as i3$1 from '@angular/platform-browser';
|
|
17
17
|
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
18
18
|
import * as i3$2 from '@angular/cdk/a11y';
|
|
19
19
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
20
20
|
import equal from 'fast-deep-equal/es6';
|
|
21
|
-
import { distinctUntilChanged, filter as filter$1, debounceTime as debounceTime$1, mergeMap as mergeMap$1, map as map$1, catchError, withLatestFrom, tap, delay as delay$1 } from 'rxjs/operators';
|
|
22
21
|
import { animation, style, animate, trigger, transition, useAnimation } from '@angular/animations';
|
|
23
22
|
import { Style, Icon } from 'ol/style';
|
|
24
23
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
@@ -1645,11 +1644,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1645
1644
|
}] });
|
|
1646
1645
|
|
|
1647
1646
|
const DataSourceActions = {
|
|
1648
|
-
load: createAction('[Datasource] load'),
|
|
1647
|
+
load: createAction('[Datasource] load', props()),
|
|
1649
1648
|
namedQuery: {
|
|
1650
|
-
load: createAction('[NamedQuery] load'),
|
|
1651
|
-
loaded: createAction('[NamedQuery] loaded', props()),
|
|
1652
|
-
failure: createAction('[NamedQuery] failure', props()),
|
|
1649
|
+
load: createAction('[NamedQuery] (bus) load', props()),
|
|
1650
|
+
loaded: createAction('[NamedQuery] (bus) loaded', props()),
|
|
1651
|
+
failure: createAction('[NamedQuery] (bus) failure', props()),
|
|
1653
1652
|
post: createAction('[NamedQuery] post', props()),
|
|
1654
1653
|
delete: createAction('[NamedQuery] delete', props()),
|
|
1655
1654
|
addFavorite: createAction('[NamedQuery] add favorite', props()),
|
|
@@ -1662,9 +1661,9 @@ const DataSourceActions = {
|
|
|
1662
1661
|
stopRename: createAction('[NamedQuery] stop rename')
|
|
1663
1662
|
},
|
|
1664
1663
|
dataset: {
|
|
1665
|
-
loadDataset: createAction('[Dataset] load datasets'),
|
|
1666
|
-
loadedDataset: createAction('[Dataset] loaded datasets', props()),
|
|
1667
|
-
failure: createAction('[Dataset] failure effect Dataset', props()),
|
|
1664
|
+
loadDataset: createAction('[Dataset] (bus) load datasets', props()),
|
|
1665
|
+
loadedDataset: createAction('[Dataset] (bus) loaded datasets', props()),
|
|
1666
|
+
failure: createAction('[Dataset] (bus) failure effect Dataset', props()),
|
|
1668
1667
|
listVersions: createAction('[Dataset] Get Dataset versions', props()),
|
|
1669
1668
|
listVersionsSuccess: createAction('[Dataset] Get Dataset versions Success', props()),
|
|
1670
1669
|
listVersionsFailure: createAction('[Dataset] Get Dataset versions Failure'),
|
|
@@ -1910,7 +1909,7 @@ const ConfigActions = {
|
|
|
1910
1909
|
defineUrls: createAction('[Config] (bus) defining urls', props()),
|
|
1911
1910
|
updateIcons: createAction('[Config] (bus) updating icons', props()),
|
|
1912
1911
|
saveIcons: createAction('[Config] (bus) saving icons', props()),
|
|
1913
|
-
loadCustomization: createAction('[Config] (bus) load all class customization'),
|
|
1912
|
+
loadCustomization: createAction('[Config] (bus) load all class customization', props()),
|
|
1914
1913
|
loadedCustomization: createAction('[Config] (bus) customization loaded', props()),
|
|
1915
1914
|
getMapStyles: createAction('[Config] get map styles'),
|
|
1916
1915
|
defineMapStyles: createAction('[Config] (bus) defining map styles', props()),
|
|
@@ -2972,7 +2971,7 @@ class PryUploadComponent {
|
|
|
2972
2971
|
asyncEmit(file) {
|
|
2973
2972
|
const tmpSub = this.store
|
|
2974
2973
|
.select(ImagesSelectors.lastAdded)
|
|
2975
|
-
.pipe(filter
|
|
2974
|
+
.pipe(filter((image) => !!image))
|
|
2976
2975
|
.subscribe((name) => {
|
|
2977
2976
|
this.uploaded.emit(name);
|
|
2978
2977
|
this.uploadedFile.emit(file);
|
|
@@ -3004,9 +3003,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
3004
3003
|
}] } });
|
|
3005
3004
|
|
|
3006
3005
|
const ClassActions = {
|
|
3007
|
-
load: createAction('[Class] Load Classes'),
|
|
3006
|
+
load: createAction('[Class] (bus) Load Classes', props()),
|
|
3008
3007
|
loadSuccess: createAction('[Class Api] (bus) Load Classes Success', props()),
|
|
3009
|
-
loadFailure: createAction('[Class Api] Load Classes Failure', props()),
|
|
3008
|
+
loadFailure: createAction('[Class Api] (bus) Load Classes Failure', props()),
|
|
3010
3009
|
loadDatasetCount: createAction('[Class Api] Load DatasetCount'),
|
|
3011
3010
|
loadDatasetCountSuccess: createAction('[Class Api] Load DatasetCount Success', props()),
|
|
3012
3011
|
loadDatasetCountFailure: createAction('[Class Api] Load DatasetCount Failure', props())
|
|
@@ -3377,44 +3376,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
3377
3376
|
}] } });
|
|
3378
3377
|
|
|
3379
3378
|
const CategoryActions = {
|
|
3380
|
-
load: createAction('[Category] Load Categories'),
|
|
3379
|
+
load: createAction('[Category] (bus) Load Categories', props()),
|
|
3381
3380
|
loadSuccess: createAction('[Category Api] (bus) Load Categories Success', props()),
|
|
3382
|
-
loadFailure: createAction('[Category Api] Load Categories Failure', props())
|
|
3381
|
+
loadFailure: createAction('[Category Api] (bus) Load Categories Failure', props())
|
|
3383
3382
|
};
|
|
3384
3383
|
|
|
3385
|
-
class CategoryService {
|
|
3386
|
-
constructor(httpClient, store) {
|
|
3387
|
-
this.httpClient = httpClient;
|
|
3388
|
-
this.store = store;
|
|
3389
|
-
}
|
|
3390
|
-
getCategories() {
|
|
3391
|
-
return this.store
|
|
3392
|
-
.select(ConfigSelectors.refUrl)
|
|
3393
|
-
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/categories`))));
|
|
3394
|
-
}
|
|
3395
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3396
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, providedIn: 'root' }); }
|
|
3397
|
-
}
|
|
3398
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, decorators: [{
|
|
3399
|
-
type: Injectable,
|
|
3400
|
-
args: [{
|
|
3401
|
-
providedIn: 'root'
|
|
3402
|
-
}]
|
|
3403
|
-
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
3404
|
-
|
|
3405
|
-
class CategoryEffects {
|
|
3406
|
-
constructor(actions$, categoryService) {
|
|
3407
|
-
this.actions$ = actions$;
|
|
3408
|
-
this.categoryService = categoryService;
|
|
3409
|
-
this.loadCategories$ = createEffect(() => this.actions$.pipe(ofType(CategoryActions.load), debounceTime$1(200), mergeMap$1((action) => this.categoryService.getCategories().pipe(map$1((categories) => CategoryActions.loadSuccess({ categories })), catchError((error) => [CategoryActions.loadFailure({ error: error })])))));
|
|
3410
|
-
}
|
|
3411
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, deps: [{ token: i1$2.Actions }, { token: CategoryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3412
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects }); }
|
|
3413
|
-
}
|
|
3414
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, decorators: [{
|
|
3415
|
-
type: Injectable
|
|
3416
|
-
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: CategoryService }] });
|
|
3417
|
-
|
|
3418
3384
|
const categoriesFeatureKey = '@pry/model/categories';
|
|
3419
3385
|
function sortByName$1(a, b) {
|
|
3420
3386
|
return a.name.localeCompare(b.name);
|
|
@@ -3431,49 +3397,410 @@ function categoryReducer(state, action) {
|
|
|
3431
3397
|
return internalReducer$2(state, action);
|
|
3432
3398
|
}
|
|
3433
3399
|
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
getClasses() {
|
|
3443
|
-
return this.store
|
|
3444
|
-
.select(ConfigSelectors.refUrl)
|
|
3445
|
-
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class`))));
|
|
3446
|
-
}
|
|
3447
|
-
getDatasetCounts() {
|
|
3448
|
-
return this.store
|
|
3449
|
-
.select(ConfigSelectors.refUrl)
|
|
3450
|
-
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class/datasets/count`))));
|
|
3451
|
-
}
|
|
3452
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3453
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, providedIn: 'root' }); }
|
|
3454
|
-
}
|
|
3455
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, decorators: [{
|
|
3456
|
-
type: Injectable,
|
|
3457
|
-
args: [{
|
|
3458
|
-
providedIn: 'root'
|
|
3459
|
-
}]
|
|
3460
|
-
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
3400
|
+
const feature$5 = createFeatureSelector(categoriesFeatureKey);
|
|
3401
|
+
const entities$1 = createSelector(feature$5, selectEntities$1);
|
|
3402
|
+
const categories = createSelector(feature$5, selectAll$1);
|
|
3403
|
+
const CategorySelectors = {
|
|
3404
|
+
feature: feature$5,
|
|
3405
|
+
entities: entities$1,
|
|
3406
|
+
categories
|
|
3407
|
+
};
|
|
3461
3408
|
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3409
|
+
var DashboardGridLayout;
|
|
3410
|
+
(function (DashboardGridLayout) {
|
|
3411
|
+
DashboardGridLayout["FULL"] = "1";
|
|
3412
|
+
DashboardGridLayout["THIRD_VERTICAL"] = "1/3v";
|
|
3413
|
+
DashboardGridLayout["THIRD_HORIZONTAL"] = "1/3h";
|
|
3414
|
+
DashboardGridLayout["HALF_VERTICAL"] = "1/2v";
|
|
3415
|
+
DashboardGridLayout["HALF_HORIZONTAL"] = "1/2h";
|
|
3416
|
+
DashboardGridLayout["QUARTER"] = "1/4";
|
|
3417
|
+
DashboardGridLayout["MANUAL"] = "0";
|
|
3418
|
+
})(DashboardGridLayout || (DashboardGridLayout = {}));
|
|
3419
|
+
|
|
3420
|
+
var ViewMode;
|
|
3421
|
+
(function (ViewMode) {
|
|
3422
|
+
ViewMode["CATALOG"] = "catalog";
|
|
3423
|
+
ViewMode["CONSULT"] = "consult";
|
|
3424
|
+
ViewMode["CREATION"] = "creation";
|
|
3425
|
+
ViewMode["EDITION"] = "edition";
|
|
3426
|
+
ViewMode["EDITOR"] = "editor";
|
|
3427
|
+
ViewMode["SEARCH"] = "search";
|
|
3428
|
+
ViewMode["CUSTOM"] = "custom";
|
|
3429
|
+
})(ViewMode || (ViewMode = {}));
|
|
3430
|
+
const DashboardActions = {
|
|
3431
|
+
join: createAction('[Dashboard] joined', props()),
|
|
3432
|
+
leave: createAction('[Dashboard] leave', props()),
|
|
3433
|
+
updateManifest: createAction('[Dashboard] (bus) updating manifest', props()),
|
|
3434
|
+
updateManifestAfterFetch: createAction('[Dashboard] (bus) updating manifest after fetch', props()),
|
|
3435
|
+
updateManifestWithoutActivation: createAction('[Dashboard] (bus) updating manifest but do not activate it', props()),
|
|
3436
|
+
updateManifestAfterTenantJoin: createAction('[Dashboard] (bus) updating manifest after tenant join', props()),
|
|
3437
|
+
updateManifestAfterTenantLeave: createAction('[Dashboard] (bus) updating manifest after tenant leave', props()),
|
|
3438
|
+
selectPresentation: createAction('[Dashboard] (bus) selectPresentation', props()),
|
|
3439
|
+
setInitialPresentation: createAction('[Dashboard] (bus) set initial presentation', props()),
|
|
3440
|
+
declareSenderId: createAction('[Dashboard] self-updating manifest', props()),
|
|
3441
|
+
updateDashboardManifest: createAction('[Dashboard] updating dashboard view', props()),
|
|
3442
|
+
updateWidgetManifest: createAction('[Dashboard] updating widget view', props()),
|
|
3443
|
+
addWidgetToPresentation: createAction('[Dashboard] add widget to presentation', props()),
|
|
3444
|
+
updateWidgetInPresentation: createAction('[Dashboard] update widget in presentation', props()),
|
|
3445
|
+
requestAllRoutes: createAction('[Dashboard] (bus) requesting route update'),
|
|
3446
|
+
requestManifestsToEmit: createAction('[Dashboard] (bus) pre-save manifest, asking all widgets to emit'),
|
|
3447
|
+
updateRouteManifest: createAction('[Dashboard] (bus) updating route', props()),
|
|
3448
|
+
fetchManifestsList: createAction('[Dashboard] (bus) fetching available manifests'),
|
|
3449
|
+
setRefreshRate: createAction('[Dashboard] (bus) setting refreshRate', props()),
|
|
3450
|
+
updateManifestsList: createAction('[Dashboard] (bus) received manifests list', props()),
|
|
3451
|
+
fetchStaticManifest: createAction('[Dashboard] (bus) fetching staticManifest', props()),
|
|
3452
|
+
fetchMoreItems: createAction('[Dashboard] (bus) fetching more items', props()),
|
|
3453
|
+
endLoading: createAction('[Dashboard] end loading'),
|
|
3454
|
+
updateStaticManifest: createAction('[Dashboard] (bus) received staticManifest', props()),
|
|
3455
|
+
loadManifest: createAction('[Dashboard] (bus) load manifest', props()),
|
|
3456
|
+
loadAndActivateManifest: createAction('[Dashboard] (bus) load and activate manifest', props()),
|
|
3457
|
+
downloadManifest: createAction('[Dashboard] download manifest', props()),
|
|
3458
|
+
confirmManifestDeletion: createAction('[Dashboard] confirm manifest deletion', props()),
|
|
3459
|
+
deleteManifest: createAction('[Dashboard] deleting manifest', props()),
|
|
3460
|
+
saveManifest: createAction('[Dashboard] save manifest', props()),
|
|
3461
|
+
solveCollisions: createAction('[Dashboard] solving collisions'),
|
|
3462
|
+
clearManifest: createAction('[Dashboard] clear manifest'),
|
|
3463
|
+
followManifestRoute: createAction('[Dashboard] (bus) follow manifest route'),
|
|
3464
|
+
moveWidget: createAction('[Dashboard] moving widget', props()),
|
|
3465
|
+
maximizeWidget: createAction('[Dashboard] maximize widget', props()),
|
|
3466
|
+
assertResultSets: createAction('[Dashboard] assert resultSet', props()),
|
|
3467
|
+
updateResultSet: createAction('[Dashboard] (bus) received named resultSet (not-active-action)', props()),
|
|
3468
|
+
addRelationsToResultSets: createAction('[Dashboard] (bus) add relations to resultSet', props()),
|
|
3469
|
+
removeRelationsFromResultSets: createAction('[Dashboard] (bus) remove relations from resultSet', props()),
|
|
3470
|
+
addItemToResultSets: createAction('[Dashboard] (bus) add item to resultSet', props()),
|
|
3471
|
+
startingMissingViews: createAction('[Dashboard] opening missing views for manifest'),
|
|
3472
|
+
setAvailableNamedQueries: createAction('[Dashboard] (bus) set available rs names', props()),
|
|
3473
|
+
setDefaultDatasource: createAction('[Dashboard] set current rs name', props()),
|
|
3474
|
+
updateDashboardParams: createAction('[Dashboard] set dashboard cell params', props()),
|
|
3475
|
+
toggleEditionMode: createAction('[Dashboard] toggle edition mode', props()),
|
|
3476
|
+
select: createAction('[Dashboard] (bus) select item', props()),
|
|
3477
|
+
selectMany: createAction('[Dashboard] (bus) select items', props()),
|
|
3478
|
+
invertSelection: createAction('[Dashboard] (bus) invert selection'),
|
|
3479
|
+
fetchObjectsDetails: createAction('[Dashboard] fetch objects details', props()),
|
|
3480
|
+
updateObjectsDetails: createAction('[Dashboard] (bus) update objects details', props()),
|
|
3481
|
+
explore: createAction('[Dashboard] (bus) isolate in data set', props()),
|
|
3482
|
+
detail: createAction('[Dashboard] (bus) add detail view', props()),
|
|
3483
|
+
proximity: createAction('[Dashboard] proximity search', props()),
|
|
3484
|
+
multiSnackBar: createAction('[Dashboard] (bus) display snack message', props()),
|
|
3485
|
+
quickOrder: createAction('[Dashboard] (bus) quick order', props()),
|
|
3486
|
+
setGridLayout: createAction('[Dashboard] set grid layout', props()),
|
|
3487
|
+
propagateGridLayout: createAction('[Dashboard] (bus) change grid layout', props()),
|
|
3488
|
+
createTab: createAction('[Dashboard] (bus) create new tab'),
|
|
3489
|
+
restoreInitialManifest: createAction('[Dashboard] (bus) restoring missing tabs'),
|
|
3490
|
+
setFilters: createAction('[Dashboard] (bus) set datasource filters', props()),
|
|
3491
|
+
updateFilters: createAction('[Dashboard] (bus) update datasource filters', props()),
|
|
3492
|
+
removeFilter: createAction('[Dashboard] (bus) remove filter in presentation', props()),
|
|
3493
|
+
removeFilters: createAction('[Dashboard] (bus) remove filters'),
|
|
3494
|
+
updateFilterValue: createAction('[Dashboard] (bus) update filter value', props()),
|
|
3495
|
+
clearAllFilterValues: createAction('[Dashboard] (bus) clear all filter values'),
|
|
3496
|
+
dispatchFilters: createAction('[Dashboard] (bus) apply filters to presentation datasources', props()),
|
|
3497
|
+
resetWmsFeatures: createAction('[Widget map] Reset Wms layer features', props()),
|
|
3498
|
+
getWmsFeatures: createAction('[Widget map] Get Wms layer features', props()),
|
|
3499
|
+
addWmsFeatures: createAction('[Widget map] Set Wms layer features', props()),
|
|
3500
|
+
getWfsFeatures: createAction('[Widget map] Get wfs Features for point', props()),
|
|
3501
|
+
getWfsFeaturesForPointStackTooltips: createAction('[Widget map] Get wfs Features for showing stack tooltips', props()),
|
|
3502
|
+
updateDisplayOptions: createAction('[Dashboard/Display] (bus) Update displayed dashboard management features', props()),
|
|
3503
|
+
getCapability: createAction('[Widget map] Get Wms capability', props()),
|
|
3504
|
+
updateCapability: createAction('[Widget map] Store Wms capability', props()),
|
|
3505
|
+
addManifestMetadata: createAction('[Dashboard] Add manifest metadata', props()),
|
|
3506
|
+
deleteManifestMetadata: createAction('[Dashboard] Delete manifest metadata', props()),
|
|
3507
|
+
triggerAggregate: createAction('[Dashboard] (bus) Triggering aggregates for datasource', props()),
|
|
3508
|
+
loadPresentation: createAction('[Dashboard] load presentation', props())
|
|
3509
|
+
};
|
|
3510
|
+
|
|
3511
|
+
const BASE_DISPLAY_OPTIONS = {
|
|
3512
|
+
presentationTitle: true,
|
|
3513
|
+
search: false,
|
|
3514
|
+
catalog: false,
|
|
3515
|
+
useFilters: false,
|
|
3516
|
+
toolbox: {
|
|
3517
|
+
edit_action: false,
|
|
3518
|
+
save_view: false,
|
|
3519
|
+
save_view_as: false,
|
|
3520
|
+
filter_settings: false,
|
|
3521
|
+
new_tab: false,
|
|
3522
|
+
clear_view: false,
|
|
3523
|
+
default_size: false,
|
|
3524
|
+
refresh_datasets: false,
|
|
3525
|
+
automate_refresh: false,
|
|
3526
|
+
edit_presentation_content: false,
|
|
3527
|
+
share: false,
|
|
3528
|
+
delete: false,
|
|
3529
|
+
dashboard_details: false,
|
|
3530
|
+
edit_presentation: false
|
|
3531
|
+
},
|
|
3532
|
+
edit_toggle: false,
|
|
3533
|
+
widgetContextMenu: {
|
|
3534
|
+
datasourceSelection: true,
|
|
3535
|
+
parameters: true,
|
|
3536
|
+
window: true,
|
|
3537
|
+
maximize: true,
|
|
3538
|
+
addToCatalog: true,
|
|
3539
|
+
delete: true,
|
|
3540
|
+
changeSpot: true
|
|
3541
|
+
}
|
|
3542
|
+
};
|
|
3543
|
+
function getDisplayOptions(mode) {
|
|
3544
|
+
switch (mode) {
|
|
3545
|
+
case ViewMode.CONSULT:
|
|
3546
|
+
return {
|
|
3547
|
+
...BASE_DISPLAY_OPTIONS,
|
|
3548
|
+
useFilters: true,
|
|
3549
|
+
toolbox: {
|
|
3550
|
+
...BASE_DISPLAY_OPTIONS.toolbox,
|
|
3551
|
+
save_view_as: true,
|
|
3552
|
+
refresh_datasets: true,
|
|
3553
|
+
edit_presentation_content: true,
|
|
3554
|
+
share: true,
|
|
3555
|
+
delete: true,
|
|
3556
|
+
dashboard_details: true,
|
|
3557
|
+
edit_presentation: true
|
|
3558
|
+
},
|
|
3559
|
+
widgetContextMenu: false
|
|
3560
|
+
};
|
|
3561
|
+
case ViewMode.SEARCH:
|
|
3562
|
+
return {
|
|
3563
|
+
...BASE_DISPLAY_OPTIONS,
|
|
3564
|
+
presentationTitle: false,
|
|
3565
|
+
search: true,
|
|
3566
|
+
toolbox: { ...BASE_DISPLAY_OPTIONS.toolbox, clear_view: true, default_size: true, refresh_datasets: true },
|
|
3567
|
+
edit_toggle: true
|
|
3568
|
+
};
|
|
3569
|
+
case ViewMode.EDITION:
|
|
3570
|
+
case ViewMode.CREATION:
|
|
3571
|
+
return {
|
|
3572
|
+
...BASE_DISPLAY_OPTIONS,
|
|
3573
|
+
catalog: true,
|
|
3574
|
+
useFilters: true,
|
|
3575
|
+
toolbox: {
|
|
3576
|
+
edit_action: false,
|
|
3577
|
+
save_view: true,
|
|
3578
|
+
save_view_as: true,
|
|
3579
|
+
filter_settings: true,
|
|
3580
|
+
new_tab: true,
|
|
3581
|
+
clear_view: true,
|
|
3582
|
+
default_size: true,
|
|
3583
|
+
refresh_datasets: true,
|
|
3584
|
+
automate_refresh: true,
|
|
3585
|
+
edit_presentation_content: false,
|
|
3586
|
+
share: true,
|
|
3587
|
+
delete: false,
|
|
3588
|
+
dashboard_details: true,
|
|
3589
|
+
edit_presentation: true
|
|
3590
|
+
},
|
|
3591
|
+
edit_toggle: true,
|
|
3592
|
+
widgetContextMenu: true
|
|
3593
|
+
};
|
|
3594
|
+
default:
|
|
3595
|
+
return BASE_DISPLAY_OPTIONS;
|
|
3470
3596
|
}
|
|
3471
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, deps: [{ token: i1$2.Actions }, { token: ClassService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3472
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects }); }
|
|
3473
3597
|
}
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3598
|
+
|
|
3599
|
+
const NEW_WINDOW_TARGET = -1;
|
|
3600
|
+
const feature$4 = createFeatureSelector('@pry/dashboard');
|
|
3601
|
+
const manifests = createSelector(feature$4, (state) => state?.manifests);
|
|
3602
|
+
const rank = createSelector(manifests, (manifests) => manifests?.tenants.indexOf(manifests.sender));
|
|
3603
|
+
const currentManifestId = createSelector(manifests, (manifests) => manifests.currentId);
|
|
3604
|
+
const globalManifest = createSelector(manifests,
|
|
3605
|
+
// @ts-ignore
|
|
3606
|
+
(manifests) => ({ windows: [], ...manifests?.manifest }) ?? { windows: [] });
|
|
3607
|
+
const staticManifest = createSelector(manifests,
|
|
3608
|
+
// @ts-ignore
|
|
3609
|
+
(manifests) => ({ windows: [], ...manifests?.staticManifest }) ?? { windows: [] });
|
|
3610
|
+
const loading = createSelector(manifests, (manifests) => !!manifests?.loading);
|
|
3611
|
+
const refreshRates = createSelector(globalManifest, (manifests) => manifests.refreshRates ?? {});
|
|
3612
|
+
const windowManifest = createSelector(globalManifest, rank, (manifest, rank) => manifest.windows[rank] ?? { widgets: [] });
|
|
3613
|
+
const gridLayout = createSelector(windowManifest, (manifest) => ((manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL));
|
|
3614
|
+
const memoizeWidgetManifest = {};
|
|
3615
|
+
const widgetManifest = (index) => {
|
|
3616
|
+
if (!memoizeWidgetManifest[index]) {
|
|
3617
|
+
memoizeWidgetManifest[index] = createSelector(windowManifest, (windowManifest) => windowManifest.widgets[index] ??
|
|
3618
|
+
{
|
|
3619
|
+
type: 'placeholder',
|
|
3620
|
+
layout: { x: 1, y: 1, width: 1, height: 1 }
|
|
3621
|
+
});
|
|
3622
|
+
}
|
|
3623
|
+
return memoizeWidgetManifest[index];
|
|
3624
|
+
};
|
|
3625
|
+
const manifestsList = createSelector(manifests, (manifests) => manifests.list);
|
|
3626
|
+
const tenants = createSelector(manifests, (manifests) => manifests.tenants ?? []);
|
|
3627
|
+
const targetTenantsIndexes = createSelector(manifests, rank, (manifests, rank) => [
|
|
3628
|
+
NEW_WINDOW_TARGET,
|
|
3629
|
+
...(manifests.tenants ?? []).map((ten, idx) => idx).filter((idx) => idx !== rank)
|
|
3630
|
+
]);
|
|
3631
|
+
const results = createSelector(feature$4, (state) => state?.results);
|
|
3632
|
+
const resultSets = createSelector(results, (results) => results.resultSets ?? {});
|
|
3633
|
+
const resultSetsParams = createSelector(results, (results) => results.resultSetsParams ?? {});
|
|
3634
|
+
const namedQueriesNames = createSelector(resultSets, (state) => Object.keys(state) ?? []);
|
|
3635
|
+
const availableNamedQueries = createSelector(results, (results) => {
|
|
3636
|
+
return [...new Set([...results.availableDatasourceNames, ...Object.keys(results.resultSets)])];
|
|
3637
|
+
});
|
|
3638
|
+
const defaultDatasourceNames = createSelector(results, (results) => results.defaultDatasource ?? 'current');
|
|
3639
|
+
const selectedItemIds = createSelector(results, (results) => results.selectedItems ?? []);
|
|
3640
|
+
const objectDetails = createSelector(results, (results) => results.objectDetails ?? {});
|
|
3641
|
+
const quickOrder = createSelector(results, (results) => results.quickOrder ?? {});
|
|
3642
|
+
const allItems = createSelector(results, (results) => Object.keys(results.resultSets)
|
|
3643
|
+
.map((rsKey) => Object.keys(results.resultSets[rsKey].items)
|
|
3644
|
+
.map((classKey) => results.resultSets[rsKey].items[classKey])
|
|
3645
|
+
.reduce((p, c) => [...p, ...c], []))
|
|
3646
|
+
.reduce((p, c) => [...p, ...c], []));
|
|
3647
|
+
const getItemsByIds = (ids) => createSelector(allItems, (items) => items.filter((item) => ids.includes(item.id)));
|
|
3648
|
+
const selectedItems = createSelector(selectedItemIds, allItems, (itemNames, allItems) => itemNames.map((name) => allItems.find((it) => it.id === name)) ?? []);
|
|
3649
|
+
const dashboard = createSelector(feature$4, (state) => state?.dashboard ?? {});
|
|
3650
|
+
const dashboardCellParams = createSelector(dashboard, (dashboard) => dashboard.params ?? {});
|
|
3651
|
+
const dashboardEditionMode = createSelector(dashboard, (dashboard) => dashboard.editionMode ?? false);
|
|
3652
|
+
const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.windows
|
|
3653
|
+
.map((window, idx) => ({ windowIndex: idx, widgets: window.widgets }))
|
|
3654
|
+
.map(({ windowIndex, widgets }) => (widgets ?? []).map((widget) => (Array.isArray(widget.datasource) ? widget.datasource : [widget.datasource])
|
|
3655
|
+
.filter((rsName) => rsName !== undefined)
|
|
3656
|
+
.map((rsName) => ({
|
|
3657
|
+
rsName,
|
|
3658
|
+
windowIndex,
|
|
3659
|
+
type: widget.type,
|
|
3660
|
+
layout: widget.layout
|
|
3661
|
+
}))))
|
|
3662
|
+
.reduce((p, c) => [...p, ...c], [])
|
|
3663
|
+
.reduce((p, c) => [...p, ...c], [])
|
|
3664
|
+
.reduce((p, c) => ({ ...p, [c.rsName ?? '']: [...(p[c.rsName ?? ''] || []), { ...c }] }), {}));
|
|
3665
|
+
const presentation = createSelector(feature$4, (state) => state?.presentation);
|
|
3666
|
+
const isCurrentPresentationModified = createSelector(presentation, globalManifest, (state, global) => !equal(global, state.initial));
|
|
3667
|
+
const currentManifest = createSelector(feature$4, (state) => state?.presentation.current);
|
|
3668
|
+
const filters = createSelector(feature$4, (state) => state?.manifests.manifest.filters ?? []);
|
|
3669
|
+
const datasourceFilters = createSelector(feature$4, (state) => state?.manifests.manifest.filters
|
|
3670
|
+
? state?.manifests.manifest.filters.reduce((obj, filter) => (filter.attributes.forEach((attribute) => (obj[attribute.datasource] || (obj[attribute.datasource] = [])).push({
|
|
3671
|
+
attribute: attribute.id,
|
|
3672
|
+
operator: filter.operator ?? '',
|
|
3673
|
+
value: filter.value,
|
|
3674
|
+
type: filter.type
|
|
3675
|
+
})),
|
|
3676
|
+
obj), {})
|
|
3677
|
+
: {});
|
|
3678
|
+
const memoizeFeatures = {};
|
|
3679
|
+
const wmsFeatures = (componentId) => {
|
|
3680
|
+
if (!memoizeFeatures[componentId]) {
|
|
3681
|
+
memoizeFeatures[componentId] = createSelector(feature$4, (state) => state.wmsFeatures[componentId] ?? []);
|
|
3682
|
+
}
|
|
3683
|
+
return memoizeFeatures[componentId];
|
|
3684
|
+
};
|
|
3685
|
+
const displayOptions = createSelector(feature$4, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
|
|
3686
|
+
const capabilities = createSelector(feature$4, (state) => state?.capabilities);
|
|
3687
|
+
const DashboardSelectors = {
|
|
3688
|
+
feature: feature$4,
|
|
3689
|
+
rank,
|
|
3690
|
+
currentManifestId,
|
|
3691
|
+
globalManifest,
|
|
3692
|
+
refreshRates,
|
|
3693
|
+
windowManifest,
|
|
3694
|
+
widgetManifest,
|
|
3695
|
+
manifestsList,
|
|
3696
|
+
gridLayout,
|
|
3697
|
+
tenants,
|
|
3698
|
+
resultSets,
|
|
3699
|
+
resultSetsParams,
|
|
3700
|
+
namedQueriesNames,
|
|
3701
|
+
namedQueriesUses,
|
|
3702
|
+
availableNamedQueries,
|
|
3703
|
+
defaultDatasourceNames,
|
|
3704
|
+
selectedItemIds,
|
|
3705
|
+
allItems,
|
|
3706
|
+
getItemsByIds,
|
|
3707
|
+
selectedItems,
|
|
3708
|
+
objectDetails,
|
|
3709
|
+
targetTenantsIndexes,
|
|
3710
|
+
dashboard,
|
|
3711
|
+
dashboardCellParams,
|
|
3712
|
+
dashboardEditionMode,
|
|
3713
|
+
staticManifest,
|
|
3714
|
+
loading,
|
|
3715
|
+
quickOrder,
|
|
3716
|
+
presentation,
|
|
3717
|
+
currentManifest,
|
|
3718
|
+
filters,
|
|
3719
|
+
isCurrentPresentationModified,
|
|
3720
|
+
datasourceFilters,
|
|
3721
|
+
wmsFeatures,
|
|
3722
|
+
displayOptions,
|
|
3723
|
+
capabilities
|
|
3724
|
+
};
|
|
3725
|
+
|
|
3726
|
+
class CategoryService {
|
|
3727
|
+
constructor(httpClient, store) {
|
|
3728
|
+
this.httpClient = httpClient;
|
|
3729
|
+
this.store = store;
|
|
3730
|
+
}
|
|
3731
|
+
getCategories() {
|
|
3732
|
+
return this.store
|
|
3733
|
+
.select(ConfigSelectors.refUrl)
|
|
3734
|
+
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/categories`))));
|
|
3735
|
+
}
|
|
3736
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3737
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, providedIn: 'root' }); }
|
|
3738
|
+
}
|
|
3739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, decorators: [{
|
|
3740
|
+
type: Injectable,
|
|
3741
|
+
args: [{
|
|
3742
|
+
providedIn: 'root'
|
|
3743
|
+
}]
|
|
3744
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
3745
|
+
|
|
3746
|
+
class CategoryEffects {
|
|
3747
|
+
constructor(actions$, categoryService, store) {
|
|
3748
|
+
this.actions$ = actions$;
|
|
3749
|
+
this.categoryService = categoryService;
|
|
3750
|
+
this.store = store;
|
|
3751
|
+
this.loadCategories$ = createEffect(() => this.actions$.pipe(ofType(CategoryActions.load), withLatestFrom(this.store.select(CategorySelectors.categories), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, categories, rank]) => (action.force || categories.length === 0) && rank === 0), mergeMap((action) => this.categoryService.getCategories().pipe(map((categories) => CategoryActions.loadSuccess({ categories })), catchError((error) => [CategoryActions.loadFailure({ error: error })])))));
|
|
3752
|
+
}
|
|
3753
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, deps: [{ token: i1$2.Actions }, { token: CategoryService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3754
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects }); }
|
|
3755
|
+
}
|
|
3756
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, decorators: [{
|
|
3757
|
+
type: Injectable
|
|
3758
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: CategoryService }, { type: i1.Store }] });
|
|
3759
|
+
|
|
3760
|
+
class ClassService {
|
|
3761
|
+
constructor(httpClient, store) {
|
|
3762
|
+
this.httpClient = httpClient;
|
|
3763
|
+
this.store = store;
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Returns the list of business classes
|
|
3767
|
+
*/
|
|
3768
|
+
getClasses() {
|
|
3769
|
+
return this.store
|
|
3770
|
+
.select(ConfigSelectors.refUrl)
|
|
3771
|
+
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class`))));
|
|
3772
|
+
}
|
|
3773
|
+
getDatasetCounts() {
|
|
3774
|
+
return this.store
|
|
3775
|
+
.select(ConfigSelectors.refUrl)
|
|
3776
|
+
.pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class/datasets/count`))));
|
|
3777
|
+
}
|
|
3778
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3779
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, providedIn: 'root' }); }
|
|
3780
|
+
}
|
|
3781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, decorators: [{
|
|
3782
|
+
type: Injectable,
|
|
3783
|
+
args: [{
|
|
3784
|
+
providedIn: 'root'
|
|
3785
|
+
}]
|
|
3786
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
3787
|
+
|
|
3788
|
+
class ClassEffects {
|
|
3789
|
+
constructor(actions$, classService, store) {
|
|
3790
|
+
this.actions$ = actions$;
|
|
3791
|
+
this.classService = classService;
|
|
3792
|
+
this.store = store;
|
|
3793
|
+
this.loadClasses$ = createEffect(() => this.actions$.pipe(ofType(ClassActions.load), withLatestFrom(this.store.select(ClassSelectors.classes), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, classes, rank]) => (action.force || classes.length === 0) && rank === 0), mergeMap(() => this.classService.getClasses().pipe(map((classes) => ClassActions.loadSuccess({ classes })), catchError((error) => [ClassActions.loadFailure({ error: error })])))));
|
|
3794
|
+
this.loadDatasetCount$ = createEffect(() => this.actions$.pipe(ofType(ClassActions.loadDatasetCount), mergeMap((action) => this.classService.getDatasetCounts().pipe(map((datasetCounts) => {
|
|
3795
|
+
return ClassActions.loadDatasetCountSuccess({ datasetCounts: datasetCounts });
|
|
3796
|
+
}), catchError((error) => [ClassActions.loadDatasetCountFailure({ error: error })])))));
|
|
3797
|
+
}
|
|
3798
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, deps: [{ token: i1$2.Actions }, { token: ClassService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3799
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects }); }
|
|
3800
|
+
}
|
|
3801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, decorators: [{
|
|
3802
|
+
type: Injectable
|
|
3803
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: ClassService }, { type: i1.Store }] });
|
|
3477
3804
|
|
|
3478
3805
|
const SYMBOL_DOMAIN = 'symbol';
|
|
3479
3806
|
const TABLE_ATTR_DOMAIN = 'tableAttr';
|
|
@@ -3537,7 +3864,7 @@ class ConfigService {
|
|
|
3537
3864
|
* Get a list of all widgets from catalog
|
|
3538
3865
|
*/
|
|
3539
3866
|
getAllWidgets() {
|
|
3540
|
-
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/widget/catalog`))), catchError
|
|
3867
|
+
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/widget/catalog`))), catchError((error) => {
|
|
3541
3868
|
if (error.error instanceof Error) {
|
|
3542
3869
|
// A client-side or network error occurred
|
|
3543
3870
|
if (ConfigService.warn) {
|
|
@@ -3566,7 +3893,7 @@ class ConfigService {
|
|
|
3566
3893
|
}));
|
|
3567
3894
|
}
|
|
3568
3895
|
handleBackendVersion(url) {
|
|
3569
|
-
return this.httpClient.get(encodeURI(url)).pipe(catchError
|
|
3896
|
+
return this.httpClient.get(encodeURI(url)).pipe(catchError(() => of({})));
|
|
3570
3897
|
}
|
|
3571
3898
|
getAllVersions() {
|
|
3572
3899
|
return combineLatest([
|
|
@@ -3582,7 +3909,7 @@ class ConfigService {
|
|
|
3582
3909
|
this.handleBackendVersion(`${replay}/about/version`),
|
|
3583
3910
|
this.handleBackendVersion(`${exec}/about/version`),
|
|
3584
3911
|
this.handleBackendVersion(`${transfo}/about/version`),
|
|
3585
|
-
this.httpClient.get(encodeURI(`/assets/pry.version`)).pipe(startWith({}), map((version) => (version ? { libVersion: version } : {})), catchError
|
|
3912
|
+
this.httpClient.get(encodeURI(`/assets/pry.version`)).pipe(startWith({}), map((version) => (version ? { libVersion: version } : {})), catchError(() => of({})))
|
|
3586
3913
|
];
|
|
3587
3914
|
return combineLatest(allVersions).pipe(map(([refVersion, dataVersion, replayVersion, execVersion, tranfoVersion, frontend]) => {
|
|
3588
3915
|
const versions = {};
|
|
@@ -3621,7 +3948,7 @@ class OpenMapTilesService {
|
|
|
3621
3948
|
this.pRegexp = new RegExp(/<p class="identifier">(.*?)<.p>/gm);
|
|
3622
3949
|
}
|
|
3623
3950
|
getStyles() {
|
|
3624
|
-
return this.store.select(ConfigSelectors.mapUrl).pipe(filter
|
|
3951
|
+
return this.store.select(ConfigSelectors.mapUrl).pipe(filter((mapUrl) => !!mapUrl), mergeMap((url) => this.httpClient.get(encodeURI(`${url}`), { responseType: 'text' })), map((html) => {
|
|
3625
3952
|
const h3matches = html.match(this.h3Regexp);
|
|
3626
3953
|
const pMatches = html.match(this.pRegexp);
|
|
3627
3954
|
return (h3matches
|
|
@@ -3652,20 +3979,25 @@ class ConfigEffects {
|
|
|
3652
3979
|
this.snackBar = snackBar;
|
|
3653
3980
|
this.translateService = translateService;
|
|
3654
3981
|
this.pryDialog = pryDialog;
|
|
3655
|
-
this.mapStyles$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.getMapStyles), withLatestFrom(this.store.select(ConfigSelectors.mapStyles)), filter
|
|
3656
|
-
this.saveIconDefinitions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveIcons), mergeMap
|
|
3982
|
+
this.mapStyles$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.getMapStyles), withLatestFrom(this.store.select(ConfigSelectors.mapStyles)), filter(([action, mapStyles]) => !mapStyles || mapStyles.length === 0), mergeMap(([action]) => this.openMapTilesService.getStyles().pipe(map((styles) => ConfigActions.defineMapStyles({ styles }))))));
|
|
3983
|
+
this.saveIconDefinitions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveIcons), mergeMap((action) => this.configService
|
|
3657
3984
|
.saveDefinitions(action.definitions, SYMBOL_DOMAIN)
|
|
3658
|
-
.pipe(map
|
|
3659
|
-
this.saveTableAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTableDefaultAttributes), mergeMap
|
|
3985
|
+
.pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
|
|
3986
|
+
this.saveTableAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTableDefaultAttributes), mergeMap((action) => this.configService
|
|
3660
3987
|
.saveDefinitions(action.definitions, TABLE_ATTR_DOMAIN)
|
|
3661
|
-
.pipe(map
|
|
3662
|
-
this.saveTileAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTileAttributes), mergeMap
|
|
3988
|
+
.pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
|
|
3989
|
+
this.saveTileAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTileAttributes), mergeMap((action) => this.configService
|
|
3663
3990
|
.saveDefinitions(action.definitions, TILE_ATTR_DOMAIN)
|
|
3664
|
-
.pipe(map
|
|
3665
|
-
this.saveTemplates$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTooltip), mergeMap
|
|
3991
|
+
.pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
|
|
3992
|
+
this.saveTemplates$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTooltip), mergeMap((action) => this.configService
|
|
3666
3993
|
.saveDefinitions(action.definitions, TOOLTIPS_DOMAIN)
|
|
3667
|
-
.pipe(map
|
|
3668
|
-
this.getCustomization$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadCustomization),
|
|
3994
|
+
.pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
|
|
3995
|
+
this.getCustomization$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadCustomization), withLatestFrom(this.store.select(ConfigSelectors.iconDefinitions), this.store.select(ConfigSelectors.tableDefaultAttributesDefinitions), this.store.select(ConfigSelectors.tooltipDefinitions), this.store.select(ConfigSelectors.tileAttributesDefinitions), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, iconsDef, tableDef, tooltipDef, tileDef, rank]) => (action.force ||
|
|
3996
|
+
(Object.keys(iconsDef).length === 0 &&
|
|
3997
|
+
Object.keys(tableDef).length === 0 &&
|
|
3998
|
+
Object.keys(tooltipDef).length === 1 &&
|
|
3999
|
+
Object.keys(tileDef).length === 0)) &&
|
|
4000
|
+
rank === 0), mergeMap((action) => this.configService.getAllClassParams().pipe(mergeMap((allDefinitions) => {
|
|
3669
4001
|
const icons = allDefinitions
|
|
3670
4002
|
.filter((def) => def.domain === SYMBOL_DOMAIN)
|
|
3671
4003
|
.reduce((p, c) => ({
|
|
@@ -3698,10 +4030,10 @@ class ConfigEffects {
|
|
|
3698
4030
|
}), {});
|
|
3699
4031
|
return [ConfigActions.loadedCustomization({ icons, tableAttributes, tooltips, filters, tileAttributes })];
|
|
3700
4032
|
})))));
|
|
3701
|
-
this.saveWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveWidget), mergeMap
|
|
4033
|
+
this.saveWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveWidget), mergeMap((action) => this.configService.saveWidget(action.widget).pipe(tap(() => this.snackBar.open({
|
|
3702
4034
|
message: this.translateService.instant('@pry.toolbox.catalog.saved', { viewId: action.widget.name }),
|
|
3703
4035
|
type: 'success'
|
|
3704
|
-
})), map
|
|
4036
|
+
})), map(() => ConfigActions.loadWidgets()), catchError((error) => {
|
|
3705
4037
|
this.snackBar.open({
|
|
3706
4038
|
message: this.translateService.instant('@pry.toolbox.catalog.saveErrorCode.' + +(error.error?.code ?? 'UNKNOWN'), {
|
|
3707
4039
|
name: action.widget.name
|
|
@@ -3728,9 +4060,9 @@ class ConfigEffects {
|
|
|
3728
4060
|
};
|
|
3729
4061
|
this.pryDialog.open(PryDialogConfirmComponent, { data });
|
|
3730
4062
|
})), { dispatch: false });
|
|
3731
|
-
this.deleteRestitution$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.deleteRestitution), mergeMap
|
|
3732
|
-
this.loadWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadWidgets), mergeMap
|
|
3733
|
-
this.loadChartOption$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadChartOption), withLatestFrom(this.store.select(ConfigSelectors.chartOption)), map
|
|
4063
|
+
this.deleteRestitution$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.deleteRestitution), mergeMap((action) => this.configService.deleteRestitution(action.id).pipe(map(() => ConfigActions.loadWidgets())))));
|
|
4064
|
+
this.loadWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadWidgets), mergeMap((action) => this.configService.getAllWidgets().pipe(map((widgets) => ConfigActions.loadedWidgets({ widgets }))))));
|
|
4065
|
+
this.loadChartOption$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadChartOption), withLatestFrom(this.store.select(ConfigSelectors.chartOption)), map(([action, chartOptions]) => {
|
|
3734
4066
|
const chartOption = {
|
|
3735
4067
|
type: chartOptions.type ?? ChartOptionDefault.type,
|
|
3736
4068
|
subType: chartOptions.subType ?? ChartOptionDefault.subType,
|
|
@@ -3739,10 +4071,10 @@ class ConfigEffects {
|
|
|
3739
4071
|
};
|
|
3740
4072
|
return ConfigActions.loadedChartOption({ chartOption });
|
|
3741
4073
|
})));
|
|
3742
|
-
this.loadVersions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadVersions), mergeMap
|
|
4074
|
+
this.loadVersions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadVersions), mergeMap((action) => this.configService.getAllVersions().pipe(map((versionsData) => {
|
|
3743
4075
|
return ConfigActions.loadVersionsSuccess({ versions: versionsData });
|
|
3744
|
-
}), catchError
|
|
3745
|
-
this.loadAccessGroups$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadAccessGroups), withLatestFrom(this.store.select(ConfigSelectors.accessGroups)), filter
|
|
4076
|
+
}), catchError((error) => [ConfigActions.loadVersionsFailure({ error: error })])))));
|
|
4077
|
+
this.loadAccessGroups$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadAccessGroups), withLatestFrom(this.store.select(ConfigSelectors.accessGroups)), filter(([_, groups]) => groups.length === 0), mergeMap((_) => this.configService.getAccessGroups().pipe(map((groups) => ConfigActions.loadAccessGroupsSuccess({ groups })), catchError((error) => {
|
|
3746
4078
|
this.snackBar.open({
|
|
3747
4079
|
message: error,
|
|
3748
4080
|
type: 'error'
|
|
@@ -3761,363 +4093,46 @@ class ContextMenuEffects {
|
|
|
3761
4093
|
constructor(actions$) {
|
|
3762
4094
|
this.actions$ = actions$;
|
|
3763
4095
|
}
|
|
3764
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, deps: [{ token: i1$2.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3765
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects }); }
|
|
3766
|
-
}
|
|
3767
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, decorators: [{
|
|
3768
|
-
type: Injectable
|
|
3769
|
-
}], ctorParameters: () => [{ type: i1$2.Actions }] });
|
|
3770
|
-
|
|
3771
|
-
const ContextMenuActions = {
|
|
3772
|
-
open: createAction('[ContextMenu] open', props()),
|
|
3773
|
-
hide: createAction('[ContextMenu] hide')
|
|
3774
|
-
};
|
|
3775
|
-
|
|
3776
|
-
const contextMenuFeatureKey = '@pry/context-menu';
|
|
3777
|
-
const initialContextMenuState = {
|
|
3778
|
-
opened: false,
|
|
3779
|
-
clientX: 0,
|
|
3780
|
-
clientY: 0,
|
|
3781
|
-
itemId: '',
|
|
3782
|
-
from: '',
|
|
3783
|
-
resultSet: undefined,
|
|
3784
|
-
coordinates: undefined,
|
|
3785
|
-
allowObjectCreation: false
|
|
3786
|
-
};
|
|
3787
|
-
const contextMenuReducer = createReducer(initialContextMenuState, on(ContextMenuActions.open, (state, action) => ({
|
|
3788
|
-
...state,
|
|
3789
|
-
opened: true,
|
|
3790
|
-
clientX: action.clientX,
|
|
3791
|
-
clientY: action.clientY,
|
|
3792
|
-
itemId: action.itemId,
|
|
3793
|
-
resultSet: action.resultSet,
|
|
3794
|
-
from: action.from,
|
|
3795
|
-
coordinates: action.coordinates,
|
|
3796
|
-
allowObjectCreation: action.allowObjectCreation
|
|
3797
|
-
})), on(ContextMenuActions.hide, (state, action) => ({
|
|
3798
|
-
...state,
|
|
3799
|
-
opened: false,
|
|
3800
|
-
itemId: '',
|
|
3801
|
-
resultSet: undefined,
|
|
3802
|
-
from: ''
|
|
3803
|
-
})));
|
|
3804
|
-
|
|
3805
|
-
var ViewMode;
|
|
3806
|
-
(function (ViewMode) {
|
|
3807
|
-
ViewMode["CATALOG"] = "catalog";
|
|
3808
|
-
ViewMode["CONSULT"] = "consult";
|
|
3809
|
-
ViewMode["CREATION"] = "creation";
|
|
3810
|
-
ViewMode["EDITION"] = "edition";
|
|
3811
|
-
ViewMode["EDITOR"] = "editor";
|
|
3812
|
-
ViewMode["SEARCH"] = "search";
|
|
3813
|
-
ViewMode["CUSTOM"] = "custom";
|
|
3814
|
-
})(ViewMode || (ViewMode = {}));
|
|
3815
|
-
const DashboardActions = {
|
|
3816
|
-
join: createAction('[Dashboard] joined', props()),
|
|
3817
|
-
leave: createAction('[Dashboard] leave', props()),
|
|
3818
|
-
updateManifest: createAction('[Dashboard] (bus) updating manifest', props()),
|
|
3819
|
-
updateManifestAfterFetch: createAction('[Dashboard] (bus) updating manifest after fetch', props()),
|
|
3820
|
-
updateManifestWithoutActivation: createAction('[Dashboard] (bus) updating manifest but do not activate it', props()),
|
|
3821
|
-
updateManifestAfterTenantJoin: createAction('[Dashboard] (bus) updating manifest after tenant join', props()),
|
|
3822
|
-
updateManifestAfterTenantLeave: createAction('[Dashboard] (bus) updating manifest after tenant leave', props()),
|
|
3823
|
-
selectPresentation: createAction('[Dashboard] (bus) selectPresentation', props()),
|
|
3824
|
-
setInitialPresentation: createAction('[Dashboard] (bus) set initial presentation', props()),
|
|
3825
|
-
declareSenderId: createAction('[Dashboard] self-updating manifest', props()),
|
|
3826
|
-
updateDashboardManifest: createAction('[Dashboard] updating dashboard view', props()),
|
|
3827
|
-
updateWidgetManifest: createAction('[Dashboard] updating widget view', props()),
|
|
3828
|
-
addWidgetToPresentation: createAction('[Dashboard] add widget to presentation', props()),
|
|
3829
|
-
updateWidgetInPresentation: createAction('[Dashboard] update widget in presentation', props()),
|
|
3830
|
-
requestAllRoutes: createAction('[Dashboard] (bus) requesting route update'),
|
|
3831
|
-
requestManifestsToEmit: createAction('[Dashboard] (bus) pre-save manifest, asking all widgets to emit'),
|
|
3832
|
-
updateRouteManifest: createAction('[Dashboard] (bus) updating route', props()),
|
|
3833
|
-
fetchManifestsList: createAction('[Dashboard] (bus) fetching available manifests'),
|
|
3834
|
-
setRefreshRate: createAction('[Dashboard] (bus) setting refreshRate', props()),
|
|
3835
|
-
updateManifestsList: createAction('[Dashboard] (bus) received manifests list', props()),
|
|
3836
|
-
fetchStaticManifest: createAction('[Dashboard] (bus) fetching staticManifest', props()),
|
|
3837
|
-
fetchMoreItems: createAction('[Dashboard] (bus) fetching more items', props()),
|
|
3838
|
-
endLoading: createAction('[Dashboard] end loading'),
|
|
3839
|
-
updateStaticManifest: createAction('[Dashboard] (bus) received staticManifest', props()),
|
|
3840
|
-
loadManifest: createAction('[Dashboard] (bus) load manifest', props()),
|
|
3841
|
-
loadAndActivateManifest: createAction('[Dashboard] (bus) load and activate manifest', props()),
|
|
3842
|
-
downloadManifest: createAction('[Dashboard] download manifest', props()),
|
|
3843
|
-
confirmManifestDeletion: createAction('[Dashboard] confirm manifest deletion', props()),
|
|
3844
|
-
deleteManifest: createAction('[Dashboard] deleting manifest', props()),
|
|
3845
|
-
saveManifest: createAction('[Dashboard] save manifest', props()),
|
|
3846
|
-
solveCollisions: createAction('[Dashboard] solving collisions'),
|
|
3847
|
-
clearManifest: createAction('[Dashboard] clear manifest'),
|
|
3848
|
-
followManifestRoute: createAction('[Dashboard] (bus) follow manifest route'),
|
|
3849
|
-
moveWidget: createAction('[Dashboard] moving widget', props()),
|
|
3850
|
-
maximizeWidget: createAction('[Dashboard] maximize widget', props()),
|
|
3851
|
-
assertResultSets: createAction('[Dashboard] assert resultSet', props()),
|
|
3852
|
-
updateResultSet: createAction('[Dashboard] (bus) received named resultSet (not-active-action)', props()),
|
|
3853
|
-
addRelationsToResultSets: createAction('[Dashboard] (bus) add relations to resultSet', props()),
|
|
3854
|
-
removeRelationsFromResultSets: createAction('[Dashboard] (bus) remove relations from resultSet', props()),
|
|
3855
|
-
addItemToResultSets: createAction('[Dashboard] (bus) add item to resultSet', props()),
|
|
3856
|
-
startingMissingViews: createAction('[Dashboard] opening missing views for manifest'),
|
|
3857
|
-
setAvailableNamedQueries: createAction('[Dashboard] (bus) set available rs names', props()),
|
|
3858
|
-
setDefaultDatasource: createAction('[Dashboard] set current rs name', props()),
|
|
3859
|
-
updateDashboardParams: createAction('[Dashboard] set dashboard cell params', props()),
|
|
3860
|
-
toggleEditionMode: createAction('[Dashboard] toggle edition mode', props()),
|
|
3861
|
-
select: createAction('[Dashboard] (bus) select item', props()),
|
|
3862
|
-
selectMany: createAction('[Dashboard] (bus) select items', props()),
|
|
3863
|
-
invertSelection: createAction('[Dashboard] (bus) invert selection'),
|
|
3864
|
-
fetchObjectsDetails: createAction('[Dashboard] fetch objects details', props()),
|
|
3865
|
-
updateObjectsDetails: createAction('[Dashboard] (bus) update objects details', props()),
|
|
3866
|
-
explore: createAction('[Dashboard] (bus) isolate in data set', props()),
|
|
3867
|
-
detail: createAction('[Dashboard] (bus) add detail view', props()),
|
|
3868
|
-
proximity: createAction('[Dashboard] proximity search', props()),
|
|
3869
|
-
multiSnackBar: createAction('[Dashboard] (bus) display snack message', props()),
|
|
3870
|
-
quickOrder: createAction('[Dashboard] (bus) quick order', props()),
|
|
3871
|
-
setGridLayout: createAction('[Dashboard] set grid layout', props()),
|
|
3872
|
-
propagateGridLayout: createAction('[Dashboard] (bus) change grid layout', props()),
|
|
3873
|
-
createTab: createAction('[Dashboard] (bus) create new tab'),
|
|
3874
|
-
restoreInitialManifest: createAction('[Dashboard] (bus) restoring missing tabs'),
|
|
3875
|
-
setFilters: createAction('[Dashboard] (bus) set datasource filters', props()),
|
|
3876
|
-
updateFilters: createAction('[Dashboard] (bus) update datasource filters', props()),
|
|
3877
|
-
removeFilter: createAction('[Dashboard] (bus) remove filter in presentation', props()),
|
|
3878
|
-
removeFilters: createAction('[Dashboard] (bus) remove filters'),
|
|
3879
|
-
updateFilterValue: createAction('[Dashboard] (bus) update filter value', props()),
|
|
3880
|
-
clearAllFilterValues: createAction('[Dashboard] (bus) clear all filter values'),
|
|
3881
|
-
dispatchFilters: createAction('[Dashboard] (bus) apply filters to presentation datasources', props()),
|
|
3882
|
-
resetWmsFeatures: createAction('[Widget map] Reset Wms layer features', props()),
|
|
3883
|
-
getWmsFeatures: createAction('[Widget map] Get Wms layer features', props()),
|
|
3884
|
-
addWmsFeatures: createAction('[Widget map] Set Wms layer features', props()),
|
|
3885
|
-
getWfsFeatures: createAction('[Widget map] Get wfs Features for point', props()),
|
|
3886
|
-
getWfsFeaturesForPointStackTooltips: createAction('[Widget map] Get wfs Features for showing stack tooltips', props()),
|
|
3887
|
-
updateDisplayOptions: createAction('[Dashboard/Display] (bus) Update displayed dashboard management features', props()),
|
|
3888
|
-
getCapability: createAction('[Widget map] Get Wms capability', props()),
|
|
3889
|
-
updateCapability: createAction('[Widget map] Store Wms capability', props()),
|
|
3890
|
-
addManifestMetadata: createAction('[Dashboard] Add manifest metadata', props()),
|
|
3891
|
-
deleteManifestMetadata: createAction('[Dashboard] Delete manifest metadata', props()),
|
|
3892
|
-
triggerAggregate: createAction('[Dashboard] (bus) Triggering aggregates for datasource', props()),
|
|
3893
|
-
loadPresentation: createAction('[Dashboard] load presentation', props())
|
|
3894
|
-
};
|
|
3895
|
-
|
|
3896
|
-
var DashboardGridLayout;
|
|
3897
|
-
(function (DashboardGridLayout) {
|
|
3898
|
-
DashboardGridLayout["FULL"] = "1";
|
|
3899
|
-
DashboardGridLayout["THIRD_VERTICAL"] = "1/3v";
|
|
3900
|
-
DashboardGridLayout["THIRD_HORIZONTAL"] = "1/3h";
|
|
3901
|
-
DashboardGridLayout["HALF_VERTICAL"] = "1/2v";
|
|
3902
|
-
DashboardGridLayout["HALF_HORIZONTAL"] = "1/2h";
|
|
3903
|
-
DashboardGridLayout["QUARTER"] = "1/4";
|
|
3904
|
-
DashboardGridLayout["MANUAL"] = "0";
|
|
3905
|
-
})(DashboardGridLayout || (DashboardGridLayout = {}));
|
|
3906
|
-
|
|
3907
|
-
const BASE_DISPLAY_OPTIONS = {
|
|
3908
|
-
presentationTitle: true,
|
|
3909
|
-
search: false,
|
|
3910
|
-
catalog: false,
|
|
3911
|
-
useFilters: false,
|
|
3912
|
-
toolbox: {
|
|
3913
|
-
edit_action: false,
|
|
3914
|
-
save_view: false,
|
|
3915
|
-
save_view_as: false,
|
|
3916
|
-
filter_settings: false,
|
|
3917
|
-
new_tab: false,
|
|
3918
|
-
clear_view: false,
|
|
3919
|
-
default_size: false,
|
|
3920
|
-
refresh_datasets: false,
|
|
3921
|
-
automate_refresh: false,
|
|
3922
|
-
edit_presentation_content: false,
|
|
3923
|
-
share: false,
|
|
3924
|
-
delete: false,
|
|
3925
|
-
dashboard_details: false,
|
|
3926
|
-
edit_presentation: false
|
|
3927
|
-
},
|
|
3928
|
-
edit_toggle: false,
|
|
3929
|
-
widgetContextMenu: {
|
|
3930
|
-
datasourceSelection: true,
|
|
3931
|
-
parameters: true,
|
|
3932
|
-
window: true,
|
|
3933
|
-
maximize: true,
|
|
3934
|
-
addToCatalog: true,
|
|
3935
|
-
delete: true,
|
|
3936
|
-
changeSpot: true
|
|
3937
|
-
}
|
|
3938
|
-
};
|
|
3939
|
-
function getDisplayOptions(mode) {
|
|
3940
|
-
switch (mode) {
|
|
3941
|
-
case ViewMode.CONSULT:
|
|
3942
|
-
return {
|
|
3943
|
-
...BASE_DISPLAY_OPTIONS,
|
|
3944
|
-
useFilters: true,
|
|
3945
|
-
toolbox: {
|
|
3946
|
-
...BASE_DISPLAY_OPTIONS.toolbox,
|
|
3947
|
-
save_view_as: true,
|
|
3948
|
-
refresh_datasets: true,
|
|
3949
|
-
edit_presentation_content: true,
|
|
3950
|
-
share: true,
|
|
3951
|
-
delete: true,
|
|
3952
|
-
dashboard_details: true,
|
|
3953
|
-
edit_presentation: true
|
|
3954
|
-
},
|
|
3955
|
-
widgetContextMenu: false
|
|
3956
|
-
};
|
|
3957
|
-
case ViewMode.SEARCH:
|
|
3958
|
-
return {
|
|
3959
|
-
...BASE_DISPLAY_OPTIONS,
|
|
3960
|
-
presentationTitle: false,
|
|
3961
|
-
search: true,
|
|
3962
|
-
toolbox: { ...BASE_DISPLAY_OPTIONS.toolbox, clear_view: true, default_size: true, refresh_datasets: true },
|
|
3963
|
-
edit_toggle: true
|
|
3964
|
-
};
|
|
3965
|
-
case ViewMode.EDITION:
|
|
3966
|
-
case ViewMode.CREATION:
|
|
3967
|
-
return {
|
|
3968
|
-
...BASE_DISPLAY_OPTIONS,
|
|
3969
|
-
catalog: true,
|
|
3970
|
-
useFilters: true,
|
|
3971
|
-
toolbox: {
|
|
3972
|
-
edit_action: false,
|
|
3973
|
-
save_view: true,
|
|
3974
|
-
save_view_as: true,
|
|
3975
|
-
filter_settings: true,
|
|
3976
|
-
new_tab: true,
|
|
3977
|
-
clear_view: true,
|
|
3978
|
-
default_size: true,
|
|
3979
|
-
refresh_datasets: true,
|
|
3980
|
-
automate_refresh: true,
|
|
3981
|
-
edit_presentation_content: false,
|
|
3982
|
-
share: true,
|
|
3983
|
-
delete: false,
|
|
3984
|
-
dashboard_details: true,
|
|
3985
|
-
edit_presentation: true
|
|
3986
|
-
},
|
|
3987
|
-
edit_toggle: true,
|
|
3988
|
-
widgetContextMenu: true
|
|
3989
|
-
};
|
|
3990
|
-
default:
|
|
3991
|
-
return BASE_DISPLAY_OPTIONS;
|
|
3992
|
-
}
|
|
3993
|
-
}
|
|
3994
|
-
|
|
3995
|
-
const NEW_WINDOW_TARGET = -1;
|
|
3996
|
-
const feature$5 = createFeatureSelector('@pry/dashboard');
|
|
3997
|
-
const manifests = createSelector(feature$5, (state) => state?.manifests);
|
|
3998
|
-
const rank = createSelector(manifests, (manifests) => manifests?.tenants.indexOf(manifests.sender));
|
|
3999
|
-
const currentManifestId = createSelector(manifests, (manifests) => manifests.currentId);
|
|
4000
|
-
const globalManifest = createSelector(manifests,
|
|
4001
|
-
// @ts-ignore
|
|
4002
|
-
(manifests) => ({ windows: [], ...manifests?.manifest }) ?? { windows: [] });
|
|
4003
|
-
const staticManifest = createSelector(manifests,
|
|
4004
|
-
// @ts-ignore
|
|
4005
|
-
(manifests) => ({ windows: [], ...manifests?.staticManifest }) ?? { windows: [] });
|
|
4006
|
-
const loading = createSelector(manifests, (manifests) => !!manifests?.loading);
|
|
4007
|
-
const refreshRates = createSelector(globalManifest, (manifests) => manifests.refreshRates ?? {});
|
|
4008
|
-
const windowManifest = createSelector(globalManifest, rank, (manifest, rank) => manifest.windows[rank] ?? { widgets: [] });
|
|
4009
|
-
const gridLayout = createSelector(windowManifest, (manifest) => ((manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL));
|
|
4010
|
-
const memoizeWidgetManifest = {};
|
|
4011
|
-
const widgetManifest = (index) => {
|
|
4012
|
-
if (!memoizeWidgetManifest[index]) {
|
|
4013
|
-
memoizeWidgetManifest[index] = createSelector(windowManifest, (windowManifest) => windowManifest.widgets[index] ??
|
|
4014
|
-
{
|
|
4015
|
-
type: 'placeholder',
|
|
4016
|
-
layout: { x: 1, y: 1, width: 1, height: 1 }
|
|
4017
|
-
});
|
|
4018
|
-
}
|
|
4019
|
-
return memoizeWidgetManifest[index];
|
|
4020
|
-
};
|
|
4021
|
-
const manifestsList = createSelector(manifests, (manifests) => manifests.list);
|
|
4022
|
-
const tenants = createSelector(manifests, (manifests) => manifests.tenants ?? []);
|
|
4023
|
-
const targetTenantsIndexes = createSelector(manifests, rank, (manifests, rank) => [
|
|
4024
|
-
NEW_WINDOW_TARGET,
|
|
4025
|
-
...(manifests.tenants ?? []).map((ten, idx) => idx).filter((idx) => idx !== rank)
|
|
4026
|
-
]);
|
|
4027
|
-
const results = createSelector(feature$5, (state) => state?.results);
|
|
4028
|
-
const resultSets = createSelector(results, (results) => results.resultSets ?? {});
|
|
4029
|
-
const resultSetsParams = createSelector(results, (results) => results.resultSetsParams ?? {});
|
|
4030
|
-
const namedQueriesNames = createSelector(resultSets, (state) => Object.keys(state) ?? []);
|
|
4031
|
-
const availableNamedQueries = createSelector(results, (results) => {
|
|
4032
|
-
return [...new Set([...results.availableDatasourceNames, ...Object.keys(results.resultSets)])];
|
|
4033
|
-
});
|
|
4034
|
-
const defaultDatasourceNames = createSelector(results, (results) => results.defaultDatasource ?? 'current');
|
|
4035
|
-
const selectedItemIds = createSelector(results, (results) => results.selectedItems ?? []);
|
|
4036
|
-
const objectDetails = createSelector(results, (results) => results.objectDetails ?? {});
|
|
4037
|
-
const quickOrder = createSelector(results, (results) => results.quickOrder ?? {});
|
|
4038
|
-
const allItems = createSelector(results, (results) => Object.keys(results.resultSets)
|
|
4039
|
-
.map((rsKey) => Object.keys(results.resultSets[rsKey].items)
|
|
4040
|
-
.map((classKey) => results.resultSets[rsKey].items[classKey])
|
|
4041
|
-
.reduce((p, c) => [...p, ...c], []))
|
|
4042
|
-
.reduce((p, c) => [...p, ...c], []));
|
|
4043
|
-
const getItemsByIds = (ids) => createSelector(allItems, (items) => items.filter((item) => ids.includes(item.id)));
|
|
4044
|
-
const selectedItems = createSelector(selectedItemIds, allItems, (itemNames, allItems) => itemNames.map((name) => allItems.find((it) => it.id === name)) ?? []);
|
|
4045
|
-
const dashboard = createSelector(feature$5, (state) => state?.dashboard ?? {});
|
|
4046
|
-
const dashboardCellParams = createSelector(dashboard, (dashboard) => dashboard.params ?? {});
|
|
4047
|
-
const dashboardEditionMode = createSelector(dashboard, (dashboard) => dashboard.editionMode ?? false);
|
|
4048
|
-
const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.windows
|
|
4049
|
-
.map((window, idx) => ({ windowIndex: idx, widgets: window.widgets }))
|
|
4050
|
-
.map(({ windowIndex, widgets }) => (widgets ?? []).map((widget) => (Array.isArray(widget.datasource) ? widget.datasource : [widget.datasource])
|
|
4051
|
-
.filter((rsName) => rsName !== undefined)
|
|
4052
|
-
.map((rsName) => ({
|
|
4053
|
-
rsName,
|
|
4054
|
-
windowIndex,
|
|
4055
|
-
type: widget.type,
|
|
4056
|
-
layout: widget.layout
|
|
4057
|
-
}))))
|
|
4058
|
-
.reduce((p, c) => [...p, ...c], [])
|
|
4059
|
-
.reduce((p, c) => [...p, ...c], [])
|
|
4060
|
-
.reduce((p, c) => ({ ...p, [c.rsName ?? '']: [...(p[c.rsName ?? ''] || []), { ...c }] }), {}));
|
|
4061
|
-
const presentation = createSelector(feature$5, (state) => state?.presentation);
|
|
4062
|
-
const isCurrentPresentationModified = createSelector(presentation, globalManifest, (state, global) => !equal(global, state.initial));
|
|
4063
|
-
const currentManifest = createSelector(feature$5, (state) => state?.presentation.current);
|
|
4064
|
-
const filters = createSelector(feature$5, (state) => state?.manifests.manifest.filters ?? []);
|
|
4065
|
-
const datasourceFilters = createSelector(feature$5, (state) => state?.manifests.manifest.filters
|
|
4066
|
-
? state?.manifests.manifest.filters.reduce((obj, filter) => (filter.attributes.forEach((attribute) => (obj[attribute.datasource] || (obj[attribute.datasource] = [])).push({
|
|
4067
|
-
attribute: attribute.id,
|
|
4068
|
-
operator: filter.operator ?? '',
|
|
4069
|
-
value: filter.value,
|
|
4070
|
-
type: filter.type
|
|
4071
|
-
})),
|
|
4072
|
-
obj), {})
|
|
4073
|
-
: {});
|
|
4074
|
-
const memoizeFeatures = {};
|
|
4075
|
-
const wmsFeatures = (componentId) => {
|
|
4076
|
-
if (!memoizeFeatures[componentId]) {
|
|
4077
|
-
memoizeFeatures[componentId] = createSelector(feature$5, (state) => state.wmsFeatures[componentId] ?? []);
|
|
4078
|
-
}
|
|
4079
|
-
return memoizeFeatures[componentId];
|
|
4080
|
-
};
|
|
4081
|
-
const displayOptions = createSelector(feature$5, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
|
|
4082
|
-
const capabilities = createSelector(feature$5, (state) => state?.capabilities);
|
|
4083
|
-
const DashboardSelectors = {
|
|
4084
|
-
feature: feature$5,
|
|
4085
|
-
rank,
|
|
4086
|
-
currentManifestId,
|
|
4087
|
-
globalManifest,
|
|
4088
|
-
refreshRates,
|
|
4089
|
-
windowManifest,
|
|
4090
|
-
widgetManifest,
|
|
4091
|
-
manifestsList,
|
|
4092
|
-
gridLayout,
|
|
4093
|
-
tenants,
|
|
4094
|
-
resultSets,
|
|
4095
|
-
resultSetsParams,
|
|
4096
|
-
namedQueriesNames,
|
|
4097
|
-
namedQueriesUses,
|
|
4098
|
-
availableNamedQueries,
|
|
4099
|
-
defaultDatasourceNames,
|
|
4100
|
-
selectedItemIds,
|
|
4101
|
-
allItems,
|
|
4102
|
-
getItemsByIds,
|
|
4103
|
-
selectedItems,
|
|
4104
|
-
objectDetails,
|
|
4105
|
-
targetTenantsIndexes,
|
|
4106
|
-
dashboard,
|
|
4107
|
-
dashboardCellParams,
|
|
4108
|
-
dashboardEditionMode,
|
|
4109
|
-
staticManifest,
|
|
4110
|
-
loading,
|
|
4111
|
-
quickOrder,
|
|
4112
|
-
presentation,
|
|
4113
|
-
currentManifest,
|
|
4114
|
-
filters,
|
|
4115
|
-
isCurrentPresentationModified,
|
|
4116
|
-
datasourceFilters,
|
|
4117
|
-
wmsFeatures,
|
|
4118
|
-
displayOptions,
|
|
4119
|
-
capabilities
|
|
4096
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, deps: [{ token: i1$2.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4097
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects }); }
|
|
4098
|
+
}
|
|
4099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, decorators: [{
|
|
4100
|
+
type: Injectable
|
|
4101
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }] });
|
|
4102
|
+
|
|
4103
|
+
const ContextMenuActions = {
|
|
4104
|
+
open: createAction('[ContextMenu] open', props()),
|
|
4105
|
+
hide: createAction('[ContextMenu] hide')
|
|
4106
|
+
};
|
|
4107
|
+
|
|
4108
|
+
const contextMenuFeatureKey = '@pry/context-menu';
|
|
4109
|
+
const initialContextMenuState = {
|
|
4110
|
+
opened: false,
|
|
4111
|
+
clientX: 0,
|
|
4112
|
+
clientY: 0,
|
|
4113
|
+
itemId: '',
|
|
4114
|
+
from: '',
|
|
4115
|
+
resultSet: undefined,
|
|
4116
|
+
coordinates: undefined,
|
|
4117
|
+
allowObjectCreation: false
|
|
4120
4118
|
};
|
|
4119
|
+
const contextMenuReducer = createReducer(initialContextMenuState, on(ContextMenuActions.open, (state, action) => ({
|
|
4120
|
+
...state,
|
|
4121
|
+
opened: true,
|
|
4122
|
+
clientX: action.clientX,
|
|
4123
|
+
clientY: action.clientY,
|
|
4124
|
+
itemId: action.itemId,
|
|
4125
|
+
resultSet: action.resultSet,
|
|
4126
|
+
from: action.from,
|
|
4127
|
+
coordinates: action.coordinates,
|
|
4128
|
+
allowObjectCreation: action.allowObjectCreation
|
|
4129
|
+
})), on(ContextMenuActions.hide, (state, action) => ({
|
|
4130
|
+
...state,
|
|
4131
|
+
opened: false,
|
|
4132
|
+
itemId: '',
|
|
4133
|
+
resultSet: undefined,
|
|
4134
|
+
from: ''
|
|
4135
|
+
})));
|
|
4121
4136
|
|
|
4122
4137
|
const SearchActions = {
|
|
4123
4138
|
search: createAction('[Search] search', props()),
|
|
@@ -4130,208 +4145,6 @@ const SearchActions = {
|
|
|
4130
4145
|
setPossibleFilterValues: createAction('[Dashboard] (bus) set possible filter values', props())
|
|
4131
4146
|
};
|
|
4132
4147
|
|
|
4133
|
-
const operators = [
|
|
4134
|
-
'EQUALS',
|
|
4135
|
-
'CONTAINS',
|
|
4136
|
-
'I_CONTAINS',
|
|
4137
|
-
'GREATER_THAN',
|
|
4138
|
-
'START_WITH',
|
|
4139
|
-
'END_WITH',
|
|
4140
|
-
'LOWER_THAN',
|
|
4141
|
-
'INSIDE',
|
|
4142
|
-
'OUTSIDE',
|
|
4143
|
-
'IN',
|
|
4144
|
-
'NOT_IN'
|
|
4145
|
-
];
|
|
4146
|
-
class FilterParamEncoder extends HttpUrlEncodingCodec {
|
|
4147
|
-
constructor() {
|
|
4148
|
-
super();
|
|
4149
|
-
}
|
|
4150
|
-
encodeValue(v) {
|
|
4151
|
-
const hasOperator = operators.includes(v.split(',')?.[1]);
|
|
4152
|
-
if (hasOperator) {
|
|
4153
|
-
return v;
|
|
4154
|
-
}
|
|
4155
|
-
return encodeURIComponent(v);
|
|
4156
|
-
}
|
|
4157
|
-
}
|
|
4158
|
-
|
|
4159
|
-
class DateUtils {
|
|
4160
|
-
static formatDate(date) {
|
|
4161
|
-
// prettier-ignore
|
|
4162
|
-
return `${date.getFullYear()}-${(date.getMonth() + 1 + "").padStart(2, "0")}-${(date.getDate() + "").padStart(2, "0")}T${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
|
|
4163
|
-
}
|
|
4164
|
-
static onlyPastDateValidator(control) {
|
|
4165
|
-
const today = new Date();
|
|
4166
|
-
if (new Date(control.value) <= today) {
|
|
4167
|
-
return null;
|
|
4168
|
-
}
|
|
4169
|
-
else {
|
|
4170
|
-
return { dateValidator: { valid: false } };
|
|
4171
|
-
}
|
|
4172
|
-
}
|
|
4173
|
-
/**
|
|
4174
|
-
* Converts a string date into an ISO-8601 string format
|
|
4175
|
-
*
|
|
4176
|
-
* Works with this formats :
|
|
4177
|
-
* - "YYYY-MM-DD" : '2024-12-31' --> '2024-12-31T00:00:00.000Z'
|
|
4178
|
-
* - "MM/DD/YYYY" : '12/31/2024' --> '2024-12-30T23:00:00.000Z' (format FR donc prise en compte de la locale : UTC+1)
|
|
4179
|
-
* - "YYYY" : '2025' --> '2025-01-01T00:00:00.000Z'
|
|
4180
|
-
*
|
|
4181
|
-
* @param dateAsString the date to convert (example : 2024-12-31)
|
|
4182
|
-
* @see Date.parse
|
|
4183
|
-
* @see Date.toISOString
|
|
4184
|
-
*/
|
|
4185
|
-
static parseToIsoString(dateAsString) {
|
|
4186
|
-
try {
|
|
4187
|
-
return new Date(Date.parse(dateAsString)).toISOString();
|
|
4188
|
-
}
|
|
4189
|
-
catch (error) {
|
|
4190
|
-
return '';
|
|
4191
|
-
}
|
|
4192
|
-
}
|
|
4193
|
-
static isInTheFuture(date) {
|
|
4194
|
-
return new Date(date) > new Date(DateUtils.formatDate(new Date()));
|
|
4195
|
-
}
|
|
4196
|
-
}
|
|
4197
|
-
|
|
4198
|
-
class SearchService {
|
|
4199
|
-
constructor(httpClient, store) {
|
|
4200
|
-
this.httpClient = httpClient;
|
|
4201
|
-
this.store = store;
|
|
4202
|
-
this.transformations = [];
|
|
4203
|
-
this.filters = {};
|
|
4204
|
-
this.limits = {};
|
|
4205
|
-
this.datasources = [];
|
|
4206
|
-
store.select(DashboardSelectors.datasourceFilters).subscribe((filters) => {
|
|
4207
|
-
this.filters = filters;
|
|
4208
|
-
});
|
|
4209
|
-
store.select(ConfigSelectors.limits).subscribe((limits) => {
|
|
4210
|
-
this.limits = limits;
|
|
4211
|
-
});
|
|
4212
|
-
store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => {
|
|
4213
|
-
this.datasources = datasources;
|
|
4214
|
-
});
|
|
4215
|
-
}
|
|
4216
|
-
getItems(id, quickOrder, excludeGeo, searchAfter, linkedItems = []) {
|
|
4217
|
-
const params = this.getItemsFilter(id, this.getOrder(quickOrder));
|
|
4218
|
-
if (!id) {
|
|
4219
|
-
console.warn('Not sending items request with no datasource attached.');
|
|
4220
|
-
return of({ items: {}, relations: [] });
|
|
4221
|
-
}
|
|
4222
|
-
return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => {
|
|
4223
|
-
const ds = this.datasources.find((d) => d.id === id);
|
|
4224
|
-
return this.httpClient.post(encodeURI(`${url}/data-sources/id/${id}/items`), {
|
|
4225
|
-
type: ds?.sourceType === 'namedQuery' ? ds.request.type : NamedQueryTypes.MONO_CLASS,
|
|
4226
|
-
excludeGeo: excludeGeo ?? false,
|
|
4227
|
-
searchAfter: searchAfter ?? undefined,
|
|
4228
|
-
linkedItems
|
|
4229
|
-
}, { params });
|
|
4230
|
-
}), map((rs) => this.applyTransformations(id, rs)));
|
|
4231
|
-
}
|
|
4232
|
-
getItemsSerializedParams(id, quickOrder = {}) {
|
|
4233
|
-
return '|' + this.getItemsFilter(id, this.getOrder(quickOrder[id])).toString() + '|';
|
|
4234
|
-
}
|
|
4235
|
-
getItemsFilter(id, cumulative, includeLimit = true) {
|
|
4236
|
-
let params = cumulative ?? new HttpParams({ encoder: new FilterParamEncoder() });
|
|
4237
|
-
if (this.filters[id]) {
|
|
4238
|
-
this.filters[id]
|
|
4239
|
-
.filter((filter) => filter.value !== null && filter.value !== undefined)
|
|
4240
|
-
.forEach((filter) => {
|
|
4241
|
-
let valuesToAddToParams = filter.value;
|
|
4242
|
-
// INSIDE and OUTSIDE operators uses 2 values but not sent in an array, values are separated by a coma
|
|
4243
|
-
// wich must not be encoded (as if values were in an array)
|
|
4244
|
-
const isMultiValued = ['INSIDE', 'OUTSIDE'].find((val) => val === filter.operator) !== undefined;
|
|
4245
|
-
if (isMultiValued) {
|
|
4246
|
-
valuesToAddToParams = filter.value.split(',');
|
|
4247
|
-
}
|
|
4248
|
-
// date filter value must be send in ISO-8601 format
|
|
4249
|
-
if (filter.type === 'date') {
|
|
4250
|
-
valuesToAddToParams = isMultiValued
|
|
4251
|
-
? valuesToAddToParams.map((value) => DateUtils.parseToIsoString(value))
|
|
4252
|
-
: DateUtils.parseToIsoString(valuesToAddToParams);
|
|
4253
|
-
}
|
|
4254
|
-
const value = Array.isArray(valuesToAddToParams)
|
|
4255
|
-
? valuesToAddToParams.map((v) => encodeURIComponent(v.toString().split(',').join('\\,'))).join(',')
|
|
4256
|
-
: encodeURIComponent(valuesToAddToParams.toString().replace(/,/g, '\\,'));
|
|
4257
|
-
params = params.append('filter', `${filter.attribute},${filter.operator},${value}`);
|
|
4258
|
-
});
|
|
4259
|
-
}
|
|
4260
|
-
if (includeLimit) {
|
|
4261
|
-
const limit = this.limits[id];
|
|
4262
|
-
if (limit) {
|
|
4263
|
-
params = params.append('limit', limit);
|
|
4264
|
-
}
|
|
4265
|
-
}
|
|
4266
|
-
return params;
|
|
4267
|
-
}
|
|
4268
|
-
getOrder(quickOrder) {
|
|
4269
|
-
let params = new HttpParams({ encoder: new FilterParamEncoder() });
|
|
4270
|
-
if (quickOrder) {
|
|
4271
|
-
params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
|
|
4272
|
-
}
|
|
4273
|
-
else {
|
|
4274
|
-
params = params.append('order', 'true,asc');
|
|
4275
|
-
}
|
|
4276
|
-
return params;
|
|
4277
|
-
}
|
|
4278
|
-
/**
|
|
4279
|
-
* Launch a search request (and saves it as current search)
|
|
4280
|
-
* @param condition
|
|
4281
|
-
*/
|
|
4282
|
-
search(condition, id, withLinkedItems = []) {
|
|
4283
|
-
return this.store.select(ConfigSelectors.dataUrl).pipe(filter((url) => !!url), take(1), withLatestFrom$1(this.store.select(DashboardSelectors.quickOrder), this.store.select(ConfigSelectors.limits)), mergeMap(([url, quickOrder, limits]) => {
|
|
4284
|
-
const params = {};
|
|
4285
|
-
if (quickOrder[DEFAULT_NAMED_QUERY_ID]) {
|
|
4286
|
-
params['order'] = `${quickOrder[DEFAULT_NAMED_QUERY_ID]?.attribute},${quickOrder[DEFAULT_NAMED_QUERY_ID]?.asc ?? ''}`;
|
|
4287
|
-
}
|
|
4288
|
-
const otherParams = {};
|
|
4289
|
-
if (withLinkedItems.length > 0) {
|
|
4290
|
-
if (withLinkedItems.includes('destination')) {
|
|
4291
|
-
otherParams['withDestinationItems'] = 'true';
|
|
4292
|
-
}
|
|
4293
|
-
if (withLinkedItems.includes('source')) {
|
|
4294
|
-
otherParams['withSourceItems'] = 'true';
|
|
4295
|
-
}
|
|
4296
|
-
}
|
|
4297
|
-
const _condition = { ...condition, limit: limits[DEFAULT_NAMED_QUERY_ID] ?? limits['default'], ...otherParams };
|
|
4298
|
-
return this.httpClient.post(encodeURI(`${url}/items/search`), _condition, { params });
|
|
4299
|
-
}), map((rs) => this.applyTransformations(id ?? DEFAULT_NAMED_QUERY_ID, rs)));
|
|
4300
|
-
}
|
|
4301
|
-
/**
|
|
4302
|
-
* Allows to add a transformation function when getting results from backend
|
|
4303
|
-
* @param func
|
|
4304
|
-
*/
|
|
4305
|
-
addTransformation(func) {
|
|
4306
|
-
this.transformations.push(func);
|
|
4307
|
-
}
|
|
4308
|
-
/**
|
|
4309
|
-
* Apply all transformation functions
|
|
4310
|
-
* @param id
|
|
4311
|
-
* @param rs
|
|
4312
|
-
*/
|
|
4313
|
-
applyTransformations(id, rs) {
|
|
4314
|
-
let transformed = rs;
|
|
4315
|
-
this.transformations.forEach((func) => (transformed = func(id, transformed)));
|
|
4316
|
-
return transformed;
|
|
4317
|
-
}
|
|
4318
|
-
autocomplete(attributes, search = '', limit) {
|
|
4319
|
-
return this.store.select(ConfigSelectors.dataUrl).pipe(switchMap((url) => this.httpClient.post(encodeURI(`${url}/data-sources/values`), {
|
|
4320
|
-
attributes: (attributes ?? []).map((attr) => ({ datasource: attr.datasource, attribute: attr.id })),
|
|
4321
|
-
value: search,
|
|
4322
|
-
limit
|
|
4323
|
-
})));
|
|
4324
|
-
}
|
|
4325
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4326
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, providedIn: 'root' }); }
|
|
4327
|
-
}
|
|
4328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, decorators: [{
|
|
4329
|
-
type: Injectable,
|
|
4330
|
-
args: [{
|
|
4331
|
-
providedIn: 'root'
|
|
4332
|
-
}]
|
|
4333
|
-
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
4334
|
-
|
|
4335
4148
|
class DataSourceService {
|
|
4336
4149
|
constructor(store, httpClient, translateService) {
|
|
4337
4150
|
this.store = store;
|
|
@@ -4457,9 +4270,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
4457
4270
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i1$1.HttpClient }, { type: PryI18nService }] });
|
|
4458
4271
|
|
|
4459
4272
|
class DataSourceEffects {
|
|
4460
|
-
constructor(actions$,
|
|
4273
|
+
constructor(actions$, dataSourceService, snackBar, translate, store, pryDialog) {
|
|
4461
4274
|
this.actions$ = actions$;
|
|
4462
|
-
this.searchService = searchService;
|
|
4463
4275
|
this.dataSourceService = dataSourceService;
|
|
4464
4276
|
this.snackBar = snackBar;
|
|
4465
4277
|
this.translate = translate;
|
|
@@ -4485,16 +4297,16 @@ class DataSourceEffects {
|
|
|
4485
4297
|
actions.push(SearchActions.getDatasourceItems({ id: this.idNamedQuery, excludeGeo: false, from: 'postNameQuery$' }));
|
|
4486
4298
|
}
|
|
4487
4299
|
this.idNamedQuery = undefined;
|
|
4488
|
-
actions.push(DataSourceActions.namedQuery.load());
|
|
4300
|
+
actions.push(DataSourceActions.namedQuery.load({ force: true }));
|
|
4489
4301
|
return actions;
|
|
4490
4302
|
}), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
|
|
4491
|
-
this.getNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.load), debounceTime(
|
|
4303
|
+
this.getNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.load), withLatestFrom(this.store.select(DataSourceSelectors.getAllNamedQuery), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, nq, rank]) => (action.force || nq.length === 0) && rank === 0), switchMap(() => this.dataSourceService.get()), map((namedQueryList) => DataSourceActions.namedQuery.loaded({ list: namedQueryList })), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
|
|
4492
4304
|
this.loaded$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.loaded), map((action) => {
|
|
4493
4305
|
return DashboardActions.setAvailableNamedQueries({ names: action.list.map((nq) => nq.id) });
|
|
4494
4306
|
})));
|
|
4495
|
-
this.deleteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.delete), switchMap((props) => this.dataSourceService.delete(props.id).pipe(mergeMap(() => [DataSourceActions.namedQuery.load()]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])))));
|
|
4496
|
-
this.addFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.addFavorite), switchMap((props) => this.dataSourceService.addFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load()]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
|
|
4497
|
-
this.deleteFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.deleteFavorite), switchMap((props) => this.dataSourceService.deleteFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load()]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
|
|
4307
|
+
this.deleteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.delete), switchMap((props) => this.dataSourceService.delete(props.id).pipe(mergeMap(() => [DataSourceActions.namedQuery.load({ force: true })]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])))));
|
|
4308
|
+
this.addFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.addFavorite), switchMap((props) => this.dataSourceService.addFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load({ force: true })]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
|
|
4309
|
+
this.deleteFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.deleteFavorite), switchMap((props) => this.dataSourceService.deleteFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load({ force: true })]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
|
|
4498
4310
|
this.tryEdit$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.edit), withLatestFrom(this.store.select(DataSourceSelectors.editInProgress)), map(([action, inProgress]) => {
|
|
4499
4311
|
if (!inProgress) {
|
|
4500
4312
|
return DataSourceActions.namedQuery.openEdit(action);
|
|
@@ -4531,10 +4343,13 @@ class DataSourceEffects {
|
|
|
4531
4343
|
manifest: widgetManifestCopy
|
|
4532
4344
|
});
|
|
4533
4345
|
})));
|
|
4534
|
-
this.loadedDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.loadDataset),
|
|
4346
|
+
this.loadedDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.loadDataset), withLatestFrom(this.store.select(DataSourceSelectors.datasets), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, dss, rank]) => (action.force || dss.length === 0) && rank === 0), mergeMap(() => this.dataSourceService
|
|
4535
4347
|
.getDatasets()
|
|
4536
4348
|
.pipe(map((dsd) => DataSourceActions.dataset.loadedDataset({ datasets: dsd }))))));
|
|
4537
|
-
this.loadDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.load), debounceTime(100), mergeMap((action) => [
|
|
4349
|
+
this.loadDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.load), debounceTime(100), mergeMap((action) => [
|
|
4350
|
+
DataSourceActions.namedQuery.load({ force: action.force }),
|
|
4351
|
+
DataSourceActions.dataset.loadDataset({ force: action.force })
|
|
4352
|
+
])));
|
|
4538
4353
|
this.listVersions$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.listVersions), switchMap((action) => this.dataSourceService.getDatasetVersions(action).pipe(map((response) => DataSourceActions.dataset.listVersionsSuccess({
|
|
4539
4354
|
versions: response.body ?? [],
|
|
4540
4355
|
totalVersionCount: +(response.headers.get('x-total-count') ?? 0)
|
|
@@ -4543,14 +4358,14 @@ class DataSourceEffects {
|
|
|
4543
4358
|
this.deactivateDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.deactivateDatasetVersion), switchMap((action) => this.dataSourceService.deactivateDatasetVersion(action.versionId).pipe(map(() => DataSourceActions.dataset.deactivateDatasetVersionSuccess({ datasetId: action.datasetId })), catchError((error) => [DataSourceActions.dataset.deactivateDatasetVersionFailure({ error })])))));
|
|
4544
4359
|
this.activateDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.activateDatasetVersion), switchMap((action) => this.dataSourceService.activateDatasetVersion(action.versionId).pipe(map(() => DataSourceActions.dataset.activateDatasetVersionSuccess({ datasetId: action.datasetId })), catchError((error) => [DataSourceActions.dataset.activateDatasetVersionFailure({ error })])))));
|
|
4545
4360
|
this.activateOrDeactivateDatasetVersionSuccess$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.activateDatasetVersionSuccess, DataSourceActions.dataset.deactivateDatasetVersionSuccess), map((action) => {
|
|
4546
|
-
this.store.dispatch(DataSourceActions.dataset.loadDataset());
|
|
4361
|
+
this.store.dispatch(DataSourceActions.dataset.loadDataset({ force: true }));
|
|
4547
4362
|
return DataSourceActions.dataset.listVersionsByDatasetId({ id: action.datasetId });
|
|
4548
4363
|
})));
|
|
4549
4364
|
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 })])))));
|
|
4550
4365
|
this.updateDatasetVersionInfo = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.updateDatasetVersionInfo), switchMap((action) => this.dataSourceService
|
|
4551
4366
|
.updateDatasetVersionInfo(action.version)
|
|
4552
4367
|
.pipe(map((previews) => DataSourceActions.dataset.updateDatasetVersionInfoSuccess({ version: action.version }))))));
|
|
4553
|
-
this.confirmDeleteDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.confirmDeleteVersion), tap
|
|
4368
|
+
this.confirmDeleteDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.confirmDeleteVersion), tap((action) => {
|
|
4554
4369
|
const data = {
|
|
4555
4370
|
title: '@pry.dataset.version.delete.title',
|
|
4556
4371
|
message: '@pry.dataset.version.delete.message',
|
|
@@ -4574,17 +4389,50 @@ class DataSourceEffects {
|
|
|
4574
4389
|
.getCategories()
|
|
4575
4390
|
.pipe(map((categories) => DataSourceActions.dataset.getCategoriesSuccess({ categories }))))));
|
|
4576
4391
|
}
|
|
4577
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects, deps: [{ token: i1$2.Actions }, { token:
|
|
4392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects, deps: [{ token: i1$2.Actions }, { token: DataSourceService }, { token: PrySnackbarService }, { token: PryI18nService }, { token: i1.Store }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4578
4393
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects }); }
|
|
4579
4394
|
}
|
|
4580
4395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects, decorators: [{
|
|
4581
4396
|
type: Injectable
|
|
4582
|
-
}], ctorParameters: () => [{ type: i1$2.Actions }, { type:
|
|
4397
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: DataSourceService }, { type: PrySnackbarService }, { type: PryI18nService }, { type: i1.Store }, { type: PryDialogService }] });
|
|
4583
4398
|
|
|
4584
4399
|
const FieldActions = {
|
|
4585
|
-
load: createAction('[Field] Load Fields'),
|
|
4400
|
+
load: createAction('[Field] (bus) Load Fields', props()),
|
|
4586
4401
|
loadSuccess: createAction('[Field Api] (bus) Load Fields Success', props()),
|
|
4587
|
-
loadFailure: createAction('[Field Api] Load Fields Failure', props())
|
|
4402
|
+
loadFailure: createAction('[Field Api] (bus) Load Fields Failure', props())
|
|
4403
|
+
};
|
|
4404
|
+
|
|
4405
|
+
const fieldsFeatureKey = '@pry/model/fields';
|
|
4406
|
+
function sortByName(a, b) {
|
|
4407
|
+
return a.name.localeCompare(b.name);
|
|
4408
|
+
}
|
|
4409
|
+
const adapter = createEntityAdapter({
|
|
4410
|
+
sortComparer: sortByName
|
|
4411
|
+
});
|
|
4412
|
+
const initialState = adapter.getInitialState({
|
|
4413
|
+
// additional entity state properties
|
|
4414
|
+
});
|
|
4415
|
+
const internalReducer$1 = createReducer(initialState, on(FieldActions.loadSuccess, (state, action) => adapter.setAll(action.fields, state)));
|
|
4416
|
+
const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();
|
|
4417
|
+
function fieldReducer(state, action) {
|
|
4418
|
+
return internalReducer$1(state, action);
|
|
4419
|
+
}
|
|
4420
|
+
|
|
4421
|
+
const feature$3 = createFeatureSelector(fieldsFeatureKey);
|
|
4422
|
+
const entities = createSelector(feature$3, selectEntities);
|
|
4423
|
+
const fields = createSelector(feature$3, selectAll);
|
|
4424
|
+
const memoizeFieldById = {};
|
|
4425
|
+
const fieldById = (id) => {
|
|
4426
|
+
if (!memoizeFieldById[id]) {
|
|
4427
|
+
memoizeFieldById[id] = createSelector(entities, (entities) => entities[id]);
|
|
4428
|
+
}
|
|
4429
|
+
return memoizeFieldById[id];
|
|
4430
|
+
};
|
|
4431
|
+
const FieldSelectors = {
|
|
4432
|
+
feature: feature$3,
|
|
4433
|
+
entities,
|
|
4434
|
+
fields,
|
|
4435
|
+
fieldById
|
|
4588
4436
|
};
|
|
4589
4437
|
|
|
4590
4438
|
class FieldService {
|
|
@@ -4623,40 +4471,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
4623
4471
|
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
4624
4472
|
|
|
4625
4473
|
class FieldEffects {
|
|
4626
|
-
constructor(actions$, fieldService) {
|
|
4474
|
+
constructor(actions$, fieldService, store) {
|
|
4627
4475
|
this.actions$ = actions$;
|
|
4628
4476
|
this.fieldService = fieldService;
|
|
4629
|
-
this.
|
|
4477
|
+
this.store = store;
|
|
4478
|
+
this.loadFields$ = createEffect(() => this.actions$.pipe(ofType(FieldActions.load), withLatestFrom(this.store.select(FieldSelectors.fields), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, fields, rank]) => (action.force || fields.length === 0) && rank === 0), mergeMap(() => this.fieldService.getFields().pipe(map((fields) => FieldActions.loadSuccess({ fields })), catchError((error) => [FieldActions.loadFailure({ error: error })])))));
|
|
4630
4479
|
}
|
|
4631
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects, deps: [{ token: i1$2.Actions }, { token: FieldService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4480
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects, deps: [{ token: i1$2.Actions }, { token: FieldService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4632
4481
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects }); }
|
|
4633
4482
|
}
|
|
4634
4483
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects, decorators: [{
|
|
4635
4484
|
type: Injectable
|
|
4636
|
-
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: FieldService }] });
|
|
4637
|
-
|
|
4638
|
-
const fieldsFeatureKey = '@pry/model/fields';
|
|
4639
|
-
function sortByName(a, b) {
|
|
4640
|
-
return a.name.localeCompare(b.name);
|
|
4641
|
-
}
|
|
4642
|
-
const adapter = createEntityAdapter({
|
|
4643
|
-
sortComparer: sortByName
|
|
4644
|
-
});
|
|
4645
|
-
const initialState = adapter.getInitialState({
|
|
4646
|
-
// additional entity state properties
|
|
4647
|
-
});
|
|
4648
|
-
const internalReducer$1 = createReducer(initialState, on(FieldActions.loadSuccess, (state, action) => adapter.setAll(action.fields, state)));
|
|
4649
|
-
const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();
|
|
4650
|
-
function fieldReducer(state, action) {
|
|
4651
|
-
return internalReducer$1(state, action);
|
|
4652
|
-
}
|
|
4485
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: FieldService }, { type: i1.Store }] });
|
|
4653
4486
|
|
|
4654
4487
|
class ImageEffects {
|
|
4655
4488
|
constructor(actions$, imageService) {
|
|
4656
4489
|
this.actions$ = actions$;
|
|
4657
4490
|
this.imageService = imageService;
|
|
4658
|
-
this.loadImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.load), debounceTime
|
|
4659
|
-
this.addImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.add), mergeMap
|
|
4491
|
+
this.loadImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.load), debounceTime(50), mergeMap(() => this.imageService.getImages().pipe(map((images) => ImageActions.loadSuccess({ images })), catchError((error) => [ImageActions.loadFailure({ error })])))));
|
|
4492
|
+
this.addImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.add), mergeMap((action) => this.imageService.upload(action.file, action.mediaType, action.imageType).pipe(mergeMap((name) => [ImageActions.load(), ImageActions.added({ name })]), catchError((error) => [ImageActions.loadFailure({ error })])))));
|
|
4660
4493
|
}
|
|
4661
4494
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ImageEffects, deps: [{ token: i1$2.Actions }, { token: ImageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4662
4495
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ImageEffects }); }
|
|
@@ -4665,16 +4498,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
4665
4498
|
type: Injectable
|
|
4666
4499
|
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: ImageService }] });
|
|
4667
4500
|
|
|
4668
|
-
const feature$
|
|
4669
|
-
const opened = createSelector(feature$
|
|
4670
|
-
const position = createSelector(feature$
|
|
4671
|
-
const itemId = createSelector(feature$
|
|
4672
|
-
const from = createSelector(feature$
|
|
4673
|
-
const coordinates = createSelector(feature$
|
|
4674
|
-
const resultSet = createSelector(feature$
|
|
4675
|
-
const allowObjectCreation = createSelector(feature$
|
|
4501
|
+
const feature$2 = createFeatureSelector(contextMenuFeatureKey);
|
|
4502
|
+
const opened = createSelector(feature$2, (state) => state?.opened);
|
|
4503
|
+
const position = createSelector(feature$2, (state) => ({ clientX: state?.clientX ?? 0, clientY: state?.clientY ?? 0 }));
|
|
4504
|
+
const itemId = createSelector(feature$2, (state) => state.itemId);
|
|
4505
|
+
const from = createSelector(feature$2, (state) => state.from);
|
|
4506
|
+
const coordinates = createSelector(feature$2, (state) => state.coordinates);
|
|
4507
|
+
const resultSet = createSelector(feature$2, (state) => state.resultSet);
|
|
4508
|
+
const allowObjectCreation = createSelector(feature$2, (state) => state.allowObjectCreation);
|
|
4676
4509
|
const ContextMenuSelectors = {
|
|
4677
|
-
feature: feature$
|
|
4510
|
+
feature: feature$2,
|
|
4678
4511
|
opened,
|
|
4679
4512
|
position,
|
|
4680
4513
|
itemId,
|
|
@@ -4876,7 +4709,7 @@ class ItemEffects {
|
|
|
4876
4709
|
this.store = store;
|
|
4877
4710
|
this.snackBar = snackBar;
|
|
4878
4711
|
this.translateService = translateService;
|
|
4879
|
-
this.create$ = createEffect(() => this.actions$.pipe(ofType(ItemActions.create), withLatestFrom(this.store.select(ContextMenuSelectors.resultSet)), mergeMap
|
|
4712
|
+
this.create$ = createEffect(() => this.actions$.pipe(ofType(ItemActions.create), withLatestFrom(this.store.select(ContextMenuSelectors.resultSet)), mergeMap(([action, resultSet]) => this.service.create(action.item, action.datasetVersionId, action.mode).pipe(mergeMap((items) => (items ?? (action.item ? [action.item] : []))
|
|
4880
4713
|
.map((item) => [
|
|
4881
4714
|
ItemActions.createSuccess({ id: item.id }),
|
|
4882
4715
|
DashboardActions.addItemToResultSets({ item, resultSet })
|
|
@@ -4902,9 +4735,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
4902
4735
|
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: ItemService }, { type: i1.Store }, { type: PrySnackbarService }, { type: PryI18nService }] });
|
|
4903
4736
|
|
|
4904
4737
|
const RelationTypesActions = {
|
|
4905
|
-
load: createAction('[Relation Types] Load Relation Types'),
|
|
4906
|
-
loadSuccess: createAction('[Relation Types Api] Load Relation Types Success', props()),
|
|
4907
|
-
loadFailure: createAction('[Relation Types Api] Load Relation Types Failure', props()),
|
|
4738
|
+
load: createAction('[Relation Types] (bus) Load Relation Types', props()),
|
|
4739
|
+
loadSuccess: createAction('[Relation Types Api] (bus) Load Relation Types Success', props()),
|
|
4740
|
+
loadFailure: createAction('[Relation Types Api] (bus) Load Relation Types Failure', props()),
|
|
4908
4741
|
saveRelationType: createAction('[Relation Types] Save Relation Types', props()),
|
|
4909
4742
|
saveRelationTypeSuccess: createAction('[Relation Types Api] Save Relation Types Success'),
|
|
4910
4743
|
saveRelationTypeFailure: createAction('[Relation Types Api] Save Relation Types Failure', props()),
|
|
@@ -4923,118 +4756,376 @@ const RelationTypesActions = {
|
|
|
4923
4756
|
closeDeleteModale: createAction('[Relation Types] Close delete modal')
|
|
4924
4757
|
};
|
|
4925
4758
|
|
|
4759
|
+
const relationTypesFeatureKey = '@pry/relation-types';
|
|
4760
|
+
const initialRelationTypeState = {
|
|
4761
|
+
relationsTypes: [],
|
|
4762
|
+
loading: false,
|
|
4763
|
+
openModal: false,
|
|
4764
|
+
openDeleteModale: false
|
|
4765
|
+
};
|
|
4766
|
+
const relationTypeReducer = createReducer(initialRelationTypeState, on(RelationTypesActions.load, (state, action) => ({
|
|
4767
|
+
...state,
|
|
4768
|
+
loading: true
|
|
4769
|
+
})), on(RelationTypesActions.loadSuccess, (state, action) => ({
|
|
4770
|
+
...state,
|
|
4771
|
+
relationsTypes: [...action.datas],
|
|
4772
|
+
loading: false
|
|
4773
|
+
})), on(RelationTypesActions.loadFailure, (state, action) => ({
|
|
4774
|
+
...state,
|
|
4775
|
+
loading: false
|
|
4776
|
+
})), on(RelationTypesActions.selectRelationType, (state, action) => ({
|
|
4777
|
+
...state,
|
|
4778
|
+
selectedRelationType: state.relationsTypes.find((rt) => rt.id === action.id)
|
|
4779
|
+
})), on(RelationTypesActions.unSelectRelationType, (state, action) => ({
|
|
4780
|
+
...state,
|
|
4781
|
+
selectedRelationType: undefined
|
|
4782
|
+
})), on(RelationTypesActions.openModal, (state, action) => ({
|
|
4783
|
+
...state,
|
|
4784
|
+
openModal: true
|
|
4785
|
+
})), on(RelationTypesActions.closeModal, (state, action) => ({
|
|
4786
|
+
...state,
|
|
4787
|
+
openModal: false
|
|
4788
|
+
})));
|
|
4789
|
+
|
|
4790
|
+
const feature$1 = createFeatureSelector(relationTypesFeatureKey);
|
|
4791
|
+
const relationsTypes = createSelector(feature$1, (state) => {
|
|
4792
|
+
const arrayForSort = state?.relationsTypes ? [...state.relationsTypes] : [];
|
|
4793
|
+
return arrayForSort.sort((a, b) => a.name.localeCompare(b.name));
|
|
4794
|
+
});
|
|
4795
|
+
const selectedRelationType = createSelector(feature$1, (state) => state?.selectedRelationType);
|
|
4796
|
+
const openModal = createSelector(feature$1, (state) => state.openModal);
|
|
4797
|
+
const openDeleteModale = createSelector(feature$1, (state) => state.openDeleteModale);
|
|
4798
|
+
const RelationTypesSelectors = {
|
|
4799
|
+
feature: feature$1,
|
|
4800
|
+
relationsTypes,
|
|
4801
|
+
selectedRelationType,
|
|
4802
|
+
openModal,
|
|
4803
|
+
openDeleteModale
|
|
4804
|
+
};
|
|
4805
|
+
|
|
4926
4806
|
class RelationTypesService {
|
|
4927
4807
|
constructor(store, httpClient) {
|
|
4928
4808
|
this.store = store;
|
|
4929
4809
|
this.httpClient = httpClient;
|
|
4930
4810
|
}
|
|
4931
|
-
addRelationType(id, name) {
|
|
4932
|
-
return this.store
|
|
4933
|
-
.select(ConfigSelectors.refUrl)
|
|
4934
|
-
.pipe(mergeMap((url) => this.httpClient.post(`${url}/relation-types`, { id: id, name: name })));
|
|
4811
|
+
addRelationType(id, name) {
|
|
4812
|
+
return this.store
|
|
4813
|
+
.select(ConfigSelectors.refUrl)
|
|
4814
|
+
.pipe(mergeMap((url) => this.httpClient.post(`${url}/relation-types`, { id: id, name: name })));
|
|
4815
|
+
}
|
|
4816
|
+
getRelationsTypes() {
|
|
4817
|
+
return this.store
|
|
4818
|
+
.select(ConfigSelectors.refUrl)
|
|
4819
|
+
.pipe(mergeMap((url) => this.httpClient.get(`${url}/relation-types`)));
|
|
4820
|
+
}
|
|
4821
|
+
deleteRelationType(id) {
|
|
4822
|
+
return this.store
|
|
4823
|
+
.select(ConfigSelectors.refUrl)
|
|
4824
|
+
.pipe(mergeMap((url) => this.httpClient.delete(`${url}/relation-types/id/${id}`)));
|
|
4825
|
+
}
|
|
4826
|
+
createRelation(sources, destination, relationType, inversion) {
|
|
4827
|
+
let relations = [];
|
|
4828
|
+
if (inversion) {
|
|
4829
|
+
relations = sources.map((source) => ({ source: destination, destination: source, relationType }));
|
|
4830
|
+
}
|
|
4831
|
+
else {
|
|
4832
|
+
relations = sources.map((source) => ({ destination, source, relationType }));
|
|
4833
|
+
}
|
|
4834
|
+
return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.post(`${url}/relations`, relations)), map(() => relations));
|
|
4835
|
+
}
|
|
4836
|
+
deleteRelation(source, destination, relationType) {
|
|
4837
|
+
const relation = { source, destination, relationType };
|
|
4838
|
+
return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.delete(`${url}/relations`, { body: relation })), map(() => relation));
|
|
4839
|
+
}
|
|
4840
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, deps: [{ token: i1.Store }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4841
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, providedIn: 'root' }); }
|
|
4842
|
+
}
|
|
4843
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, decorators: [{
|
|
4844
|
+
type: Injectable,
|
|
4845
|
+
args: [{
|
|
4846
|
+
providedIn: 'root'
|
|
4847
|
+
}]
|
|
4848
|
+
}], ctorParameters: () => [{ type: i1.Store }, { type: i1$1.HttpClient }] });
|
|
4849
|
+
|
|
4850
|
+
class RelationTypesEffects {
|
|
4851
|
+
constructor(actions$, service, store, pryDialog) {
|
|
4852
|
+
this.actions$ = actions$;
|
|
4853
|
+
this.service = service;
|
|
4854
|
+
this.store = store;
|
|
4855
|
+
this.pryDialog = pryDialog;
|
|
4856
|
+
this.loadRelationsTypes$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.load), withLatestFrom(this.store.select(RelationTypesSelectors.relationsTypes), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, relationTypes, rank]) => (action.force || relationTypes.length === 0) && rank === 0), mergeMap((action) => this.service.getRelationsTypes().pipe(map((datas) => RelationTypesActions.loadSuccess({ datas })), catchError((error) => [RelationTypesActions.loadFailure({ error })])))));
|
|
4857
|
+
this.saveRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationType), mergeMap((action) => this.service.addRelationType(action.id, action.name).pipe(map((data) => RelationTypesActions.saveRelationTypeSuccess()), catchError((error) => [RelationTypesActions.saveRelationTypeFailure({ error })])))));
|
|
4858
|
+
this.saveRelationTypeSuccess$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationTypeSuccess), map((action) => {
|
|
4859
|
+
return RelationTypesActions.load({ force: true });
|
|
4860
|
+
})));
|
|
4861
|
+
this.deleteRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelationType), mergeMap((action) => {
|
|
4862
|
+
if (!action.relationType.deletable) {
|
|
4863
|
+
const data = {
|
|
4864
|
+
title: '@pry.admin.infoModalTitle',
|
|
4865
|
+
message: '@pry.admin.relationTypes.deleteModalMessage',
|
|
4866
|
+
actions: [{ id: 0, label: '@pry.admin.closeModale' }]
|
|
4867
|
+
};
|
|
4868
|
+
this.pryDialog.open(PryDialogConfirmComponent, { data });
|
|
4869
|
+
return [];
|
|
4870
|
+
}
|
|
4871
|
+
else {
|
|
4872
|
+
return this.service.deleteRelationType(action.relationType.id).pipe(map((data) => RelationTypesActions.deleteRelationTypeSuccess()), catchError((error) => [RelationTypesActions.deleteRelationTypeFailure({ error })]));
|
|
4873
|
+
}
|
|
4874
|
+
})));
|
|
4875
|
+
this.createRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.createRelation), mergeMap((action) => this.service.createRelation(action.from, action.to, action.typeId, action.inversion).pipe(mergeMap((relations) => [
|
|
4876
|
+
RelationTypesActions.createRelationSuccess(),
|
|
4877
|
+
DashboardActions.addRelationsToResultSets({ relations })
|
|
4878
|
+
]), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
|
|
4879
|
+
this.deleteRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelation), mergeMap((action) => this.service.deleteRelation(action.from, action.to, action.typeId).pipe(map((relation) => DashboardActions.removeRelationsFromResultSets({ relation })), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
|
|
4880
|
+
}
|
|
4881
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, deps: [{ token: i1$2.Actions }, { token: RelationTypesService }, { token: i1.Store }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4882
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects }); }
|
|
4883
|
+
}
|
|
4884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, decorators: [{
|
|
4885
|
+
type: Injectable
|
|
4886
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: RelationTypesService }, { type: i1.Store }, { type: PryDialogService }] });
|
|
4887
|
+
|
|
4888
|
+
const searchFeatureKey = '@pry/search';
|
|
4889
|
+
const initialSearchState = {
|
|
4890
|
+
searchLoading: [],
|
|
4891
|
+
payload: undefined,
|
|
4892
|
+
id: undefined,
|
|
4893
|
+
possibleFilterValues: {}
|
|
4894
|
+
};
|
|
4895
|
+
const searchReducer = createReducer(initialSearchState, on(SearchActions.search, (state, action) => ({
|
|
4896
|
+
...state,
|
|
4897
|
+
searchLoading: [...new Set([...state.searchLoading, action.id ?? DEFAULT_NAMED_QUERY_ID])],
|
|
4898
|
+
payload: action.payload,
|
|
4899
|
+
id: action.id
|
|
4900
|
+
})), on(SearchActions.getDatasourceItems, (state, action) => ({
|
|
4901
|
+
...state,
|
|
4902
|
+
searchLoading: [...new Set([...state.searchLoading, action.id])]
|
|
4903
|
+
})), on(SearchActions.searchSuccess, (state, action) => ({
|
|
4904
|
+
...state,
|
|
4905
|
+
searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
|
|
4906
|
+
})), on(SearchActions.searchFailure, (state, action) => ({
|
|
4907
|
+
...state,
|
|
4908
|
+
searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
|
|
4909
|
+
})), on(SearchActions.setSearchLoading, (state, action) => ({
|
|
4910
|
+
...state,
|
|
4911
|
+
searchLoading: action.start
|
|
4912
|
+
? [...new Set([...state.searchLoading, ...action.datasources])]
|
|
4913
|
+
: [...state.searchLoading.filter((id) => !action.datasources.includes(id))]
|
|
4914
|
+
})), on(SearchActions.setPossibleFilterValues, (state, { filterId, values }) => ({
|
|
4915
|
+
...state,
|
|
4916
|
+
possibleFilterValues: {
|
|
4917
|
+
...state.possibleFilterValues,
|
|
4918
|
+
[filterId]: values
|
|
4919
|
+
}
|
|
4920
|
+
})));
|
|
4921
|
+
|
|
4922
|
+
const feature = createFeatureSelector(searchFeatureKey);
|
|
4923
|
+
const searchLoading = createSelector(feature, (state) => state.searchLoading);
|
|
4924
|
+
const possibleFilterValues = (filterId) => createSelector(feature, (state) => filterId && state.possibleFilterValues[filterId] ? state.possibleFilterValues[filterId] : []);
|
|
4925
|
+
const filterValues = createSelector(feature, (state) => state.possibleFilterValues);
|
|
4926
|
+
const SearchSelectors = {
|
|
4927
|
+
feature,
|
|
4928
|
+
searchLoading,
|
|
4929
|
+
filterValues,
|
|
4930
|
+
possibleFilterValues
|
|
4931
|
+
};
|
|
4932
|
+
|
|
4933
|
+
const operators = [
|
|
4934
|
+
'EQUALS',
|
|
4935
|
+
'CONTAINS',
|
|
4936
|
+
'I_CONTAINS',
|
|
4937
|
+
'GREATER_THAN',
|
|
4938
|
+
'START_WITH',
|
|
4939
|
+
'END_WITH',
|
|
4940
|
+
'LOWER_THAN',
|
|
4941
|
+
'INSIDE',
|
|
4942
|
+
'OUTSIDE',
|
|
4943
|
+
'IN',
|
|
4944
|
+
'NOT_IN'
|
|
4945
|
+
];
|
|
4946
|
+
class FilterParamEncoder extends HttpUrlEncodingCodec {
|
|
4947
|
+
constructor() {
|
|
4948
|
+
super();
|
|
4949
|
+
}
|
|
4950
|
+
encodeValue(v) {
|
|
4951
|
+
const hasOperator = operators.includes(v.split(',')?.[1]);
|
|
4952
|
+
if (hasOperator) {
|
|
4953
|
+
return v;
|
|
4954
|
+
}
|
|
4955
|
+
return encodeURIComponent(v);
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
|
|
4959
|
+
class DateUtils {
|
|
4960
|
+
static formatDate(date) {
|
|
4961
|
+
// prettier-ignore
|
|
4962
|
+
return `${date.getFullYear()}-${(date.getMonth() + 1 + "").padStart(2, "0")}-${(date.getDate() + "").padStart(2, "0")}T${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
|
|
4963
|
+
}
|
|
4964
|
+
static onlyPastDateValidator(control) {
|
|
4965
|
+
const today = new Date();
|
|
4966
|
+
if (new Date(control.value) <= today) {
|
|
4967
|
+
return null;
|
|
4968
|
+
}
|
|
4969
|
+
else {
|
|
4970
|
+
return { dateValidator: { valid: false } };
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
/**
|
|
4974
|
+
* Converts a string date into an ISO-8601 string format
|
|
4975
|
+
*
|
|
4976
|
+
* Works with this formats :
|
|
4977
|
+
* - "YYYY-MM-DD" : '2024-12-31' --> '2024-12-31T00:00:00.000Z'
|
|
4978
|
+
* - "MM/DD/YYYY" : '12/31/2024' --> '2024-12-30T23:00:00.000Z' (format FR donc prise en compte de la locale : UTC+1)
|
|
4979
|
+
* - "YYYY" : '2025' --> '2025-01-01T00:00:00.000Z'
|
|
4980
|
+
*
|
|
4981
|
+
* @param dateAsString the date to convert (example : 2024-12-31)
|
|
4982
|
+
* @see Date.parse
|
|
4983
|
+
* @see Date.toISOString
|
|
4984
|
+
*/
|
|
4985
|
+
static parseToIsoString(dateAsString) {
|
|
4986
|
+
try {
|
|
4987
|
+
return new Date(Date.parse(dateAsString)).toISOString();
|
|
4988
|
+
}
|
|
4989
|
+
catch (error) {
|
|
4990
|
+
return '';
|
|
4991
|
+
}
|
|
4992
|
+
}
|
|
4993
|
+
static isInTheFuture(date) {
|
|
4994
|
+
return new Date(date) > new Date(DateUtils.formatDate(new Date()));
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
|
|
4998
|
+
class SearchService {
|
|
4999
|
+
constructor(httpClient, store) {
|
|
5000
|
+
this.httpClient = httpClient;
|
|
5001
|
+
this.store = store;
|
|
5002
|
+
this.transformations = [];
|
|
5003
|
+
this.filters = {};
|
|
5004
|
+
this.limits = {};
|
|
5005
|
+
this.datasources = [];
|
|
5006
|
+
store.select(DashboardSelectors.datasourceFilters).subscribe((filters) => {
|
|
5007
|
+
this.filters = filters;
|
|
5008
|
+
});
|
|
5009
|
+
store.select(ConfigSelectors.limits).subscribe((limits) => {
|
|
5010
|
+
this.limits = limits;
|
|
5011
|
+
});
|
|
5012
|
+
store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => {
|
|
5013
|
+
this.datasources = datasources;
|
|
5014
|
+
});
|
|
5015
|
+
}
|
|
5016
|
+
getItems(id, quickOrder, excludeGeo, searchAfter, linkedItems = []) {
|
|
5017
|
+
const params = this.getItemsFilter(id, this.getOrder(quickOrder));
|
|
5018
|
+
if (!id) {
|
|
5019
|
+
console.warn('Not sending items request with no datasource attached.');
|
|
5020
|
+
return of({ items: {}, relations: [] });
|
|
5021
|
+
}
|
|
5022
|
+
return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => {
|
|
5023
|
+
const ds = this.datasources.find((d) => d.id === id);
|
|
5024
|
+
return this.httpClient.post(encodeURI(`${url}/data-sources/id/${id}/items`), {
|
|
5025
|
+
type: ds?.sourceType === 'namedQuery' ? ds.request.type : NamedQueryTypes.MONO_CLASS,
|
|
5026
|
+
excludeGeo: excludeGeo ?? false,
|
|
5027
|
+
searchAfter: searchAfter ?? undefined,
|
|
5028
|
+
linkedItems,
|
|
5029
|
+
limit: this.limits[id] || this.limits['default']
|
|
5030
|
+
}, { params });
|
|
5031
|
+
}), map((rs) => this.applyTransformations(id, rs)));
|
|
4935
5032
|
}
|
|
4936
|
-
|
|
4937
|
-
return this.
|
|
4938
|
-
.select(ConfigSelectors.refUrl)
|
|
4939
|
-
.pipe(mergeMap((url) => this.httpClient.get(`${url}/relation-types`)));
|
|
5033
|
+
getItemsSerializedParams(id, quickOrder = {}) {
|
|
5034
|
+
return '|' + this.getItemsFilter(id, this.getOrder(quickOrder[id])).toString() + '|';
|
|
4940
5035
|
}
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
5036
|
+
getItemsFilter(id, cumulative) {
|
|
5037
|
+
let params = cumulative ?? new HttpParams({ encoder: new FilterParamEncoder() });
|
|
5038
|
+
if (this.filters[id]) {
|
|
5039
|
+
this.filters[id]
|
|
5040
|
+
.filter((filter) => filter.value !== null && filter.value !== undefined)
|
|
5041
|
+
.forEach((filter) => {
|
|
5042
|
+
let valuesToAddToParams = filter.value;
|
|
5043
|
+
// INSIDE and OUTSIDE operators uses 2 values but not sent in an array, values are separated by a coma
|
|
5044
|
+
// wich must not be encoded (as if values were in an array)
|
|
5045
|
+
const isMultiValued = ['INSIDE', 'OUTSIDE'].find((val) => val === filter.operator) !== undefined;
|
|
5046
|
+
if (isMultiValued) {
|
|
5047
|
+
valuesToAddToParams = filter.value.split(',');
|
|
5048
|
+
}
|
|
5049
|
+
// date filter value must be send in ISO-8601 format
|
|
5050
|
+
if (filter.type === 'date') {
|
|
5051
|
+
valuesToAddToParams = isMultiValued
|
|
5052
|
+
? valuesToAddToParams.map((value) => DateUtils.parseToIsoString(value))
|
|
5053
|
+
: DateUtils.parseToIsoString(valuesToAddToParams);
|
|
5054
|
+
}
|
|
5055
|
+
const value = Array.isArray(valuesToAddToParams)
|
|
5056
|
+
? valuesToAddToParams.map((v) => encodeURIComponent(v.toString().split(',').join('\\,'))).join(',')
|
|
5057
|
+
: encodeURIComponent(valuesToAddToParams.toString().replace(/,/g, '\\,'));
|
|
5058
|
+
params = params.append('filter', `${filter.attribute},${filter.operator},${value}`);
|
|
5059
|
+
});
|
|
5060
|
+
}
|
|
5061
|
+
return params;
|
|
4945
5062
|
}
|
|
4946
|
-
|
|
4947
|
-
let
|
|
4948
|
-
if (
|
|
4949
|
-
|
|
5063
|
+
getOrder(quickOrder) {
|
|
5064
|
+
let params = new HttpParams({ encoder: new FilterParamEncoder() });
|
|
5065
|
+
if (quickOrder) {
|
|
5066
|
+
params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
|
|
4950
5067
|
}
|
|
4951
5068
|
else {
|
|
4952
|
-
|
|
5069
|
+
params = params.append('order', 'true,asc');
|
|
4953
5070
|
}
|
|
4954
|
-
return
|
|
5071
|
+
return params;
|
|
4955
5072
|
}
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
5073
|
+
/**
|
|
5074
|
+
* Launch a search request (and saves it as current search)
|
|
5075
|
+
* @param condition
|
|
5076
|
+
*/
|
|
5077
|
+
search(condition, id, withLinkedItems = []) {
|
|
5078
|
+
return this.store.select(ConfigSelectors.dataUrl).pipe(filter((url) => !!url), take(1), withLatestFrom(this.store.select(DashboardSelectors.quickOrder), this.store.select(ConfigSelectors.limits)), mergeMap(([url, quickOrder, limits]) => {
|
|
5079
|
+
const params = {};
|
|
5080
|
+
if (quickOrder[DEFAULT_NAMED_QUERY_ID]) {
|
|
5081
|
+
params['order'] = `${quickOrder[DEFAULT_NAMED_QUERY_ID]?.attribute},${quickOrder[DEFAULT_NAMED_QUERY_ID]?.asc ?? ''}`;
|
|
5082
|
+
}
|
|
5083
|
+
const otherParams = {};
|
|
5084
|
+
if (withLinkedItems.length > 0) {
|
|
5085
|
+
if (withLinkedItems.includes('destination')) {
|
|
5086
|
+
otherParams['withDestinationItems'] = 'true';
|
|
5087
|
+
}
|
|
5088
|
+
if (withLinkedItems.includes('source')) {
|
|
5089
|
+
otherParams['withSourceItems'] = 'true';
|
|
5090
|
+
}
|
|
5091
|
+
}
|
|
5092
|
+
const _condition = { ...condition, limit: limits[DEFAULT_NAMED_QUERY_ID] ?? limits['default'], ...otherParams };
|
|
5093
|
+
return this.httpClient.post(encodeURI(`${url}/items/search`), _condition, { params });
|
|
5094
|
+
}), map((rs) => this.applyTransformations(id ?? DEFAULT_NAMED_QUERY_ID, rs)));
|
|
4959
5095
|
}
|
|
4960
|
-
|
|
4961
|
-
|
|
5096
|
+
/**
|
|
5097
|
+
* Allows to add a transformation function when getting results from backend
|
|
5098
|
+
* @param func
|
|
5099
|
+
*/
|
|
5100
|
+
addTransformation(func) {
|
|
5101
|
+
this.transformations.push(func);
|
|
5102
|
+
}
|
|
5103
|
+
/**
|
|
5104
|
+
* Apply all transformation functions
|
|
5105
|
+
* @param id
|
|
5106
|
+
* @param rs
|
|
5107
|
+
*/
|
|
5108
|
+
applyTransformations(id, rs) {
|
|
5109
|
+
let transformed = rs;
|
|
5110
|
+
this.transformations.forEach((func) => (transformed = func(id, transformed)));
|
|
5111
|
+
return transformed;
|
|
5112
|
+
}
|
|
5113
|
+
autocomplete(attributes, search = '', limit) {
|
|
5114
|
+
return this.store.select(ConfigSelectors.dataUrl).pipe(switchMap((url) => this.httpClient.post(encodeURI(`${url}/data-sources/values`), {
|
|
5115
|
+
attributes: (attributes ?? []).map((attr) => ({ datasource: attr.datasource, attribute: attr.id })),
|
|
5116
|
+
value: search,
|
|
5117
|
+
limit
|
|
5118
|
+
})));
|
|
5119
|
+
}
|
|
5120
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5121
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, providedIn: 'root' }); }
|
|
4962
5122
|
}
|
|
4963
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type:
|
|
5123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, decorators: [{
|
|
4964
5124
|
type: Injectable,
|
|
4965
5125
|
args: [{
|
|
4966
5126
|
providedIn: 'root'
|
|
4967
5127
|
}]
|
|
4968
|
-
}], ctorParameters: () => [{ type: i1.
|
|
4969
|
-
|
|
4970
|
-
class RelationTypesEffects {
|
|
4971
|
-
constructor(actions$, service, router, pryDialog) {
|
|
4972
|
-
this.actions$ = actions$;
|
|
4973
|
-
this.service = service;
|
|
4974
|
-
this.router = router;
|
|
4975
|
-
this.pryDialog = pryDialog;
|
|
4976
|
-
this.loadRelationsTypes$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.load), debounceTime(100), mergeMap$1((action) => this.service.getRelationsTypes().pipe(map$1((datas) => RelationTypesActions.loadSuccess({ datas })), catchError((error) => [RelationTypesActions.loadFailure({ error })])))));
|
|
4977
|
-
this.saveRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationType), mergeMap$1((action) => this.service.addRelationType(action.id, action.name).pipe(map$1((data) => RelationTypesActions.saveRelationTypeSuccess()), catchError((error) => [RelationTypesActions.saveRelationTypeFailure({ error })])))));
|
|
4978
|
-
this.saveRelationTypeSuccess$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationTypeSuccess), map$1((action) => {
|
|
4979
|
-
return RelationTypesActions.load();
|
|
4980
|
-
})));
|
|
4981
|
-
this.deleteRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelationType), mergeMap$1((action) => {
|
|
4982
|
-
if (!action.relationType.deletable) {
|
|
4983
|
-
const data = {
|
|
4984
|
-
title: '@pry.admin.infoModalTitle',
|
|
4985
|
-
message: '@pry.admin.relationTypes.deleteModalMessage',
|
|
4986
|
-
actions: [{ id: 0, label: '@pry.admin.closeModale' }]
|
|
4987
|
-
};
|
|
4988
|
-
this.pryDialog.open(PryDialogConfirmComponent, { data });
|
|
4989
|
-
return [];
|
|
4990
|
-
}
|
|
4991
|
-
else {
|
|
4992
|
-
return this.service.deleteRelationType(action.relationType.id).pipe(map$1((data) => RelationTypesActions.deleteRelationTypeSuccess()), catchError((error) => [RelationTypesActions.deleteRelationTypeFailure({ error })]));
|
|
4993
|
-
}
|
|
4994
|
-
})));
|
|
4995
|
-
this.createRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.createRelation), mergeMap$1((action) => this.service.createRelation(action.from, action.to, action.typeId, action.inversion).pipe(mergeMap$1((relations) => [
|
|
4996
|
-
RelationTypesActions.createRelationSuccess(),
|
|
4997
|
-
DashboardActions.addRelationsToResultSets({ relations })
|
|
4998
|
-
]), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
|
|
4999
|
-
this.deleteRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelation), mergeMap$1((action) => this.service.deleteRelation(action.from, action.to, action.typeId).pipe(map$1((relation) => DashboardActions.removeRelationsFromResultSets({ relation })), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
|
|
5000
|
-
}
|
|
5001
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, deps: [{ token: i1$2.Actions }, { token: RelationTypesService }, { token: i2.Router }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5002
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects }); }
|
|
5003
|
-
}
|
|
5004
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, decorators: [{
|
|
5005
|
-
type: Injectable
|
|
5006
|
-
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: RelationTypesService }, { type: i2.Router }, { type: PryDialogService }] });
|
|
5007
|
-
|
|
5008
|
-
const relationTypesFeatureKey = '@pry/relation-types';
|
|
5009
|
-
const initialRelationTypeState = {
|
|
5010
|
-
relationsTypes: [],
|
|
5011
|
-
loading: false,
|
|
5012
|
-
openModal: false,
|
|
5013
|
-
openDeleteModale: false
|
|
5014
|
-
};
|
|
5015
|
-
const relationTypeReducer = createReducer(initialRelationTypeState, on(RelationTypesActions.load, (state, action) => ({
|
|
5016
|
-
...state,
|
|
5017
|
-
loading: true
|
|
5018
|
-
})), on(RelationTypesActions.loadSuccess, (state, action) => ({
|
|
5019
|
-
...state,
|
|
5020
|
-
relationsTypes: [...action.datas],
|
|
5021
|
-
loading: false
|
|
5022
|
-
})), on(RelationTypesActions.loadFailure, (state, action) => ({
|
|
5023
|
-
...state,
|
|
5024
|
-
loading: false
|
|
5025
|
-
})), on(RelationTypesActions.selectRelationType, (state, action) => ({
|
|
5026
|
-
...state,
|
|
5027
|
-
selectedRelationType: state.relationsTypes.find((rt) => rt.id === action.id)
|
|
5028
|
-
})), on(RelationTypesActions.unSelectRelationType, (state, action) => ({
|
|
5029
|
-
...state,
|
|
5030
|
-
selectedRelationType: undefined
|
|
5031
|
-
})), on(RelationTypesActions.openModal, (state, action) => ({
|
|
5032
|
-
...state,
|
|
5033
|
-
openModal: true
|
|
5034
|
-
})), on(RelationTypesActions.closeModal, (state, action) => ({
|
|
5035
|
-
...state,
|
|
5036
|
-
openModal: false
|
|
5037
|
-
})));
|
|
5128
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
|
|
5038
5129
|
|
|
5039
5130
|
class BaseWidgetComponent extends SubscriptionnerDirective {
|
|
5040
5131
|
set widgetIndex(index) {
|
|
@@ -5062,13 +5153,13 @@ class BaseWidgetComponent extends SubscriptionnerDirective {
|
|
|
5062
5153
|
this._widgetSize$ = new BehaviorSubject({ width: 300, height: 300 });
|
|
5063
5154
|
this.open$ = new Subject();
|
|
5064
5155
|
this.manifestModified = new EventEmitter();
|
|
5065
|
-
this.manifest$ = this.observableList$.pipe(combineLatestWith(this.staticManifest$), switchMap(([observables, staticManifest]) => (!staticManifest ? merge(...observables) : of(staticManifest))), distinctUntilChanged
|
|
5156
|
+
this.manifest$ = this.observableList$.pipe(combineLatestWith(this.staticManifest$), switchMap(([observables, staticManifest]) => (!staticManifest ? merge(...observables) : of(staticManifest))), distinctUntilChanged((p, v) => equal(p, v)));
|
|
5066
5157
|
this.subscriptions.add(this.manifest$.subscribe((manifest) => (this.manifest = manifest)));
|
|
5067
5158
|
this.displayHeader$ = this.manifest$.pipe(map((manifest) => manifest.header === undefined || manifest.header));
|
|
5068
5159
|
this.widgetSize$ = this._widgetSize$.pipe(startWith({
|
|
5069
5160
|
width: 300,
|
|
5070
5161
|
height: 300
|
|
5071
|
-
}), distinctUntilChanged
|
|
5162
|
+
}), distinctUntilChanged((p, c) => p.width === c.width && p.height === c.height), debounceTime(100), distinctUntilChanged((p, c) => p.width === c.width && p.height === c.height));
|
|
5072
5163
|
document.addEventListener('emit-manifest', () => this.emitManifest());
|
|
5073
5164
|
}
|
|
5074
5165
|
ngAfterViewChecked() {
|
|
@@ -5275,15 +5366,15 @@ class SearchEffects {
|
|
|
5275
5366
|
this.searchService = searchService;
|
|
5276
5367
|
this.store = store;
|
|
5277
5368
|
this.widgetFactoryService = widgetFactoryService;
|
|
5278
|
-
this.searchNamed$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getDatasourceItems), withLatestFrom
|
|
5369
|
+
this.searchNamed$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getDatasourceItems), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.quickOrder), this.store.select(DashboardSelectors.resultSets)), filter(([_, rank]) => rank === 0), filter(([props, rank]) => props.id !== DEFAULT_NAMED_QUERY_ID && props.id !== EXPLORE_NAMED_QUERY_ID), groupBy(([props, rank, quickOrder, rs]) => props.id), mergeMap((group$) => group$.pipe(debounceTime(100), switchMap(([props, rank, quickOrder, rs]) => this.searchService
|
|
5279
5370
|
.getItems(props.id, quickOrder[props.id], props.excludeGeo, props.next ? rs[props.id].searchAfter : undefined, props.linkedItems)
|
|
5280
5371
|
.pipe(map((resultSet) => SearchActions.searchSuccess({
|
|
5281
5372
|
resultSet,
|
|
5282
5373
|
id: props.id,
|
|
5283
5374
|
params: this.searchService.getItemsSerializedParams(props.id, quickOrder),
|
|
5284
5375
|
next: props.next
|
|
5285
|
-
})), catchError
|
|
5286
|
-
this.fetchMore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchMoreItems), withLatestFrom
|
|
5376
|
+
})), catchError((error) => [SearchActions.searchFailure({ error, id: props.id })])))))));
|
|
5377
|
+
this.fetchMore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchMoreItems), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.resultSets)), filter(([props, rank, rs]) => rank === 0 && !!rs[props.id].searchAfter), debounceTime(300), mergeMap(([props]) => {
|
|
5287
5378
|
const ds = this.widgetFactoryService.datasourcesToAutoLoad({
|
|
5288
5379
|
type: props.widgetType,
|
|
5289
5380
|
datasource: [props.id]
|
|
@@ -5302,14 +5393,14 @@ class SearchEffects {
|
|
|
5302
5393
|
})));
|
|
5303
5394
|
this.search$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.search), mergeMap((props) => this.searchService.search(props.payload, props.id, props.linkedItems).pipe(map((resultSet) => {
|
|
5304
5395
|
return SearchActions.searchSuccess({ resultSet, id: props.id });
|
|
5305
|
-
}), catchError
|
|
5396
|
+
}), catchError((error) => [SearchActions.searchFailure({ error, id: props.id })])))));
|
|
5306
5397
|
this.searchSuccess$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.searchSuccess), map((action) => DashboardActions.updateResultSet({
|
|
5307
5398
|
id: action.id ?? DEFAULT_NAMED_QUERY_ID,
|
|
5308
5399
|
resultSet: action.resultSet,
|
|
5309
5400
|
params: action.params,
|
|
5310
5401
|
next: action.next
|
|
5311
5402
|
}))));
|
|
5312
|
-
this.getPossibleFilterValues$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getPossibleFilterValues), mergeMap((action) => this.searchService
|
|
5403
|
+
this.getPossibleFilterValues$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getPossibleFilterValues), withLatestFrom(this.store.select(SearchSelectors.filterValues), this.store.select(DashboardSelectors.rank)), filter(([action, filterValues, rank]) => (action.force || !filterValues[action.filterId] || filterValues[action.filterId].length === 0) && rank === 0), mergeMap(([action]) => this.searchService
|
|
5313
5404
|
.autocomplete(action.attributes, '', action.limit)
|
|
5314
5405
|
.pipe(map((values) => SearchActions.setPossibleFilterValues({ filterId: action.filterId, values }))))));
|
|
5315
5406
|
}
|
|
@@ -5320,40 +5411,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5320
5411
|
type: Injectable
|
|
5321
5412
|
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: SearchService }, { type: i1.Store }, { type: WidgetFactoryService }] });
|
|
5322
5413
|
|
|
5323
|
-
const searchFeatureKey = '@pry/search';
|
|
5324
|
-
const initialSearchState = {
|
|
5325
|
-
searchLoading: [],
|
|
5326
|
-
payload: undefined,
|
|
5327
|
-
id: undefined,
|
|
5328
|
-
possibleFilterValues: {}
|
|
5329
|
-
};
|
|
5330
|
-
const searchReducer = createReducer(initialSearchState, on(SearchActions.search, (state, action) => ({
|
|
5331
|
-
...state,
|
|
5332
|
-
searchLoading: [...new Set([...state.searchLoading, action.id ?? DEFAULT_NAMED_QUERY_ID])],
|
|
5333
|
-
payload: action.payload,
|
|
5334
|
-
id: action.id
|
|
5335
|
-
})), on(SearchActions.getDatasourceItems, (state, action) => ({
|
|
5336
|
-
...state,
|
|
5337
|
-
searchLoading: [...new Set([...state.searchLoading, action.id])]
|
|
5338
|
-
})), on(SearchActions.searchSuccess, (state, action) => ({
|
|
5339
|
-
...state,
|
|
5340
|
-
searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
|
|
5341
|
-
})), on(SearchActions.searchFailure, (state, action) => ({
|
|
5342
|
-
...state,
|
|
5343
|
-
searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
|
|
5344
|
-
})), on(SearchActions.setSearchLoading, (state, action) => ({
|
|
5345
|
-
...state,
|
|
5346
|
-
searchLoading: action.start
|
|
5347
|
-
? [...new Set([...state.searchLoading, ...action.datasources])]
|
|
5348
|
-
: [...state.searchLoading.filter((id) => !action.datasources.includes(id))]
|
|
5349
|
-
})), on(SearchActions.setPossibleFilterValues, (state, { filterId, values }) => ({
|
|
5350
|
-
...state,
|
|
5351
|
-
possibleFilterValues: {
|
|
5352
|
-
...state.possibleFilterValues,
|
|
5353
|
-
[filterId]: values
|
|
5354
|
-
}
|
|
5355
|
-
})));
|
|
5356
|
-
|
|
5357
5414
|
class AccordionComponent {
|
|
5358
5415
|
constructor() { }
|
|
5359
5416
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -5526,23 +5583,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5526
5583
|
type: Input
|
|
5527
5584
|
}] } });
|
|
5528
5585
|
|
|
5529
|
-
const feature$3 = createFeatureSelector(fieldsFeatureKey);
|
|
5530
|
-
const entities$1 = createSelector(feature$3, selectEntities);
|
|
5531
|
-
const fields = createSelector(feature$3, selectAll);
|
|
5532
|
-
const memoizeFieldById = {};
|
|
5533
|
-
const fieldById = (id) => {
|
|
5534
|
-
if (!memoizeFieldById[id]) {
|
|
5535
|
-
memoizeFieldById[id] = createSelector(entities$1, (entities) => entities[id]);
|
|
5536
|
-
}
|
|
5537
|
-
return memoizeFieldById[id];
|
|
5538
|
-
};
|
|
5539
|
-
const FieldSelectors = {
|
|
5540
|
-
feature: feature$3,
|
|
5541
|
-
entities: entities$1,
|
|
5542
|
-
fields,
|
|
5543
|
-
fieldById
|
|
5544
|
-
};
|
|
5545
|
-
|
|
5546
5586
|
class TranslateIdPipe {
|
|
5547
5587
|
constructor(store, translateService, symbolService) {
|
|
5548
5588
|
this.store = store;
|
|
@@ -5796,15 +5836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5796
5836
|
}]
|
|
5797
5837
|
}], ctorParameters: () => [{ type: PryI18nService }] });
|
|
5798
5838
|
|
|
5799
|
-
const feature$2 = createFeatureSelector(searchFeatureKey);
|
|
5800
|
-
const searchLoading = createSelector(feature$2, (state) => state.searchLoading);
|
|
5801
|
-
const possibleFilterValues = (filterId) => createSelector(feature$2, (state) => filterId && state.possibleFilterValues[filterId] ? state.possibleFilterValues[filterId] : []);
|
|
5802
|
-
const SearchSelectors = {
|
|
5803
|
-
feature: feature$2,
|
|
5804
|
-
searchLoading,
|
|
5805
|
-
possibleFilterValues
|
|
5806
|
-
};
|
|
5807
|
-
|
|
5808
5839
|
const latLonToGeographicFieldTransformation = (latAttrName, lonAttrName, locAttrName, datasetIds = []) => (id, result) => {
|
|
5809
5840
|
if (datasetIds.length > 0 && !datasetIds.includes(id)) {
|
|
5810
5841
|
return result;
|
|
@@ -5839,15 +5870,6 @@ const latLonToGeographicFieldTransformation = (latAttrName, lonAttrName, locAttr
|
|
|
5839
5870
|
return targetResultSet;
|
|
5840
5871
|
};
|
|
5841
5872
|
|
|
5842
|
-
const feature$1 = createFeatureSelector(categoriesFeatureKey);
|
|
5843
|
-
const entities = createSelector(feature$1, selectEntities$1);
|
|
5844
|
-
const categories = createSelector(feature$1, selectAll$1);
|
|
5845
|
-
const CategorySelectors = {
|
|
5846
|
-
feature: feature$1,
|
|
5847
|
-
entities,
|
|
5848
|
-
categories
|
|
5849
|
-
};
|
|
5850
|
-
|
|
5851
5873
|
var PryVisibilityType;
|
|
5852
5874
|
(function (PryVisibilityType) {
|
|
5853
5875
|
PryVisibilityType["PRIVATE"] = "PRIVATE";
|
|
@@ -5855,22 +5877,6 @@ var PryVisibilityType;
|
|
|
5855
5877
|
PryVisibilityType["RESTRICTED"] = "RESTRICTED";
|
|
5856
5878
|
})(PryVisibilityType || (PryVisibilityType = {}));
|
|
5857
5879
|
|
|
5858
|
-
const feature = createFeatureSelector(relationTypesFeatureKey);
|
|
5859
|
-
const relationsTypes = createSelector(feature, (state) => {
|
|
5860
|
-
const arrayForSort = state?.relationsTypes ? [...state.relationsTypes] : [];
|
|
5861
|
-
return arrayForSort.sort((a, b) => a.name.localeCompare(b.name));
|
|
5862
|
-
});
|
|
5863
|
-
const selectedRelationType = createSelector(feature, (state) => state?.selectedRelationType);
|
|
5864
|
-
const openModal = createSelector(feature, (state) => state.openModal);
|
|
5865
|
-
const openDeleteModale = createSelector(feature, (state) => state.openDeleteModale);
|
|
5866
|
-
const RelationTypesSelectors = {
|
|
5867
|
-
feature,
|
|
5868
|
-
relationsTypes,
|
|
5869
|
-
selectedRelationType,
|
|
5870
|
-
openModal,
|
|
5871
|
-
openDeleteModale
|
|
5872
|
-
};
|
|
5873
|
-
|
|
5874
5880
|
class PryAggregationService {
|
|
5875
5881
|
aggregate(datasource, options) {
|
|
5876
5882
|
throw new Error('You must declare the use of an aggregation service. Add PryBackendAggregationService, PryFrontendAggregationService or a custom service');
|
|
@@ -5985,7 +5991,7 @@ class PryBackendAggregationService extends PryAggregationService {
|
|
|
5985
5991
|
if (options.abscissa && options.abscissa.limit) {
|
|
5986
5992
|
params = params.set('limit', `${options.abscissa.limit}`);
|
|
5987
5993
|
}
|
|
5988
|
-
params = this.searchService.getItemsFilter(targetDatasource, params
|
|
5994
|
+
params = this.searchService.getItemsFilter(targetDatasource, params);
|
|
5989
5995
|
const key = `${this.dataUrl}_${targetDatasource}_${params.toString()}`;
|
|
5990
5996
|
if (!this.cache[key] || this.cache[key].time + 1000 < new Date().getTime()) {
|
|
5991
5997
|
this.cache[key] = {
|
|
@@ -5993,7 +5999,7 @@ class PryBackendAggregationService extends PryAggregationService {
|
|
|
5993
5999
|
.get(`${this.dataUrl}/data-sources/id/${targetDatasource}/items/aggregate`, {
|
|
5994
6000
|
params
|
|
5995
6001
|
})
|
|
5996
|
-
.pipe(debounceTime
|
|
6002
|
+
.pipe(debounceTime(100), map((result) => ({
|
|
5997
6003
|
...result,
|
|
5998
6004
|
operation: options.ordinate.operation === Operation.NONE ? Operation.NONE : result.operation
|
|
5999
6005
|
})), share()),
|
|
@@ -8363,7 +8369,7 @@ class PryAccessRightsShareModalComponent {
|
|
|
8363
8369
|
this.data = data;
|
|
8364
8370
|
this.accessRightsByGroup = {};
|
|
8365
8371
|
this.disableShareButton$ = new BehaviorSubject(false);
|
|
8366
|
-
this.store.dispatch(DataSourceActions.dataset.loadDataset());
|
|
8372
|
+
this.store.dispatch(DataSourceActions.dataset.loadDataset({}));
|
|
8367
8373
|
this.store.dispatch(ConfigActions.loadAccessGroups());
|
|
8368
8374
|
this.manifest = this.data.manifest;
|
|
8369
8375
|
this.accessRightsByGroup = { ...this.manifest.accessRightsByGroup };
|
|
@@ -8919,9 +8925,9 @@ class WidgetInstanciatorComponent extends SubscriptionnerDirective {
|
|
|
8919
8925
|
}
|
|
8920
8926
|
ngAfterViewInit() {
|
|
8921
8927
|
// Dynamically create associated component
|
|
8922
|
-
this.widgetManifest$ = combineLatest([this.staticManifest$, this._widgetIndex$]).pipe(distinctUntilChanged
|
|
8928
|
+
this.widgetManifest$ = combineLatest([this.staticManifest$, this._widgetIndex$]).pipe(distinctUntilChanged(), switchMap(([staticManifest, index]) => !!staticManifest ? of(staticManifest) : this.store.select(DashboardSelectors.widgetManifest(index))), distinctUntilChanged((p, c) => equal(p, c)));
|
|
8923
8929
|
this.subscriptions.add(this.widgetManifest$
|
|
8924
|
-
.pipe(map((widgetManifest) => ({ type: widgetManifest.type, layout: widgetManifest.layout })), distinctUntilChanged
|
|
8930
|
+
.pipe(map((widgetManifest) => ({ type: widgetManifest.type, layout: widgetManifest.layout })), distinctUntilChanged((p, c) => equal(p, c)), withLatestFrom(this.widgetManifest$), map(([triggering, widgetManifest]) => widgetManifest))
|
|
8925
8931
|
.subscribe((widgetManifest) => {
|
|
8926
8932
|
this.componentRef.clear();
|
|
8927
8933
|
this.instanceSubscription?.unsubscribe();
|
|
@@ -9388,11 +9394,11 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
9388
9394
|
this.DashboardGridLayout = DashboardGridLayout;
|
|
9389
9395
|
this.layout = DashboardGridLayout.MANUAL;
|
|
9390
9396
|
this.loading$ = this.store.select(DashboardSelectors.loading);
|
|
9391
|
-
this.dataFetching$ = this.store.select(SearchSelectors.searchLoading).pipe(delay
|
|
9397
|
+
this.dataFetching$ = this.store.select(SearchSelectors.searchLoading).pipe(delay(10));
|
|
9392
9398
|
this.modeEdition$ = combineLatest([
|
|
9393
9399
|
this.store.select(DashboardSelectors.dashboardEditionMode),
|
|
9394
9400
|
this.forceModeEdition$
|
|
9395
|
-
]).pipe(map
|
|
9401
|
+
]).pipe(map(([storeMode, forceMode]) => (forceMode === undefined ? storeMode : forceMode)));
|
|
9396
9402
|
this.subscriptions.add(this.modeEdition$.subscribe((mode) => {
|
|
9397
9403
|
this.modeEdition = mode;
|
|
9398
9404
|
if (!mode) {
|
|
@@ -9401,7 +9407,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
9401
9407
|
}));
|
|
9402
9408
|
this.targetIndexes$ = this.store.select(DashboardSelectors.targetTenantsIndexes);
|
|
9403
9409
|
this.subscriptions.add(this.store.select(DashboardSelectors.dashboardCellParams).subscribe((params) => (this.dashboardParams = params)));
|
|
9404
|
-
this.windowManifest$ = this.store.select(DashboardSelectors.windowManifest).pipe(combineLatestWith(this.staticDashboard$), switchMap(([windowManifest, staticDashboard]) => (!staticDashboard ? of(windowManifest) : of(staticDashboard))), map
|
|
9410
|
+
this.windowManifest$ = this.store.select(DashboardSelectors.windowManifest).pipe(combineLatestWith(this.staticDashboard$), switchMap(([windowManifest, staticDashboard]) => (!staticDashboard ? of(windowManifest) : of(staticDashboard))), map((_wManifest) => {
|
|
9405
9411
|
const wManifest = structuredClone(_wManifest);
|
|
9406
9412
|
if (wManifest.grid?.layout && wManifest.grid.layout !== DashboardGridLayout.MANUAL) {
|
|
9407
9413
|
// Complete with placeholders
|
|
@@ -9424,7 +9430,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
9424
9430
|
}
|
|
9425
9431
|
return wManifest;
|
|
9426
9432
|
}), distinctUntilChanged((p, c) => equal(p, c)));
|
|
9427
|
-
this.nonFillerWidgets$ = this.windowManifest$.pipe(map
|
|
9433
|
+
this.nonFillerWidgets$ = this.windowManifest$.pipe(map((wManifest) => (wManifest.widgets ?? []).filter((w) => w.type !== 'filler').length));
|
|
9428
9434
|
this.subscriptions.add(this.staticDashboard$.subscribe((manifest) => {
|
|
9429
9435
|
if (!!manifest) {
|
|
9430
9436
|
this.store.dispatch(DashboardActions.assertResultSets({
|
|
@@ -9437,13 +9443,13 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
9437
9443
|
this.store.dispatch(DashboardActions.assertResultSets({}));
|
|
9438
9444
|
}
|
|
9439
9445
|
}));
|
|
9440
|
-
this.store.dispatch(FieldActions.load());
|
|
9441
|
-
this.store.dispatch(ClassActions.load());
|
|
9442
|
-
this.store.dispatch(CategoryActions.load());
|
|
9446
|
+
this.store.dispatch(FieldActions.load({}));
|
|
9447
|
+
this.store.dispatch(ClassActions.load({}));
|
|
9448
|
+
this.store.dispatch(CategoryActions.load({}));
|
|
9443
9449
|
this.store.dispatch(ConfigActions.getMapStyles());
|
|
9444
|
-
this.store.dispatch(DataSourceActions.load());
|
|
9445
|
-
this.store.dispatch(RelationTypesActions.load());
|
|
9446
|
-
this.store.dispatch(ConfigActions.loadCustomization());
|
|
9450
|
+
this.store.dispatch(DataSourceActions.load({}));
|
|
9451
|
+
this.store.dispatch(RelationTypesActions.load({}));
|
|
9452
|
+
this.store.dispatch(ConfigActions.loadCustomization({}));
|
|
9447
9453
|
this.subscriptions.add(fromEvent(window, 'resize')
|
|
9448
9454
|
.pipe(auditTime(100))
|
|
9449
9455
|
.subscribe(() => {
|
|
@@ -9455,7 +9461,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
9455
9461
|
this.calculateView();
|
|
9456
9462
|
}));
|
|
9457
9463
|
this.subscriptions.add(fromEvent(window, 'keydown')
|
|
9458
|
-
.pipe(map
|
|
9464
|
+
.pipe(map(($event) => $event), filter(($event) => $event.key === 'L' && $event.ctrlKey && $event.shiftKey))
|
|
9459
9465
|
.subscribe(() => this.store.dispatch(DashboardActions.toggleEditionMode({}))));
|
|
9460
9466
|
this.subscriptions.add(fromEvent(window, 'mouseup').subscribe(() => {
|
|
9461
9467
|
this.clearActions();
|
|
@@ -9469,16 +9475,16 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
9469
9475
|
this.subscriptions.add(this.store.select(DashboardSelectors.gridLayout).subscribe((layout) => {
|
|
9470
9476
|
this.layout = layout;
|
|
9471
9477
|
}));
|
|
9472
|
-
this.gridTemplateRows$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map
|
|
9478
|
+
this.gridTemplateRows$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map(([manifest, stacked]) => this.generateRows(stacked && this.manifest
|
|
9473
9479
|
? this.manifest?.widgets.map((wm) => wm.layout.height).reduce((wm1, wm2) => wm1 + wm2, 0)
|
|
9474
9480
|
: manifest.grid?.rows ?? DEFAULT_ROWS_NUMBER)));
|
|
9475
|
-
this.gridTemplateColumns$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map
|
|
9476
|
-
this.backgroundArea$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map
|
|
9481
|
+
this.gridTemplateColumns$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map(([manifest, stacked]) => this.generateColumns(stacked ? 1 : manifest.grid?.columns || DEFAULT_COLUMNS_NUMBER)));
|
|
9482
|
+
this.backgroundArea$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map(([manifest, stacked]) => !stacked
|
|
9477
9483
|
? `1/1/${(manifest.grid?.rows ?? DEFAULT_ROWS_NUMBER) + 1}/${(manifest.grid?.columns ?? DEFAULT_COLUMNS_NUMBER) + 1}`
|
|
9478
9484
|
: `1/1/${(manifest.grid?.columns ?? DEFAULT_COLUMNS_NUMBER) + 1}/1`));
|
|
9479
9485
|
this.separators$ = this.store
|
|
9480
9486
|
.select(DashboardSelectors.gridLayout)
|
|
9481
|
-
.pipe(map
|
|
9487
|
+
.pipe(map((layout) => layout === DashboardGridLayout.MANUAL ? [] : WidgetPlacementUtils.getLayout(layout)?.places ?? []));
|
|
9482
9488
|
}
|
|
9483
9489
|
ngOnInit() {
|
|
9484
9490
|
if (this.displayOptions)
|
|
@@ -10605,7 +10611,7 @@ class ActionBusEffects {
|
|
|
10605
10611
|
this.busService = busService;
|
|
10606
10612
|
this.forwardOnBus$ = createEffect(() => this.actions$.pipe(
|
|
10607
10613
|
// For actions with type containing "(bus)", automatically transfer it on the data-bus to propagate to other windows
|
|
10608
|
-
filter
|
|
10614
|
+
filter((action) => action.type.includes('(bus)')), tap((action) => this.busService.postData(action))), { dispatch: false });
|
|
10609
10615
|
}
|
|
10610
10616
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ActionBusEffects, deps: [{ token: i1$2.Actions }, { token: i1.Store }, { token: BusService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10611
10617
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ActionBusEffects }); }
|
|
@@ -10768,7 +10774,7 @@ class DataWidgetComponent extends BaseWidgetComponent {
|
|
|
10768
10774
|
relations: [],
|
|
10769
10775
|
merged: resultSetArray.length
|
|
10770
10776
|
});
|
|
10771
|
-
}), distinctUntilChanged
|
|
10777
|
+
}), distinctUntilChanged((p, v) => equal(p, v)));
|
|
10772
10778
|
}
|
|
10773
10779
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataWidgetComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10774
10780
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: DataWidgetComponent, selector: "pry-data-widget", inputs: { openData$: "openData$", staticResultSet: "staticResultSet" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
@@ -10841,7 +10847,7 @@ class PryDatasourceListComponent extends SubscriptionnerDirective {
|
|
|
10841
10847
|
this.consultedDataset = new EventEmitter();
|
|
10842
10848
|
this.datasourceSelected = new EventEmitter();
|
|
10843
10849
|
this.searchOrCategoryChanged = new EventEmitter();
|
|
10844
|
-
this.store.dispatch(DataSourceActions.load());
|
|
10850
|
+
this.store.dispatch(DataSourceActions.load({}));
|
|
10845
10851
|
this.datasources$ = combineLatest([
|
|
10846
10852
|
this.store.select(DataSourceSelectors.getDataSourcesSorted),
|
|
10847
10853
|
this.selectedDatasources$
|
|
@@ -10854,7 +10860,7 @@ class PryDatasourceListComponent extends SubscriptionnerDirective {
|
|
|
10854
10860
|
this.subscriptions.add(this.selectedCategories$.subscribe((_) => {
|
|
10855
10861
|
this.searchOrCategoryChanged.next();
|
|
10856
10862
|
}));
|
|
10857
|
-
this.subscriptions.add(this.search$.pipe(debounceTime
|
|
10863
|
+
this.subscriptions.add(this.search$.pipe(debounceTime(100)).subscribe((_) => {
|
|
10858
10864
|
this.searchOrCategoryChanged.next();
|
|
10859
10865
|
}));
|
|
10860
10866
|
}
|
|
@@ -10941,7 +10947,7 @@ class DatasourceSelectorComponent extends SubscriptionnerDirective {
|
|
|
10941
10947
|
this.itemsChanged.emit(selectedIds);
|
|
10942
10948
|
this.detectChanges();
|
|
10943
10949
|
}));
|
|
10944
|
-
this.subscriptions.add(this.searchOrCategoryChanged$.pipe(delay
|
|
10950
|
+
this.subscriptions.add(this.searchOrCategoryChanged$.pipe(delay(50)).subscribe(() => {
|
|
10945
10951
|
this.detectChanges();
|
|
10946
10952
|
}));
|
|
10947
10953
|
}
|
|
@@ -11073,7 +11079,7 @@ class PryWidgetHeaderComponent extends SubscriptionnerDirective {
|
|
|
11073
11079
|
this.type = LibraryTypes.ILLUSTRATION;
|
|
11074
11080
|
this.windowManifest$ = this.store
|
|
11075
11081
|
.select(DashboardSelectors.windowManifest)
|
|
11076
|
-
.pipe(distinctUntilChanged
|
|
11082
|
+
.pipe(distinctUntilChanged((p, c) => equal(p, c)));
|
|
11077
11083
|
this.targetIndexes$ = this.store.select(DashboardSelectors.targetTenantsIndexes);
|
|
11078
11084
|
this.subscriptions.add(this.windowManifest$.subscribe((manifest) => {
|
|
11079
11085
|
this.windowManifest = manifest;
|
|
@@ -11913,12 +11919,12 @@ class ManifestService {
|
|
|
11913
11919
|
if (!!actual) {
|
|
11914
11920
|
return this.httpClient
|
|
11915
11921
|
.put(encodeURI(`${url}/users/me/dashboards/id/${id}/default`), {})
|
|
11916
|
-
.pipe(map
|
|
11922
|
+
.pipe(map(() => true));
|
|
11917
11923
|
}
|
|
11918
11924
|
else {
|
|
11919
11925
|
return this.httpClient
|
|
11920
11926
|
.delete(encodeURI(`${url}/users/me/dashboards/default`), {})
|
|
11921
|
-
.pipe(map
|
|
11927
|
+
.pipe(map(() => false));
|
|
11922
11928
|
}
|
|
11923
11929
|
}));
|
|
11924
11930
|
}
|
|
@@ -11986,7 +11992,7 @@ class RefreshService {
|
|
|
11986
11992
|
start() {
|
|
11987
11993
|
if (!this.subscription) {
|
|
11988
11994
|
this.subscription = interval(1000)
|
|
11989
|
-
.pipe(withLatestFrom(this.store.select(DashboardSelectors.refreshRates), this.store.select(DashboardSelectors.globalManifest)), map
|
|
11995
|
+
.pipe(withLatestFrom(this.store.select(DashboardSelectors.refreshRates), this.store.select(DashboardSelectors.globalManifest)), map(([interval, refreshRates, globalManifest]) => {
|
|
11990
11996
|
const datasources = this.widgetFactoryService.getObjectsToAutoLoad(globalManifest).datasources;
|
|
11991
11997
|
return Object.keys(refreshRates)
|
|
11992
11998
|
.filter((key) => datasources.map((ds) => ds.datasetId).includes(key))
|
|
@@ -12116,7 +12122,7 @@ class DashboardEffects {
|
|
|
12116
12122
|
this.wmsService = wmsService;
|
|
12117
12123
|
this.widgetFactoryService = widgetFactoryService;
|
|
12118
12124
|
this.i18nService = i18nService;
|
|
12119
|
-
this.join$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.join), delay(1000), 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
|
|
12125
|
+
this.join$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.join), delay(1000), 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(([action, rank, tenants, manifest, resultSets, display]) => rank === 0), debounceTime(200), map(([action, rank, tenants, manifest, resultSets, selectedIds, presentation, display]) => DashboardActions.updateManifestAfterTenantJoin({
|
|
12120
12126
|
tenants, // we already have added tenant in the reduce of the "join" action
|
|
12121
12127
|
manifest: {
|
|
12122
12128
|
...manifest,
|
|
@@ -12128,7 +12134,7 @@ class DashboardEffects {
|
|
|
12128
12134
|
presentation,
|
|
12129
12135
|
display
|
|
12130
12136
|
}))));
|
|
12131
|
-
this.leave$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.leave), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), filter
|
|
12137
|
+
this.leave$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.leave), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), filter(([action, rank, tenants, manifest]) => rank === 0 || (tenants[0] === action.sender && rank === 1)), map(([action, rank, tenants, manifest, selectedIds]) => {
|
|
12132
12138
|
const leaverRank = tenants.indexOf(action.sender);
|
|
12133
12139
|
const newTenantsList = [...tenants];
|
|
12134
12140
|
const newWindowList = [...manifest.windows];
|
|
@@ -12145,10 +12151,10 @@ class DashboardEffects {
|
|
|
12145
12151
|
selectedIds
|
|
12146
12152
|
});
|
|
12147
12153
|
})));
|
|
12148
|
-
this.fetchStaticManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchStaticManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter
|
|
12154
|
+
this.fetchStaticManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchStaticManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter(([action, rank]) => rank === 0), mergeMap(([action, rank]) => this.manifestService
|
|
12149
12155
|
.get(action.id)
|
|
12150
|
-
.pipe(map
|
|
12151
|
-
this.loadAndActivateManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.loadAndActivateManifest, DashboardActions.loadManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter
|
|
12156
|
+
.pipe(map((staticManifest) => DashboardActions.updateStaticManifest({ staticManifest }))))));
|
|
12157
|
+
this.loadAndActivateManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.loadAndActivateManifest, DashboardActions.loadManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter(([action, rank]) => rank === 0), mergeMap(([action, rank, selectedIds]) => this.manifestService.get(action.id).pipe(mergeMap((manifest) => {
|
|
12152
12158
|
return action.type === DashboardActions.loadAndActivateManifest.type
|
|
12153
12159
|
? [
|
|
12154
12160
|
DashboardActions.updateManifestAfterFetch({ manifest, manifestId: action.id, selectedIds }),
|
|
@@ -12156,7 +12162,7 @@ class DashboardEffects {
|
|
|
12156
12162
|
]
|
|
12157
12163
|
: [DashboardActions.updateManifestWithoutActivation({ manifest, manifestId: action.id, selectedIds })];
|
|
12158
12164
|
})))));
|
|
12159
|
-
this.clearManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.clearManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), map
|
|
12165
|
+
this.clearManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.clearManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), map(([action, manifest, selectedIds]) => DashboardActions.updateManifestAfterFetch({ manifest, manifestId: '', selectedIds }))));
|
|
12160
12166
|
this.downloadManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.downloadManifest), tap((action) => this.manifestService.get(action.id).subscribe((manifest) => {
|
|
12161
12167
|
const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(manifest));
|
|
12162
12168
|
const dlAnchorElem = document.createElement('a');
|
|
@@ -12169,11 +12175,11 @@ class DashboardEffects {
|
|
|
12169
12175
|
this.router.navigateByUrl(manifest.route);
|
|
12170
12176
|
}
|
|
12171
12177
|
})), { dispatch: false });
|
|
12172
|
-
this.endLoadingAfterFollowingManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.followManifestRoute), map
|
|
12173
|
-
this.requestManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.requestAllRoutes), map
|
|
12178
|
+
this.endLoadingAfterFollowingManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.followManifestRoute), map((action) => DashboardActions.endLoading())));
|
|
12179
|
+
this.requestManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.requestAllRoutes), map(() => DashboardActions.updateRouteManifest({ route: this.router.url }))));
|
|
12174
12180
|
this.requestManifestsToEmit$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.requestManifestsToEmit), tap(() => document.dispatchEvent(new CustomEvent('emit-manifest')))), { dispatch: false });
|
|
12175
|
-
this.dispatchFilter$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.dispatchFilters), map
|
|
12176
|
-
this.assertResultSets$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.assertResultSets, DashboardActions.dispatchFilters, DashboardActions.clearAllFilterValues), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.resultSetsParams), this.store.select(DashboardSelectors.quickOrder)), mergeMap
|
|
12181
|
+
this.dispatchFilter$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.dispatchFilters), map(() => DashboardActions.requestManifestsToEmit())));
|
|
12182
|
+
this.assertResultSets$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.assertResultSets, DashboardActions.dispatchFilters, DashboardActions.clearAllFilterValues), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.resultSetsParams), this.store.select(DashboardSelectors.quickOrder)), mergeMap(([action, manifest, resultSets, resultSetsParams, quickOrder]) => {
|
|
12177
12183
|
const manifestToCheck = (action.type === DashboardActions.assertResultSets.type ||
|
|
12178
12184
|
action.type === DashboardActions.dispatchFilters.type) &&
|
|
12179
12185
|
action.staticManifest
|
|
@@ -12212,8 +12218,8 @@ class DashboardEffects {
|
|
|
12212
12218
|
}));
|
|
12213
12219
|
return [...toItemsActions, ...toAggregateActions];
|
|
12214
12220
|
})));
|
|
12215
|
-
this.sendAggregatesEvent$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.triggerAggregate), filter
|
|
12216
|
-
this.startMissingViewAfterViewUpdate$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateManifest, DashboardActions.updateManifestAfterFetch, DashboardActions.updateManifestAfterTenantLeave, DashboardActions.updateManifestAfterTenantJoin, DashboardActions.explore, DashboardActions.detail, DashboardActions.restoreInitialManifest, DashboardActions.createTab, DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter
|
|
12221
|
+
this.sendAggregatesEvent$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.triggerAggregate), filter((action) => action.id !== DEFAULT_NAMED_QUERY_ID && action.id !== EXPLORE_NAMED_QUERY_ID), tap((action) => window.dispatchEvent(new CustomEvent('datasourceRefresh', { detail: action.id })))), { dispatch: false });
|
|
12222
|
+
this.startMissingViewAfterViewUpdate$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateManifest, DashboardActions.updateManifestAfterFetch, DashboardActions.updateManifestAfterTenantLeave, DashboardActions.updateManifestAfterTenantJoin, DashboardActions.explore, DashboardActions.detail, DashboardActions.restoreInitialManifest, DashboardActions.createTab, DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter(([action, rank]) => rank === 0), mergeMap((action) => [
|
|
12217
12223
|
DashboardActions.startingMissingViews(),
|
|
12218
12224
|
DashboardActions.assertResultSets({}),
|
|
12219
12225
|
DashboardActions.solveCollisions()
|
|
@@ -12221,7 +12227,7 @@ class DashboardEffects {
|
|
|
12221
12227
|
this.updateTitle$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateManifest, DashboardActions.updateManifestAfterTenantJoin, DashboardActions.updateManifestAfterTenantLeave, DashboardActions.updateManifestAfterFetch, DashboardActions.declareSenderId), withLatestFrom(this.store.select(DashboardSelectors.rank)), tap(([action, rank]) => {
|
|
12222
12228
|
this.titleService.changeTitle();
|
|
12223
12229
|
})), { dispatch: false });
|
|
12224
|
-
this.openOther$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.startingMissingViews), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest)), debounceTime
|
|
12230
|
+
this.openOther$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.startingMissingViews), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest)), debounceTime(1000), filter(([action, rank, tenants, manifest]) => rank === 0), tap(([action, rank, tenants, manifest]) => {
|
|
12225
12231
|
manifest.windows.forEach((windowManifest, index) => {
|
|
12226
12232
|
if (!tenants[index]) {
|
|
12227
12233
|
// If no window is opened for this part, then open one
|
|
@@ -12229,7 +12235,7 @@ class DashboardEffects {
|
|
|
12229
12235
|
}
|
|
12230
12236
|
});
|
|
12231
12237
|
})), { dispatch: false });
|
|
12232
|
-
this.saveManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.saveManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), withLatestFrom(this.store.select(DataSourceSelectors.datasets)), mergeMap
|
|
12238
|
+
this.saveManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.saveManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), withLatestFrom(this.store.select(DataSourceSelectors.datasets)), mergeMap(([[action, currentManifest], datasets]) => this.manifestService
|
|
12233
12239
|
.save(action.name, action.manifest ?? currentManifest, action.id, action.description, action.image, action.metadata, action.accessRightsByGroup, action.additionalInformation)
|
|
12234
12240
|
.pipe(tap((response) => {
|
|
12235
12241
|
this.snackBar.open({
|
|
@@ -12255,7 +12261,7 @@ class DashboardEffects {
|
|
|
12255
12261
|
};
|
|
12256
12262
|
this.pryDialog.open(PryDialogConfirmComponent, { data });
|
|
12257
12263
|
}
|
|
12258
|
-
}), map
|
|
12264
|
+
}), map(() => action.manifest ?? currentManifest), catchError((error) => {
|
|
12259
12265
|
this.snackBar.open({
|
|
12260
12266
|
message: this.translateService.instant('@pry.toolbox.manifest.saveErrorCode.' + (error.error?.code ?? 'UNKNOWN'), {
|
|
12261
12267
|
name: action.name
|
|
@@ -12263,12 +12269,12 @@ class DashboardEffects {
|
|
|
12263
12269
|
type: 'error'
|
|
12264
12270
|
});
|
|
12265
12271
|
return throwError(() => error);
|
|
12266
|
-
}))), withLatestFrom(this.store.select(DashboardSelectors.selectedItemIds)), mergeMap
|
|
12272
|
+
}))), withLatestFrom(this.store.select(DashboardSelectors.selectedItemIds)), mergeMap(([manifest, selectedIds]) => [
|
|
12267
12273
|
DashboardActions.fetchManifestsList(),
|
|
12268
12274
|
DashboardActions.setInitialPresentation({ initial: manifest }),
|
|
12269
12275
|
DashboardActions.updateManifest({ manifest, selectedIds })
|
|
12270
12276
|
])));
|
|
12271
|
-
this.listManifests$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchManifestsList), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter
|
|
12277
|
+
this.listManifests$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchManifestsList), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter(([action, rank]) => rank === 0 || rank === -1), debounceTime(100), mergeMap(([action, rank]) => this.manifestService.list().pipe(map((manifests) => DashboardActions.updateManifestsList({ manifests }))))));
|
|
12272
12278
|
this.confirmManifestDeletion$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.confirmManifestDeletion), tap((action) => {
|
|
12273
12279
|
const data = {
|
|
12274
12280
|
title: '@pry.widget.modalTitle',
|
|
@@ -12287,23 +12293,23 @@ class DashboardEffects {
|
|
|
12287
12293
|
};
|
|
12288
12294
|
this.pryDialog.open(PryDialogConfirmComponent, { data });
|
|
12289
12295
|
})), { dispatch: false });
|
|
12290
|
-
this.deleteManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifest), mergeMap
|
|
12291
|
-
this.fetchObjectsDetails$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchObjectsDetails), mergeMap
|
|
12292
|
-
this.proximitySearch$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.proximity), withLatestFrom(this.store.select(DashboardSelectors.resultSets)), mergeMap
|
|
12296
|
+
this.deleteManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifest), mergeMap((action) => this.manifestService.delete(action.id).pipe(map(() => DashboardActions.fetchManifestsList())))));
|
|
12297
|
+
this.fetchObjectsDetails$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchObjectsDetails), mergeMap((action) => merge(...action.ids.map((id) => this.itemService.get(id)))), map((item) => DashboardActions.updateObjectsDetails({ list: { [item.id]: item } }))));
|
|
12298
|
+
this.proximitySearch$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.proximity), withLatestFrom(this.store.select(DashboardSelectors.resultSets)), mergeMap(([action, resultSets]) => this.itemService.proximity(action.id).pipe(map((proxRs) => {
|
|
12293
12299
|
return DashboardActions.updateResultSet({
|
|
12294
12300
|
id: action.targetResultSet,
|
|
12295
12301
|
resultSet: ResultsetUtils.mergeResultSets(proxRs, resultSets[action.targetResultSet])
|
|
12296
12302
|
});
|
|
12297
12303
|
})))));
|
|
12298
|
-
this.explore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.explore), mergeMap
|
|
12299
|
-
this.detailAsLoadInWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.detail), map
|
|
12304
|
+
this.explore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.explore), mergeMap((action) => [DashboardActions.proximity({ id: action.id, targetResultSet: EXPLORE_NAMED_QUERY_ID })])));
|
|
12305
|
+
this.detailAsLoadInWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.detail), map((action) => DashboardActions.addWidgetToPresentation({
|
|
12300
12306
|
id: '',
|
|
12301
12307
|
widgetType: 'detail',
|
|
12302
12308
|
additionalOptions: {
|
|
12303
12309
|
itemIds: action.ids
|
|
12304
12310
|
}
|
|
12305
12311
|
}))));
|
|
12306
|
-
this.updateWidgetInPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateWidgetInPresentation), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), mergeMap
|
|
12312
|
+
this.updateWidgetInPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateWidgetInPresentation), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), mergeMap(([action, manifest]) => {
|
|
12307
12313
|
// Check if a widget with same datasource and type already exist in current presentation
|
|
12308
12314
|
const widgetToMatch = this.toolboxManifestService.get(action.widgetType);
|
|
12309
12315
|
let additionalMatchingFn;
|
|
@@ -12339,7 +12345,7 @@ class DashboardEffects {
|
|
|
12339
12345
|
}
|
|
12340
12346
|
return result;
|
|
12341
12347
|
})));
|
|
12342
|
-
this.addWidgetToPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addWidgetToPresentation), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map
|
|
12348
|
+
this.addWidgetToPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addWidgetToPresentation), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map(([action, layout, _globalManifest, rank, params, selectedIds]) => {
|
|
12343
12349
|
const manifestGlobal = structuredClone(_globalManifest);
|
|
12344
12350
|
// Create new configuration
|
|
12345
12351
|
const newOptions = this.toolboxManifestService.get(action.widgetType) ?? {
|
|
@@ -12410,7 +12416,7 @@ class DashboardEffects {
|
|
|
12410
12416
|
}
|
|
12411
12417
|
return DashboardActions.updateManifest({ manifest: manifestGlobal, selectedIds });
|
|
12412
12418
|
})));
|
|
12413
|
-
this.moveWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map
|
|
12419
|
+
this.moveWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map(([action, layout, _globalManifest, rank, params, selectedIds]) => {
|
|
12414
12420
|
const manifestGlobal = structuredClone(_globalManifest);
|
|
12415
12421
|
const newWindows = [...manifestGlobal.windows];
|
|
12416
12422
|
// Creating new current window manifest, without moved widget
|
|
@@ -12478,16 +12484,16 @@ class DashboardEffects {
|
|
|
12478
12484
|
return DashboardActions.updateManifest({ manifest: { ...manifestGlobal, windows: newWindows }, selectedIds });
|
|
12479
12485
|
})));
|
|
12480
12486
|
this.multiSnackBar$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.multiSnackBar), tap((action) => this.snackBar.open(action.message))), { dispatch: false });
|
|
12481
|
-
this.relaunchAfterOrder$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.quickOrder), map
|
|
12487
|
+
this.relaunchAfterOrder$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.quickOrder), map((action) => SearchActions.getDatasourceItems({
|
|
12482
12488
|
id: action.datasourceId,
|
|
12483
12489
|
excludeGeo: true,
|
|
12484
12490
|
from: 'DashboardEffects.relaunchAfterOrder$'
|
|
12485
12491
|
}))));
|
|
12486
|
-
this.propagateGridLayout$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.windowManifest)), map
|
|
12487
|
-
this.toggleEditionModeIfNotManual$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), filter
|
|
12488
|
-
this.getCapability$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getCapability), withLatestFrom(this.store.select(DashboardSelectors.capabilities)), filter
|
|
12489
|
-
!!action.force), mergeMap
|
|
12490
|
-
this.getWmsFeatures = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWmsFeatures), mergeMap
|
|
12492
|
+
this.propagateGridLayout$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.windowManifest)), map(([action, rank, windowManifest]) => DashboardActions.propagateGridLayout({ manifest: windowManifest, rank }))));
|
|
12493
|
+
this.toggleEditionModeIfNotManual$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), filter((action) => action.layout !== DashboardGridLayout.MANUAL), map(() => DashboardActions.toggleEditionMode({ force: false }))));
|
|
12494
|
+
this.getCapability$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getCapability), withLatestFrom(this.store.select(DashboardSelectors.capabilities)), filter(([action, capabilities]) => (!!capabilities && !!action.url && (!capabilities[action.url] || !capabilities[action.url].doc)) ||
|
|
12495
|
+
!!action.force), mergeMap(([action, _]) => this.wmsService.getCapabilities(action.url).pipe(map((capability) => DashboardActions.updateCapability({ url: action.url, capability })), startWith(DashboardActions.updateCapability({ url: action.url, capability: null }))))));
|
|
12496
|
+
this.getWmsFeatures = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWmsFeatures), mergeMap((action) => combineLatest([of(action), this.wmsService.getWmsFeatures(action.url)])), map(([action, json]) => {
|
|
12491
12497
|
return DashboardActions.addWmsFeatures({
|
|
12492
12498
|
features: json.features.map((feature) => {
|
|
12493
12499
|
const result = {
|
|
@@ -12503,7 +12509,7 @@ class DashboardEffects {
|
|
|
12503
12509
|
componentId: action.componentId
|
|
12504
12510
|
});
|
|
12505
12511
|
})));
|
|
12506
|
-
this.getWfsFeaturesForPointStack = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWfsFeaturesForPointStackTooltips), mergeMap
|
|
12512
|
+
this.getWfsFeaturesForPointStack = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWfsFeaturesForPointStackTooltips), mergeMap((action) => combineLatest([of(action), this.wmsService.getWmsFeatures(action.url)])), mergeMap(([action, wmsJson]) => {
|
|
12507
12513
|
// check if data is actually a stack of points
|
|
12508
12514
|
if (wmsJson.features[0] &&
|
|
12509
12515
|
wmsJson.features[0].properties.count &&
|
|
@@ -12512,11 +12518,11 @@ class DashboardEffects {
|
|
|
12512
12518
|
let envBBOXCoords = [...wmsJson.features[0].properties.envBBOX.matchAll(/\d+.\d+/g)].map((m) => parseFloat(m[0]));
|
|
12513
12519
|
return this.wmsService
|
|
12514
12520
|
.getWfsFeatures(action.url, envBBOXCoords)
|
|
12515
|
-
.pipe(map
|
|
12521
|
+
.pipe(map((wfsJson) => ({ action, json: wfsJson })));
|
|
12516
12522
|
}
|
|
12517
12523
|
// if data is not a stack just add features without calling wfs service
|
|
12518
12524
|
return of({ action, json: wmsJson });
|
|
12519
|
-
}), map
|
|
12525
|
+
}), map(({ action, json }) => DashboardActions.addWmsFeatures({
|
|
12520
12526
|
features: json.features.map((feature) => ({
|
|
12521
12527
|
id: feature.id,
|
|
12522
12528
|
oClass: action.oClass,
|
|
@@ -12530,7 +12536,7 @@ class DashboardEffects {
|
|
|
12530
12536
|
console.error('Error while fetching WFS features', error);
|
|
12531
12537
|
return of(DashboardActions.addWmsFeatures({ features: [], componentId: 'error' }));
|
|
12532
12538
|
})));
|
|
12533
|
-
this.addManifestMetadata = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addManifestMetadata), mergeMap
|
|
12539
|
+
this.addManifestMetadata = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addManifestMetadata), mergeMap((action) => this.manifestService.addMetadata(action.presentationId, action.metadataId, action.value).pipe(map(() => DashboardActions.fetchManifestsList()), catchError((error) => {
|
|
12534
12540
|
if (error.status === 404) {
|
|
12535
12541
|
this.snackBar.open({
|
|
12536
12542
|
type: 'error',
|
|
@@ -12541,16 +12547,16 @@ class DashboardEffects {
|
|
|
12541
12547
|
}
|
|
12542
12548
|
return throwError(() => error);
|
|
12543
12549
|
})))));
|
|
12544
|
-
this.deleteManifestMetadata$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifestMetadata), mergeMap
|
|
12550
|
+
this.deleteManifestMetadata$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifestMetadata), mergeMap((action) => this.manifestService
|
|
12545
12551
|
.deleteMetadata(action.presentationId, action.metadataId)
|
|
12546
|
-
.pipe(map
|
|
12552
|
+
.pipe(map(() => DashboardActions.fetchManifestsList())))));
|
|
12547
12553
|
this.loadPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.loadPresentation), tap(() => this.store.dispatch(DashboardActions.updateManifest({
|
|
12548
12554
|
manifest: { windows: [] },
|
|
12549
12555
|
selectedIds: []
|
|
12550
12556
|
}))), tap((action) => this.store.dispatch(DashboardActions.selectPresentation({
|
|
12551
12557
|
presentation: action.presentation,
|
|
12552
12558
|
viewMode: action.viewMode
|
|
12553
|
-
}))), tap((action) => this.titleService.changeTitle(action.presentation.name)), mergeMap
|
|
12559
|
+
}))), tap((action) => this.titleService.changeTitle(action.presentation.name)), mergeMap((action) => this.manifestService.get(action.presentation.id).pipe(mergeMap((manifest) => [
|
|
12554
12560
|
DashboardActions.updateManifest({
|
|
12555
12561
|
manifest,
|
|
12556
12562
|
selectedIds: [],
|