Datasource new refine fields datasourcethematic, datasourcejurisdiction
Present boolean filters as Yes/No In selected filters add filter name for boolean filters remove boolean sc39 from advanced search
This commit is contained in:
parent
86b48dc932
commit
fd8f53507e
|
@ -47,7 +47,14 @@
|
||||||
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
|
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
|
||||||
class="">
|
class="">
|
||||||
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
|
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
|
||||||
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{value.name}}</span>
|
<span
|
||||||
|
class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
||||||
|
<span *ngIf="filter.type && filter.type == 'boolean' else noboolean">{{filter.title}}:
|
||||||
|
{{value.name=='true'?'Yes':'No'}}
|
||||||
|
</span>
|
||||||
|
<ng-template #noboolean>
|
||||||
|
{{value.name}}
|
||||||
|
</ng-template></span>
|
||||||
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
|
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
|
||||||
<icon name="close" flex="true" ratio="0.7"></icon>
|
<icon name="close" flex="true" ratio="0.7"></icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -24,7 +24,6 @@ import {properties} from "../../../../environments/environment";
|
||||||
import {AlertModal} from "../../utils/modal/alert";
|
import {AlertModal} from "../../utils/modal/alert";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
import {IndexInfoService} from "../../utils/indexInfo.service";
|
import {IndexInfoService} from "../../utils/indexInfo.service";
|
||||||
import { Option } from '../../sharedComponents/input/input.component';
|
|
||||||
|
|
||||||
export interface SearchForm {
|
export interface SearchForm {
|
||||||
class: string,
|
class: string,
|
||||||
|
@ -1508,7 +1507,7 @@ export class NewSearchPageComponent {
|
||||||
options = this.serviceTypeOptions;
|
options = this.serviceTypeOptions;
|
||||||
}
|
}
|
||||||
if (options) {
|
if (options) {
|
||||||
this.resultTypes = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"};
|
this.resultTypes = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', type:'checkBox', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"};
|
||||||
for (let typeOption of Object.keys(options)) {
|
for (let typeOption of Object.keys(options)) {
|
||||||
let type = typeOption;
|
let type = typeOption;
|
||||||
if ( URLparams["type"] && URLparams["type"].indexOf(type)==-1 || !URLparams["type"]) {
|
if ( URLparams["type"] && URLparams["type"].indexOf(type)==-1 || !URLparams["type"]) {
|
||||||
|
|
|
@ -53,7 +53,13 @@
|
||||||
(ngModelChange)="uniqueFilterChange(value)"/>
|
(ngModelChange)="uniqueFilterChange(value)"/>
|
||||||
</span>
|
</span>
|
||||||
<span class="uk-margin-small-left">
|
<span class="uk-margin-small-left">
|
||||||
{{_formatName(value)}}
|
<span *ngIf="filter.type && filter.type == 'boolean' else noboolean">
|
||||||
|
{{value.name=='true'?'Yes':'No'}}
|
||||||
|
</span>
|
||||||
|
<ng-template #noboolean>
|
||||||
|
{{_formatName(value)}}
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
<span *ngIf="showResultCount">({{value.number|number}})</span>
|
<span *ngIf="showResultCount">({{value.number|number}})</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -8,6 +8,7 @@ export class Filter{
|
||||||
public filterOperator: string ='or';
|
public filterOperator: string ='or';
|
||||||
public valueIsExact: boolean = true; // for search table view, if value is contained or is equal with column entry
|
public valueIsExact: boolean = true; // for search table view, if value is contained or is equal with column entry
|
||||||
public filterType: string = "checkbox";
|
public filterType: string = "checkbox";
|
||||||
|
public type?: string = "keyword";
|
||||||
public radioValue?: string = "";
|
public radioValue?: string = "";
|
||||||
// public uniqueValueIdSelected: string;
|
// public uniqueValueIdSelected: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,12 @@ export class RefineResultsUtils {
|
||||||
for(let j=0; j<fields.length; j++) {
|
for(let j=0; j<fields.length; j++) {
|
||||||
|
|
||||||
var filter:Filter = new Filter();
|
var filter:Filter = new Filter();
|
||||||
filter.title = searchFields.getFieldName(fields[j],entityType);
|
let fieldInfo = searchFields.getField(fields[j],entityType);
|
||||||
|
filter.title = fieldInfo?fieldInfo.name:"UNDEFINED";
|
||||||
filter.filterId = fields[j];
|
filter.filterId = fields[j];
|
||||||
filter.originalFilterId = fields[j];
|
filter.originalFilterId = fields[j];
|
||||||
filter.filterType = searchFields.getFieldFilterType(fields[j], entityType, usedBy);
|
filter.filterType = fieldInfo?fieldInfo.filterType:"checkbox";
|
||||||
|
filter.type = fieldInfo?fieldInfo.type:"keyword";
|
||||||
filter.filterOperator = searchFields.getFieldOperator(fields[j]);
|
filter.filterOperator = searchFields.getFieldOperator(fields[j]);
|
||||||
filter.radioValue = "";
|
filter.radioValue = "";
|
||||||
//console.info("filter.title: "+filter.title+" filter.filterType: "+filter.filterType);
|
//console.info("filter.title: "+filter.title+" filter.filterType: "+filter.filterType);
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class";
|
||||||
|
|
||||||
export class SearchFields {
|
export class SearchFields {
|
||||||
|
|
||||||
//main Entities
|
//main Entities
|
||||||
|
@ -257,7 +259,7 @@ export class SearchFields {
|
||||||
"fundinglevel2_id", "projectstartyear", "projectendyear", "projectecsc39"];
|
"fundinglevel2_id", "projectstartyear", "projectendyear", "projectecsc39"];
|
||||||
public PROJECT_ADVANCED_FIELDS: string[] = ["q", "projectacronym", "projecttitle", "projectkeywords",
|
public PROJECT_ADVANCED_FIELDS: string[] = ["q", "projectacronym", "projecttitle", "projectkeywords",
|
||||||
"funder", "fundinglevel0_id", "fundinglevel1_id", "fundinglevel2_id",
|
"funder", "fundinglevel0_id", "fundinglevel1_id", "fundinglevel2_id",
|
||||||
"projectstartdate", "projectenddate", "projectecsc39",
|
"projectstartdate", "projectenddate",
|
||||||
"projectcode_nt", "relorganizationid", "collectedfromdatasourceid"];
|
"projectcode_nt", "relorganizationid", "collectedfromdatasourceid"];
|
||||||
public PROJECT_FIELDS: { [key: string]: FieldDetails } = {
|
public PROJECT_FIELDS: { [key: string]: FieldDetails } = {
|
||||||
["q"]: {name: "All fields", type: "keyword", param: "q", operator: "op", equalityOperator: "=", filterType: null},
|
["q"]: {name: "All fields", type: "keyword", param: "q", operator: "op", equalityOperator: "=", filterType: null},
|
||||||
|
@ -396,7 +398,8 @@ export class SearchFields {
|
||||||
//DATAPROVIDERS
|
//DATAPROVIDERS
|
||||||
// add Collected From Filter "collectedfromname"
|
// add Collected From Filter "collectedfromname"
|
||||||
public DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypeuiname", "datasourceodlanguages", "datasourceodcontenttypes",
|
public DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypeuiname", "datasourceodlanguages", "datasourceodcontenttypes",
|
||||||
"datasourcecompatibilityname", "country", "collectedfromname"];
|
"datasourcecompatibilityname", "country", "collectedfromname","datasourcethematic",
|
||||||
|
"datasourcejurisdiction"];
|
||||||
public DATASOURCE_ADVANCED_FIELDS: string[] = ["q", "datasourceofficialname",
|
public DATASOURCE_ADVANCED_FIELDS: string[] = ["q", "datasourceofficialname",
|
||||||
"datasourceenglishname", "datasourceodsubjects", "datasourcetypename", "datasourceodlanguages",
|
"datasourceenglishname", "datasourceodsubjects", "datasourcetypename", "datasourceodlanguages",
|
||||||
"datasourceodcontenttypes", "datasourcecompatibilityname", "relorganizationid", "collectedfromdatasourceid"];
|
"datasourceodcontenttypes", "datasourcecompatibilityname", "relorganizationid", "collectedfromdatasourceid"];
|
||||||
|
@ -514,6 +517,22 @@ export class SearchFields {
|
||||||
operator: "cu",
|
operator: "cu",
|
||||||
equalityOperator: "=",
|
equalityOperator: "=",
|
||||||
filterType: "checkbox"
|
filterType: "checkbox"
|
||||||
|
},
|
||||||
|
["datasourcethematic"]: {
|
||||||
|
name: "Thematic",
|
||||||
|
type: "boolean",
|
||||||
|
param: "thematic",
|
||||||
|
operator: "th",
|
||||||
|
equalityOperator: " exact ",
|
||||||
|
filterType: "radio"
|
||||||
|
},
|
||||||
|
["datasourcejurisdiction"]: {
|
||||||
|
name: "Jurisdiction",
|
||||||
|
type: "vocabulary",
|
||||||
|
param: "jurisdiction",
|
||||||
|
operator: "ju",
|
||||||
|
equalityOperator: "=",
|
||||||
|
filterType: "checkbox"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -526,7 +545,7 @@ export class SearchFields {
|
||||||
{"name": "country", "equalityOperator": " exact "},
|
{"name": "country", "equalityOperator": " exact "},
|
||||||
{"name": "datasourcesubject", "equalityOperator": " all "}
|
{"name": "datasourcesubject", "equalityOperator": " all "}
|
||||||
];
|
];
|
||||||
public DEPOSIT_DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypename", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"];
|
public DEPOSIT_DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypename", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname","datasourcethematic", "datasourcejurisdiction"];
|
||||||
|
|
||||||
public DEPOSIT_DATASOURCE_FIELDS: { [key: string]: FieldDetails } = {
|
public DEPOSIT_DATASOURCE_FIELDS: { [key: string]: FieldDetails } = {
|
||||||
["datasourcetypeuiname"]: {
|
["datasourcetypeuiname"]: {
|
||||||
|
@ -644,55 +663,34 @@ export class SearchFields {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
getField(fieldId: string, fieldType: string): any {
|
||||||
getFieldName(fieldId: string, fieldType: string): string {
|
|
||||||
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
|
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
|
||||||
return this.RESULT_FIELDS[fieldId].name;
|
return this.RESULT_FIELDS[fieldId];
|
||||||
} else if (fieldType == "project") {
|
} else if (fieldType == "project") {
|
||||||
return this.PROJECT_FIELDS[fieldId].name;
|
return this.PROJECT_FIELDS[fieldId];
|
||||||
} else if (fieldType == "organization") {
|
} else if (fieldType == "organization") {
|
||||||
return this.ORGANIZATION_FIELDS[fieldId].name;
|
return this.ORGANIZATION_FIELDS[fieldId];
|
||||||
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
|
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
|
||||||
return this.DATASOURCE_FIELDS[fieldId].name;
|
return this.DATASOURCE_FIELDS[fieldId];
|
||||||
} else if (fieldType == "service") {
|
} else if (fieldType == "service") {
|
||||||
return this.DATASOURCE_FIELDS[fieldId].name;
|
return this.DATASOURCE_FIELDS[fieldId];
|
||||||
} else {
|
} else {
|
||||||
return "UNDEFINED";
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getFieldName(fieldId: string, fieldType: string): string {
|
||||||
|
let field = this.getField(fieldId, fieldType);
|
||||||
|
return field?field.name:"UNDEFINED";
|
||||||
|
}
|
||||||
|
|
||||||
getFieldFilterType(fieldId: string, fieldType: string, usedBy: string = "search"): string {
|
getFieldFilterType(fieldId: string, fieldType: string, usedBy: string = "search"): string {
|
||||||
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
|
let field = this.getField(fieldId, fieldType);
|
||||||
return this.RESULT_FIELDS[fieldId].filterType;
|
return field?field.filterType:"checkbox";
|
||||||
} else if (fieldType == "project") {
|
|
||||||
return this.PROJECT_FIELDS[fieldId].filterType;
|
|
||||||
} else if (fieldType == "organization") {
|
|
||||||
return this.ORGANIZATION_FIELDS[fieldId].filterType;
|
|
||||||
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
|
|
||||||
if (usedBy == "search") {
|
|
||||||
return this.DATASOURCE_FIELDS[fieldId].filterType;
|
|
||||||
} else if (usedBy == "deposit") {
|
|
||||||
return this.DEPOSIT_DATASOURCE_FIELDS[fieldId].filterType;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return "checkbox";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getFieldParam(fieldId: string, fieldType: string): string {
|
getFieldParam(fieldId: string, fieldType: string): string {
|
||||||
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
|
let field = this.getField(fieldId, fieldType);
|
||||||
return this.RESULT_FIELDS[fieldId].param;
|
return field?field.param:"UNDEFINED";
|
||||||
} else if (fieldType == "project") {
|
|
||||||
return this.PROJECT_FIELDS[fieldId].param;
|
|
||||||
} else if (fieldType == "organization") {
|
|
||||||
return this.ORGANIZATION_FIELDS[fieldId].param;
|
|
||||||
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
|
|
||||||
return this.DATASOURCE_FIELDS[fieldId].param;
|
|
||||||
} else if (fieldType == "service") {
|
|
||||||
return this.DATASOURCE_FIELDS[fieldId].param;
|
|
||||||
} else {
|
|
||||||
return "UNDEFINED";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static getParameterOrder(fieldId: string, params): number {
|
public static getParameterOrder(fieldId: string, params): number {
|
||||||
let fields = [];
|
let fields = [];
|
||||||
|
|
Loading…
Reference in New Issue