@provoly/dashboard 1.3.34 → 1.3.35
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-user/admin-user-select/admin-user-select.component.d.ts +2 -1
- package/components/metadata-editor/metadata-editor.component.d.ts +10 -1
- package/components/metadata-editor/store/metadata.action.d.ts +2 -2
- package/components/metadata-editor/store/metadata.service.d.ts +1 -1
- package/esm2022/admin/components/admin-user/admin-user-select/admin-user-select.component.mjs +17 -4
- package/esm2022/components/metadata-editor/metadata-editor.component.mjs +38 -12
- package/esm2022/components/metadata-editor/store/metadata.action.mjs +1 -1
- package/esm2022/components/metadata-editor/store/metadata.service.mjs +1 -1
- package/fesm2022/provoly-dashboard-admin.mjs +16 -3
- package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-metadata-editor.mjs +38 -12
- package/fesm2022/provoly-dashboard-components-metadata-editor.mjs.map +1 -1
- package/package.json +31 -31
- package/styles/components/_o-tabs.scss +6 -0
|
@@ -3762,6 +3762,9 @@ class AdminUserSelectComponent {
|
|
|
3762
3762
|
this.store.dispatch(MetadataActions.loadUserProfile());
|
|
3763
3763
|
this.selectedUser$ = this.store.select(AdminUserSelectors.selectedUser);
|
|
3764
3764
|
this.userMetadata$ = this.store.select(MetadataSelectors.selectedUserProfile);
|
|
3765
|
+
this.userMetadata$.subscribe((metas) => {
|
|
3766
|
+
this.currentUsermetadatas = metas;
|
|
3767
|
+
});
|
|
3765
3768
|
this.metadata$ = this.store.select(MetadataSelectors.userProfile);
|
|
3766
3769
|
this.editable$ = this.store.select(AdminUserSelectors.editable);
|
|
3767
3770
|
this.compId = nextCompId++;
|
|
@@ -3782,17 +3785,27 @@ class AdminUserSelectComponent {
|
|
|
3782
3785
|
this.store.dispatch(AdminUserActions.unselectUser());
|
|
3783
3786
|
}
|
|
3784
3787
|
addMetadataUser(metadata) {
|
|
3788
|
+
const newMetadatas = this.getCurrentMetadatasValuesOfUserProfile(metadata.metadataId)
|
|
3789
|
+
// removing redundant values
|
|
3790
|
+
.filter((val) => val !== metadata.value)
|
|
3791
|
+
// removing previous value if editing
|
|
3792
|
+
.filter((val) => !metadata.previousValue || val !== metadata.previousValue);
|
|
3793
|
+
if (metadata.value) {
|
|
3794
|
+
newMetadatas.push(metadata.value);
|
|
3795
|
+
}
|
|
3785
3796
|
this.store.dispatch(MetadataActions.addMetadataUser({
|
|
3786
3797
|
userId: metadata.id,
|
|
3787
3798
|
metaId: metadata.metadataId,
|
|
3788
|
-
value:
|
|
3799
|
+
value: newMetadatas
|
|
3789
3800
|
}));
|
|
3790
3801
|
}
|
|
3791
3802
|
removeMetadata(metadata) {
|
|
3792
3803
|
this.store.dispatch(MetadataActions.deleteMetadataUser({ userId: this.userId, metadataId: metadata.metadataId }));
|
|
3793
3804
|
}
|
|
3794
|
-
|
|
3795
|
-
this.
|
|
3805
|
+
getCurrentMetadatasValuesOfUserProfile(userProfileId) {
|
|
3806
|
+
return (this.currentUsermetadatas
|
|
3807
|
+
?.filter((metadata) => metadata.userProfile.id === userProfileId)
|
|
3808
|
+
.map((metadata) => metadata.value) ?? []);
|
|
3796
3809
|
}
|
|
3797
3810
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AdminUserSelectComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3798
3811
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AdminUserSelectComponent, selector: "pry-admin-user-select", inputs: { profil: "profil" }, ngImport: i0, template: "<div\n *ngIf=\"selectedUser$ | async as user\"\n [id]=\"'panel-user-' + user.id\"\n [attr.aria-labelledby]=\"'button-user-' + user.id\"\n class=\"o-panel\"\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 [id]=\"'tab-title-' + compId\" class=\"a-h3\">\n {{ '@pry.admin.userInfo.info' | i18n }}\n </h3>\n </div>\n\n <pry-tab-group translationStringBase=\"@pry.admin.\">\n <pry-tab [templateRef]=\"userProfile\" name=\"userInfo.profile\"></pry-tab>\n <pry-tab [templateRef]=\"userDetails\" name=\"details\"></pry-tab>\n </pry-tab-group>\n\n <ng-template #userProfile>\n <pry-metadata-editor\n [targetId]=\"(selectedUser$ | async)?.id ?? ''\"\n [isModification]=\"(editable$ | async) ?? false\"\n [metadata]=\"(userMetadata$ | async) ?? []\"\n (removeMeta)=\"removeMetadata($event)\"\n (addMeta)=\"addMetadataUser($event)\"\n [type]=\"'user'\"\n ></pry-metadata-editor>\n </ng-template>\n\n <ng-template #userDetails>\n <h4 class=\"a-h4\">{{ '@pry.admin.properties' | i18n }}</h4>\n <p class=\"a-p\">\n {{ '@pry.admin.userInfo.name' | i18n }} :\n <strong>{{ user?.name }}</strong>\n </p>\n <p class=\"a-p\">\n {{ '@pry.admin.userInfo.familyName' | i18n }} :\n <strong>{{ user.familyName }}</strong>\n </p>\n <p class=\"a-p\">\n {{ '@pry.admin.userInfo.email' | i18n }} :\n <strong>{{ user.email }}</strong>\n </p>\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: "component", type: i6$1.PryMetadataEditorComponent, selector: "pry-metadata-editor", inputs: ["isModification", "targetId", "type", "metadata"], outputs: ["addMeta", "removeMeta"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }] }); }
|