@provoly/dashboard 1.2.7 → 1.2.9

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.
Files changed (71) hide show
  1. package/admin/admin.module.d.ts +16 -15
  2. package/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.d.ts +5 -16
  3. package/admin/components/admin-dataset/{shared/admin-form-dataset → admin-form-dataset}/admin-form-dataset.component.d.ts +8 -7
  4. package/admin/components/admin-dataset/store/admin-dataset.actions.d.ts +23 -18
  5. package/admin/components/admin-dataset/store/admin-dataset.effects.d.ts +9 -6
  6. package/admin/components/admin-dataset/store/admin-dataset.service.d.ts +2 -1
  7. package/admin/components/shared/add-category-modal/add-category-modal.component.d.ts +39 -0
  8. package/admin/i18n/en.translations.d.ts +23 -8
  9. package/admin/i18n/fr.translations.d.ts +23 -8
  10. package/dataset/components/dataset.component.d.ts +6 -2
  11. package/dataset/dataset.module.d.ts +1 -1
  12. package/dataset/i18n/en.translations.d.ts +8 -0
  13. package/dataset/i18n/fr.translations.d.ts +8 -0
  14. package/dataset/style/_o-pry-dataset-card.scss +19 -11
  15. package/dataset/style/_o-pry-dataset.scss +43 -11
  16. package/esm2022/admin/admin.module.mjs +7 -4
  17. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.mjs +22 -53
  18. package/esm2022/admin/components/admin-dataset/admin-edit-dataset/admin-edit-dataset.component.mjs +1 -1
  19. package/esm2022/admin/components/admin-dataset/admin-form-dataset/admin-form-dataset.component.mjs +115 -0
  20. package/esm2022/admin/components/admin-dataset/admin-new-dataset/admin-new-dataset.component.mjs +1 -1
  21. package/esm2022/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.mjs +3 -3
  22. package/esm2022/admin/components/admin-dataset/store/admin-dataset.actions.mjs +11 -10
  23. package/esm2022/admin/components/admin-dataset/store/admin-dataset.effects.mjs +2 -1
  24. package/esm2022/admin/components/admin-dataset/store/admin-dataset.service.mjs +10 -4
  25. package/esm2022/admin/components/shared/add-category-modal/add-category-modal.component.mjs +73 -0
  26. package/esm2022/admin/i18n/en.translations.mjs +25 -10
  27. package/esm2022/admin/i18n/fr.translations.mjs +26 -11
  28. package/esm2022/dataset/components/dataset-card/dataset-card.component.mjs +6 -6
  29. package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +3 -3
  30. package/esm2022/dataset/components/dataset.component.mjs +16 -6
  31. package/esm2022/dataset/dataset.module.mjs +8 -5
  32. package/esm2022/dataset/i18n/en.translations.mjs +9 -1
  33. package/esm2022/dataset/i18n/fr.translations.mjs +10 -2
  34. package/esm2022/dataset/style/css.component.mjs +2 -2
  35. package/esm2022/lib/core/components/share/access-rights-share/access-rights-share.component.mjs +1 -3
  36. package/esm2022/lib/core/components/share/access-rights-share-modal/access-rights-share-modal.component.mjs +11 -9
  37. package/esm2022/lib/core/components/share/share.utils.mjs +7 -4
  38. package/esm2022/lib/core/store/data-source/data-source.actions.mjs +4 -2
  39. package/esm2022/lib/core/store/data-source/data-source.effects.mjs +4 -1
  40. package/esm2022/lib/core/store/data-source/data-source.model.mjs +1 -1
  41. package/esm2022/lib/core/store/data-source/data-source.reducer.mjs +6 -2
  42. package/esm2022/lib/core/store/data-source/data-source.selectors.mjs +4 -2
  43. package/esm2022/lib/core/store/data-source/data-source.service.mjs +6 -1
  44. package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +3 -3
  45. package/esm2022/toolbox/components/save-view/save-view.component.mjs +7 -1
  46. package/esm2022/toolbox/shared/presentation-form/presentation-form.component.mjs +3 -3
  47. package/fesm2022/provoly-dashboard-admin.mjs +194 -105
  48. package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
  49. package/fesm2022/provoly-dashboard-dataset.mjs +45 -16
  50. package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
  51. package/fesm2022/provoly-dashboard-presentation.mjs +2 -2
  52. package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
  53. package/fesm2022/provoly-dashboard-toolbox.mjs +8 -2
  54. package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
  55. package/fesm2022/provoly-dashboard.mjs +50 -16
  56. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  57. package/lib/core/components/share/share.utils.d.ts +1 -1
  58. package/lib/core/store/data-source/data-source.actions.d.ts +7 -0
  59. package/lib/core/store/data-source/data-source.effects.d.ts +3 -0
  60. package/lib/core/store/data-source/data-source.model.d.ts +3 -0
  61. package/lib/core/store/data-source/data-source.reducer.d.ts +2 -0
  62. package/lib/core/store/data-source/data-source.selectors.d.ts +1 -0
  63. package/lib/core/store/data-source/data-source.service.d.ts +2 -0
  64. package/package.json +48 -48
  65. package/styles/base/_typography.scss +4 -0
  66. package/styles/base/_utils.scss +27 -1
  67. package/styles/components/_a-btn.scss +4 -0
  68. package/styles/components/_a-chip.scss +1 -0
  69. package/styles/components/_o-modal.scss +0 -42
  70. package/styles/layout/_o-base-layout.scss +1 -7
  71. package/esm2022/admin/components/admin-dataset/shared/admin-form-dataset/admin-form-dataset.component.mjs +0 -99
@@ -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, PryShareMode, 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';
16
+ import { ClassSelectors, FieldSelectors, FieldType, ClassActions, FieldActions, SubscriptionnerDirective, ConfigSelectors, ConfigActions, DEFAULT_ICON_URL, IconPosition, compareOperationFunctions, ItemUtils, CategoryActions, CategorySelectors, DataSourceActions, DataSourceSelectors, FIELD_OPTIONS, DEFAULT_CATEGORY_UUID, PryDatasetType, ENV_OPTIONS, GeometricFieldTypes, DashboardSelectors, PryShareMode, 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';
@@ -1436,26 +1436,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
1436
1436
  args: [{ selector: 'pry-admin-classes-new', template: "<div class=\"o-base-container\">\n <h1 class=\"a-h1\">{{ '@pry.admin.classes.add' | i18n }}</h1>\n <pry-admin-classes-form></pry-admin-classes-form>\n</div>\n" }]
1437
1437
  }] });
1438
1438
 
1439
+ const AdminDatasetActions = {
1440
+ failure: createAction('[Dataset] Failure effect Dataset', props()),
1441
+ create: createAction('[Dataset] Create Dataset', props()),
1442
+ update: createAction('[Dataset] Update Dataset', props()),
1443
+ confirmDatasetDeletion: createAction('[Dataset] Confirm deletion', props()),
1444
+ delete: createAction('[Dataset] Delete Dataset', props()),
1445
+ deleted: createAction('[Dataset] Dataset is deleted call to admin', props()),
1446
+ selectDataset: createAction('[Dataset] Open Dataset details', props()),
1447
+ unselectDataset: createAction('[Dataset] Unselect Dataset'),
1448
+ getDatasetById: createAction('[Dataset] Get Dataset by ID', props()),
1449
+ getDatasetByIdSuccess: createAction('[Dataset] Get Dataset by Id Success', props()),
1450
+ getDatasetByIdFailure: createAction('[Dataset] Get Dataset by Id Failure', props()),
1451
+ openNewDataset: createAction('[Dataset] Open New Dataset', props()),
1452
+ setMissingGroups: createAction('[Dataset] Set Missing Groups', props()),
1453
+ addCategory: createAction('[Dataset] Add Category', props())
1454
+ };
1455
+
1456
+ class AddCategoryModalComponent {
1457
+ constructor(store) {
1458
+ this.store = store;
1459
+ this.catToAdd = {
1460
+ id: v4(),
1461
+ name: ''
1462
+ };
1463
+ this.search$ = new BehaviorSubject(undefined);
1464
+ this.closeModal = new EventEmitter();
1465
+ this.category = new EventEmitter();
1466
+ this.actions = {
1467
+ attribute: {
1468
+ load: () => this.store.dispatch(CategoryActions.load()),
1469
+ select: () => this.store.select(CategorySelectors.categories),
1470
+ add: (category) => this.store.dispatch(AdminClassActions.saveCategory({ category }))
1471
+ },
1472
+ dataset: {
1473
+ load: () => this.store.dispatch(DataSourceActions.dataset.getCategories()),
1474
+ select: () => this.store.select(DataSourceSelectors.categories),
1475
+ add: (category) => this.store.dispatch(AdminDatasetActions.addCategory({ category }))
1476
+ }
1477
+ };
1478
+ }
1479
+ ngOnInit() {
1480
+ this.loadCategories();
1481
+ this.categories$ = this.selectCategories();
1482
+ this.filteredCategories$ = combineLatest([this.categories$, this.search$]).pipe(map(([categories, search]) => search
1483
+ ? categories.filter((category) => category.name.toLowerCase().includes(search?.toLowerCase()))
1484
+ : categories));
1485
+ }
1486
+ loadCategories() {
1487
+ this.actions[this.entityType].load();
1488
+ }
1489
+ selectCategories() {
1490
+ return this.actions[this.entityType].select();
1491
+ }
1492
+ addCategory() {
1493
+ this.actions[this.entityType].add(this.catToAdd);
1494
+ this.selectCategory(this.catToAdd);
1495
+ }
1496
+ selectCategory(category) {
1497
+ this.category.emit(category);
1498
+ this.closeModal.emit();
1499
+ }
1500
+ search($event) {
1501
+ this.search$.next($event.target.value);
1502
+ }
1503
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AddCategoryModalComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
1504
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: AddCategoryModalComponent, selector: "pry-add-category-modal", inputs: { entityType: "entityType" }, outputs: { closeModal: "closeModal", category: "category" }, ngImport: i0, template: "<div class=\"o-modal o-modal--selector\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.admin.shared.categoryModal.' + entityType + '.select' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"closeModal.emit()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <form (ngSubmit)=\"addCategory()\">\n <div class=\"m-form-label-field selector\">\n <label class=\"a-label\" for=\"name-search\">{{\n '@pry.admin.shared.categoryModal.' + entityType + '.searchOrCreate' | i18n\n }}</label>\n <input\n type=\"text\"\n class=\"a-form-field\"\n (input)=\"search($event)\"\n [(ngModel)]=\"catToAdd.name\"\n name=\"name\"\n id=\"name-search\"\n />\n </div>\n <div>\n <h3>\n {{ '@pry.admin.shared.categoryModal.' + entityType + '.name' | i18n }}\n </h3>\n <div class=\"u-display-flex -column\">\n @for (category of filteredCategories$ | async; track category.id) {\n <button\n type=\"button\"\n class=\"a-btn a-btn--ghost -no-padding u-display-flex -justify-start -width-full\"\n (click)=\"selectCategory(category)\"\n >\n <span class=\"u-visually-hidden\">{{\n '@pry.admin.shared.categoryModal.' + entityType + '.selectIt' | i18n\n }}</span>\n {{ category.name }}\n </button>\n }\n </div>\n </div>\n @if ((categories$ | async)?.length === 0) {\n <span>{{ '@pry.admin.shared.categoryModal.noCategories' | i18n }}</span>\n } @else if ((filteredCategories$ | async)?.length === 0) {\n <div class=\"u-display-flex -column\">\n <p class=\"a-p\">\n <strong>{{ catToAdd.name }} </strong>\n <span [innerHTML]=\"'@pry.admin.shared.categoryModal.' + entityType + '.add' | i18n\"></span>\n </p>\n <button type=\"submit\" class=\"a-btn a-btn--primary u-self-center\">\n {{ '@pry.admin.shared.categoryModal.' + entityType + '.create' | i18n }}\n </button>\n </div>\n }\n </form>\n</div>\n", dependencies: [{ kind: "component", type: i4.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
1505
+ }
1506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AddCategoryModalComponent, decorators: [{
1507
+ type: Component,
1508
+ args: [{ selector: 'pry-add-category-modal', template: "<div class=\"o-modal o-modal--selector\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.admin.shared.categoryModal.' + entityType + '.select' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"closeModal.emit()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <form (ngSubmit)=\"addCategory()\">\n <div class=\"m-form-label-field selector\">\n <label class=\"a-label\" for=\"name-search\">{{\n '@pry.admin.shared.categoryModal.' + entityType + '.searchOrCreate' | i18n\n }}</label>\n <input\n type=\"text\"\n class=\"a-form-field\"\n (input)=\"search($event)\"\n [(ngModel)]=\"catToAdd.name\"\n name=\"name\"\n id=\"name-search\"\n />\n </div>\n <div>\n <h3>\n {{ '@pry.admin.shared.categoryModal.' + entityType + '.name' | i18n }}\n </h3>\n <div class=\"u-display-flex -column\">\n @for (category of filteredCategories$ | async; track category.id) {\n <button\n type=\"button\"\n class=\"a-btn a-btn--ghost -no-padding u-display-flex -justify-start -width-full\"\n (click)=\"selectCategory(category)\"\n >\n <span class=\"u-visually-hidden\">{{\n '@pry.admin.shared.categoryModal.' + entityType + '.selectIt' | i18n\n }}</span>\n {{ category.name }}\n </button>\n }\n </div>\n </div>\n @if ((categories$ | async)?.length === 0) {\n <span>{{ '@pry.admin.shared.categoryModal.noCategories' | i18n }}</span>\n } @else if ((filteredCategories$ | async)?.length === 0) {\n <div class=\"u-display-flex -column\">\n <p class=\"a-p\">\n <strong>{{ catToAdd.name }} </strong>\n <span [innerHTML]=\"'@pry.admin.shared.categoryModal.' + entityType + '.add' | i18n\"></span>\n </p>\n <button type=\"submit\" class=\"a-btn a-btn--primary u-self-center\">\n {{ '@pry.admin.shared.categoryModal.' + entityType + '.create' | i18n }}\n </button>\n </div>\n }\n </form>\n</div>\n" }]
1509
+ }], ctorParameters: () => [{ type: i1.Store }], propDecorators: { entityType: [{
1510
+ type: Input,
1511
+ args: [{ required: true }]
1512
+ }], closeModal: [{
1513
+ type: Output
1514
+ }], category: [{
1515
+ type: Output
1516
+ }] } });
1517
+
1439
1518
  class AdminAttributesFormComponent extends SubscriptionnerDirective {
1440
- constructor(store, router, route, formBuilder, overlay, viewContainerRef, i18nService) {
1519
+ constructor(store, router, route, formBuilder, i18nService, dialog) {
1441
1520
  super();
1442
1521
  this.store = store;
1443
1522
  this.router = router;
1444
1523
  this.route = route;
1445
1524
  this.formBuilder = formBuilder;
1446
- this.overlay = overlay;
1447
- this.viewContainerRef = viewContainerRef;
1448
1525
  this.i18nService = i18nService;
1526
+ this.dialog = dialog;
1449
1527
  this.nameAlreadyExists = false;
1450
1528
  this.technicalNameAlreadyExists = false;
1451
1529
  this.fieldTypeDescription = FIELD_OPTIONS;
1452
- this.isShowedCategory = false;
1453
- this.catToAdd = {};
1454
- this.filterCategories$ = new BehaviorSubject(undefined);
1455
1530
  this.store.dispatch(FieldActions.load());
1456
1531
  this.fields$ = this.store.select(FieldSelectors.fields);
1457
1532
  this.store.dispatch(CategoryActions.load());
1458
- this.categories$ = combineLatest([this.store.select(CategorySelectors.categories), this.filterCategories$]).pipe(map(([categories, filter]) => categories.filter((cat) => !filter || cat.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))));
1533
+ this.categories$ = this.store.select(CategorySelectors.categories);
1459
1534
  this.attrForm = this.formBuilder.group({
1460
1535
  id: [v4()],
1461
1536
  technicalName: [
@@ -1551,53 +1626,28 @@ class AdminAttributesFormComponent extends SubscriptionnerDirective {
1551
1626
  }
1552
1627
  }
1553
1628
  }
1554
- showCategory() {
1555
- this.isShowedCategory = true;
1556
- this.overlayRef = this.overlay.create(new OverlayConfig({
1557
- hasBackdrop: true,
1558
- panelClass: ['o-modal-wrapper'],
1559
- backdropClass: 'backdrop'
1629
+ openModal() {
1630
+ const ref = this.dialog.open(AddCategoryModalComponent);
1631
+ ref.component.entityType = 'attribute';
1632
+ this.subscriptions.add(ref.component.category.subscribe((category) => {
1633
+ this.attrForm.patchValue({
1634
+ categories: category.id
1635
+ });
1560
1636
  }));
1561
- this.store.dispatch(ConfigActions.addingOverlay({ id: this.constructor.name }));
1562
- this.overlayRef.backdropClick().subscribe((_) => this.closeCategory());
1563
- this.overlayRef.attach(new TemplatePortal(this.template, this.viewContainerRef));
1564
- }
1565
- closeCategory() {
1566
- this.isShowedCategory = false;
1567
- this.catToAdd = {};
1568
- this.overlayRef?.dispose();
1569
- this.categories$ = this.store.select(CategorySelectors.categories);
1570
- this.store.dispatch(ConfigActions.closeOverlay({ id: this.constructor.name }));
1571
- }
1572
- search(event) {
1573
- this.filterCategories$.next(event.target.value);
1574
- }
1575
- addCategory() {
1576
- this.catToAdd.id = v4();
1577
- this.store.dispatch(AdminClassActions.saveCategory({ category: this.catToAdd }));
1578
- this.setCategory(this.catToAdd);
1579
- }
1580
- setCategory(cat) {
1581
- this.attrForm.patchValue({
1582
- category: cat.id
1583
- });
1584
- this.closeCategory();
1637
+ this.subscriptions.add(ref.component.closeModal.subscribe(() => ref.close()));
1585
1638
  }
1586
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminAttributesFormComponent, deps: [{ token: i1.Store }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i3$1.UntypedFormBuilder }, { token: i5.Overlay }, { token: i0.ViewContainerRef }, { token: i4.PryI18nService }], target: i0.ɵɵFactoryTarget.Component }); }
1587
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AdminAttributesFormComponent, selector: "pry-admin-attributes-form", inputs: { selectedClass: "selectedClass", interClass: "interClass", selectedAttribute: "selectedAttribute" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<form class=\"o-form\" [formGroup]=\"attrForm\" (ngSubmit)=\"addAttribute()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_technicalName\">{{ '@pry.admin.classes.attributes.technicalName' | i18n }}</label>\n <input id=\"attr_technicalName\" type=\"text\" class=\"a-form-field\" formControlName=\"technicalName\" required />\n <label class=\"a-label a-label--help -error\" *ngIf=\"technicalNameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('technicalName')?.invalid\">\n <div *ngIf=\"attrForm.get('technicalName')?.dirty && attrForm.get('technicalName')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('minlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.minLength' | i18n : { len: 2 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.maxLength' | i18n : { len: 100 }\n }}</label>\n </div>\n <div\n *ngIf=\"\n attrForm.get('technicalName')?.hasError('whitespace') && !attrForm.get('technicalName')?.hasError('minlength')\n \"\n >\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.noWhitespace' | i18n\n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_name\">{{ '@pry.admin.classes.attributes.name' | i18n }}</label>\n <input id=\"attr_name\" type=\"text\" class=\"a-form-field\" formControlName=\"name\" />\n <label class=\"a-label a-label--help -error\" *ngIf=\"nameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('name')?.invalid\">\n <div *ngIf=\"attrForm.get('name')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{\n '@pry.admin.maxLength' | i18n : { len: 50 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('name')?.hasError('whitespace')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{ '@pry.admin.noWhitespace' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"type\">{{ '@pry.admin.classes.attributes.field' | i18n }}</label>\n <div class=\"u-display-flex\">\n <pry-select\n id=\"type\"\n formControlName=\"field\"\n [items]=\"fields$ | async\"\n [autocomplete]=\"true\"\n bindLabel=\"name\"\n bindValue=\"id\"\n [isForm]=\"true\"\n required=\"true\"\n [template]=\"templateOption\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"aligned-option\">\n <p>{{ item.name }}</p>\n <div class=\"a-chip\" *ngIf=\"item.crs\">{{ item.crs }}</div>\n </div>\n </ng-template>\n <div\n *ngIf=\"selectedFieldTypeDescription$ | async as description\"\n class=\"m-info-icon a-tooltip -tooltip-width-lg u-self-center -flex-shrink-0\"\n [attr.data-tooltip]=\"description\"\n data-tooltip-position=\"right\"\n >\n <span>i</span>\n </div>\n </div>\n <div *ngIf=\"attrForm.get('field')?.invalid\">\n <div *ngIf=\"attrForm.get('field')?.dirty && attrForm.get('field')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"category\">{{ '@pry.admin.classes.attributes.category' | i18n }}</label>\n <pry-select\n id=\"category\"\n class=\"form-control\"\n formControlName=\"category\"\n [items]=\"categories$ | async\"\n (click)=\"showCategory()\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n [readonly]=\"true\"\n ></pry-select>\n </div>\n\n <div class=\"m-btn-group -width-sm\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n (click)=\"goBack()\"\n [innerHTML]=\"'@pry.admin.cancel' | i18n\"\n ></button>\n <button\n *pryAccess=\"{ module: 'admin', page: 'classes', action: 'add_attribute' }\"\n class=\"a-btn a-btn--primary\"\n type=\"submit\"\n [disabled]=\"attrForm.invalid || nameAlreadyExists || technicalNameAlreadyExists\"\n [innerHTML]=\"(selectedAttribute ? '@pry.admin.edit' : '@pry.admin.create') | i18n\"\n ></button>\n </div>\n</form>\n\n<ng-template #template>\n <div class=\"o-modal o-modal--selector\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.admin.classes.category.select' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"closeCategory()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <form (ngSubmit)=\"addCategory()\">\n <div class=\"m-form-label-field selector\">\n <label class=\"a-label\" for=\"name-search\">{{ '@pry.admin.classes.category.searchOrCreate' | i18n }}</label>\n <input\n type=\"text\"\n class=\"a-form-field\"\n (input)=\"search($event)\"\n [(ngModel)]=\"catToAdd.name\"\n name=\"name\"\n id=\"name-search\"\n />\n </div>\n\n <table class=\"a-table\">\n <caption>\n {{\n '@pry.admin.classes.category.name' | i18n\n }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ '@pry.admin.classes.category.name' | i18n }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let cat of categories$ | async\">\n <td>\n <button type=\"button\" class=\"a-btn a-btn--secondary select-it\" (click)=\"setCategory(cat)\">\n <span class=\"u-visually-hidden\">{{ '@pry.admin.classes.category.selectIt' | i18n }}</span>\n {{ cat.name }}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n <ng-container *ngIf=\"(categories$ | async)?.length === 0\">\n <p class=\"a-p a-p--create\">\n <strong>{{ catToAdd.name }} </strong>\n <span [innerHTML]=\"'@pry.admin.classes.category.add' | i18n\"></span>\n </p>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n [innerHTML]=\"'@pry.admin.classes.category.create' | i18n\"\n ></button>\n </ng-container>\n </form>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.PryAccessDirective, selector: "[pryAccess]", inputs: ["pryAccess"] }, { kind: "component", type: i4.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
1639
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminAttributesFormComponent, deps: [{ token: i1.Store }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i3$1.UntypedFormBuilder }, { token: i4.PryI18nService }, { token: i4.PryDialogService }], target: i0.ɵɵFactoryTarget.Component }); }
1640
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AdminAttributesFormComponent, selector: "pry-admin-attributes-form", inputs: { selectedClass: "selectedClass", interClass: "interClass", selectedAttribute: "selectedAttribute" }, usesInheritance: true, ngImport: i0, template: "<form class=\"o-form\" [formGroup]=\"attrForm\" (ngSubmit)=\"addAttribute()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_technicalName\">{{ '@pry.admin.classes.attributes.technicalName' | i18n }}</label>\n <input id=\"attr_technicalName\" type=\"text\" class=\"a-form-field\" formControlName=\"technicalName\" required />\n <label class=\"a-label a-label--help -error\" *ngIf=\"technicalNameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('technicalName')?.invalid\">\n <div *ngIf=\"attrForm.get('technicalName')?.dirty && attrForm.get('technicalName')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('minlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.minLength' | i18n: { len: 2 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.maxLength' | i18n: { len: 100 }\n }}</label>\n </div>\n <div\n *ngIf=\"\n attrForm.get('technicalName')?.hasError('whitespace') && !attrForm.get('technicalName')?.hasError('minlength')\n \"\n >\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.noWhitespace' | i18n\n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_name\">{{ '@pry.admin.classes.attributes.name' | i18n }}</label>\n <input id=\"attr_name\" type=\"text\" class=\"a-form-field\" formControlName=\"name\" />\n <label class=\"a-label a-label--help -error\" *ngIf=\"nameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('name')?.invalid\">\n <div *ngIf=\"attrForm.get('name')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{\n '@pry.admin.maxLength' | i18n: { len: 50 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('name')?.hasError('whitespace')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{ '@pry.admin.noWhitespace' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"type\">{{ '@pry.admin.classes.attributes.field' | i18n }}</label>\n <div class=\"u-display-flex\">\n <pry-select\n id=\"type\"\n formControlName=\"field\"\n [items]=\"fields$ | async\"\n [autocomplete]=\"true\"\n bindLabel=\"name\"\n bindValue=\"id\"\n [isForm]=\"true\"\n required=\"true\"\n [template]=\"templateOption\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"aligned-option\">\n <p>{{ item.name }}</p>\n <div class=\"a-chip\" *ngIf=\"item.crs\">{{ item.crs }}</div>\n </div>\n </ng-template>\n <div\n *ngIf=\"selectedFieldTypeDescription$ | async as description\"\n class=\"m-info-icon a-tooltip -tooltip-width-lg u-self-center -flex-shrink-0\"\n [attr.data-tooltip]=\"description\"\n data-tooltip-position=\"right\"\n >\n <span>i</span>\n </div>\n </div>\n <div *ngIf=\"attrForm.get('field')?.invalid\">\n <div *ngIf=\"attrForm.get('field')?.dirty && attrForm.get('field')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"category\">{{ '@pry.admin.classes.attributes.category' | i18n }}</label>\n <pry-select\n id=\"category\"\n class=\"form-control\"\n formControlName=\"category\"\n [items]=\"categories$ | async\"\n (click)=\"openModal()\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n [readonly]=\"true\"\n ></pry-select>\n </div>\n\n <div class=\"m-btn-group -width-sm\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n (click)=\"goBack()\"\n [innerHTML]=\"'@pry.admin.cancel' | i18n\"\n ></button>\n <button\n *pryAccess=\"{ module: 'admin', page: 'classes', action: 'add_attribute' }\"\n class=\"a-btn a-btn--primary\"\n type=\"submit\"\n [disabled]=\"attrForm.invalid || nameAlreadyExists || technicalNameAlreadyExists\"\n [innerHTML]=\"(selectedAttribute ? '@pry.admin.edit' : '@pry.admin.create') | i18n\"\n ></button>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.PryAccessDirective, selector: "[pryAccess]", inputs: ["pryAccess"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
1588
1641
  }
1589
1642
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminAttributesFormComponent, decorators: [{
1590
1643
  type: Component,
1591
- args: [{ selector: 'pry-admin-attributes-form', template: "<form class=\"o-form\" [formGroup]=\"attrForm\" (ngSubmit)=\"addAttribute()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_technicalName\">{{ '@pry.admin.classes.attributes.technicalName' | i18n }}</label>\n <input id=\"attr_technicalName\" type=\"text\" class=\"a-form-field\" formControlName=\"technicalName\" required />\n <label class=\"a-label a-label--help -error\" *ngIf=\"technicalNameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('technicalName')?.invalid\">\n <div *ngIf=\"attrForm.get('technicalName')?.dirty && attrForm.get('technicalName')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('minlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.minLength' | i18n : { len: 2 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.maxLength' | i18n : { len: 100 }\n }}</label>\n </div>\n <div\n *ngIf=\"\n attrForm.get('technicalName')?.hasError('whitespace') && !attrForm.get('technicalName')?.hasError('minlength')\n \"\n >\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.noWhitespace' | i18n\n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_name\">{{ '@pry.admin.classes.attributes.name' | i18n }}</label>\n <input id=\"attr_name\" type=\"text\" class=\"a-form-field\" formControlName=\"name\" />\n <label class=\"a-label a-label--help -error\" *ngIf=\"nameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('name')?.invalid\">\n <div *ngIf=\"attrForm.get('name')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{\n '@pry.admin.maxLength' | i18n : { len: 50 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('name')?.hasError('whitespace')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{ '@pry.admin.noWhitespace' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"type\">{{ '@pry.admin.classes.attributes.field' | i18n }}</label>\n <div class=\"u-display-flex\">\n <pry-select\n id=\"type\"\n formControlName=\"field\"\n [items]=\"fields$ | async\"\n [autocomplete]=\"true\"\n bindLabel=\"name\"\n bindValue=\"id\"\n [isForm]=\"true\"\n required=\"true\"\n [template]=\"templateOption\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"aligned-option\">\n <p>{{ item.name }}</p>\n <div class=\"a-chip\" *ngIf=\"item.crs\">{{ item.crs }}</div>\n </div>\n </ng-template>\n <div\n *ngIf=\"selectedFieldTypeDescription$ | async as description\"\n class=\"m-info-icon a-tooltip -tooltip-width-lg u-self-center -flex-shrink-0\"\n [attr.data-tooltip]=\"description\"\n data-tooltip-position=\"right\"\n >\n <span>i</span>\n </div>\n </div>\n <div *ngIf=\"attrForm.get('field')?.invalid\">\n <div *ngIf=\"attrForm.get('field')?.dirty && attrForm.get('field')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"category\">{{ '@pry.admin.classes.attributes.category' | i18n }}</label>\n <pry-select\n id=\"category\"\n class=\"form-control\"\n formControlName=\"category\"\n [items]=\"categories$ | async\"\n (click)=\"showCategory()\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n [readonly]=\"true\"\n ></pry-select>\n </div>\n\n <div class=\"m-btn-group -width-sm\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n (click)=\"goBack()\"\n [innerHTML]=\"'@pry.admin.cancel' | i18n\"\n ></button>\n <button\n *pryAccess=\"{ module: 'admin', page: 'classes', action: 'add_attribute' }\"\n class=\"a-btn a-btn--primary\"\n type=\"submit\"\n [disabled]=\"attrForm.invalid || nameAlreadyExists || technicalNameAlreadyExists\"\n [innerHTML]=\"(selectedAttribute ? '@pry.admin.edit' : '@pry.admin.create') | i18n\"\n ></button>\n </div>\n</form>\n\n<ng-template #template>\n <div class=\"o-modal o-modal--selector\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.admin.classes.category.select' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"closeCategory()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <form (ngSubmit)=\"addCategory()\">\n <div class=\"m-form-label-field selector\">\n <label class=\"a-label\" for=\"name-search\">{{ '@pry.admin.classes.category.searchOrCreate' | i18n }}</label>\n <input\n type=\"text\"\n class=\"a-form-field\"\n (input)=\"search($event)\"\n [(ngModel)]=\"catToAdd.name\"\n name=\"name\"\n id=\"name-search\"\n />\n </div>\n\n <table class=\"a-table\">\n <caption>\n {{\n '@pry.admin.classes.category.name' | i18n\n }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ '@pry.admin.classes.category.name' | i18n }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let cat of categories$ | async\">\n <td>\n <button type=\"button\" class=\"a-btn a-btn--secondary select-it\" (click)=\"setCategory(cat)\">\n <span class=\"u-visually-hidden\">{{ '@pry.admin.classes.category.selectIt' | i18n }}</span>\n {{ cat.name }}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n <ng-container *ngIf=\"(categories$ | async)?.length === 0\">\n <p class=\"a-p a-p--create\">\n <strong>{{ catToAdd.name }} </strong>\n <span [innerHTML]=\"'@pry.admin.classes.category.add' | i18n\"></span>\n </p>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n [innerHTML]=\"'@pry.admin.classes.category.create' | i18n\"\n ></button>\n </ng-container>\n </form>\n </div>\n</ng-template>\n" }]
1592
- }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3$1.UntypedFormBuilder }, { type: i5.Overlay }, { type: i0.ViewContainerRef }, { type: i4.PryI18nService }], propDecorators: { selectedClass: [{
1644
+ args: [{ selector: 'pry-admin-attributes-form', template: "<form class=\"o-form\" [formGroup]=\"attrForm\" (ngSubmit)=\"addAttribute()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_technicalName\">{{ '@pry.admin.classes.attributes.technicalName' | i18n }}</label>\n <input id=\"attr_technicalName\" type=\"text\" class=\"a-form-field\" formControlName=\"technicalName\" required />\n <label class=\"a-label a-label--help -error\" *ngIf=\"technicalNameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('technicalName')?.invalid\">\n <div *ngIf=\"attrForm.get('technicalName')?.dirty && attrForm.get('technicalName')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('minlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.minLength' | i18n: { len: 2 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('technicalName')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.maxLength' | i18n: { len: 100 }\n }}</label>\n </div>\n <div\n *ngIf=\"\n attrForm.get('technicalName')?.hasError('whitespace') && !attrForm.get('technicalName')?.hasError('minlength')\n \"\n >\n <label class=\"a-label a-label--help -error\" for=\"attr_technicalName\">{{\n '@pry.admin.noWhitespace' | i18n\n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"attr_name\">{{ '@pry.admin.classes.attributes.name' | i18n }}</label>\n <input id=\"attr_name\" type=\"text\" class=\"a-form-field\" formControlName=\"name\" />\n <label class=\"a-label a-label--help -error\" *ngIf=\"nameAlreadyExists$ | async\">{{\n '@pry.admin.exists' | i18n\n }}</label>\n <div *ngIf=\"attrForm.get('name')?.invalid\">\n <div *ngIf=\"attrForm.get('name')?.hasError('maxlength')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{\n '@pry.admin.maxLength' | i18n: { len: 50 }\n }}</label>\n </div>\n <div *ngIf=\"attrForm.get('name')?.hasError('whitespace')\">\n <label class=\"a-label a-label--help -error\" for=\"attr_name\">{{ '@pry.admin.noWhitespace' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"type\">{{ '@pry.admin.classes.attributes.field' | i18n }}</label>\n <div class=\"u-display-flex\">\n <pry-select\n id=\"type\"\n formControlName=\"field\"\n [items]=\"fields$ | async\"\n [autocomplete]=\"true\"\n bindLabel=\"name\"\n bindValue=\"id\"\n [isForm]=\"true\"\n required=\"true\"\n [template]=\"templateOption\"\n ></pry-select>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"aligned-option\">\n <p>{{ item.name }}</p>\n <div class=\"a-chip\" *ngIf=\"item.crs\">{{ item.crs }}</div>\n </div>\n </ng-template>\n <div\n *ngIf=\"selectedFieldTypeDescription$ | async as description\"\n class=\"m-info-icon a-tooltip -tooltip-width-lg u-self-center -flex-shrink-0\"\n [attr.data-tooltip]=\"description\"\n data-tooltip-position=\"right\"\n >\n <span>i</span>\n </div>\n </div>\n <div *ngIf=\"attrForm.get('field')?.invalid\">\n <div *ngIf=\"attrForm.get('field')?.dirty && attrForm.get('field')?.hasError('required')\">\n <label class=\"a-label a-label--help -error\">{{ '@pry.admin.required' | i18n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" for=\"category\">{{ '@pry.admin.classes.attributes.category' | i18n }}</label>\n <pry-select\n id=\"category\"\n class=\"form-control\"\n formControlName=\"category\"\n [items]=\"categories$ | async\"\n (click)=\"openModal()\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n [readonly]=\"true\"\n ></pry-select>\n </div>\n\n <div class=\"m-btn-group -width-sm\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n (click)=\"goBack()\"\n [innerHTML]=\"'@pry.admin.cancel' | i18n\"\n ></button>\n <button\n *pryAccess=\"{ module: 'admin', page: 'classes', action: 'add_attribute' }\"\n class=\"a-btn a-btn--primary\"\n type=\"submit\"\n [disabled]=\"attrForm.invalid || nameAlreadyExists || technicalNameAlreadyExists\"\n [innerHTML]=\"(selectedAttribute ? '@pry.admin.edit' : '@pry.admin.create') | i18n\"\n ></button>\n </div>\n</form>\n" }]
1645
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3$1.UntypedFormBuilder }, { type: i4.PryI18nService }, { type: i4.PryDialogService }], propDecorators: { selectedClass: [{
1593
1646
  type: Input
1594
1647
  }], interClass: [{
1595
1648
  type: Input
1596
1649
  }], selectedAttribute: [{
1597
1650
  type: Input
1598
- }], template: [{
1599
- type: ViewChild,
1600
- args: ['template', { read: TemplateRef }]
1601
1651
  }] } });
1602
1652
 
1603
1653
  class AdminAttributesEditComponent {
@@ -1872,22 +1922,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
1872
1922
  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" }]
1873
1923
  }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }] });
1874
1924
 
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
1925
  const datasetFeatureKey = '@pry/admin/datasets';
1892
1926
  const initialDatasetState = {
1893
1927
  isLoading: false,
@@ -2003,53 +2037,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
2003
2037
  args: ['input']
2004
2038
  }] } });
2005
2039
 
2006
- class AdminFormDatasetComponent {
2007
- constructor(store, router, route, formBuilder) {
2040
+ class AdminFormDatasetComponent extends SubscriptionnerDirective {
2041
+ constructor(store, router, route, formBuilder, dialog) {
2042
+ super();
2008
2043
  this.store = store;
2009
2044
  this.router = router;
2010
2045
  this.route = route;
2011
2046
  this.formBuilder = formBuilder;
2047
+ this.dialog = dialog;
2012
2048
  this.datasetList = [];
2013
2049
  this.datasetTypes = [];
2014
- this.sub = new Subscription();
2015
2050
  this.isSameName = false;
2016
2051
  this.isSubmitted = false;
2017
2052
  this.store.dispatch(ClassActions.load());
2018
2053
  this.store.dispatch(DataSourceActions.dataset.loadDataset());
2054
+ this.store.dispatch(DataSourceActions.dataset.getCategories());
2019
2055
  this.datasetList$ = this.store.select(DataSourceSelectors.datasets);
2020
- this.classes = this.store.select(ClassSelectors.classes);
2056
+ this.classes$ = this.store.select(ClassSelectors.classes);
2057
+ this.categories$ = this.store.select(DataSourceSelectors.categories);
2021
2058
  this.form = this.formBuilder.group({
2022
2059
  id: [v4()],
2023
2060
  name: ['', [Validators.required, Validators.maxLength(100)]],
2024
2061
  oClass: ['', [Validators.required]],
2025
2062
  type: ['', [Validators.required]],
2026
- description: ['', [Validators.maxLength(500)]]
2063
+ description: ['', [Validators.maxLength(500)]],
2064
+ categories: [[]]
2027
2065
  });
2028
2066
  }
2029
2067
  ngOnInit() {
2030
2068
  this.isSameName = false;
2031
- this.sub = this.datasetList$.subscribe((dataset) => {
2069
+ this.subscriptions.add(this.datasetList$.subscribe((dataset) => {
2032
2070
  this.datasetList = dataset;
2033
- });
2071
+ }));
2034
2072
  this.datasetTypes = Object.keys(PryDatasetType).map((label) => ({
2035
2073
  label: '@pry.admin.dataset.' + label,
2036
2074
  value: label
2037
2075
  }));
2038
- this.sub.add(this.dataset$?.subscribe((dataset) => {
2076
+ this.subscriptions.add(this.dataset$?.subscribe((dataset) => {
2039
2077
  if (dataset) {
2040
2078
  this.form.patchValue({
2041
2079
  id: dataset.id,
2042
2080
  name: dataset.name,
2043
2081
  oClass: dataset.oClass,
2044
2082
  type: dataset.type,
2045
- description: dataset.description
2083
+ description: dataset.description,
2084
+ categories: dataset.categories
2046
2085
  });
2086
+ this.form.controls['oClass'].disable();
2087
+ this.form.controls['type'].disable();
2047
2088
  }
2048
2089
  }));
2049
2090
  }
2050
- ngOnDestroy() {
2051
- this.sub.unsubscribe();
2052
- }
2053
2091
  goBack() {
2054
2092
  this.store.dispatch(AdminActions.routeTo({ path: this.getPath() }));
2055
2093
  }
@@ -2069,23 +2107,35 @@ class AdminFormDatasetComponent {
2069
2107
  this.isSubmitted = false;
2070
2108
  if (this.dataset$) {
2071
2109
  const path = this.router.createUrlTree(['../..'], { relativeTo: this.route });
2072
- this.store.dispatch(AdminDatasetActions.update({ dataset: this.form.value, route: path.toString() }));
2110
+ this.store.dispatch(AdminDatasetActions.update({ dataset: this.form.getRawValue(), route: path.toString() }));
2073
2111
  return;
2074
2112
  }
2075
2113
  const path = this.router.createUrlTree(['..'], { relativeTo: this.route });
2076
2114
  this.isSameName = !!this.datasetList.find((dataset) => this.form.get('name')?.value.toLowerCase() === dataset.name.toLowerCase());
2077
2115
  if (!this.isSameName) {
2078
- this.store.dispatch(AdminDatasetActions.create({ dataset: this.form.value, route: path.toString() }));
2116
+ this.store.dispatch(AdminDatasetActions.create({ dataset: this.form.getRawValue(), route: path.toString() }));
2079
2117
  }
2080
2118
  }
2081
2119
  }
2082
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminFormDatasetComponent, deps: [{ token: i1.Store }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i3$1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
2083
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AdminFormDatasetComponent, selector: "pry-admin-form-dataset", inputs: { dataset$: "dataset$" }, ngImport: i0, template: "<form class=\"o-form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"name-label\" for=\"name\">\n {{ '@pry.admin.dataset.name' | i18n }} *\n <span class=\"u-visually-hidden\">({{ '@pry.admin.required' | i18n }})</span>\n </label>\n <input\n id=\"name\"\n type=\"text\"\n class=\"a-form-field\"\n formControlName=\"name\"\n (ngModelChange)=\"changeValueName($event)\"\n [attr.aria-labelledby]=\"isSubmitted && form.get('name')?.invalid ? 'name-label name-error' : 'name-label'\"\n [attr.aria-invalid]=\"isSubmitted && form.get('name')?.invalid\"\n required\n />\n <label\n class=\"a-label a-label--help -error\"\n id=\"name-error\"\n for=\"name\"\n *ngIf=\"isSubmitted && form.get('name')?.invalid\"\n >{{ '@pry.admin.required' | i18n }}</label\n >\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"description-label\" for=\"description\">{{ '@pry.admin.fields.description' | i18n }}</label>\n <textarea\n class=\"-resizable-both\"\n formControlName=\"description\"\n name=\"description\"\n id=\"description\"\n maxlength=\"500\"\n ></textarea>\n <label\n for=\"description\"\n *ngIf=\"form.get('description')?.hasError('maxlength')\"\n class=\"a-label a-label--help -error\"\n >\n {{ '@pry.presentation.maxLength' | i18n : { len: '500' } }}\n </label>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"item-label\" for=\"class\">{{ '@pry.admin.dataset.oClass' | i18n }}</label>\n <pry-select\n id=\"class\"\n formControlName=\"oClass\"\n [items]=\"classes | async\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n aria-labelledby=\"item-label\"\n [readonly]=\"!!dataset$\"\n ></pry-select>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"user-label\" for=\"type\">{{ '@pry.admin.dataset.type' | i18n }}</label>\n <pry-select\n id=\"type\"\n formControlName=\"type\"\n [items]=\"datasetTypes\"\n bindValue=\"value\"\n bindLabel=\"label\"\n [isForm]=\"true\"\n aria-labelledby=\"user-label\"\n [readonly]=\"!!dataset$\"\n ></pry-select>\n </div>\n\n <label class=\"a-label a-label--help -error\" *ngIf=\"isSameName\">{{ '@pry.admin.dataset.is-same-name' | i18n }}</label>\n\n <div class=\"m-btn-group -width-sm\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n (click)=\"goBack()\"\n [innerHTML]=\"'@pry.admin.cancel' | i18n\"\n ></button>\n <button\n class=\"a-btn a-btn--primary\"\n type=\"submit\"\n [innerHTML]=\"(dataset$ ? '@pry.admin.edit' : '@pry.admin.create') | i18n\"\n ></button>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
2120
+ openModal() {
2121
+ const ref = this.dialog.open(AddCategoryModalComponent);
2122
+ ref.component.entityType = 'dataset';
2123
+ this.subscriptions.add(ref.component.category.subscribe((category) => {
2124
+ if (!this.form.get('categories')?.value?.some((cat) => cat.id === category.id)) {
2125
+ this.form.patchValue({
2126
+ categories: [...(this.form.get('categories')?.value ?? []), category]
2127
+ });
2128
+ }
2129
+ }));
2130
+ this.subscriptions.add(ref.component.closeModal.subscribe(() => ref.close()));
2131
+ }
2132
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminFormDatasetComponent, deps: [{ token: i1.Store }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i3$1.UntypedFormBuilder }, { token: i4.PryDialogService }], target: i0.ɵɵFactoryTarget.Component }); }
2133
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: AdminFormDatasetComponent, selector: "pry-admin-form-dataset", inputs: { dataset$: "dataset$" }, usesInheritance: true, ngImport: i0, template: "<form class=\"o-form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"name-label\" for=\"name\">\n {{ '@pry.admin.dataset.name' | i18n }} <span class=\"-error\">*</span>\n <span class=\"u-visually-hidden\">({{ '@pry.admin.required' | i18n }})</span>\n </label>\n <input\n id=\"name\"\n type=\"text\"\n class=\"a-form-field\"\n formControlName=\"name\"\n (ngModelChange)=\"changeValueName($event)\"\n [attr.aria-labelledby]=\"isSubmitted && form.get('name')?.invalid ? 'name-label name-error' : 'name-label'\"\n [attr.aria-invalid]=\"isSubmitted && form.get('name')?.invalid\"\n required\n />\n @if (\n (isSubmitted && form.get('name')?.invalid) ||\n (form.get('name')?.touched && form.get('name')?.hasError('required'))\n ) {\n <label class=\"a-label a-label--help -error\" id=\"name-error\" for=\"name\">{{ '@pry.admin.required' | i18n }}</label>\n }\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"description-label\" for=\"description\"\n >{{ '@pry.admin.fields.description' | i18n }}\n </label>\n <textarea\n class=\"-resizable-both\"\n formControlName=\"description\"\n name=\"description\"\n id=\"description\"\n maxlength=\"500\"\n ></textarea>\n @if (form.get('description')?.hasError('maxlength')) {\n <label for=\"description\" class=\"a-label a-label--help -error\">\n {{ '@pry.presentation.maxLength' | i18n: { len: '500' } }}\n </label>\n }\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"item-label\" for=\"class\"\n >{{ '@pry.admin.dataset.oClass' | i18n }}\n @if (!dataset$) {\n <span>*</span>\n }\n </label>\n <pry-select\n id=\"class\"\n formControlName=\"oClass\"\n [items]=\"classes$ | async\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n aria-labelledby=\"item-label\"\n ></pry-select>\n @if (form.get('oClass')?.touched && form.get('oClass')?.hasError('required')) {\n <label for=\"description\" class=\"a-label a-label--help -error\">\n {{ '@pry.presentation.maxLength' | i18n: { len: '500' } }}\n </label>\n }\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"user-label\" for=\"type\"\n >{{ '@pry.admin.dataset.type' | i18n }}\n @if (!dataset$) {\n <span>*</span>\n }\n </label>\n <pry-select\n id=\"type\"\n formControlName=\"type\"\n [items]=\"datasetTypes\"\n bindValue=\"value\"\n bindLabel=\"label\"\n [isForm]=\"true\"\n aria-labelledby=\"user-label\"\n ></pry-select>\n </div>\n\n <div class=\"u-display-flex -gap-20\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"tags-label\" for=\"tags\">{{ '@pry.dataset.tags' | i18n }}</label>\n <pry-select\n id=\"tags\"\n formControlName=\"categories\"\n [items]=\"categories$ | async\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n aria-labelledby=\"tags-label\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n ></pry-select>\n </div>\n <button class=\"a-btn a-btn--primary u-self-center\" type=\"button\" (click)=\"openModal()\">\n {{ '@pry.admin.dataset.addTag' | i18n }}\n </button>\n </div>\n\n <div class=\"m-btn-group -width-sm\">\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"goBack()\">\n {{ '@pry.admin.cancel' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ (dataset$ ? '@pry.admin.edit' : '@pry.admin.create') | i18n }}\n </button>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
2084
2134
  }
2085
2135
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminFormDatasetComponent, decorators: [{
2086
2136
  type: Component,
2087
- args: [{ selector: 'pry-admin-form-dataset', template: "<form class=\"o-form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"name-label\" for=\"name\">\n {{ '@pry.admin.dataset.name' | i18n }} *\n <span class=\"u-visually-hidden\">({{ '@pry.admin.required' | i18n }})</span>\n </label>\n <input\n id=\"name\"\n type=\"text\"\n class=\"a-form-field\"\n formControlName=\"name\"\n (ngModelChange)=\"changeValueName($event)\"\n [attr.aria-labelledby]=\"isSubmitted && form.get('name')?.invalid ? 'name-label name-error' : 'name-label'\"\n [attr.aria-invalid]=\"isSubmitted && form.get('name')?.invalid\"\n required\n />\n <label\n class=\"a-label a-label--help -error\"\n id=\"name-error\"\n for=\"name\"\n *ngIf=\"isSubmitted && form.get('name')?.invalid\"\n >{{ '@pry.admin.required' | i18n }}</label\n >\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"description-label\" for=\"description\">{{ '@pry.admin.fields.description' | i18n }}</label>\n <textarea\n class=\"-resizable-both\"\n formControlName=\"description\"\n name=\"description\"\n id=\"description\"\n maxlength=\"500\"\n ></textarea>\n <label\n for=\"description\"\n *ngIf=\"form.get('description')?.hasError('maxlength')\"\n class=\"a-label a-label--help -error\"\n >\n {{ '@pry.presentation.maxLength' | i18n : { len: '500' } }}\n </label>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"item-label\" for=\"class\">{{ '@pry.admin.dataset.oClass' | i18n }}</label>\n <pry-select\n id=\"class\"\n formControlName=\"oClass\"\n [items]=\"classes | async\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n aria-labelledby=\"item-label\"\n [readonly]=\"!!dataset$\"\n ></pry-select>\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"user-label\" for=\"type\">{{ '@pry.admin.dataset.type' | i18n }}</label>\n <pry-select\n id=\"type\"\n formControlName=\"type\"\n [items]=\"datasetTypes\"\n bindValue=\"value\"\n bindLabel=\"label\"\n [isForm]=\"true\"\n aria-labelledby=\"user-label\"\n [readonly]=\"!!dataset$\"\n ></pry-select>\n </div>\n\n <label class=\"a-label a-label--help -error\" *ngIf=\"isSameName\">{{ '@pry.admin.dataset.is-same-name' | i18n }}</label>\n\n <div class=\"m-btn-group -width-sm\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n (click)=\"goBack()\"\n [innerHTML]=\"'@pry.admin.cancel' | i18n\"\n ></button>\n <button\n class=\"a-btn a-btn--primary\"\n type=\"submit\"\n [innerHTML]=\"(dataset$ ? '@pry.admin.edit' : '@pry.admin.create') | i18n\"\n ></button>\n </div>\n</form>\n" }]
2088
- }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3$1.UntypedFormBuilder }], propDecorators: { dataset$: [{
2137
+ args: [{ selector: 'pry-admin-form-dataset', template: "<form class=\"o-form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"name-label\" for=\"name\">\n {{ '@pry.admin.dataset.name' | i18n }} <span class=\"-error\">*</span>\n <span class=\"u-visually-hidden\">({{ '@pry.admin.required' | i18n }})</span>\n </label>\n <input\n id=\"name\"\n type=\"text\"\n class=\"a-form-field\"\n formControlName=\"name\"\n (ngModelChange)=\"changeValueName($event)\"\n [attr.aria-labelledby]=\"isSubmitted && form.get('name')?.invalid ? 'name-label name-error' : 'name-label'\"\n [attr.aria-invalid]=\"isSubmitted && form.get('name')?.invalid\"\n required\n />\n @if (\n (isSubmitted && form.get('name')?.invalid) ||\n (form.get('name')?.touched && form.get('name')?.hasError('required'))\n ) {\n <label class=\"a-label a-label--help -error\" id=\"name-error\" for=\"name\">{{ '@pry.admin.required' | i18n }}</label>\n }\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"description-label\" for=\"description\"\n >{{ '@pry.admin.fields.description' | i18n }}\n </label>\n <textarea\n class=\"-resizable-both\"\n formControlName=\"description\"\n name=\"description\"\n id=\"description\"\n maxlength=\"500\"\n ></textarea>\n @if (form.get('description')?.hasError('maxlength')) {\n <label for=\"description\" class=\"a-label a-label--help -error\">\n {{ '@pry.presentation.maxLength' | i18n: { len: '500' } }}\n </label>\n }\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"item-label\" for=\"class\"\n >{{ '@pry.admin.dataset.oClass' | i18n }}\n @if (!dataset$) {\n <span>*</span>\n }\n </label>\n <pry-select\n id=\"class\"\n formControlName=\"oClass\"\n [items]=\"classes$ | async\"\n bindValue=\"id\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n aria-labelledby=\"item-label\"\n ></pry-select>\n @if (form.get('oClass')?.touched && form.get('oClass')?.hasError('required')) {\n <label for=\"description\" class=\"a-label a-label--help -error\">\n {{ '@pry.presentation.maxLength' | i18n: { len: '500' } }}\n </label>\n }\n </div>\n\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"user-label\" for=\"type\"\n >{{ '@pry.admin.dataset.type' | i18n }}\n @if (!dataset$) {\n <span>*</span>\n }\n </label>\n <pry-select\n id=\"type\"\n formControlName=\"type\"\n [items]=\"datasetTypes\"\n bindValue=\"value\"\n bindLabel=\"label\"\n [isForm]=\"true\"\n aria-labelledby=\"user-label\"\n ></pry-select>\n </div>\n\n <div class=\"u-display-flex -gap-20\">\n <div class=\"m-form-label-field -width-sm\">\n <label class=\"a-label\" id=\"tags-label\" for=\"tags\">{{ '@pry.dataset.tags' | i18n }}</label>\n <pry-select\n id=\"tags\"\n formControlName=\"categories\"\n [items]=\"categories$ | async\"\n bindLabel=\"name\"\n [isForm]=\"true\"\n aria-labelledby=\"tags-label\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n ></pry-select>\n </div>\n <button class=\"a-btn a-btn--primary u-self-center\" type=\"button\" (click)=\"openModal()\">\n {{ '@pry.admin.dataset.addTag' | i18n }}\n </button>\n </div>\n\n <div class=\"m-btn-group -width-sm\">\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"goBack()\">\n {{ '@pry.admin.cancel' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ (dataset$ ? '@pry.admin.edit' : '@pry.admin.create') | i18n }}\n </button>\n </div>\n</form>\n" }]
2138
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3$1.UntypedFormBuilder }, { type: i4.PryDialogService }], propDecorators: { dataset$: [{
2089
2139
  type: Input
2090
2140
  }] } });
2091
2141
 
@@ -2960,11 +3010,11 @@ class AdminSelectDatasetComponent extends SubscriptionnerDirective {
2960
3010
  return this.access ? this.access.canModifyDataset(dataset) : of(false);
2961
3011
  }
2962
3012
  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)=\"updateGroups($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" }] }); }
3013
+ 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.datasetDetails' | i18n }}\n </h3>\n </div>\n\n <pry-tab-group translationStringBase=\"@pry.admin.\">\n <pry-tab [templateRef]=\"datasetDetails\" name=\"dataset.details\"></pry-tab>\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 #datasetDetails>\n <div class=\"u-display-flex -column -gap-20\">\n <div>\n <h4 class=\"a-h4\">{{ '@pry.dataset.name' | i18n }}</h4>\n <span>{{ dataset.name }}</span>\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.dataset.description' | i18n }}</h4>\n @if (dataset.description) {\n <span>{{ dataset.description }}</span>\n } @else {\n <span class=\"-italic\">{{ '@pry.dataset.noDescription' | i18n }}</span>\n }\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.admin.customize.name' | i18n }}</h4>\n <span>{{ dataset.oClass | translateId: { type: 'class', output: 'name' } | async }}</span>\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.admin.dataset.type' | i18n }}</h4>\n <span>{{ '@pry.admin.dataset.' + dataset.type | i18n }}</span>\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.dataset.tags' | i18n }}</h4>\n @if (dataset.categories && dataset.categories.length > 0) {\n <div class=\"u-display-flex\">\n @for (category of dataset.categories; track category.id) {\n <span class=\"a-chip -md\">{{ category.name }}</span>\n }\n </div>\n } @else {\n <span class=\"-italic\">{{ '@pry.dataset.noTags' | i18n }}</span>\n }\n </div>\n </div>\n </ng-template>\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)=\"updateGroups($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.TranslateIdPipe, name: "translateId" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
2964
3014
  }
2965
3015
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminSelectDatasetComponent, decorators: [{
2966
3016
  type: Component,
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)=\"updateGroups($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" }]
3017
+ 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.datasetDetails' | i18n }}\n </h3>\n </div>\n\n <pry-tab-group translationStringBase=\"@pry.admin.\">\n <pry-tab [templateRef]=\"datasetDetails\" name=\"dataset.details\"></pry-tab>\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 #datasetDetails>\n <div class=\"u-display-flex -column -gap-20\">\n <div>\n <h4 class=\"a-h4\">{{ '@pry.dataset.name' | i18n }}</h4>\n <span>{{ dataset.name }}</span>\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.dataset.description' | i18n }}</h4>\n @if (dataset.description) {\n <span>{{ dataset.description }}</span>\n } @else {\n <span class=\"-italic\">{{ '@pry.dataset.noDescription' | i18n }}</span>\n }\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.admin.customize.name' | i18n }}</h4>\n <span>{{ dataset.oClass | translateId: { type: 'class', output: 'name' } | async }}</span>\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.admin.dataset.type' | i18n }}</h4>\n <span>{{ '@pry.admin.dataset.' + dataset.type | i18n }}</span>\n </div>\n <div>\n <h4 class=\"a-h4\">{{ '@pry.dataset.tags' | i18n }}</h4>\n @if (dataset.categories && dataset.categories.length > 0) {\n <div class=\"u-display-flex\">\n @for (category of dataset.categories; track category.id) {\n <span class=\"a-chip -md\">{{ category.name }}</span>\n }\n </div>\n } @else {\n <span class=\"-italic\">{{ '@pry.dataset.noTags' | i18n }}</span>\n }\n </div>\n </div>\n </ng-template>\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)=\"updateGroups($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
3018
  }], ctorParameters: () => [{ type: i1.Store }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i4.PryI18nService }, { type: i4.PryBaseAccess, decorators: [{
2969
3019
  type: Optional
2970
3020
  }, {
@@ -6075,7 +6125,8 @@ const enTranslations = {
6075
6125
  conflict: 'Careful, the following dashboards are shared to groups which can no longer access this datasource:',
6076
6126
  entities: {
6077
6127
  dashboard: 'Dashboard'
6078
- }
6128
+ },
6129
+ addTag: 'Add a new tag'
6079
6130
  },
6080
6131
  'abac-rules': {
6081
6132
  delete: 'Delete',
@@ -6168,16 +6219,9 @@ const enTranslations = {
6168
6219
  info: 'Attribute information',
6169
6220
  description: 'Description',
6170
6221
  field: 'Field',
6222
+ dfield: 'Field',
6171
6223
  category: 'Category',
6172
6224
  multiValued: 'Multi valued'
6173
- },
6174
- category: {
6175
- select: 'Select category',
6176
- searchOrCreate: 'Search for existing category OR create a new one',
6177
- name: 'Category',
6178
- selectIt: 'Select category',
6179
- create: 'Create category',
6180
- add: 'does not exist. <br>You can create it here. <br>It will be automatically selected and added to categories list.'
6181
6225
  }
6182
6226
  },
6183
6227
  fields: {
@@ -6282,6 +6326,27 @@ const enTranslations = {
6282
6326
  POSTGIS: 'PostGIS',
6283
6327
  ELASTIC: 'ElasticSearch'
6284
6328
  }
6329
+ },
6330
+ shared: {
6331
+ noCategories: 'No categories available',
6332
+ categoryModal: {
6333
+ dataset: {
6334
+ select: 'Select tag',
6335
+ searchOrCreate: 'Search for existing tag OR create a new one',
6336
+ name: 'Tag',
6337
+ selectIt: 'Select tag',
6338
+ create: 'Create tag',
6339
+ add: 'does not exist. <br>You can create it here. <br>It will be automatically selected and added to the tag list.'
6340
+ },
6341
+ attribute: {
6342
+ select: 'Select category',
6343
+ searchOrCreate: 'Search for existing category OR create a new one',
6344
+ name: 'Category',
6345
+ selectIt: 'Select category',
6346
+ create: 'Create category',
6347
+ add: 'does not exist. <br>You can create it here. <br>It will be automatically selected and added to the category list.'
6348
+ }
6349
+ }
6285
6350
  }
6286
6351
  },
6287
6352
  tooltip: {
@@ -6431,7 +6496,8 @@ const frTranslations = {
6431
6496
  dataset: {
6432
6497
  delete: "L'ensemble des versions et des données associées seront supprimées. Les restitutions et présentations utilisant ce jeu de données n'afficheront plus les données correspondantes. Confirmez-vous la suppression ?",
6433
6498
  title: 'Jeux de données',
6434
- details: 'Détails du jeu de données',
6499
+ details: 'Détails',
6500
+ datasetDetails: 'Détails du jeu de données',
6435
6501
  id: 'Identifiant',
6436
6502
  name: 'Nom',
6437
6503
  oClass: 'Modèle métier',
@@ -6450,7 +6516,8 @@ const frTranslations = {
6450
6516
  conflict: "Attention, les tableaux de bord suivants sont partagés à des groupes qui n'auront plus accès aux données :",
6451
6517
  entities: {
6452
6518
  dashboard: 'Tableaux de bord'
6453
- }
6519
+ },
6520
+ addTag: 'Ajouter un noueau tag'
6454
6521
  },
6455
6522
  'abac-rules': {
6456
6523
  delete: 'Supprimer',
@@ -6546,14 +6613,6 @@ const frTranslations = {
6546
6613
  field: 'Type',
6547
6614
  category: 'Catégorie',
6548
6615
  multiValued: 'Multi valué'
6549
- },
6550
- category: {
6551
- select: 'Sélectionner une catégorie',
6552
- searchOrCreate: 'Rechercher une catégorie existante OU en créer une nouvelle',
6553
- name: 'Catégorie',
6554
- selectIt: 'Sélectionner la catégorie',
6555
- create: 'Créer la catégorie',
6556
- add: "n'existe pas encore. <br>Il est possible \n de la créer ici. <br>Elle sera automatiquement sélectionnée et ajoutée à la liste des catégories."
6557
6616
  }
6558
6617
  },
6559
6618
  fields: {
@@ -6659,6 +6718,27 @@ const frTranslations = {
6659
6718
  POSTGIS: 'PostGIS',
6660
6719
  ELASTIC: 'ElasticSearch'
6661
6720
  }
6721
+ },
6722
+ shared: {
6723
+ categoryModal: {
6724
+ noCategories: "Aucune catégorie n'a été créée pour le moment",
6725
+ dataset: {
6726
+ select: 'Sélectionner un tag',
6727
+ searchOrCreate: 'Rechercher un tag existant OU en créer un nouveau',
6728
+ name: 'Tag',
6729
+ selectIt: 'Sélectionner le tag',
6730
+ create: 'Créer le tag',
6731
+ add: "n'existe pas encore. <br>Il est possible \n de le créer ici. <br>Il sera automatiquement sélectionné et ajouté à la liste des tags."
6732
+ },
6733
+ attribute: {
6734
+ select: 'Sélectionner une catégorie',
6735
+ searchOrCreate: 'Rechercher une catégorie existante OU en créer une nouvelle',
6736
+ name: 'Catégorie',
6737
+ selectIt: 'Sélectionner la catégorie',
6738
+ create: 'Créer la catégorie',
6739
+ add: "n'existe pas encore. <br>Il est possible \n de la créer ici. <br>Elle sera automatiquement sélectionnée et ajoutée à la liste des catégories."
6740
+ }
6741
+ }
6662
6742
  }
6663
6743
  },
6664
6744
  tooltip: {
@@ -6730,9 +6810,10 @@ class AdminDatasetService {
6730
6810
  .pipe(mergeMap((url) => this.httpClient.post(encodeURI(`${url}/datasets`), dataset)));
6731
6811
  }
6732
6812
  updateDataset(dataset) {
6733
- return this.store
6734
- .select(ConfigSelectors.refUrl)
6735
- .pipe(mergeMap((url) => this.httpClient.put(encodeURI(`${url}/datasets`), dataset)));
6813
+ return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.put(encodeURI(`${url}/datasets`), {
6814
+ ...dataset,
6815
+ categories: dataset.categories?.map((category) => category.id)
6816
+ })));
6736
6817
  }
6737
6818
  deleteDataset(id) {
6738
6819
  return this.store
@@ -6759,6 +6840,11 @@ class AdminDatasetService {
6759
6840
  .select(ConfigSelectors.refUrl)
6760
6841
  .pipe(mergeMap((url) => this.httpClient.delete(encodeURI(`${url}/datasets/id/${datasetId}/metadata/id/${metadataId}`))));
6761
6842
  }
6843
+ addCategory(category) {
6844
+ return this.store
6845
+ .select(ConfigSelectors.refUrl)
6846
+ .pipe(mergeMap((url) => this.httpClient.put(encodeURI(`${url}/datasets/categories`), { ...category })));
6847
+ }
6762
6848
  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
6849
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetService, providedIn: 'root' }); }
6764
6850
  }
@@ -6853,6 +6939,7 @@ class AdminDatasetEffects {
6853
6939
  DataSourceActions.dataset.loadDataset()
6854
6940
  ];
6855
6941
  })));
6942
+ this.addCategory$ = createEffect(() => this.actions$.pipe(ofType(AdminDatasetActions.addCategory), mergeMap((action) => this.datasetService.addCategory(action.category).pipe(map(() => DataSourceActions.dataset.getCategories()), catchError$1((error) => [AdminDatasetActions.failure({ error })])))));
6856
6943
  }
6857
6944
  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
6945
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminDatasetEffects }); }
@@ -6940,7 +7027,8 @@ class PryAdminModule {
6940
7027
  AdminClassesCustomizeComponent,
6941
7028
  AdminClassesCustomizeTooltipComponent,
6942
7029
  AdminClassesCustomizeSymbolComponent,
6943
- PryAssociationComponent], imports: [CommonModule,
7030
+ PryAssociationComponent,
7031
+ AddCategoryModalComponent], imports: [CommonModule,
6944
7032
  PryCoreModule,
6945
7033
  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,
6946
7034
  FormsModule,
@@ -7079,7 +7167,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
7079
7167
  AdminClassesCustomizeComponent,
7080
7168
  AdminClassesCustomizeTooltipComponent,
7081
7169
  AdminClassesCustomizeSymbolComponent,
7082
- PryAssociationComponent
7170
+ PryAssociationComponent,
7171
+ AddCategoryModalComponent
7083
7172
  ],
7084
7173
  imports: [
7085
7174
  CommonModule,