From 67913b878372640b9dc02f2b27a3b46b6ef9f5a2 Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Wed, 26 Jun 2024 13:15:53 +0300 Subject: [PATCH] added description role filter --- .../src/app/core/common/enum/dmp-user-role.ts | 2 +- .../src/app/core/query/description.lookup.ts | 4 +-- .../src/app/core/query/dmp-user.lookup.ts | 26 ++++++++++++++++ dmp-frontend/src/app/core/query/dmp.lookup.ts | 12 ++++---- .../description-listing.component.html | 2 +- .../listing/description-listing.component.ts | 30 +++++++++++++++---- .../description-filter.component.html | 10 +++---- .../filtering/description-filter.component.ts | 2 ++ 8 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 dmp-frontend/src/app/core/query/dmp-user.lookup.ts diff --git a/dmp-frontend/src/app/core/common/enum/dmp-user-role.ts b/dmp-frontend/src/app/core/common/enum/dmp-user-role.ts index 7d8c28d58..b9d0d6eef 100644 --- a/dmp-frontend/src/app/core/common/enum/dmp-user-role.ts +++ b/dmp-frontend/src/app/core/common/enum/dmp-user-role.ts @@ -2,5 +2,5 @@ export enum DmpUserRole { Owner = 0, Viewer = 1, DescriptionContributor = 2, - Reviewer= 3 + Reviewer = 3 } \ No newline at end of file diff --git a/dmp-frontend/src/app/core/query/description.lookup.ts b/dmp-frontend/src/app/core/query/description.lookup.ts index 9220144de..c494bdbc4 100644 --- a/dmp-frontend/src/app/core/query/description.lookup.ts +++ b/dmp-frontend/src/app/core/query/description.lookup.ts @@ -25,8 +25,7 @@ export class DescriptionLookup extends Lookup implements DescriptionFilter { descriptionTagSubQuery: DescriptionTagLookup; descriptionReferenceSubQuery: DescriptionReferenceLookup; - roleInDmp: DmpUserRole[]; //TODO - showAllVersions: boolean; //TODO + showAllVersions: boolean; //TODO ?? constructor() { super(); @@ -44,7 +43,6 @@ export interface DescriptionFilter { isActive: IsActive[]; statuses: DescriptionStatus[]; showAllVersions: boolean; - roleInDmp: DmpUserRole[]; dmpSubQuery: DmpLookup; descriptionTemplateSubQuery: DescriptionTemplateLookup; diff --git a/dmp-frontend/src/app/core/query/dmp-user.lookup.ts b/dmp-frontend/src/app/core/query/dmp-user.lookup.ts new file mode 100644 index 000000000..9cd94dd3b --- /dev/null +++ b/dmp-frontend/src/app/core/query/dmp-user.lookup.ts @@ -0,0 +1,26 @@ +import { Guid } from "@common/types/guid"; +import { IsActive } from "../common/enum/is-active.enum"; +import { Lookup } from "@common/model/lookup"; + +export class DmpUserLookup extends Lookup implements DmpUserFilter { + ids: Guid[]; + isActive: IsActive[]; + dmpIds: Guid[]; + userIds: Guid[]; + sectionIds: Guid[]; + userRoles: Guid[]; + + constructor() { + super(); + } +} + +export interface DmpUserFilter { + ids: Guid[]; + isActive: IsActive[]; + + dmpIds: Guid[]; + userIds: Guid[]; + sectionIds: Guid[]; + userRoles: Guid[]; +} \ No newline at end of file diff --git a/dmp-frontend/src/app/core/query/dmp.lookup.ts b/dmp-frontend/src/app/core/query/dmp.lookup.ts index b2e95387f..86451b3d0 100644 --- a/dmp-frontend/src/app/core/query/dmp.lookup.ts +++ b/dmp-frontend/src/app/core/query/dmp.lookup.ts @@ -5,8 +5,8 @@ import { DmpStatus } from '../common/enum/dmp-status'; import { DmpVersionStatus } from '../common/enum/dmp-version-status'; import { IsActive } from '../common/enum/is-active.enum'; import { DmpDescriptionTemplateLookup } from './dmp-description-template.lookup'; -import { DmpUserRole } from '../common/enum/dmp-user-role'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; +import { DmpUserLookup } from './dmp-user.lookup'; export class DmpLookup extends Lookup implements DmpFilter { ids: Guid[]; @@ -20,9 +20,10 @@ export class DmpLookup extends Lookup implements DmpFilter { dmpDescriptionTemplateSubQuery: DmpDescriptionTemplateLookup; groupIds: Guid[]; + dmpUserSubQuery: DmpUserLookup; + dmpBlueprintIds: Guid[]; //TODO descriptionTemplateIds: Guid[]; //TODO - roleInDmp: DmpUserRole[]; //TODO constructor() { super(); @@ -30,7 +31,7 @@ export class DmpLookup extends Lookup implements DmpFilter { from(formGroup: UntypedFormGroup): void { this.statuses = formGroup.get('status')?.value ? [formGroup.get('status')?.value] : null; - this.roleInDmp = formGroup.get('role')?.value ? [formGroup.get('role')?.value] : null; + // this.roleInDmp = formGroup.get('role')?.value ? [formGroup.get('role')?.value] : null; this.dmpBlueprintIds = formGroup.get('dmpBlueprintIds')?.value ? formGroup.get('dmpBlueprintIds')?.value : null; this.descriptionTemplateIds = formGroup.get('descriptionTemplateIds')?.value ? formGroup.get('descriptionTemplateIds')?.value : null; } @@ -38,7 +39,7 @@ export class DmpLookup extends Lookup implements DmpFilter { buildForm(): UntypedFormGroup { return (new UntypedFormBuilder()).group({ status: [this.statuses ? this.statuses[0] : null], - role: [this.roleInDmp ? this.roleInDmp[0] : null], + // role: [this.roleInDmp ? this.roleInDmp[0] : null], dmpBlueprintIds: [this.dmpBlueprintIds], descriptionTemplateIds: [this.descriptionTemplateIds], }); @@ -56,7 +57,8 @@ export interface DmpFilter { versions: Number[]; groupIds: Guid[]; + dmpUserSubQuery: DmpUserLookup; + dmpBlueprintIds: Guid[]; //TODO descriptionTemplateIds: Guid[]; //TODO - roleInDmp: DmpUserRole[]; //TODO } diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.html b/dmp-frontend/src/app/ui/description/listing/description-listing.component.html index cc1ae9b06..a9c3dee06 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.html +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.html @@ -29,7 +29,7 @@ -