@provoly/dashboard 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.d.ts +5 -3
- package/dataset/components/dataset-detail/dataset-detail.component.d.ts +5 -3
- package/esm2022/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.mjs +24 -12
- package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +18 -9
- package/esm2022/dataset/components/dataset.component.mjs +3 -2
- package/esm2022/lib/core/access/access.service.mjs +4 -1
- package/esm2022/toolbox/components/delete/delete.component.mjs +3 -3
- package/esm2022/toolbox/components/edit-mode-action/edit-mode-action.component.mjs +3 -3
- package/esm2022/toolbox/components/save-view/save-view.component.mjs +3 -3
- package/esm2022/toolbox/components/share/share.component.mjs +3 -3
- package/esm2022/toolbox/components/switch-to-edit-content/switch-to-edit-content.component.mjs +3 -3
- package/esm2022/toolbox/components/toolbox-action/toolbox-action.component.mjs +5 -5
- package/esm2022/toolbox/components/toolbox.component.mjs +15 -12
- package/esm2022/toolbox/toolbox.model.mjs +4 -4
- package/esm2022/widgets/widget-map/component/widget-map.component.mjs +5 -2
- package/esm2022/widgets/widget-vega/style/css.component.mjs +2 -2
- package/fesm2022/provoly-dashboard-admin.mjs +22 -10
- package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-dataset.mjs +19 -9
- package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-toolbox.mjs +31 -28
- package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-map.mjs +4 -1
- package/fesm2022/provoly-dashboard-widgets-widget-map.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs +2 -2
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +3 -0
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/lib/core/access/access.service.d.ts +3 -0
- package/package.json +37 -37
- package/toolbox/components/toolbox-action/toolbox-action.component.d.ts +1 -1
- package/toolbox/components/toolbox.component.d.ts +3 -2
- package/widgets/widget-vega/style/_o-widget-vega.scss +9 -0
|
@@ -14,7 +14,7 @@ import * as i5 from '@provoly/dashboard/components/checkbox';
|
|
|
14
14
|
import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
|
|
15
15
|
import * as i6$1 from '@provoly/dashboard/components/stepper';
|
|
16
16
|
import { PryStepperModule } from '@provoly/dashboard/components/stepper';
|
|
17
|
-
import { map, of, BehaviorSubject, combineLatest, take
|
|
17
|
+
import { map, switchMap, of, BehaviorSubject, combineLatest, take } from 'rxjs';
|
|
18
18
|
import * as i1 from '@ngrx/store';
|
|
19
19
|
import * as i3$2 from '@angular/cdk/bidi';
|
|
20
20
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
@@ -35,6 +35,9 @@ class ToolboxActionComponent extends SubscriptionnerDirective {
|
|
|
35
35
|
this.currentManifest$ = this.store
|
|
36
36
|
.select(DashboardSelectors.presentation)
|
|
37
37
|
.pipe(map((manifest) => manifest?.current));
|
|
38
|
+
this.canModify$ = this.currentManifest$.pipe(switchMap((manifest) => {
|
|
39
|
+
return manifest ? this.access?.canModifyPresentation(manifest) : of(false);
|
|
40
|
+
}));
|
|
38
41
|
this.subscriptions.add(this.currentManifest$.subscribe((manifest) => {
|
|
39
42
|
this.currentManifest = manifest;
|
|
40
43
|
}));
|
|
@@ -42,9 +45,6 @@ class ToolboxActionComponent extends SubscriptionnerDirective {
|
|
|
42
45
|
close() {
|
|
43
46
|
this.closeOptions.emit();
|
|
44
47
|
}
|
|
45
|
-
canModify$() {
|
|
46
|
-
return this.access && this.currentManifest ? this.access.canModifyPresentation(this.currentManifest) : of(false);
|
|
47
|
-
}
|
|
48
48
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ToolboxActionComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
49
49
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: ToolboxActionComponent, selector: "pry-toolbox-action", inputs: { displayLabels: "displayLabels" }, outputs: { closeOptions: "closeOptions" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
50
50
|
}
|
|
@@ -619,11 +619,11 @@ class SaveViewComponent extends ToolboxActionComponent {
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: SaveViewComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }, { token: i2.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
622
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: SaveViewComponent, selector: "pry-save-view", inputs: { mode: "mode" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "saveAs", first: true, predicate: ["saveAs"], descendants: true }, { propertyName: "directiveSave", first: true, predicate: ["directiveSave"], descendants: true }, { propertyName: "firstFocusdirective", first: true, predicate: ["firstFocusdirective"], descendants: true }, { propertyName: "cross", first: true, predicate: ["cross"], descendants: true }, { propertyName: "confirm", first: true, predicate: ["confirm"], descendants: true }, { propertyName: "cancel", first: true, predicate: ["cancel"], descendants: true }, { propertyName: "templateSaveAs", first: true, predicate: ["templateSaveAs"], descendants: true, read: TemplateRef }, { propertyName: "templateDirectSaveType", first: true, predicate: ["templateDirectSaveType"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<ng-container *pryAccess=\"{ module: 'dashboard', page: 'toolbox', action: 'save' }\">\n <ng-container *ngIf=\"mode === 'directSave'\">\n <div [attr.aria-expanded]=\"saveTypeOpened\" aria-controls=\"directiveSave\" aria-describedby=\"infoTooltip_directSave\">\n @if (canModify$() | async) {\n <button\n type=\"button\"\n #directiveSave\n class=\"a-btn a-btn--primary\"\n (click)=\"directSave()\"\n [disabled]=\"!(isCurrentPresentationModified$ | async)\"\n >\n <ng-container *ngIf=\"displayLabels\">{{ '@pry.toolbox.save' | i18n }} ({{ nbPages }})</ng-container>\n </button>\n }\n </div>\n </ng-container>\n <ng-container *ngIf=\"mode === 'saveAs'\">\n <div\n class=\"save-manifest-container\"\n [attr.aria-expanded]=\"saveAsOpened\"\n aria-controls=\"saveModal\"\n aria-describedby=\"infoTooltip_saveAs\"\n >\n <button type=\"button\" #saveAs class=\"a-btn a-btn--secondary\" (click)=\"toggleSaveAs()\" aria-haspopup=\"dialog\">\n <ng-container *ngIf=\"displayLabels\">{{ '@pry.toolbox.rename' | i18n }} ({{ nbPages }})</ng-container>\n </button>\n </div>\n </ng-container>\n</ng-container>\n<ng-template #templateSaveAs>\n <div\n class=\"o-modal\"\n (click)=\"$event.stopPropagation()\"\n id=\"saveModal\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"dialog_saveModal\"\n (keydown.escape)=\"closeModals()\"\n >\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">{{ '@pry.toolbox.rename' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" #cross (keydown.shift.tab)=\"focusValidation()\" (click)=\"toggleSaveAs()\">\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 <pry-stepper #stepper>\n <pry-step>\n <h4 class=\"m-stepper-item__title\" *stepTitle>{{ '@pry.presentation.add.info' | i18n }}</h4>\n <form>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" id=\"label-name\" for=\"input-name\">{{ '@pry.toolbox.manifest.name' | i18n }}</label>\n <input\n type=\"text\"\n id=\"input-name\"\n name=\"input-name\"\n class=\"a-form-field\"\n placeholder=\"{{ '@pry.toolbox.manifest.name' | i18n }}\"\n [ngModel]=\"currentManifest!.name\"\n (ngModelChange)=\"changeValue($event)\"\n aria-labelledby=\"label-name\"\n maxlength=\"50\"\n #input\n />\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" id=\"label-descr\" for=\"input-descr\">{{\n '@pry.toolbox.manifest.description' | i18n\n }}</label>\n <input\n type=\"text\"\n id=\"input-descr\"\n name=\"input-descr\"\n class=\"a-form-field\"\n placeholder=\"{{ '@pry.toolbox.manifest.description' | i18n }}\"\n [ngModel]=\"currentManifest!.description\"\n (ngModelChange)=\"changeDescr($event)\"\n aria-labelledby=\"label-name\"\n maxlength=\"200\"\n />\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"presentation_image\">{{ '@pry.presentation.form.image' | i18n }}</label>\n <div class=\"o-file-input\">\n <pry-select-image\n id=\"presentation_image\"\n (changed)=\"currentManifest!.image = $event\"\n [iconUrl]=\"currentManifest!.image\"\n [mode]=\"type\"\n ></pry-select-image>\n </div>\n </div>\n\n <div class=\"m-btn-group\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n #cancel\n (click)=\"toggleSaveAs()\"\n (keydown.tab)=\"disableNextStep()\"\n >\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n (click)=\"stepper.next()\"\n [disabled]=\"!isValid()\"\n (keydown.tab)=\"focusCrossElement()\"\n >\n {{ '@pry.action.next' | i18n }}\n </button>\n </div>\n </form>\n </pry-step>\n <pry-step>\n <h4 class=\"m-stepper-item__title\" *stepTitle>{{ '@pry.restitution.share' | i18n }}</h4>\n <pry-access-rights-share\n [(ngModel)]=\"accessRightsByGroup\"\n (ngModelChange)=\"changeAccessRights($event)\"\n [manifestDescription]=\"currentManifest\"\n ></pry-access-rights-share>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"stepper.prev()\">\n {{ '@pry.action.back' | i18n }}\n </button>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n #confirm\n (click)=\"save()\"\n (keydown.tab)=\"focusCrossElement()\"\n >\n {{ '@pry.restitution.share' | i18n }}\n </button>\n </div>\n </pry-step>\n </pry-stepper>\n </div>\n</ng-template>\n\n<ng-template #templateDirectSaveType>\n <div\n class=\"o-modal\"\n (click)=\"$event.stopPropagation()\"\n id=\"directiveSave\"\n role=\"dialog\"\n aria-labelledby=\"dialog_title\"\n (keydown.escape)=\"closeModals()\"\n >\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title_\">{{ '@pry.toolbox.save' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" #firstFocusdirective (click)=\"toggleDirectSaveType()\">\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 <div>\n <h3>{{ '@pry.snack.pagesChanged' | i18n }}</h3>\n </div>\n <div class=\"m-btn-group\">\n <button class=\"a-btn a-btn--primary\" (click)=\"save()\">\n {{ '@pry.toolbox.save' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" (click)=\"rename()\">\n {{ '@pry.toolbox.rename' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" (click)=\"restore()\" (keydown.tab)=\"closeModals()\">\n {{ '@pry.toolbox.restore' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.PryAccessDirective, selector: "[pryAccess]", inputs: ["pryAccess"] }, { kind: "component", type: i3.PrySelectImageComponent, selector: "pry-select-image", inputs: ["iconUrl", "size", "mode"], outputs: ["toggled", "changed"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i6$1.PryStepperComponent, selector: "pry-stepper", inputs: ["isConsultMode"], outputs: ["lastStepCompleted", "activeIndexChange"] }, { kind: "component", type: i6$1.PryStepComponent, selector: "pry-step", inputs: ["setActiveState"] }, { kind: "directive", type: i6$1.PryStepTitleDirective, selector: "[stepTitle]" }, { kind: "component", type: i3.PryAccessRightsShareComponent, selector: "pry-access-rights-share", inputs: ["manifestDescription", "allowedGroups"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
622
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: SaveViewComponent, selector: "pry-save-view", inputs: { mode: "mode" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "saveAs", first: true, predicate: ["saveAs"], descendants: true }, { propertyName: "directiveSave", first: true, predicate: ["directiveSave"], descendants: true }, { propertyName: "firstFocusdirective", first: true, predicate: ["firstFocusdirective"], descendants: true }, { propertyName: "cross", first: true, predicate: ["cross"], descendants: true }, { propertyName: "confirm", first: true, predicate: ["confirm"], descendants: true }, { propertyName: "cancel", first: true, predicate: ["cancel"], descendants: true }, { propertyName: "templateSaveAs", first: true, predicate: ["templateSaveAs"], descendants: true, read: TemplateRef }, { propertyName: "templateDirectSaveType", first: true, predicate: ["templateDirectSaveType"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<ng-container *pryAccess=\"{ module: 'dashboard', page: 'toolbox', action: 'save' }\">\n <ng-container *ngIf=\"mode === 'directSave'\">\n <div [attr.aria-expanded]=\"saveTypeOpened\" aria-controls=\"directiveSave\" aria-describedby=\"infoTooltip_directSave\">\n @if (canModify$ | async) {\n <button\n type=\"button\"\n #directiveSave\n class=\"a-btn a-btn--primary\"\n (click)=\"directSave()\"\n [disabled]=\"!(isCurrentPresentationModified$ | async)\"\n >\n <ng-container *ngIf=\"displayLabels\">{{ '@pry.toolbox.save' | i18n }} ({{ nbPages }})</ng-container>\n </button>\n }\n </div>\n </ng-container>\n <ng-container *ngIf=\"mode === 'saveAs'\">\n <div\n class=\"save-manifest-container\"\n [attr.aria-expanded]=\"saveAsOpened\"\n aria-controls=\"saveModal\"\n aria-describedby=\"infoTooltip_saveAs\"\n >\n <button type=\"button\" #saveAs class=\"a-btn a-btn--secondary\" (click)=\"toggleSaveAs()\" aria-haspopup=\"dialog\">\n <ng-container *ngIf=\"displayLabels\">{{ '@pry.toolbox.rename' | i18n }} ({{ nbPages }})</ng-container>\n </button>\n </div>\n </ng-container>\n</ng-container>\n<ng-template #templateSaveAs>\n <div\n class=\"o-modal\"\n (click)=\"$event.stopPropagation()\"\n id=\"saveModal\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"dialog_saveModal\"\n (keydown.escape)=\"closeModals()\"\n >\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">{{ '@pry.toolbox.rename' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" #cross (keydown.shift.tab)=\"focusValidation()\" (click)=\"toggleSaveAs()\">\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 <pry-stepper #stepper>\n <pry-step>\n <h4 class=\"m-stepper-item__title\" *stepTitle>{{ '@pry.presentation.add.info' | i18n }}</h4>\n <form>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" id=\"label-name\" for=\"input-name\">{{ '@pry.toolbox.manifest.name' | i18n }}</label>\n <input\n type=\"text\"\n id=\"input-name\"\n name=\"input-name\"\n class=\"a-form-field\"\n placeholder=\"{{ '@pry.toolbox.manifest.name' | i18n }}\"\n [ngModel]=\"currentManifest!.name\"\n (ngModelChange)=\"changeValue($event)\"\n aria-labelledby=\"label-name\"\n maxlength=\"50\"\n #input\n />\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" id=\"label-descr\" for=\"input-descr\">{{\n '@pry.toolbox.manifest.description' | i18n\n }}</label>\n <input\n type=\"text\"\n id=\"input-descr\"\n name=\"input-descr\"\n class=\"a-form-field\"\n placeholder=\"{{ '@pry.toolbox.manifest.description' | i18n }}\"\n [ngModel]=\"currentManifest!.description\"\n (ngModelChange)=\"changeDescr($event)\"\n aria-labelledby=\"label-name\"\n maxlength=\"200\"\n />\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"presentation_image\">{{ '@pry.presentation.form.image' | i18n }}</label>\n <div class=\"o-file-input\">\n <pry-select-image\n id=\"presentation_image\"\n (changed)=\"currentManifest!.image = $event\"\n [iconUrl]=\"currentManifest!.image\"\n [mode]=\"type\"\n ></pry-select-image>\n </div>\n </div>\n\n <div class=\"m-btn-group\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n #cancel\n (click)=\"toggleSaveAs()\"\n (keydown.tab)=\"disableNextStep()\"\n >\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n (click)=\"stepper.next()\"\n [disabled]=\"!isValid()\"\n (keydown.tab)=\"focusCrossElement()\"\n >\n {{ '@pry.action.next' | i18n }}\n </button>\n </div>\n </form>\n </pry-step>\n <pry-step>\n <h4 class=\"m-stepper-item__title\" *stepTitle>{{ '@pry.restitution.share' | i18n }}</h4>\n <pry-access-rights-share\n [(ngModel)]=\"accessRightsByGroup\"\n (ngModelChange)=\"changeAccessRights($event)\"\n [manifestDescription]=\"currentManifest\"\n ></pry-access-rights-share>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"stepper.prev()\">\n {{ '@pry.action.back' | i18n }}\n </button>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n #confirm\n (click)=\"save()\"\n (keydown.tab)=\"focusCrossElement()\"\n >\n {{ '@pry.restitution.share' | i18n }}\n </button>\n </div>\n </pry-step>\n </pry-stepper>\n </div>\n</ng-template>\n\n<ng-template #templateDirectSaveType>\n <div\n class=\"o-modal\"\n (click)=\"$event.stopPropagation()\"\n id=\"directiveSave\"\n role=\"dialog\"\n aria-labelledby=\"dialog_title\"\n (keydown.escape)=\"closeModals()\"\n >\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title_\">{{ '@pry.toolbox.save' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" #firstFocusdirective (click)=\"toggleDirectSaveType()\">\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 <div>\n <h3>{{ '@pry.snack.pagesChanged' | i18n }}</h3>\n </div>\n <div class=\"m-btn-group\">\n <button class=\"a-btn a-btn--primary\" (click)=\"save()\">\n {{ '@pry.toolbox.save' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" (click)=\"rename()\">\n {{ '@pry.toolbox.rename' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" (click)=\"restore()\" (keydown.tab)=\"closeModals()\">\n {{ '@pry.toolbox.restore' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.PryAccessDirective, selector: "[pryAccess]", inputs: ["pryAccess"] }, { kind: "component", type: i3.PrySelectImageComponent, selector: "pry-select-image", inputs: ["iconUrl", "size", "mode"], outputs: ["toggled", "changed"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i6$1.PryStepperComponent, selector: "pry-stepper", inputs: ["isConsultMode"], outputs: ["lastStepCompleted", "activeIndexChange"] }, { kind: "component", type: i6$1.PryStepComponent, selector: "pry-step", inputs: ["setActiveState"] }, { kind: "directive", type: i6$1.PryStepTitleDirective, selector: "[stepTitle]" }, { kind: "component", type: i3.PryAccessRightsShareComponent, selector: "pry-access-rights-share", inputs: ["manifestDescription", "allowedGroups"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
623
623
|
}
|
|
624
624
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: SaveViewComponent, decorators: [{
|
|
625
625
|
type: Component,
|
|
626
|
-
args: [{ selector: 'pry-save-view', template: "<ng-container *pryAccess=\"{ module: 'dashboard', page: 'toolbox', action: 'save' }\">\n <ng-container *ngIf=\"mode === 'directSave'\">\n <div [attr.aria-expanded]=\"saveTypeOpened\" aria-controls=\"directiveSave\" aria-describedby=\"infoTooltip_directSave\">\n @if (canModify$
|
|
626
|
+
args: [{ selector: 'pry-save-view', template: "<ng-container *pryAccess=\"{ module: 'dashboard', page: 'toolbox', action: 'save' }\">\n <ng-container *ngIf=\"mode === 'directSave'\">\n <div [attr.aria-expanded]=\"saveTypeOpened\" aria-controls=\"directiveSave\" aria-describedby=\"infoTooltip_directSave\">\n @if (canModify$ | async) {\n <button\n type=\"button\"\n #directiveSave\n class=\"a-btn a-btn--primary\"\n (click)=\"directSave()\"\n [disabled]=\"!(isCurrentPresentationModified$ | async)\"\n >\n <ng-container *ngIf=\"displayLabels\">{{ '@pry.toolbox.save' | i18n }} ({{ nbPages }})</ng-container>\n </button>\n }\n </div>\n </ng-container>\n <ng-container *ngIf=\"mode === 'saveAs'\">\n <div\n class=\"save-manifest-container\"\n [attr.aria-expanded]=\"saveAsOpened\"\n aria-controls=\"saveModal\"\n aria-describedby=\"infoTooltip_saveAs\"\n >\n <button type=\"button\" #saveAs class=\"a-btn a-btn--secondary\" (click)=\"toggleSaveAs()\" aria-haspopup=\"dialog\">\n <ng-container *ngIf=\"displayLabels\">{{ '@pry.toolbox.rename' | i18n }} ({{ nbPages }})</ng-container>\n </button>\n </div>\n </ng-container>\n</ng-container>\n<ng-template #templateSaveAs>\n <div\n class=\"o-modal\"\n (click)=\"$event.stopPropagation()\"\n id=\"saveModal\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"dialog_saveModal\"\n (keydown.escape)=\"closeModals()\"\n >\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">{{ '@pry.toolbox.rename' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" #cross (keydown.shift.tab)=\"focusValidation()\" (click)=\"toggleSaveAs()\">\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 <pry-stepper #stepper>\n <pry-step>\n <h4 class=\"m-stepper-item__title\" *stepTitle>{{ '@pry.presentation.add.info' | i18n }}</h4>\n <form>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" id=\"label-name\" for=\"input-name\">{{ '@pry.toolbox.manifest.name' | i18n }}</label>\n <input\n type=\"text\"\n id=\"input-name\"\n name=\"input-name\"\n class=\"a-form-field\"\n placeholder=\"{{ '@pry.toolbox.manifest.name' | i18n }}\"\n [ngModel]=\"currentManifest!.name\"\n (ngModelChange)=\"changeValue($event)\"\n aria-labelledby=\"label-name\"\n maxlength=\"50\"\n #input\n />\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" id=\"label-descr\" for=\"input-descr\">{{\n '@pry.toolbox.manifest.description' | i18n\n }}</label>\n <input\n type=\"text\"\n id=\"input-descr\"\n name=\"input-descr\"\n class=\"a-form-field\"\n placeholder=\"{{ '@pry.toolbox.manifest.description' | i18n }}\"\n [ngModel]=\"currentManifest!.description\"\n (ngModelChange)=\"changeDescr($event)\"\n aria-labelledby=\"label-name\"\n maxlength=\"200\"\n />\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"presentation_image\">{{ '@pry.presentation.form.image' | i18n }}</label>\n <div class=\"o-file-input\">\n <pry-select-image\n id=\"presentation_image\"\n (changed)=\"currentManifest!.image = $event\"\n [iconUrl]=\"currentManifest!.image\"\n [mode]=\"type\"\n ></pry-select-image>\n </div>\n </div>\n\n <div class=\"m-btn-group\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--secondary\"\n #cancel\n (click)=\"toggleSaveAs()\"\n (keydown.tab)=\"disableNextStep()\"\n >\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n (click)=\"stepper.next()\"\n [disabled]=\"!isValid()\"\n (keydown.tab)=\"focusCrossElement()\"\n >\n {{ '@pry.action.next' | i18n }}\n </button>\n </div>\n </form>\n </pry-step>\n <pry-step>\n <h4 class=\"m-stepper-item__title\" *stepTitle>{{ '@pry.restitution.share' | i18n }}</h4>\n <pry-access-rights-share\n [(ngModel)]=\"accessRightsByGroup\"\n (ngModelChange)=\"changeAccessRights($event)\"\n [manifestDescription]=\"currentManifest\"\n ></pry-access-rights-share>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"stepper.prev()\">\n {{ '@pry.action.back' | i18n }}\n </button>\n <button\n type=\"submit\"\n class=\"a-btn a-btn--primary\"\n #confirm\n (click)=\"save()\"\n (keydown.tab)=\"focusCrossElement()\"\n >\n {{ '@pry.restitution.share' | i18n }}\n </button>\n </div>\n </pry-step>\n </pry-stepper>\n </div>\n</ng-template>\n\n<ng-template #templateDirectSaveType>\n <div\n class=\"o-modal\"\n (click)=\"$event.stopPropagation()\"\n id=\"directiveSave\"\n role=\"dialog\"\n aria-labelledby=\"dialog_title\"\n (keydown.escape)=\"closeModals()\"\n >\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title_\">{{ '@pry.toolbox.save' | i18n }}</h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" #firstFocusdirective (click)=\"toggleDirectSaveType()\">\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 <div>\n <h3>{{ '@pry.snack.pagesChanged' | i18n }}</h3>\n </div>\n <div class=\"m-btn-group\">\n <button class=\"a-btn a-btn--primary\" (click)=\"save()\">\n {{ '@pry.toolbox.save' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" (click)=\"rename()\">\n {{ '@pry.toolbox.rename' | i18n }}\n </button>\n <button class=\"a-btn a-btn--primary\" (click)=\"restore()\" (keydown.tab)=\"closeModals()\">\n {{ '@pry.toolbox.restore' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
627
627
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i3.PryBaseAccess, decorators: [{
|
|
628
628
|
type: Optional
|
|
629
629
|
}, {
|
|
@@ -893,11 +893,11 @@ class SwitchToEditContentComponent extends ToolboxActionComponent {
|
|
|
893
893
|
this.close();
|
|
894
894
|
}
|
|
895
895
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: SwitchToEditContentComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
896
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: SwitchToEditContentComponent, selector: "pry-switch-to-edit", usesInheritance: true, ngImport: i0, template: "@if (canModify$
|
|
896
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: SwitchToEditContentComponent, selector: "pry-switch-to-edit", usesInheritance: true, ngImport: i0, template: "@if (canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"trigger()\">\n @if (displayLabels) {\n {{ '@pry.toolbox.switchEditContent' | i18n }}\n }\n </button>\n}\n", dependencies: [{ kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
897
897
|
}
|
|
898
898
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: SwitchToEditContentComponent, decorators: [{
|
|
899
899
|
type: Component,
|
|
900
|
-
args: [{ selector: 'pry-switch-to-edit', template: "@if (canModify$
|
|
900
|
+
args: [{ selector: 'pry-switch-to-edit', template: "@if (canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"trigger()\">\n @if (displayLabels) {\n {{ '@pry.toolbox.switchEditContent' | i18n }}\n }\n </button>\n}\n" }]
|
|
901
901
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i3.PryBaseAccess, decorators: [{
|
|
902
902
|
type: Optional
|
|
903
903
|
}, {
|
|
@@ -919,11 +919,11 @@ class ShareComponent extends ToolboxActionComponent {
|
|
|
919
919
|
});
|
|
920
920
|
}
|
|
921
921
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ShareComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }, { token: i3.PryDialogService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
922
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ShareComponent, selector: "pry-share-pres", usesInheritance: true, ngImport: i0, template: "@if (canModify$
|
|
922
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ShareComponent, selector: "pry-share-pres", usesInheritance: true, ngImport: i0, template: "@if (canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"trigger()\">\n @if (displayLabels) {\n {{ '@pry.toolbox.share' | i18n }}\n }\n </button>\n}\n", dependencies: [{ kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
923
923
|
}
|
|
924
924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ShareComponent, decorators: [{
|
|
925
925
|
type: Component,
|
|
926
|
-
args: [{ selector: 'pry-share-pres', template: "@if (canModify$
|
|
926
|
+
args: [{ selector: 'pry-share-pres', template: "@if (canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"trigger()\">\n @if (displayLabels) {\n {{ '@pry.toolbox.share' | i18n }}\n }\n </button>\n}\n" }]
|
|
927
927
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i3.PryBaseAccess, decorators: [{
|
|
928
928
|
type: Optional
|
|
929
929
|
}, {
|
|
@@ -940,11 +940,11 @@ class DeleteComponent extends ToolboxActionComponent {
|
|
|
940
940
|
this.close();
|
|
941
941
|
}
|
|
942
942
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DeleteComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
943
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: DeleteComponent, selector: "pry-delete-pres", usesInheritance: true, ngImport: i0, template: "@if (canModify$
|
|
943
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: DeleteComponent, selector: "pry-delete-pres", usesInheritance: true, ngImport: i0, template: "@if (canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"trigger()\">\n @if (displayLabels) {\n {{ '@pry.toolbox.delete' | i18n }}\n }\n </button>\n}\n", dependencies: [{ kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
944
944
|
}
|
|
945
945
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DeleteComponent, decorators: [{
|
|
946
946
|
type: Component,
|
|
947
|
-
args: [{ selector: 'pry-delete-pres', template: "@if (canModify$
|
|
947
|
+
args: [{ selector: 'pry-delete-pres', template: "@if (canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"trigger()\">\n @if (displayLabels) {\n {{ '@pry.toolbox.delete' | i18n }}\n }\n </button>\n}\n" }]
|
|
948
948
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i3.PryBaseAccess, decorators: [{
|
|
949
949
|
type: Optional
|
|
950
950
|
}, {
|
|
@@ -1004,11 +1004,11 @@ class EditModeActionComponent extends ToolboxActionComponent {
|
|
|
1004
1004
|
this.store.dispatch(DashboardActions.toggleEditionMode({}));
|
|
1005
1005
|
}
|
|
1006
1006
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EditModeActionComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1007
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EditModeActionComponent, selector: "pry-edit-mode-action", usesInheritance: true, ngImport: i0, template: "@if (this.canModify$
|
|
1007
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: EditModeActionComponent, selector: "pry-edit-mode-action", usesInheritance: true, ngImport: i0, template: "@if (this.canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"toggleEditionMode()\">\n @if (displayLabels) {\n {{ ((modeEdition$ | async) ? '@pry.toolbox.editOff' : '@pry.toolbox.edit') | i18n }}\n }\n </button>\n}\n", dependencies: [{ kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
1008
1008
|
}
|
|
1009
1009
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: EditModeActionComponent, decorators: [{
|
|
1010
1010
|
type: Component,
|
|
1011
|
-
args: [{ selector: 'pry-edit-mode-action', template: "@if (this.canModify$
|
|
1011
|
+
args: [{ selector: 'pry-edit-mode-action', template: "@if (this.canModify$ | async) {\n <button type=\"button\" class=\"a-btn a-btn--secondary\" (click)=\"toggleEditionMode()\">\n @if (displayLabels) {\n {{ ((modeEdition$ | async) ? '@pry.toolbox.editOff' : '@pry.toolbox.edit') | i18n }}\n }\n </button>\n}\n" }]
|
|
1012
1012
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i3.PryBaseAccess, decorators: [{
|
|
1013
1013
|
type: Optional
|
|
1014
1014
|
}, {
|
|
@@ -1085,21 +1085,21 @@ const ACTIONS = [
|
|
|
1085
1085
|
component: SwitchToEditContentComponent,
|
|
1086
1086
|
visible: true,
|
|
1087
1087
|
access: { module: 'dashboard', page: 'toolbox', action: 'edit_presentation_content' },
|
|
1088
|
-
needsOwner:
|
|
1088
|
+
needsOwner: true
|
|
1089
1089
|
},
|
|
1090
1090
|
{
|
|
1091
1091
|
name: 'share',
|
|
1092
1092
|
component: ShareComponent,
|
|
1093
1093
|
visible: true,
|
|
1094
1094
|
access: { module: 'dashboard', page: 'toolbox', action: 'share' },
|
|
1095
|
-
needsOwner:
|
|
1095
|
+
needsOwner: true
|
|
1096
1096
|
},
|
|
1097
1097
|
{
|
|
1098
1098
|
name: 'delete',
|
|
1099
1099
|
component: DeleteComponent,
|
|
1100
1100
|
visible: true,
|
|
1101
1101
|
access: { module: 'dashboard', page: 'toolbox', action: 'delete' },
|
|
1102
|
-
needsOwner:
|
|
1102
|
+
needsOwner: true
|
|
1103
1103
|
},
|
|
1104
1104
|
{
|
|
1105
1105
|
name: 'dashboard_details',
|
|
@@ -1171,8 +1171,8 @@ class ToolboxComponent {
|
|
|
1171
1171
|
set dropdownActions(dropdownActions) {
|
|
1172
1172
|
this._dropdownActions$.next(dropdownActions);
|
|
1173
1173
|
}
|
|
1174
|
-
constructor(store,
|
|
1175
|
-
this.
|
|
1174
|
+
constructor(store, access) {
|
|
1175
|
+
this.access = access;
|
|
1176
1176
|
this.actions$ = new BehaviorSubject(ACTIONS);
|
|
1177
1177
|
this._dropdownActions$ = new BehaviorSubject([]);
|
|
1178
1178
|
this.displayLabels = true;
|
|
@@ -1194,24 +1194,27 @@ class ToolboxComponent {
|
|
|
1194
1194
|
: gridLayout) === DashboardGridLayout.MANUAL));
|
|
1195
1195
|
this.actionsAvailable$ = store.select(DashboardSelectors.displayOptions);
|
|
1196
1196
|
this.showEditToggle$ = this.actionsAvailable$.pipe(map((actions) => !!actions?.edit_toggle));
|
|
1197
|
+
this.canModify$ = this.presentation$.pipe(switchMap((presentation) => {
|
|
1198
|
+
return presentation?.current ? this.access?.canModifyPresentation(presentation.current) : of(false);
|
|
1199
|
+
}));
|
|
1197
1200
|
}
|
|
1198
1201
|
ngOnInit() {
|
|
1199
1202
|
this.allActions$ = combineLatest([
|
|
1200
1203
|
this.actions$,
|
|
1201
1204
|
this.actionsAvailable$,
|
|
1202
|
-
this.
|
|
1203
|
-
]).pipe(switchMap(([actions, displayOptions,
|
|
1205
|
+
this.canModify$
|
|
1206
|
+
]).pipe(switchMap(([actions, displayOptions, _canModify]) => combineLatest(actions.map((action) => {
|
|
1204
1207
|
// @ts-ignore
|
|
1205
1208
|
const actionAvailable = action.visible && displayOptions.toolbox[action.name];
|
|
1206
|
-
const
|
|
1207
|
-
return this.
|
|
1208
|
-
? this.
|
|
1209
|
+
const canModify = !action.needsOwner || _canModify;
|
|
1210
|
+
return this.access
|
|
1211
|
+
? this.access.hasRole(null, action.access.module, action.access.page, action.access.action).pipe(map((hasRole) => ({
|
|
1209
1212
|
...action,
|
|
1210
|
-
visible: actionAvailable && (!this.
|
|
1213
|
+
visible: actionAvailable && (!this.access || hasRole) && canModify
|
|
1211
1214
|
})))
|
|
1212
1215
|
: of({
|
|
1213
1216
|
...action,
|
|
1214
|
-
visible: actionAvailable &&
|
|
1217
|
+
visible: actionAvailable && canModify
|
|
1215
1218
|
});
|
|
1216
1219
|
}))));
|
|
1217
1220
|
this.mainActions$ = combineLatest([this._dropdownActions$, this.allActions$]).pipe(map(([dropdownActions, actions]) => actions.filter((action) => !dropdownActions.find((dropdownAction) => action.name === dropdownAction.name))));
|
|
@@ -1231,11 +1234,11 @@ class ToolboxComponent {
|
|
|
1231
1234
|
return this._dropdownActions$.getValue().find((action) => actionName === action.name)?.order;
|
|
1232
1235
|
}
|
|
1233
1236
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ToolboxComponent, deps: [{ token: i1.Store }, { token: PRY_ACCESS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1234
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ToolboxComponent, selector: "pry-toolbox", inputs: { displayLabels: "displayLabels", dropdownPosition: "dropdownPosition", actions: "actions", dropdownActions: "dropdownActions" }, ngImport: i0, template: "<ul class=\"m-actions-list\" #input>\n @for (action of mainActions$ | async; track action.name) {\n @if (action.visible) {\n <li class=\"m-actions-list__item -{{action.name}}\" *pryAccess=\"action.access\">\n <pry-toolbox-action-instanciator\n [action]=\"action\"\n [displayLabels]=\"displayLabels\"\n ></pry-toolbox-action-instanciator>\n </li>\n }\n }\n @if (showDropdownButton$ | async) {\n <li class=\"m-actions-list__item\">\n
|
|
1237
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: ToolboxComponent, selector: "pry-toolbox", inputs: { displayLabels: "displayLabels", dropdownPosition: "dropdownPosition", actions: "actions", dropdownActions: "dropdownActions" }, ngImport: i0, template: "<ul class=\"m-actions-list\" #input>\n @for (action of mainActions$ | async; track action.name) {\n @if (action.visible) {\n <li class=\"m-actions-list__item -{{ action.name }}\" *pryAccess=\"action.access\">\n <pry-toolbox-action-instanciator\n [action]=\"action\"\n [displayLabels]=\"displayLabels\"\n ></pry-toolbox-action-instanciator>\n </li>\n }\n }\n @if (showDropdownButton$ | async) {\n @if (((dropdownActions$ | async)?.length ?? 0) > 0) {\n <li class=\"m-actions-list__item\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--primary\"\n cdkOverlayOrigin\n id=\"options\"\n aria-controls=\"IDpanel\"\n aria-expanded=\"false\"\n (click)=\"openDropdown($event)\"\n #trigger=\"cdkOverlayOrigin\"\n >\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.options' | i18n }}</span>\n <pry-icon [width]=\"10\" [height]=\"13\" iconSvg=\"chevron_bottom\"></pry-icon>\n @if (displayLabels) {\n <span>{{ '@pry.toolbox.options' | i18n }}</span>\n }\n </button>\n </li>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDropdownOpen\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPositions]=\"dropdownPosition\"\n [cdkConnectedOverlayOffsetY]=\"5\"\n (backdropClick)=\"isDropdownOpen = false\"\n >\n <div class=\"o-draggable-menu -dropdown\" aria-labelledby=\"\">\n <ul class=\"o-draggable-menu__list\">\n @for (action of dropdownActions$ | async; track action.name) {\n @if (action.visible) {\n <li class=\"o-draggable-menu__list__item\" [style.order]=\"getOrder(action.name)\">\n <pry-toolbox-action-instanciator\n [action]=\"action\"\n [displayLabels]=\"displayLabels\"\n (closeOptions)=\"closeDropdown($event)\"\n ></pry-toolbox-action-instanciator>\n </li>\n }\n }\n </ul>\n </div>\n </ng-template>\n }\n }\n\n @if (showEditToggle$ | async) {\n @if (isManualMode$ | async) {\n <li class=\"m-actions-list__item\">\n <pry-edit-mode-toggle\n *pryAccess=\"{ module: 'dashboard', page: 'toolbox', action: 'edit_dashboard' }\"\n [displayLabels]=\"displayLabels\"\n ></pry-edit-mode-toggle>\n </li>\n }\n }\n</ul>\n", dependencies: [{ kind: "directive", type: i2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: i3.PryAccessDirective, selector: "[pryAccess]", inputs: ["pryAccess"] }, { kind: "component", type: i3.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: ToolboxActionInstanciatorComponent, selector: "pry-toolbox-action-instanciator", inputs: ["displayLabels", "action"], outputs: ["closeOptions"] }, { kind: "component", type: EditModeToggleComponent, selector: "pry-edit-mode-toggle" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.I18nPipe, name: "i18n" }] }); }
|
|
1235
1238
|
}
|
|
1236
1239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ToolboxComponent, decorators: [{
|
|
1237
1240
|
type: Component,
|
|
1238
|
-
args: [{ selector: 'pry-toolbox', template: "<ul class=\"m-actions-list\" #input>\n @for (action of mainActions$ | async; track action.name) {\n @if (action.visible) {\n <li class=\"m-actions-list__item -{{action.name}}\" *pryAccess=\"action.access\">\n <pry-toolbox-action-instanciator\n [action]=\"action\"\n [displayLabels]=\"displayLabels\"\n ></pry-toolbox-action-instanciator>\n </li>\n }\n }\n @if (showDropdownButton$ | async) {\n <li class=\"m-actions-list__item\">\n
|
|
1241
|
+
args: [{ selector: 'pry-toolbox', template: "<ul class=\"m-actions-list\" #input>\n @for (action of mainActions$ | async; track action.name) {\n @if (action.visible) {\n <li class=\"m-actions-list__item -{{ action.name }}\" *pryAccess=\"action.access\">\n <pry-toolbox-action-instanciator\n [action]=\"action\"\n [displayLabels]=\"displayLabels\"\n ></pry-toolbox-action-instanciator>\n </li>\n }\n }\n @if (showDropdownButton$ | async) {\n @if (((dropdownActions$ | async)?.length ?? 0) > 0) {\n <li class=\"m-actions-list__item\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--primary\"\n cdkOverlayOrigin\n id=\"options\"\n aria-controls=\"IDpanel\"\n aria-expanded=\"false\"\n (click)=\"openDropdown($event)\"\n #trigger=\"cdkOverlayOrigin\"\n >\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.options' | i18n }}</span>\n <pry-icon [width]=\"10\" [height]=\"13\" iconSvg=\"chevron_bottom\"></pry-icon>\n @if (displayLabels) {\n <span>{{ '@pry.toolbox.options' | i18n }}</span>\n }\n </button>\n </li>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDropdownOpen\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPositions]=\"dropdownPosition\"\n [cdkConnectedOverlayOffsetY]=\"5\"\n (backdropClick)=\"isDropdownOpen = false\"\n >\n <div class=\"o-draggable-menu -dropdown\" aria-labelledby=\"\">\n <ul class=\"o-draggable-menu__list\">\n @for (action of dropdownActions$ | async; track action.name) {\n @if (action.visible) {\n <li class=\"o-draggable-menu__list__item\" [style.order]=\"getOrder(action.name)\">\n <pry-toolbox-action-instanciator\n [action]=\"action\"\n [displayLabels]=\"displayLabels\"\n (closeOptions)=\"closeDropdown($event)\"\n ></pry-toolbox-action-instanciator>\n </li>\n }\n }\n </ul>\n </div>\n </ng-template>\n }\n }\n\n @if (showEditToggle$ | async) {\n @if (isManualMode$ | async) {\n <li class=\"m-actions-list__item\">\n <pry-edit-mode-toggle\n *pryAccess=\"{ module: 'dashboard', page: 'toolbox', action: 'edit_dashboard' }\"\n [displayLabels]=\"displayLabels\"\n ></pry-edit-mode-toggle>\n </li>\n }\n }\n</ul>\n" }]
|
|
1239
1242
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i3.PryBaseAccess, decorators: [{
|
|
1240
1243
|
type: Optional
|
|
1241
1244
|
}, {
|