@provoly/dashboard 1.1.8 → 1.1.10
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/admin.module.d.ts +1 -1
- package/admin/components/admin-dataset/admin-edit-dataset/admin-edit-dataset.component.d.ts +3 -2
- package/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.d.ts +5 -3
- package/admin/components/admin-dataset/store/admin-dataset.actions.d.ts +76 -0
- package/admin/components/admin-dataset/store/admin-dataset.effects.d.ts +71 -0
- package/admin/components/admin-dataset/store/admin-dataset.reducer.d.ts +10 -0
- package/admin/components/admin-dataset/store/admin-dataset.selectors.d.ts +10 -0
- package/admin/components/admin-dataset/store/admin-dataset.service.d.ts +20 -0
- package/admin/store/admin.effects.d.ts +1 -14
- package/components/metadata-editor/store/metadata.effects.d.ts +1 -23
- package/components/stepper/stepper.component.d.ts +2 -1
- package/dataset/components/dataset-detail/dataset-detail.component.d.ts +5 -3
- package/esm2022/admin/admin.module.mjs +8 -2
- package/esm2022/admin/components/admin-dataset/admin-dataset.component.mjs +8 -6
- package/esm2022/admin/components/admin-dataset/admin-edit-dataset/admin-edit-dataset.component.mjs +5 -4
- package/esm2022/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.mjs +33 -19
- package/esm2022/admin/components/admin-dataset/shared/admin-form-dataset/admin-form-dataset.component.mjs +4 -3
- package/esm2022/admin/components/admin-dataset/store/admin-dataset.actions.mjs +17 -0
- package/esm2022/admin/components/admin-dataset/store/admin-dataset.effects.mjs +104 -0
- package/esm2022/admin/components/admin-dataset/store/admin-dataset.reducer.mjs +29 -0
- package/esm2022/admin/components/admin-dataset/store/admin-dataset.selectors.mjs +19 -0
- package/esm2022/admin/components/admin-dataset/store/admin-dataset.service.mjs +56 -0
- package/esm2022/admin/store/admin.effects.mjs +9 -36
- package/esm2022/components/metadata-editor/store/metadata.effects.mjs +4 -23
- package/esm2022/components/stepper/stepper.component.mjs +11 -8
- package/esm2022/dataset/components/dataset-card/dataset-card.component.mjs +1 -1
- package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +18 -9
- package/esm2022/dataset/components/dataset.component.mjs +3 -2
- package/esm2022/import/components/import.component.mjs +101 -61
- package/esm2022/import/i18n/en.translations.mjs +3 -2
- package/esm2022/import/i18n/fr.translations.mjs +3 -2
- package/esm2022/import/style/css.component.mjs +2 -2
- package/esm2022/lib/core/access/access.service.mjs +7 -1
- package/esm2022/lib/core/components/share/access-rights-share/access-rights-share.component.mjs +23 -10
- package/esm2022/lib/core/components/share/access-rights-share-modal/access-rights-share-modal.component.mjs +92 -0
- package/esm2022/lib/core/components/share/share.module.mjs +39 -6
- package/esm2022/lib/core/i18n/fr.translations.mjs +2 -2
- package/esm2022/lib/core/public-api.mjs +2 -1
- package/esm2022/lib/core/store/data-source/data-source.actions.mjs +1 -15
- package/esm2022/lib/core/store/data-source/data-source.effects.mjs +1 -39
- package/esm2022/lib/core/store/data-source/data-source.reducer.mjs +8 -29
- package/esm2022/lib/core/store/data-source/data-source.selectors.mjs +1 -9
- package/esm2022/lib/core/store/data-source/data-source.service.mjs +1 -36
- package/esm2022/presentation/components/presentation.component.mjs +14 -92
- package/esm2022/restitution/components/restitution/restitution.component.mjs +4 -3
- package/esm2022/restitution/components/restitution-list/restitution-list.component.mjs +10 -23
- package/esm2022/restitution/components/restitution-list-item/restitution-list-item.component.mjs +4 -16
- package/esm2022/restitution/i18n/en.translations.mjs +2 -1
- package/esm2022/restitution/i18n/fr.translations.mjs +2 -1
- package/esm2022/restitution/style/css.component.mjs +2 -2
- package/esm2022/toolbox/components/delete/delete.component.mjs +3 -3
- package/esm2022/toolbox/components/edit-mode-action/edit-mode-action.component.mjs +3 -3
- package/esm2022/toolbox/components/save-view/save-view.component.mjs +3 -3
- package/esm2022/toolbox/components/share/share.component.mjs +18 -75
- package/esm2022/toolbox/components/switch-to-edit-content/switch-to-edit-content.component.mjs +3 -3
- package/esm2022/toolbox/components/toolbox-action/toolbox-action.component.mjs +10 -7
- package/esm2022/toolbox/components/toolbox.component.mjs +15 -12
- package/esm2022/toolbox/toolbox.model.mjs +3 -3
- package/esm2022/widgets/widget-map/component/widget-map.component.mjs +5 -2
- package/esm2022/widgets/widget-vega/style/css.component.mjs +2 -2
- package/fesm2022/provoly-dashboard-admin.mjs +238 -47
- package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-metadata-editor.mjs +4 -21
- package/fesm2022/provoly-dashboard-components-metadata-editor.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-stepper.mjs +10 -7
- package/fesm2022/provoly-dashboard-components-stepper.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-dataset.mjs +19 -9
- package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-import.mjs +106 -65
- package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-presentation.mjs +13 -91
- package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-restitution.mjs +13 -34
- package/fesm2022/provoly-dashboard-restitution.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-toolbox.mjs +54 -100
- package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-map.mjs +4 -1
- package/fesm2022/provoly-dashboard-widgets-widget-map.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs +2 -2
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +158 -148
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/import/components/import.component.d.ts +31 -18
- package/import/i18n/en.translations.d.ts +2 -1
- package/import/i18n/fr.translations.d.ts +2 -1
- package/import/style/_o-import.scss +16 -29
- package/lib/core/access/access.service.d.ts +5 -0
- package/lib/core/components/share/access-rights-share/access-rights-share.component.d.ts +5 -2
- package/lib/core/components/share/access-rights-share-modal/access-rights-share-modal.component.d.ts +34 -0
- package/lib/core/components/share/share.module.d.ts +9 -8
- package/lib/core/public-api.d.ts +1 -0
- package/lib/core/store/data-source/data-source.actions.d.ts +1 -91
- package/lib/core/store/data-source/data-source.effects.d.ts +2 -30
- package/lib/core/store/data-source/data-source.reducer.d.ts +0 -3
- package/lib/core/store/data-source/data-source.selectors.d.ts +0 -4
- package/lib/core/store/data-source/data-source.service.d.ts +0 -9
- package/package.json +37 -37
- package/presentation/components/presentation.component.d.ts +4 -18
- package/restitution/components/restitution/restitution.component.d.ts +1 -0
- package/restitution/components/restitution-list/restitution-list.component.d.ts +3 -9
- package/restitution/components/restitution-list-item/restitution-list-item.component.d.ts +1 -4
- package/restitution/i18n/en.translations.d.ts +1 -0
- package/restitution/i18n/fr.translations.d.ts +1 -0
- package/restitution/style/_o-restitution-list.scss +0 -11
- package/styles/components/_o-modal.scss +1 -1
- package/styles-theme/components-theme/_o-restitution-list.theme.scss +0 -9
- package/toolbox/components/share/share.component.d.ts +4 -22
- package/toolbox/components/toolbox-action/toolbox-action.component.d.ts +3 -1
- package/toolbox/components/toolbox.component.d.ts +3 -2
- package/widgets/widget-vega/style/_o-widget-vega.scss +9 -0
|
@@ -2,10 +2,10 @@ import { Component, ViewEncapsulation } from '@angular/core';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export class PryWidgetVegaCssComponent {
|
|
4
4
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryWidgetVegaCssComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: PryWidgetVegaCssComponent, selector: "pry-widget-vega-css", ngImport: i0, template: '', isInline: true, styles: ["textarea.a-form-field.a-text-area{overflow:unset;height:31.25rem}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
5
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: PryWidgetVegaCssComponent, selector: "pry-widget-vega-css", ngImport: i0, template: '', isInline: true, styles: ["textarea.a-form-field.a-text-area{overflow:unset;height:31.25rem}.o-widget--chart div.vega-embed{display:block;position:absolute;height:100%;width:100%}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
6
6
|
}
|
|
7
7
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryWidgetVegaCssComponent, decorators: [{
|
|
8
8
|
type: Component,
|
|
9
|
-
args: [{ selector: 'pry-widget-vega-css', template: '', encapsulation: ViewEncapsulation.None, styles: ["textarea.a-form-field.a-text-area{overflow:unset;height:31.25rem}\n"] }]
|
|
9
|
+
args: [{ selector: 'pry-widget-vega-css', template: '', encapsulation: ViewEncapsulation.None, styles: ["textarea.a-form-field.a-text-area{overflow:unset;height:31.25rem}.o-widget--chart div.vega-embed{display:block;position:absolute;height:100%;width:100%}\n"] }]
|
|
10
10
|
}] });
|
|
11
11
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3NzLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Byb3ZvbHkvZGFzaGJvYXJkL3dpZGdldHMvd2lkZ2V0LXZlZ2Evc3R5bGUvY3NzLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sZUFBZSxDQUFDOztBQVE3RCxNQUFNLE9BQU8seUJBQXlCOzhHQUF6Qix5QkFBeUI7a0dBQXpCLHlCQUF5QiwyREFKMUIsRUFBRTs7MkZBSUQseUJBQXlCO2tCQU5yQyxTQUFTOytCQUNFLHFCQUFxQixZQUNyQixFQUFFLGlCQUVHLGlCQUFpQixDQUFDLElBQUkiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIFZpZXdFbmNhcHN1bGF0aW9uIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ3ByeS13aWRnZXQtdmVnYS1jc3MnLFxuICB0ZW1wbGF0ZTogJycsXG4gIHN0eWxlVXJsczogWycuL19vLXdpZGdldC12ZWdhLnNjc3MnXSxcbiAgZW5jYXBzdWxhdGlvbjogVmlld0VuY2Fwc3VsYXRpb24uTm9uZVxufSlcbmV4cG9ydCBjbGFzcyBQcnlXaWRnZXRWZWdhQ3NzQ29tcG9uZW50IHt9XG4iXX0=
|
|
@@ -5,7 +5,7 @@ import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
|
5
5
|
import * as i3 from '@angular/common';
|
|
6
6
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { EventEmitter, Component, Output, Input, Injectable, ViewContainerRef, ViewChild, TemplateRef, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
8
|
+
import { EventEmitter, Component, Output, Input, Injectable, ViewContainerRef, ViewChild, TemplateRef, ChangeDetectionStrategy, Optional, Inject, NgModule } from '@angular/core';
|
|
9
9
|
import * as i3$1 from '@angular/forms';
|
|
10
10
|
import { Validators, FormControl, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
11
11
|
import * as i1$2 from '@ngrx/effects';
|
|
@@ -13,7 +13,7 @@ import { concatLatestFrom, createEffect, ofType, EffectsModule } from '@ngrx/eff
|
|
|
13
13
|
import * as i1 from '@ngrx/store';
|
|
14
14
|
import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
|
|
15
15
|
import * as i4 from '@provoly/dashboard';
|
|
16
|
-
import { ClassSelectors, FieldSelectors, FieldType, ClassActions, FieldActions, SubscriptionnerDirective, ConfigSelectors, ConfigActions, DEFAULT_ICON_URL, IconPosition, compareOperationFunctions, ItemUtils, FIELD_OPTIONS, CategoryActions, CategorySelectors, DEFAULT_CATEGORY_UUID, DataSourceActions, DataSourceSelectors, PryDatasetType, ENV_OPTIONS, GeometricFieldTypes, DashboardSelectors, PryVisibilityType, META_OPTIONS, RelationTypesSelectors, RelationTypesActions, BaseMenuComponent, BaseLayoutComponent, PRY_ACCESS_GUARD, PryDialogConfirmComponent, PrySortModule, PryIconModule, PryModalModule, PryI18nModule, PryCoreModule, PrySelectModule, PryToggleModule, PryOverlayModule, PryShareModule } from '@provoly/dashboard';
|
|
16
|
+
import { ClassSelectors, FieldSelectors, FieldType, ClassActions, FieldActions, SubscriptionnerDirective, ConfigSelectors, ConfigActions, DEFAULT_ICON_URL, IconPosition, compareOperationFunctions, ItemUtils, FIELD_OPTIONS, CategoryActions, CategorySelectors, DEFAULT_CATEGORY_UUID, DataSourceActions, DataSourceSelectors, PryDatasetType, ENV_OPTIONS, GeometricFieldTypes, DashboardSelectors, PryVisibilityType, PRY_ACCESS_TOKEN, META_OPTIONS, RelationTypesSelectors, RelationTypesActions, BaseMenuComponent, BaseLayoutComponent, PRY_ACCESS_GUARD, PryDialogConfirmComponent, PrySortModule, PryIconModule, PryModalModule, PryI18nModule, PryCoreModule, PrySelectModule, PryToggleModule, PryOverlayModule, PryShareModule } from '@provoly/dashboard';
|
|
17
17
|
import * as i5$1 from '@provoly/dashboard/components/checkbox';
|
|
18
18
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
19
19
|
import * as i6 from '@provoly/dashboard/components/metadata-editor';
|
|
@@ -25,6 +25,7 @@ import { v4 } from 'uuid';
|
|
|
25
25
|
import equal from 'fast-deep-equal/es6';
|
|
26
26
|
import { distinctUntilChanged, map as map$1, filter as filter$1, mergeMap as mergeMap$1, catchError as catchError$1 } from 'rxjs/operators';
|
|
27
27
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
28
|
+
import { concatLatestFrom as concatLatestFrom$1 } from '@ngrx/operators';
|
|
28
29
|
import * as i1$1 from '@angular/common/http';
|
|
29
30
|
import { PrySinceDateModule } from '@provoly/dashboard/components/sinceDate';
|
|
30
31
|
import { PryDatasetModule } from '@provoly/dashboard/dataset';
|
|
@@ -1871,6 +1872,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
1871
1872
|
args: [{ selector: 'pry-admin-classes', template: "<div class=\"o-base-container\">\n <h1 class=\"a-h1\">{{ '@pry.admin.classes.list' | i18n }}</h1>\n <table\n class=\"a-table\"\n prySortTable\n prySortActive=\"name\"\n prySortDirection=\"asc\"\n (prySortChange)=\"sortActive = $event.active; sortDirection = $event.direction\"\n >\n <caption>\n {{\n '@pry.admin.classes.list' | i18n\n }},\n {{\n '@pry.action.sortableColumnHeader' | i18n\n }}\n </caption>\n <thead>\n <tr>\n <th></th>\n <th prySortHeader=\"image\">{{ '@pry.admin.classes.image' | i18n }}</th>\n <th prySortHeader=\"name\">{{ '@pry.admin.classes.name' | i18n }}</th>\n <th prySortHeader=\"lines\">{{ '@pry.admin.menus.dataset' | i18n }}</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let clazz of classesInputFlows$ | async | prySortData: sortActive : sortDirection\"\n (click)=\"selectClass(clazz)\"\n [class.is-selected]=\"(selectedClassId$ | async) === clazz.id\"\n >\n <td class=\"view-details\">\n <button\n id=\"button-class-{{ clazz.id }}\"\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n title=\"{{ '@pry.action.viewDetails' | i18n }}\"\n [attr.aria-expanded]=\"(selectedClassId$ | async) === clazz.id\"\n aria-haspopup\n [attr.aria-controls]=\"'panel-class-' + clazz.id\"\n >\n <span class=\"u-visually-hidden\">{{ clazz.name }}, {{ '@pry.action.viewDetails' | i18n }}</span>\n <pry-icon iconSvg=\"eye\" [width]=\"15\" [height]=\"15\"></pry-icon>\n </button>\n </td>\n <td>\n <img\n alt=\"\"\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"clazz.id | translateId: { type: 'class', output: 'icon' } | async\"\n />\n </td>\n <td>{{ clazz.name }}</td>\n <td>{{ clazz.count }}</td>\n </tr>\n </tbody>\n </table>\n</div>\n" }]
|
|
1872
1873
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }] });
|
|
1873
1874
|
|
|
1875
|
+
const AdminDatasetActions = {
|
|
1876
|
+
failure: createAction('[Dataset] failure effect Dataset', props()),
|
|
1877
|
+
create: createAction('[Dataset] create Dataset', props()),
|
|
1878
|
+
update: createAction('[Dataset] update Dataset', props()),
|
|
1879
|
+
confirmDatasetDeletion: createAction('[Dataset] confirm deletion', props()),
|
|
1880
|
+
delete: createAction('[Dataset] delete Dataset', props()),
|
|
1881
|
+
deleted: createAction('[Dataset] Dataset is deleted call to admin', props()),
|
|
1882
|
+
selectDataset: createAction('[Dataset] open Dataset details', props()),
|
|
1883
|
+
unselectDataset: createAction('[Dataset] unselect Dataset'),
|
|
1884
|
+
getDatasetById: createAction('[Dataset] Get Dataset by ID', props()),
|
|
1885
|
+
getDatasetByIdSuccess: createAction('[Dataset] Get Dataset by Id Success', props()),
|
|
1886
|
+
getDatasetByIdFailure: createAction('[Dataset] Get Dataset by Id Failure', props()),
|
|
1887
|
+
openNewDataset: createAction('[Dataset] open new Dataset', props()),
|
|
1888
|
+
setMissingGroups: createAction('[Dataset] set missing groups', props())
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
const datasetFeatureKey = '@pry/admin/datasets';
|
|
1892
|
+
const initialDatasetState = {
|
|
1893
|
+
isLoading: false,
|
|
1894
|
+
selectedDataset: null
|
|
1895
|
+
};
|
|
1896
|
+
const datasetReducer = createReducer(initialDatasetState, on(AdminDatasetActions.getDatasetById, (state, action) => ({
|
|
1897
|
+
...state,
|
|
1898
|
+
loading: true
|
|
1899
|
+
})), on(AdminDatasetActions.getDatasetByIdSuccess, (state, action) => ({
|
|
1900
|
+
...state,
|
|
1901
|
+
selectedDataset: action.data,
|
|
1902
|
+
loading: false
|
|
1903
|
+
})), on(AdminDatasetActions.getDatasetByIdFailure, (state, action) => ({
|
|
1904
|
+
...state,
|
|
1905
|
+
error: action.error,
|
|
1906
|
+
loading: false
|
|
1907
|
+
})), on(AdminDatasetActions.setMissingGroups, (state, { missingGroups }) => ({
|
|
1908
|
+
...state,
|
|
1909
|
+
missingGroups
|
|
1910
|
+
})), on(AdminDatasetActions.unselectDataset, (state) => ({
|
|
1911
|
+
...state,
|
|
1912
|
+
selectedDataset: null
|
|
1913
|
+
})), on(AdminDatasetActions.selectDataset, (state, action) => ({
|
|
1914
|
+
...state,
|
|
1915
|
+
selectedDataset: action.dataset
|
|
1916
|
+
})));
|
|
1917
|
+
|
|
1918
|
+
const selectFeature = createFeatureSelector(datasetFeatureKey);
|
|
1919
|
+
const errors = createSelector(selectFeature, (state) => state.error);
|
|
1920
|
+
const isLoading = createSelector(selectFeature, (state) => state.isLoading);
|
|
1921
|
+
const selectedDatasetId = createSelector(selectFeature, (state) => state?.selectedDataset?.id);
|
|
1922
|
+
const selectedDataset = createSelector(selectFeature, (state) => state?.selectedDataset);
|
|
1923
|
+
const selectedDatasetMetadata = createSelector(selectFeature, (state) => state?.selectedDataset?.metadata ?? []);
|
|
1924
|
+
const selectedDatasetMissingGroups = createSelector(selectFeature, (state) => state?.missingGroups);
|
|
1925
|
+
const AdminDatasetSelectors = {
|
|
1926
|
+
selectFeature,
|
|
1927
|
+
errors,
|
|
1928
|
+
isLoading,
|
|
1929
|
+
selectedDataset,
|
|
1930
|
+
selectedDatasetMetadata,
|
|
1931
|
+
selectedDatasetMissingGroups,
|
|
1932
|
+
selectedDatasetId
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1874
1935
|
class AdminDatasetComponent {
|
|
1875
1936
|
constructor(store, translateService, router, route) {
|
|
1876
1937
|
this.store = store;
|
|
@@ -1892,13 +1953,13 @@ class AdminDatasetComponent {
|
|
|
1892
1953
|
{ headerType: 'label', label: this.translateService.instant('@pry.admin.dataset.type') }
|
|
1893
1954
|
];
|
|
1894
1955
|
this.datasetList$ = this.store.select(DataSourceSelectors.datasets);
|
|
1895
|
-
this.selectedDataset$ = this.store.select(
|
|
1896
|
-
this.store.dispatch(
|
|
1956
|
+
this.selectedDataset$ = this.store.select(AdminDatasetSelectors.selectedDatasetId);
|
|
1957
|
+
this.store.dispatch(AdminDatasetActions.unselectDataset());
|
|
1897
1958
|
const path = this.router.createUrlTree(['.', 'new'], { relativeTo: this.route });
|
|
1898
1959
|
this.store.dispatch(AdminActions.mainActions({
|
|
1899
1960
|
actions: [
|
|
1900
1961
|
{
|
|
1901
|
-
action:
|
|
1962
|
+
action: AdminDatasetActions.openNewDataset({ route: path.toString() }),
|
|
1902
1963
|
label: 'add',
|
|
1903
1964
|
icon: 'add_column',
|
|
1904
1965
|
moduleAccess: 'admin',
|
|
@@ -1910,7 +1971,7 @@ class AdminDatasetComponent {
|
|
|
1910
1971
|
}
|
|
1911
1972
|
cancelEdition() {
|
|
1912
1973
|
this.toggleEditionDataset();
|
|
1913
|
-
this.store.dispatch(
|
|
1974
|
+
this.store.dispatch(AdminDatasetActions.unselectDataset());
|
|
1914
1975
|
}
|
|
1915
1976
|
toggleEditionDataset() {
|
|
1916
1977
|
this.editOpened = !this.editOpened;
|
|
@@ -1928,7 +1989,7 @@ class AdminDatasetComponent {
|
|
|
1928
1989
|
}
|
|
1929
1990
|
selectDataset(dataset) {
|
|
1930
1991
|
this.store.dispatch(AdminActions.fetchDatasetAssociations({ id: dataset.id }));
|
|
1931
|
-
this.store.dispatch(
|
|
1992
|
+
this.store.dispatch(AdminDatasetActions.selectDataset({ dataset }));
|
|
1932
1993
|
this.store.dispatch(AdminActions.selectComponentType({ componentType: 'AdminSelectDatasetComponent' }));
|
|
1933
1994
|
}
|
|
1934
1995
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetComponent, deps: [{ token: i1.Store }, { token: i4.PryI18nService }, { token: i2.Router }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -2008,13 +2069,13 @@ class AdminFormDatasetComponent {
|
|
|
2008
2069
|
this.isSubmitted = false;
|
|
2009
2070
|
if (this.dataset$) {
|
|
2010
2071
|
const path = this.router.createUrlTree(['../..'], { relativeTo: this.route });
|
|
2011
|
-
this.store.dispatch(
|
|
2072
|
+
this.store.dispatch(AdminDatasetActions.update({ dataset: this.form.value, route: path.toString() }));
|
|
2012
2073
|
return;
|
|
2013
2074
|
}
|
|
2014
2075
|
const path = this.router.createUrlTree(['..'], { relativeTo: this.route });
|
|
2015
2076
|
this.isSameName = !!this.datasetList.find((dataset) => this.form.get('name')?.value.toLowerCase() === dataset.name.toLowerCase());
|
|
2016
2077
|
if (!this.isSameName) {
|
|
2017
|
-
this.store.dispatch(
|
|
2078
|
+
this.store.dispatch(AdminDatasetActions.create({ dataset: this.form.value, route: path.toString() }));
|
|
2018
2079
|
}
|
|
2019
2080
|
}
|
|
2020
2081
|
}
|
|
@@ -2032,11 +2093,11 @@ class AdminEditDatasetComponent {
|
|
|
2032
2093
|
constructor(store, route) {
|
|
2033
2094
|
this.store = store;
|
|
2034
2095
|
this.route = route;
|
|
2035
|
-
this.datasetSelected$ = this.store.select(
|
|
2096
|
+
this.datasetSelected$ = this.store.select(AdminDatasetSelectors.selectedDataset);
|
|
2036
2097
|
}
|
|
2037
2098
|
ngOnInit() {
|
|
2038
2099
|
this.route.params.subscribe((params) => {
|
|
2039
|
-
this.store.dispatch(
|
|
2100
|
+
this.store.dispatch(AdminDatasetActions.getDatasetById({ id: params['uuid'] }));
|
|
2040
2101
|
});
|
|
2041
2102
|
}
|
|
2042
2103
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminEditDatasetComponent, deps: [{ token: i1.Store }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -2766,23 +2827,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
2766
2827
|
|
|
2767
2828
|
class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
2768
2829
|
static { this.id = 'AdminSelectDatasetComponent'; }
|
|
2769
|
-
constructor(store, router, route, i18n) {
|
|
2830
|
+
constructor(store, router, route, i18n, access) {
|
|
2770
2831
|
super();
|
|
2771
2832
|
this.store = store;
|
|
2772
2833
|
this.router = router;
|
|
2773
2834
|
this.route = route;
|
|
2774
2835
|
this.i18n = i18n;
|
|
2836
|
+
this.access = access;
|
|
2775
2837
|
this.sub = new Subscription();
|
|
2776
2838
|
this.currentTypeTranslation = '';
|
|
2777
2839
|
this.accessGroups = [];
|
|
2778
2840
|
this.shareRadioValue$ = new BehaviorSubject(undefined);
|
|
2779
2841
|
this.disableShareButton$ = new BehaviorSubject(false);
|
|
2780
2842
|
this.store.dispatch(MetadataActions.loadMetadata());
|
|
2781
|
-
this.selectedDataset$ = this.store.select(
|
|
2782
|
-
this.datasetMetadata$ = this.store.select(
|
|
2843
|
+
this.selectedDataset$ = this.store.select(AdminDatasetSelectors.selectedDataset);
|
|
2844
|
+
this.datasetMetadata$ = this.store.select(AdminDatasetSelectors.selectedDatasetMetadata);
|
|
2783
2845
|
this.associations$ = this.store.select(AdminSelectors.selectedAssociation);
|
|
2784
2846
|
this.editable$ = this.store.select(MetadataSelectors.editable);
|
|
2785
|
-
this.selectedDatasetMissingGroups$ = this.store.select(
|
|
2847
|
+
this.selectedDatasetMissingGroups$ = this.store.select(AdminDatasetSelectors.selectedDatasetMissingGroups);
|
|
2786
2848
|
this.missingGroups$ = this.selectedDatasetMissingGroups$.pipe(withLatestFrom(this.store.select(DashboardSelectors.manifestsList)), map(([conflict, manifests]) => {
|
|
2787
2849
|
const result = {};
|
|
2788
2850
|
Object.keys(conflict ?? {}).forEach((entityId) => {
|
|
@@ -2795,13 +2857,15 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
|
2795
2857
|
}));
|
|
2796
2858
|
}
|
|
2797
2859
|
ngOnInit() {
|
|
2798
|
-
this.subscriptions.add(combineLatest([this.selectedDataset$, this.store.select(DataSourceSelectors.datasetVersions)])
|
|
2860
|
+
this.subscriptions.add(combineLatest([this.selectedDataset$, this.store.select(DataSourceSelectors.datasetVersions)])
|
|
2861
|
+
.pipe(concatLatestFrom$1(([dataset, versions]) => (dataset ? this.canModify$(dataset) : of(false))))
|
|
2862
|
+
.subscribe(([[dataset, versions], canModify]) => {
|
|
2799
2863
|
if (dataset) {
|
|
2800
|
-
this.accessGroups = dataset
|
|
2864
|
+
this.accessGroups = dataset.groups ?? [];
|
|
2801
2865
|
const editPath = this.router.createUrlTree(['.', 'dataset', 'edit', dataset.id], {
|
|
2802
2866
|
relativeTo: this.route
|
|
2803
2867
|
});
|
|
2804
|
-
if (
|
|
2868
|
+
if (canModify) {
|
|
2805
2869
|
this.store.dispatch(AdminActions.mainActions({
|
|
2806
2870
|
actions: [
|
|
2807
2871
|
{
|
|
@@ -2813,7 +2877,7 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
|
2813
2877
|
actionAccess: 'write'
|
|
2814
2878
|
},
|
|
2815
2879
|
{
|
|
2816
|
-
action:
|
|
2880
|
+
action: AdminDatasetActions.confirmDatasetDeletion({
|
|
2817
2881
|
name: dataset.id,
|
|
2818
2882
|
route: this.router.createUrlTree(['.', 'dataset'], { relativeTo: this.route }).toString(),
|
|
2819
2883
|
addRoute: this.router
|
|
@@ -2840,7 +2904,7 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
|
2840
2904
|
}
|
|
2841
2905
|
closePanel() {
|
|
2842
2906
|
const path = this.router.createUrlTree(['.', 'dataset', 'new'], { relativeTo: this.route });
|
|
2843
|
-
this.store.dispatch(
|
|
2907
|
+
this.store.dispatch(AdminDatasetActions.unselectDataset());
|
|
2844
2908
|
this.store.dispatch(AdminActions.togglePanel({ panelOpen: false }));
|
|
2845
2909
|
this.store.dispatch(AdminActions.mainActions({
|
|
2846
2910
|
actions: [
|
|
@@ -2866,7 +2930,7 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
|
2866
2930
|
}));
|
|
2867
2931
|
}
|
|
2868
2932
|
share(dataset) {
|
|
2869
|
-
this.store.dispatch(
|
|
2933
|
+
this.store.dispatch(AdminDatasetActions.update({ dataset: { ...dataset, groups: this.accessGroups }, route: '' }));
|
|
2870
2934
|
}
|
|
2871
2935
|
getGroupLabel(groupName) {
|
|
2872
2936
|
const i18nBase = '@pry.components.chipsSelector.share.groups.';
|
|
@@ -2876,7 +2940,7 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
|
2876
2940
|
changeGroup($event) {
|
|
2877
2941
|
this.accessGroups = $event;
|
|
2878
2942
|
this.updateDisableButtonValue();
|
|
2879
|
-
this.store.dispatch(
|
|
2943
|
+
this.store.dispatch(AdminDatasetActions.setMissingGroups({ missingGroups: undefined }));
|
|
2880
2944
|
}
|
|
2881
2945
|
updateVisibility($event) {
|
|
2882
2946
|
this.shareRadioValue$.next($event);
|
|
@@ -2892,13 +2956,21 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
|
|
|
2892
2956
|
}
|
|
2893
2957
|
}
|
|
2894
2958
|
}
|
|
2895
|
-
|
|
2896
|
-
|
|
2959
|
+
canModify$(dataset) {
|
|
2960
|
+
return this.access ? this.access.canModifyDataset(dataset) : of(false);
|
|
2961
|
+
}
|
|
2962
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminSelectDatasetComponent, deps: [{ token: i1.Store }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i4.PryI18nService }, { token: PRY_ACCESS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2963
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: AdminSelectDatasetComponent, selector: "pry-admin-select-dataset", usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"selectedDataset$ | async as dataset\"\n [id]=\"'panel-dataset-' + dataset.id\"\n [attr.aria-labelledby]=\"'button-dataset-' + dataset.id\"\n class=\"o-panel o-pry-admin-dataset-select\"\n>\n <div class=\"o-panel__header\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"closePanel()\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.closePanel' | i18n }}</span>\n <pry-icon iconSvg=\"close\"></pry-icon>\n </button>\n\n <h3 class=\"a-h3\">\n {{ '@pry.admin.dataset.details' | i18n }}\n </h3>\n </div>\n\n <pry-tab-group translationStringBase=\"@pry.admin.\">\n <pry-tab [templateRef]=\"datasetMetadata\" name=\"metadata.title\"></pry-tab>\n <pry-tab [templateRef]=\"datasetAssociations\" name=\"classes.associations\"></pry-tab>\n <pry-tab *ngIf=\"canModify$(dataset) | async\" [templateRef]=\"shareDataset\" name=\"share\"></pry-tab>\n </pry-tab-group>\n\n <ng-template #datasetMetadata>\n <pry-metadata-editor\n [targetId]=\"(selectedDataset$ | async)?.id ?? ''\"\n [isModification]=\"(editable$ | async) ?? false\"\n [metadata]=\"(datasetMetadata$ | async) ?? []\"\n (removeMeta)=\"removeMetadata($event)\"\n (addMeta)=\"addDatasetMetadata($event)\"\n [type]=\"'meta'\"\n ></pry-metadata-editor>\n </ng-template>\n\n <ng-template #datasetAssociations>\n <div *ngIf=\"associations$ | async as associations\" class=\"o-tabs__panels__item__content\">\n <h4 class=\"a-h4\">{{ '@pry.admin.classes.associations' | i18n }}</h4>\n <pry-association [associations]=\"associations\"></pry-association>\n </div>\n </ng-template>\n\n <ng-template #shareDataset>\n <div class=\"o-pry-admin-dataset-select__share\">\n <pry-group-share\n [ngModel]=\"dataset.groups\"\n (ngModelChange)=\"changeGroup($event)\"\n (radioValueChange)=\"updateVisibility($event)\"\n ></pry-group-share>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary u-self-end\"\n #submit\n (click)=\"share(dataset)\"\n [disabled]=\"disableShareButton$ | async\"\n >\n {{ '@pry.admin.validate' | i18n }}\n </button>\n @if (selectedDatasetMissingGroups$ | async) {\n <h4 class=\"a-h4\">{{ '@pry.admin.dataset.success' | i18n }}</h4>\n }\n @if (missingGroups$ | async; as missingGroups) {\n <div class=\"u-display-flex -column\">\n <span>{{ '@pry.admin.dataset.conflict' | i18n }}</span>\n @for (missing of missingGroups | keyvalue; track missing.key) {\n <div>\n {{ '@pry.admin.dataset.entities.dashboard' | i18n }} <strong>{{ missing.value.entityName }}</strong>\n <div class=\"u-display-flex\">\n @for (group of missing.value.groups; track group) {\n <span class=\"a-chip\">{{ getGroupLabel(group) }}</span>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.TabGroupComponent, selector: "pry-tab-group", inputs: ["translationStringBase"], outputs: ["clickedTabIdx"] }, { kind: "component", type: i4.TabComponent, selector: "pry-tab", inputs: ["name", "templateRef", "index"] }, { kind: "component", type: i4.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.PryMetadataEditorComponent, selector: "pry-metadata-editor", inputs: ["isModification", "targetId", "type", "metadata"], outputs: ["addMeta", "removeMeta"] }, { kind: "component", type: i4.PryGroupShareComponent, selector: "pry-group-share", inputs: ["disableRadios", "allowedGroups"], outputs: ["radioValueChange"] }, { kind: "component", type: PryAssociationComponent, selector: "pry-association", inputs: ["associations"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
|
|
2897
2964
|
}
|
|
2898
2965
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminSelectDatasetComponent, decorators: [{
|
|
2899
2966
|
type: Component,
|
|
2900
|
-
args: [{ selector: 'pry-admin-select-dataset', template: "<div\n *ngIf=\"selectedDataset$ | async as dataset\"\n [id]=\"'panel-dataset-' + dataset.id\"\n [attr.aria-labelledby]=\"'button-dataset-' + dataset.id\"\n class=\"o-panel o-pry-admin-dataset-select\"\n>\n <div class=\"o-panel__header\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"closePanel()\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.closePanel' | i18n }}</span>\n <pry-icon iconSvg=\"close\"></pry-icon>\n </button>\n\n <h3 class=\"a-h3\">\n {{ '@pry.admin.dataset.details' | i18n }}\n </h3>\n </div>\n\n <pry-tab-group translationStringBase=\"@pry.admin.\">\n <pry-tab [templateRef]=\"datasetMetadata\" name=\"metadata.title\"></pry-tab>\n <pry-tab [templateRef]=\"datasetAssociations\" name=\"classes.associations\"></pry-tab>\n <pry-tab *ngIf=\"dataset
|
|
2901
|
-
}], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i4.PryI18nService }
|
|
2967
|
+
args: [{ selector: 'pry-admin-select-dataset', template: "<div\n *ngIf=\"selectedDataset$ | async as dataset\"\n [id]=\"'panel-dataset-' + dataset.id\"\n [attr.aria-labelledby]=\"'button-dataset-' + dataset.id\"\n class=\"o-panel o-pry-admin-dataset-select\"\n>\n <div class=\"o-panel__header\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"closePanel()\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.closePanel' | i18n }}</span>\n <pry-icon iconSvg=\"close\"></pry-icon>\n </button>\n\n <h3 class=\"a-h3\">\n {{ '@pry.admin.dataset.details' | i18n }}\n </h3>\n </div>\n\n <pry-tab-group translationStringBase=\"@pry.admin.\">\n <pry-tab [templateRef]=\"datasetMetadata\" name=\"metadata.title\"></pry-tab>\n <pry-tab [templateRef]=\"datasetAssociations\" name=\"classes.associations\"></pry-tab>\n <pry-tab *ngIf=\"canModify$(dataset) | async\" [templateRef]=\"shareDataset\" name=\"share\"></pry-tab>\n </pry-tab-group>\n\n <ng-template #datasetMetadata>\n <pry-metadata-editor\n [targetId]=\"(selectedDataset$ | async)?.id ?? ''\"\n [isModification]=\"(editable$ | async) ?? false\"\n [metadata]=\"(datasetMetadata$ | async) ?? []\"\n (removeMeta)=\"removeMetadata($event)\"\n (addMeta)=\"addDatasetMetadata($event)\"\n [type]=\"'meta'\"\n ></pry-metadata-editor>\n </ng-template>\n\n <ng-template #datasetAssociations>\n <div *ngIf=\"associations$ | async as associations\" class=\"o-tabs__panels__item__content\">\n <h4 class=\"a-h4\">{{ '@pry.admin.classes.associations' | i18n }}</h4>\n <pry-association [associations]=\"associations\"></pry-association>\n </div>\n </ng-template>\n\n <ng-template #shareDataset>\n <div class=\"o-pry-admin-dataset-select__share\">\n <pry-group-share\n [ngModel]=\"dataset.groups\"\n (ngModelChange)=\"changeGroup($event)\"\n (radioValueChange)=\"updateVisibility($event)\"\n ></pry-group-share>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary u-self-end\"\n #submit\n (click)=\"share(dataset)\"\n [disabled]=\"disableShareButton$ | async\"\n >\n {{ '@pry.admin.validate' | i18n }}\n </button>\n @if (selectedDatasetMissingGroups$ | async) {\n <h4 class=\"a-h4\">{{ '@pry.admin.dataset.success' | i18n }}</h4>\n }\n @if (missingGroups$ | async; as missingGroups) {\n <div class=\"u-display-flex -column\">\n <span>{{ '@pry.admin.dataset.conflict' | i18n }}</span>\n @for (missing of missingGroups | keyvalue; track missing.key) {\n <div>\n {{ '@pry.admin.dataset.entities.dashboard' | i18n }} <strong>{{ missing.value.entityName }}</strong>\n <div class=\"u-display-flex\">\n @for (group of missing.value.groups; track group) {\n <span class=\"a-chip\">{{ getGroupLabel(group) }}</span>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n" }]
|
|
2968
|
+
}], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i4.PryI18nService }, { type: i4.PryBaseAccess, decorators: [{
|
|
2969
|
+
type: Optional
|
|
2970
|
+
}, {
|
|
2971
|
+
type: Inject,
|
|
2972
|
+
args: [PRY_ACCESS_TOKEN]
|
|
2973
|
+
}] }] });
|
|
2902
2974
|
|
|
2903
2975
|
class AdminEnvironmentSelectComponent {
|
|
2904
2976
|
static { this.id = 'AdminEnvironmentSelectComponent'; }
|
|
@@ -6600,12 +6672,11 @@ const frTranslations = {
|
|
|
6600
6672
|
};
|
|
6601
6673
|
|
|
6602
6674
|
class AdminEffects {
|
|
6603
|
-
constructor(actions$, service, router
|
|
6675
|
+
constructor(actions$, service, router) {
|
|
6604
6676
|
this.actions$ = actions$;
|
|
6605
6677
|
this.service = service;
|
|
6606
6678
|
this.router = router;
|
|
6607
|
-
this.
|
|
6608
|
-
this.routeTo$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.routeTo, DataSourceActions.dataset.created, DataSourceActions.dataset.updated), mergeMap((action) => {
|
|
6679
|
+
this.routeTo$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.routeTo), mergeMap((action) => {
|
|
6609
6680
|
this.router.navigate([action.path], { queryParams: action.params });
|
|
6610
6681
|
return action.path === this.router.url ? [] : [AdminActions.resetActions()];
|
|
6611
6682
|
})));
|
|
@@ -6633,7 +6704,115 @@ class AdminEffects {
|
|
|
6633
6704
|
this.closePanel$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.highlightMenu), mergeMap((action) => {
|
|
6634
6705
|
return [AdminActions.togglePanel({ panelOpen: false })];
|
|
6635
6706
|
})));
|
|
6636
|
-
this.
|
|
6707
|
+
this.openNewDataset$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.openNewDataset), map((action) => {
|
|
6708
|
+
return AdminActions.routeTo({ path: action.route });
|
|
6709
|
+
})));
|
|
6710
|
+
this.fetchClassAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchClassAssociations), mergeMap((action) => this.service.getClassAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6711
|
+
this.fetchFieldAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchFieldAssociations), mergeMap((action) => this.service.getFieldAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6712
|
+
this.fetchDatasetAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchDatasetAssociations), mergeMap((action) => this.service.getDatasetAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6713
|
+
this.fetchAttributeAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchAttributeAssociations), mergeMap((action) => this.service.getAttributeAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6714
|
+
}
|
|
6715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminEffects, deps: [{ token: i1$2.Actions }, { token: AdminService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6716
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminEffects }); }
|
|
6717
|
+
}
|
|
6718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminEffects, decorators: [{
|
|
6719
|
+
type: Injectable
|
|
6720
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: AdminService }, { type: i2.Router }] });
|
|
6721
|
+
|
|
6722
|
+
class AdminDatasetService {
|
|
6723
|
+
constructor(store, httpClient) {
|
|
6724
|
+
this.store = store;
|
|
6725
|
+
this.httpClient = httpClient;
|
|
6726
|
+
}
|
|
6727
|
+
addDataset(dataset) {
|
|
6728
|
+
return this.store
|
|
6729
|
+
.select(ConfigSelectors.refUrl)
|
|
6730
|
+
.pipe(mergeMap((url) => this.httpClient.post(encodeURI(`${url}/datasets`), dataset)));
|
|
6731
|
+
}
|
|
6732
|
+
updateDataset(dataset) {
|
|
6733
|
+
return this.store
|
|
6734
|
+
.select(ConfigSelectors.refUrl)
|
|
6735
|
+
.pipe(mergeMap((url) => this.httpClient.put(encodeURI(`${url}/datasets`), dataset)));
|
|
6736
|
+
}
|
|
6737
|
+
deleteDataset(id) {
|
|
6738
|
+
return this.store
|
|
6739
|
+
.select(ConfigSelectors.refUrl)
|
|
6740
|
+
.pipe(mergeMap((url) => this.httpClient.delete(`${url}/datasets/id/${id}`)));
|
|
6741
|
+
}
|
|
6742
|
+
getDatasetById(id) {
|
|
6743
|
+
return this.store
|
|
6744
|
+
.select(ConfigSelectors.refUrl)
|
|
6745
|
+
.pipe(mergeMap((url) => this.httpClient.get(`${url}/datasets/id/${id}`)));
|
|
6746
|
+
}
|
|
6747
|
+
getDatasetMetadata(id) {
|
|
6748
|
+
return this.store
|
|
6749
|
+
.select(ConfigSelectors.refUrl)
|
|
6750
|
+
.pipe(mergeMap((url) => this.httpClient.get(`${url}/datasets/id/${id}/metadata`)));
|
|
6751
|
+
}
|
|
6752
|
+
addDatasetMetadata(datasetId, metadataId, value) {
|
|
6753
|
+
return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.put(encodeURI(`${url}/datasets/id/${datasetId}/metadata/id/${metadataId}`), {
|
|
6754
|
+
value: value
|
|
6755
|
+
})));
|
|
6756
|
+
}
|
|
6757
|
+
deleteDatasetMetadata(datasetId, metadataId) {
|
|
6758
|
+
return this.store
|
|
6759
|
+
.select(ConfigSelectors.refUrl)
|
|
6760
|
+
.pipe(mergeMap((url) => this.httpClient.delete(encodeURI(`${url}/datasets/id/${datasetId}/metadata/id/${metadataId}`))));
|
|
6761
|
+
}
|
|
6762
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetService, deps: [{ token: i1.Store }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6763
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetService, providedIn: 'root' }); }
|
|
6764
|
+
}
|
|
6765
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetService, decorators: [{
|
|
6766
|
+
type: Injectable,
|
|
6767
|
+
args: [{
|
|
6768
|
+
providedIn: 'root'
|
|
6769
|
+
}]
|
|
6770
|
+
}], ctorParameters: () => [{ type: i1.Store }, { type: i1$1.HttpClient }] });
|
|
6771
|
+
|
|
6772
|
+
class AdminDatasetEffects {
|
|
6773
|
+
constructor(actions$, datasetService, pryDialog) {
|
|
6774
|
+
this.actions$ = actions$;
|
|
6775
|
+
this.datasetService = datasetService;
|
|
6776
|
+
this.pryDialog = pryDialog;
|
|
6777
|
+
this.createDataset$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.create), switchMap((props) => this.datasetService
|
|
6778
|
+
.addDataset(props.dataset)
|
|
6779
|
+
.pipe(mergeMap(() => [
|
|
6780
|
+
DataSourceActions.dataset.loadDataset(),
|
|
6781
|
+
AdminDatasetActions.unselectDataset(),
|
|
6782
|
+
AdminActions.routeTo({ path: props.route })
|
|
6783
|
+
]))), catchError$1((error) => [AdminDatasetActions.failure({ error })])));
|
|
6784
|
+
this.confirmDatasetDeletion$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.confirmDatasetDeletion), tap((action) => {
|
|
6785
|
+
const data = {
|
|
6786
|
+
title: '@pry.admin.infoModalTitle',
|
|
6787
|
+
message: '@pry.admin.dataset.delete',
|
|
6788
|
+
actions: [
|
|
6789
|
+
{
|
|
6790
|
+
id: 0,
|
|
6791
|
+
label: '@pry.admin.delete',
|
|
6792
|
+
actions: [
|
|
6793
|
+
AdminDatasetActions.delete({
|
|
6794
|
+
name: action.name,
|
|
6795
|
+
route: action.route,
|
|
6796
|
+
addRoute: action.addRoute
|
|
6797
|
+
})
|
|
6798
|
+
]
|
|
6799
|
+
},
|
|
6800
|
+
{ id: 0, label: '@pry.admin.cancel' }
|
|
6801
|
+
]
|
|
6802
|
+
};
|
|
6803
|
+
this.pryDialog.open(PryDialogConfirmComponent, { data });
|
|
6804
|
+
})), { dispatch: false });
|
|
6805
|
+
this.deleteDataset$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.delete), switchMap((action) => this.datasetService.deleteDataset(action.name).pipe(mergeMap(() => [
|
|
6806
|
+
DataSourceActions.dataset.loadDataset(),
|
|
6807
|
+
AdminDatasetActions.unselectDataset(),
|
|
6808
|
+
AdminDatasetActions.deleted({ addRoute: action.addRoute })
|
|
6809
|
+
]), catchError$1((error) => [AdminDatasetActions.failure({ error })])))));
|
|
6810
|
+
this.getDatasetById$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.getDatasetById), mergeMap((action) => this.datasetService.getDatasetById(action.id).pipe(map((data) => AdminDatasetActions.getDatasetByIdSuccess({ data })), catchError$1((error) => [AdminDatasetActions.getDatasetByIdFailure({ error })])))));
|
|
6811
|
+
this.unsetMissingGroupsOnDatasetSelection$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.selectDataset), mergeMap((action) => [
|
|
6812
|
+
AdminDatasetActions.setMissingGroups({ missingGroups: undefined }),
|
|
6813
|
+
DataSourceActions.dataset.listVersionsByDatasetId({ id: action.dataset.id })
|
|
6814
|
+
])));
|
|
6815
|
+
this.deleted$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.deleted), mergeMap((action) => [
|
|
6637
6816
|
AdminActions.togglePanel({ panelOpen: false }),
|
|
6638
6817
|
AdminActions.selectComponentType({ componentType: null }),
|
|
6639
6818
|
AdminActions.mainActions({
|
|
@@ -6649,30 +6828,38 @@ class AdminEffects {
|
|
|
6649
6828
|
]
|
|
6650
6829
|
})
|
|
6651
6830
|
])));
|
|
6652
|
-
this.
|
|
6653
|
-
return AdminActions.routeTo({ path: action.route });
|
|
6654
|
-
})));
|
|
6655
|
-
this.fetchClassAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchClassAssociations), mergeMap((action) => this.service.getClassAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6656
|
-
this.fetchFieldAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchFieldAssociations), mergeMap((action) => this.service.getFieldAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6657
|
-
this.fetchDatasetAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchDatasetAssociations), mergeMap((action) => this.service.getDatasetAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6658
|
-
this.fetchAttributeAssociations$ = createEffect(() => this.actions$.pipe(ofType(AdminActions.fetchAttributeAssociations), mergeMap((action) => this.service.getAttributeAssociations(action.id).pipe(map((association) => AdminActions.fetchAssociationsSuccess({ association })), catchError((error) => [AdminActions.fetchAssociationsFailure({ error: error })])))));
|
|
6659
|
-
// TODO move this effect into an admin-datasource store (provoly-dashboard#586)
|
|
6660
|
-
this.updateDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.update), switchMap((action) => this.dsService.updateDataset(action.dataset).pipe(mergeMap((conflict) => {
|
|
6831
|
+
this.updateDataset$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.update), switchMap((action) => this.datasetService.updateDataset(action.dataset).pipe(mergeMap((conflict) => {
|
|
6661
6832
|
let actions = [
|
|
6662
|
-
|
|
6833
|
+
AdminDatasetActions.setMissingGroups({ missingGroups: conflict?.missingGroupsByEntity }),
|
|
6663
6834
|
DataSourceActions.dataset.loadDataset()
|
|
6664
6835
|
];
|
|
6665
6836
|
if (action.route)
|
|
6666
|
-
actions.push(
|
|
6837
|
+
actions.push(AdminDatasetActions.unselectDataset(), AdminActions.routeTo({ path: action.route }));
|
|
6667
6838
|
return actions;
|
|
6668
|
-
}))), catchError((error) => [DataSourceActions.dataset.failure({ error })])));
|
|
6839
|
+
}))), catchError$1((error) => [DataSourceActions.dataset.failure({ error })])));
|
|
6840
|
+
this.addDatasetMetadata$ = createEffect(() => this.actions$.pipe(ofType(MetadataActions.addDatasetMetadata), mergeMap((action) => this.datasetService.addDatasetMetadata(action.datasetId, action.metadataId, action.value).pipe(map(() => MetadataActions.addDatasetMetadataSuccess({ datasetId: action.datasetId })), catchError$1((error) => [MetadataActions.addDatasetMetadataFailure({ error })])))));
|
|
6841
|
+
this.addDatasetMetadataSuccess$ = createEffect(() => this.actions$.pipe(ofType(MetadataActions.addDatasetMetadataSuccess), mergeMap((action) => {
|
|
6842
|
+
return [
|
|
6843
|
+
AdminDatasetActions.getDatasetById({ id: action.datasetId }),
|
|
6844
|
+
MetadataActions.isEditable({ editable: false }),
|
|
6845
|
+
DataSourceActions.dataset.loadDataset()
|
|
6846
|
+
];
|
|
6847
|
+
})));
|
|
6848
|
+
this.deleteDatasetMetadata$ = createEffect(() => this.actions$.pipe(ofType(MetadataActions.deleteDatasetMetadata), mergeMap((action) => this.datasetService.deleteDatasetMetadata(action.datasetId, action.metadataId).pipe(map(() => MetadataActions.deleteDatasetMetadataSuccess({ datasetId: action.datasetId })), catchError$1((error) => [MetadataActions.deleteDatasetMetadataFailure({ error })])))));
|
|
6849
|
+
this.deleteDatasetMetadataSuccess$ = createEffect(() => this.actions$.pipe(ofType(MetadataActions.deleteDatasetMetadataSuccess), mergeMap((action) => {
|
|
6850
|
+
return [
|
|
6851
|
+
AdminDatasetActions.getDatasetById({ id: action.datasetId }),
|
|
6852
|
+
MetadataActions.isEditable({ editable: false }),
|
|
6853
|
+
DataSourceActions.dataset.loadDataset()
|
|
6854
|
+
];
|
|
6855
|
+
})));
|
|
6669
6856
|
}
|
|
6670
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type:
|
|
6671
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type:
|
|
6857
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetEffects, deps: [{ token: i1$2.Actions }, { token: AdminDatasetService }, { token: i4.PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6858
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetEffects }); }
|
|
6672
6859
|
}
|
|
6673
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type:
|
|
6860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetEffects, decorators: [{
|
|
6674
6861
|
type: Injectable
|
|
6675
|
-
}], ctorParameters: () => [{ type: i1$2.Actions }, { type:
|
|
6862
|
+
}], ctorParameters: () => [{ type: i1$2.Actions }, { type: AdminDatasetService }, { type: i4.PryDialogService }] });
|
|
6676
6863
|
|
|
6677
6864
|
class PryAdminModule {
|
|
6678
6865
|
constructor(pryTranslateService) {
|
|
@@ -6755,7 +6942,7 @@ class PryAdminModule {
|
|
|
6755
6942
|
AdminClassesCustomizeSymbolComponent,
|
|
6756
6943
|
PryAssociationComponent], imports: [CommonModule,
|
|
6757
6944
|
PryCoreModule,
|
|
6758
|
-
AdminRoutingModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, PryIconModule,
|
|
6945
|
+
AdminRoutingModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, i1$2.EffectsFeatureModule, PryIconModule,
|
|
6759
6946
|
FormsModule,
|
|
6760
6947
|
ReactiveFormsModule,
|
|
6761
6948
|
PrySortModule,
|
|
@@ -6785,6 +6972,7 @@ class PryAdminModule {
|
|
|
6785
6972
|
StoreModule.forFeature(fieldsFeatureKey, fieldReducer),
|
|
6786
6973
|
StoreModule.forFeature(adminUserFeatureKey, adminUserReducer),
|
|
6787
6974
|
StoreModule.forFeature(linksFeatureKey, linkReducer),
|
|
6975
|
+
StoreModule.forFeature(datasetFeatureKey, datasetReducer),
|
|
6788
6976
|
EffectsModule.forFeature([AdminEffects]),
|
|
6789
6977
|
EffectsModule.forFeature([PredicatesEffects]),
|
|
6790
6978
|
EffectsModule.forFeature([EnvironmentEffects]),
|
|
@@ -6795,6 +6983,7 @@ class PryAdminModule {
|
|
|
6795
6983
|
EffectsModule.forFeature([AdminUserEffects]),
|
|
6796
6984
|
EffectsModule.forFeature([LinksEffects]),
|
|
6797
6985
|
EffectsModule.forFeature([AdminMetadataRulesEffects]),
|
|
6986
|
+
EffectsModule.forFeature([AdminDatasetEffects]),
|
|
6798
6987
|
PryIconModule,
|
|
6799
6988
|
FormsModule,
|
|
6800
6989
|
ReactiveFormsModule,
|
|
@@ -6906,6 +7095,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
6906
7095
|
StoreModule.forFeature(fieldsFeatureKey, fieldReducer),
|
|
6907
7096
|
StoreModule.forFeature(adminUserFeatureKey, adminUserReducer),
|
|
6908
7097
|
StoreModule.forFeature(linksFeatureKey, linkReducer),
|
|
7098
|
+
StoreModule.forFeature(datasetFeatureKey, datasetReducer),
|
|
6909
7099
|
EffectsModule.forFeature([AdminEffects]),
|
|
6910
7100
|
EffectsModule.forFeature([PredicatesEffects]),
|
|
6911
7101
|
EffectsModule.forFeature([EnvironmentEffects]),
|
|
@@ -6916,6 +7106,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
6916
7106
|
EffectsModule.forFeature([AdminUserEffects]),
|
|
6917
7107
|
EffectsModule.forFeature([LinksEffects]),
|
|
6918
7108
|
EffectsModule.forFeature([AdminMetadataRulesEffects]),
|
|
7109
|
+
EffectsModule.forFeature([AdminDatasetEffects]),
|
|
6919
7110
|
PryIconModule,
|
|
6920
7111
|
FormsModule,
|
|
6921
7112
|
ReactiveFormsModule,
|