Adds Dmp criteria on Dataset listing.
This commit is contained in:
parent
0440ecba41
commit
d5cfa7823f
|
@ -4,7 +4,7 @@ import { BaseCriteria } from "../base-criteria";
|
|||
export class DatasetCriteria extends BaseCriteria {
|
||||
public projects?: string[] = [];
|
||||
public status?: Number;
|
||||
public dmpIds?: String[] = [];
|
||||
public dmpIds?: string[] = [];
|
||||
public tags?: ExternalSourceItemModel[] = [];
|
||||
public allVersions?: boolean;
|
||||
public role?: number;
|
||||
|
|
|
@ -23,15 +23,26 @@
|
|||
</div>
|
||||
<!-- End of Status Filter-->
|
||||
|
||||
<!-- Related DMP Filters -->
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{'CRITERIA.DATA-SETS.RELATED-DMP' | translate}}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('dmpIds')"
|
||||
placeholder="{{'CRITERIA.DATA-SETS.SELECT-DMP' | translate }}"
|
||||
[configuration]="dmpAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- End of Related DMP Filters -->
|
||||
|
||||
<!-- Related Project Filters -->
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{'CRITERIA.PROJECTS.LIKE' | translate}}</h6>
|
||||
<h6 class="category-title">{{'CRITERIA.DATA-SETS.RELATED-PROJECT' | translate}}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('projects')"
|
||||
placeholder="{{'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
|
||||
[configuration]="projectAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- End of Related Projects Filters -->
|
||||
|
|
|
@ -48,6 +48,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
|
||||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl(),
|
||||
dmpIds: new FormControl(),
|
||||
projects: new FormControl(),
|
||||
status: new FormControl(),
|
||||
role: new FormControl(),
|
||||
|
@ -108,6 +109,9 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
this.formGroup.get('like').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
this.formGroup.get('dmpIds').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
this.formGroup.get('projects').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
|
@ -125,8 +129,9 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
|
||||
setCriteria(criteria: DatasetCriteria): void {
|
||||
this.formGroup.get('like').patchValue(criteria.like);
|
||||
this.formGroup.get('dmpIds').patchValue(criteria.dmpIds);
|
||||
this.formGroup.get('projects').patchValue(criteria.projects);
|
||||
this.formGroup.get('status').patchValue(criteria.like);
|
||||
// this.formGroup.get('projects').patchValue(criteria.projects);
|
||||
this.formGroup.get('role').patchValue(criteria.like);
|
||||
// this.criteria = criteria;
|
||||
}
|
||||
|
@ -180,7 +185,6 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
const dataTableRequest: DataTableRequest<OrganisationCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = new OrganisationCriteria();
|
||||
dataTableRequest.criteria.labelLike = value;
|
||||
|
||||
return this.organisationService.searchInternalOrganisations(dataTableRequest).map(x => x.data);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,11 +85,11 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
|
|||
allVersions: value.allVersions,
|
||||
role: value.role
|
||||
}
|
||||
if (value.projects) {
|
||||
request.criteria.projects = value.projects.map(x => x.id);
|
||||
}
|
||||
if (value.dmpIds) {
|
||||
request.criteria.dmpIds = value.dmpIds;
|
||||
request.criteria.dmpIds = value.dmpIds.map(x => x.id);
|
||||
}
|
||||
if (value.projects) {
|
||||
request.criteria.projects = value.projects.map(x => x.id);
|
||||
}
|
||||
if (value.organisations) {
|
||||
request.criteria.organisations = value.organisations.map(x => x.id);
|
||||
|
|
|
@ -487,7 +487,10 @@
|
|||
"SELECT-PROJECTS": "Select Projects",
|
||||
"ROLE": "Role",
|
||||
"ORGANIZATION": "Organization",
|
||||
"SELECT-ORGANIZATIONS": "Select Organizations"
|
||||
"SELECT-ORGANIZATIONS": "Select Organizations",
|
||||
"RELATED-PROJECT": "Related Project",
|
||||
"SELECT-DMP": "DMP",
|
||||
"RELATED-DMP": "Related DMPs"
|
||||
},
|
||||
"DMP": {
|
||||
"LIKE": "Search DMPs",
|
||||
|
|
Loading…
Reference in New Issue