Adds radio box Roles on published DMPs and published Datasets, fixes initial value of radio boxes on filters.
This commit is contained in:
parent
28b748bb03
commit
9841b495c1
|
@ -0,0 +1,4 @@
|
||||||
|
export enum Role {
|
||||||
|
Owner = 0,
|
||||||
|
Member = 1
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
import { GrantStateType } from "../../common/enum/grant-state-type";
|
import { GrantStateType } from "../../common/enum/grant-state-type";
|
||||||
import { BaseCriteria } from "../base-criteria";
|
import { BaseCriteria } from "../base-criteria";
|
||||||
|
import { Role } from '../../common/enum/role';
|
||||||
|
|
||||||
export class ExploreDatasetCriteriaModel extends BaseCriteria {
|
export class ExploreDatasetCriteriaModel extends BaseCriteria {
|
||||||
public grantStatus: GrantStateType;
|
public grantStatus: GrantStateType;
|
||||||
|
public role: Role;
|
||||||
public dmpIds: string[] = [];
|
public dmpIds: string[] = [];
|
||||||
public grants: string[] = [];
|
public grants: string[] = [];
|
||||||
public datasetProfile: string[] = [];
|
public datasetProfile: string[] = [];
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import { BaseCriteria } from "../base-criteria";
|
import { BaseCriteria } from "../base-criteria";
|
||||||
import { GrantStateType } from "../../common/enum/grant-state-type";
|
import { GrantStateType } from "../../common/enum/grant-state-type";
|
||||||
|
import { Role } from '../../common/enum/role';
|
||||||
|
|
||||||
export class ExploreDmpCriteriaModel extends BaseCriteria {
|
export class ExploreDmpCriteriaModel extends BaseCriteria {
|
||||||
public grantStatus: GrantStateType;
|
public grantStatus: GrantStateType;
|
||||||
|
public role: Role;
|
||||||
public grants: string[] = [];
|
public grants: string[] = [];
|
||||||
public datasetProfile: string[] = [];
|
public datasetProfile: string[] = [];
|
||||||
public dmpOrganisations: string[] = [];
|
public dmpOrganisations: string[] = [];
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
<div class="col-10 gray-container" >
|
<div class="col-10 gray-container" >
|
||||||
<h6 class="category-title">{{'CRITERIA.DATA-SETS.STATUS'| translate}}</h6>
|
<h6 class="category-title">{{'CRITERIA.DATA-SETS.STATUS'| translate}}</h6>
|
||||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('status')">
|
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('status')">
|
||||||
|
<mat-list-item><mat-radio-button checked value="null">{{ 'TYPES.DATASET-STATUS.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="0" [checked]="status == 0">{{ 'TYPES.DATASET-STATUS.DRAFT' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="0" [checked]="status == 0">{{ 'TYPES.DATASET-STATUS.DRAFT' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DATASET-STATUS.FINALISED' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DATASET-STATUS.FINALISED' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="null">{{ 'TYPES.DATASET-STATUS.ANY' | translate }}</mat-radio-button></mat-list-item>
|
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Status Filter-->
|
<!-- End of Status Filter-->
|
||||||
|
@ -79,15 +79,9 @@
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{'CRITERIA.DATA-SETS.ROLE' | translate }}</h6>
|
<h6 class="category-title">{{'CRITERIA.DATA-SETS.ROLE' | translate }}</h6>
|
||||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')">
|
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')">
|
||||||
<mat-list-item>
|
<mat-list-item><mat-radio-button checked value="null">{{ 'TYPES.DATASET-ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-radio-button value="null">{{ 'TYPES.DATASET-ROLE.ANY' | translate }}</mat-radio-button>
|
<mat-list-item><mat-radio-button value="0">{{ 'TYPES.DATASET-ROLE.OWNER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
</mat-list-item>
|
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DATASET-ROLE.MEMBER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item>
|
|
||||||
<mat-radio-button value="0">{{ 'TYPES.DATASET-ROLE.OWNER' | translate }}</mat-radio-button>
|
|
||||||
</mat-list-item>
|
|
||||||
<mat-list-item>
|
|
||||||
<mat-radio-button value="1">{{ 'TYPES.DATASET-ROLE.MEMBER' | translate }}</mat-radio-button>
|
|
||||||
</mat-list-item>
|
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Role Filter -->
|
<!-- End of Role Filter -->
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'TYPES.DMP-VISIBILITY.VISIBILITY' | translate }}</h6>
|
<h6 class="category-title">{{ 'TYPES.DMP-VISIBILITY.VISIBILITY' | translate }}</h6>
|
||||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('status')">
|
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('status')">
|
||||||
<mat-list-item><mat-radio-button value="null">{{ 'TYPES.DMP-VISIBILITY.ANY' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="null" checked>{{ 'TYPES.DMP-VISIBILITY.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="2">{{ 'TYPES.DMP-VISIBILITY.PUBLIC' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="2">{{ 'TYPES.DMP-VISIBILITY.PUBLIC' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DMP-VISIBILITY.FINALIZED' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DMP-VISIBILITY.FINALIZED' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="0">{{ 'TYPES.DMP-VISIBILITY.DRAFT' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="0">{{ 'TYPES.DMP-VISIBILITY.DRAFT' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}</h6>
|
||||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')">
|
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')">
|
||||||
<mat-list-item><mat-radio-button value="null">{{ 'TYPES.DATASET-ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="null" checked>{{ 'TYPES.DATASET-ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="0">{{ 'TYPES.DATASET-ROLE.OWNER' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="0">{{ 'TYPES.DATASET-ROLE.OWNER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DATASET-ROLE.MEMBER' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="1">{{ 'TYPES.DATASET-ROLE.MEMBER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
|
|
|
@ -11,15 +11,11 @@
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
||||||
<mat-list-item>
|
<mat-radio-group>
|
||||||
<mat-radio-button value="null" checked (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }}</mat-radio-button>
|
<mat-list-item><mat-radio-button value="null" checked (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
</mat-list-item>
|
<mat-list-item><mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item>
|
<mat-list-item><mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button>
|
</mat-radio-group>
|
||||||
</mat-list-item>
|
|
||||||
<mat-list-item>
|
|
||||||
<mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button>
|
|
||||||
</mat-list-item>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
|
@ -49,6 +45,15 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-10 gray-container">
|
||||||
|
<h6 class="category-title">{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}</h6>
|
||||||
|
<mat-radio-group>
|
||||||
|
<mat-list-item><mat-radio-button value="null" checked (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
<mat-list-item><mat-radio-button value="0" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.OWNER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
<mat-list-item><mat-radio-button value="1" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.MEMBER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
</mat-radio-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
|
|
|
@ -200,6 +200,14 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
||||||
return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data));
|
return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public roleChanged(event: any) {
|
||||||
|
this.facetCriteria.role = event.value;
|
||||||
|
if (event.value === 'null') {
|
||||||
|
this.facetCriteria.role = null;
|
||||||
|
}
|
||||||
|
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||||
|
}
|
||||||
|
|
||||||
public dmpOrganisationChanged(event: any) {
|
public dmpOrganisationChanged(event: any) {
|
||||||
const eventValue = event.option.value.id;
|
const eventValue = event.option.value.id;
|
||||||
if (event.option.selected) { this.facetCriteria.dmpOrganisations.push(eventValue); }
|
if (event.option.selected) { this.facetCriteria.dmpOrganisations.push(eventValue); }
|
||||||
|
|
|
@ -10,9 +10,11 @@
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
||||||
<mat-list-item><mat-radio-button value="null" checked (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }}</mat-radio-button></mat-list-item>
|
<mat-radio-group>
|
||||||
<mat-list-item><mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="null" checked (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
<mat-list-item><mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
</mat-radio-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
|
@ -37,6 +39,15 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-10 gray-container">
|
||||||
|
<h6 class="category-title">{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}</h6>
|
||||||
|
<mat-radio-group>
|
||||||
|
<mat-list-item><mat-radio-button value="null" checked (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
<mat-list-item><mat-radio-button value="0" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.OWNER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
<mat-list-item><mat-radio-button value="1" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.MEMBER' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
</mat-radio-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
|
|
|
@ -254,6 +254,14 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public roleChanged(event: any) {
|
||||||
|
this.facetCriteria.role = event.value;
|
||||||
|
if (event.value === 'null') {
|
||||||
|
this.facetCriteria.role = null;
|
||||||
|
}
|
||||||
|
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||||
|
}
|
||||||
|
|
||||||
dmpOrganisationChanged(event: any) {
|
dmpOrganisationChanged(event: any) {
|
||||||
const eventValue = event.option.value.id;
|
const eventValue = event.option.value.id;
|
||||||
if (event.option.selected) { this.facetCriteria.dmpOrganisations.push(eventValue); }
|
if (event.option.selected) { this.facetCriteria.dmpOrganisations.push(eventValue); }
|
||||||
|
|
|
@ -108,10 +108,8 @@
|
||||||
|
|
||||||
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.BooleanDecision" class="col-12">
|
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.BooleanDecision" class="col-12">
|
||||||
<mat-radio-group [formControl]="form.get('value')" [required]="form.get('validationRequired').value">
|
<mat-radio-group [formControl]="form.get('value')" [required]="form.get('validationRequired').value">
|
||||||
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="true">Yes
|
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="true">{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.ACTIONS.YES" | translate }}</mat-radio-button>
|
||||||
</mat-radio-button>
|
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="false">{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.ACTIONS.NO" | translate }}</mat-radio-button>
|
||||||
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="false">No
|
|
||||||
</mat-radio-button>
|
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
|
|
|
@ -852,7 +852,11 @@
|
||||||
"DATASET-PROFILE-COMBO-BOX-TYPE": {
|
"DATASET-PROFILE-COMBO-BOX-TYPE": {
|
||||||
"WORD-LIST": "Word List",
|
"WORD-LIST": "Word List",
|
||||||
"AUTOCOMPLETE": "Autocomplete",
|
"AUTOCOMPLETE": "Autocomplete",
|
||||||
"EXTERNAL-SOURCE-HINT": "External source"
|
"EXTERNAL-SOURCE-HINT": "External source",
|
||||||
|
"ACTIONS": {
|
||||||
|
"YES": "Yes",
|
||||||
|
"No": "No"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DATASET-PROFILE-INTERNAL-DMP-ENTITIES-TYPE": {
|
"DATASET-PROFILE-INTERNAL-DMP-ENTITIES-TYPE": {
|
||||||
"RESEARCHERS": "Researchers",
|
"RESEARCHERS": "Researchers",
|
||||||
|
@ -1022,14 +1026,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GRANT": {
|
"GRANT": {
|
||||||
"TITLE": "Grant",
|
"TITLE": "Related Grant",
|
||||||
"FILTER": "Filter Grants"
|
"FILTER": "Filter Grants"
|
||||||
},
|
},
|
||||||
"PROFILES": {
|
"PROFILES": {
|
||||||
"TITLE": "Dataset specification"
|
"TITLE": "Dataset specification"
|
||||||
},
|
},
|
||||||
|
"ROLE": {
|
||||||
|
"TITLE": "Role",
|
||||||
|
"ANY": "Any",
|
||||||
|
"OWNER": "Owner",
|
||||||
|
"MEMBER": "Member"
|
||||||
|
},
|
||||||
"DMP-ORGANISATIONS": {
|
"DMP-ORGANISATIONS": {
|
||||||
"TITLE": "DMP Organizations",
|
"TITLE": "Organization",
|
||||||
"FILTER": "Filter Organizations"
|
"FILTER": "Filter Organizations"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue