Production release February 2024 [CONNECT] #34
|
@ -4,9 +4,7 @@
|
||||||
<div [class.uk-invisible]="list.children.length === 0" class="uk-position-relative">
|
<div [class.uk-invisible]="list.children.length === 0" class="uk-position-relative">
|
||||||
<div class="uk-slider-container">
|
<div class="uk-slider-container">
|
||||||
<ul #list class="uk-slider-items uk-grid uk-grid-small uk-margin-small-right uk-flex-nowrap" style="padding-bottom: 1px">
|
<ul #list class="uk-slider-items uk-grid uk-grid-small uk-margin-small-right uk-flex-nowrap" style="padding-bottom: 1px">
|
||||||
<ng-container *ngIf="customFilter && ((customFilterEnabled &&
|
<ng-container *ngIf="customFilter && (customFilter.isHiddenFilter)">
|
||||||
refineFields.indexOf(customFilter.queryFieldName) ==
|
|
||||||
-1) ||customFilter.isHiddenFilter)">
|
|
||||||
<li class="uk-flex uk-flex-middle">
|
<li class="uk-flex uk-flex-middle">
|
||||||
<span class="uk-label uk-label-secondary uk-text-truncate">
|
<span class="uk-label uk-label-secondary uk-text-truncate">
|
||||||
{{customFilter.valueName}}
|
{{customFilter.valueName}}
|
||||||
|
@ -272,13 +270,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-expand@m uk-with-1-1@s">
|
<div class="uk-width-expand@m uk-with-1-1@s">
|
||||||
<div [class.uk-padding-small]="mobile" class="uk-padding-remove-vertical">
|
<div [class.uk-padding-small]="mobile" class="uk-padding-remove-vertical">
|
||||||
<!-- Results only for Custom Filter? -->
|
|
||||||
<div *ngIf="customFilter && !customFilter.isHiddenFilter &&
|
|
||||||
customFilter.selected == false && customFilter.promptToAddFilter"
|
|
||||||
class="uk-alert uk-animation-slide-top-small">
|
|
||||||
Do you want to see results only for {{customFilter.valueName}}? <a
|
|
||||||
(click)="addCustomFilter();">Click here</a>.
|
|
||||||
</div>
|
|
||||||
<!-- Related results for Custom Filter Alert -->
|
<!-- Related results for Custom Filter Alert -->
|
||||||
<div *ngIf="openaireLink && (searchUtils.totalResults > 0 || !loadPaging )"
|
<div *ngIf="openaireLink && (searchUtils.totalResults > 0 || !loadPaging )"
|
||||||
class="uk-alert uk-margin-small-top ">
|
class="uk-alert uk-margin-small-top ">
|
||||||
|
@ -399,4 +391,3 @@
|
||||||
<div *ngIf="isMobile || isServer" class="uk-hidden@m">
|
<div *ngIf="isMobile || isServer" class="uk-hidden@m">
|
||||||
<ng-container *ngTemplateOutlet="main; context: {mobile: true}"></ng-container>
|
<ng-container *ngTemplateOutlet="main; context: {mobile: true}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
<modal-alert #removeCustomFilter (alertOutput)="closeCustomFilterModal()"></modal-alert>
|
|
||||||
|
|
|
@ -138,11 +138,9 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
|
|
||||||
//Dashboard
|
//Dashboard
|
||||||
filterToggle = false;
|
filterToggle = false;
|
||||||
customFilterEnabled: boolean = false;
|
|
||||||
//stickyform
|
//stickyform
|
||||||
@Input() stickyForm: boolean = false;
|
@Input() stickyForm: boolean = false;
|
||||||
|
|
||||||
@ViewChild('removeCustomFilter') removeCustomFilter: AlertModal;
|
|
||||||
currentValueToRemove;
|
currentValueToRemove;
|
||||||
currentFilterToRemove;
|
currentFilterToRemove;
|
||||||
public indexUpdateDate: Date;
|
public indexUpdateDate: Date;
|
||||||
|
@ -185,7 +183,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
if (params['page'] && params['page'] != 1) {
|
if (params['page'] && params['page'] != 1) {
|
||||||
HelperFunctions.scrollToId("searchForm");
|
HelperFunctions.scrollToId("searchForm");
|
||||||
}
|
}
|
||||||
this.customFilterEnabled = params['cf'] && params['cf'] == "true";
|
|
||||||
if (this.basicMetaDescription.length == 0) {
|
if (this.basicMetaDescription.length == 0) {
|
||||||
if (this.entityType == "result") {
|
if (this.entityType == "result") {
|
||||||
this.basicMetaDescription = [OpenaireEntities.RESULTS, "Discover" + (this.properties.adminToolsCommunity == 'openaire' ? " over 100 million of" : "") + " "+OpenaireEntities.RESULTS+" ", "categorized by research type, year range, funder, languages, "+OpenaireEntities.COMMUNITY+" and "+OpenaireEntities.DATASOURCES+"."];
|
this.basicMetaDescription = [OpenaireEntities.RESULTS, "Discover" + (this.properties.adminToolsCommunity == 'openaire' ? " over 100 million of" : "") + " "+OpenaireEntities.RESULTS+" ", "categorized by research type, year range, funder, languages, "+OpenaireEntities.COMMUNITY+" and "+OpenaireEntities.DATASOURCES+"."];
|
||||||
|
@ -644,10 +641,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
public removeFilter(value: Value, filter: Filter, forceRemove: boolean = false) {
|
public removeFilter(value: Value, filter: Filter, forceRemove: boolean = false) {
|
||||||
this.currentValueToRemove = value;
|
this.currentValueToRemove = value;
|
||||||
this.currentFilterToRemove = filter;
|
this.currentFilterToRemove = filter;
|
||||||
if (!forceRemove && this.customFilter && this.customFilter.queryFieldName == filter.filterId && this.customFilter.valueId == value.id && this.customFilter.promptToAddFilter) {
|
|
||||||
this.openRemoveCustomFilterModal();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
filter.countSelectedValues--;
|
filter.countSelectedValues--;
|
||||||
this.selectedFilters--;
|
this.selectedFilters--;
|
||||||
if (value.selected == true) {
|
if (value.selected == true) {
|
||||||
|
@ -661,20 +654,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
// }
|
// }
|
||||||
this.goTo(1);
|
this.goTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openRemoveCustomFilterModal() {
|
|
||||||
this.removeCustomFilter.alertTitle = 'Remove filter';
|
|
||||||
this.removeCustomFilter.message = 'You are about to see results that are not related to ' + this.customFilter.valueName + '. Do you want to proceed?';
|
|
||||||
this.removeCustomFilter.okButtonText = 'Yes';
|
|
||||||
this.removeCustomFilter.cancelButtonText = 'No';
|
|
||||||
this.removeCustomFilter.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
closeCustomFilterModal() {
|
|
||||||
this.customFilterEnabled = false;
|
|
||||||
this.removeFilter(this.currentValueToRemove, this.currentFilterToRemove, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public removeRangeFilter(filter: RangeFilter) {
|
public removeRangeFilter(filter: RangeFilter) {
|
||||||
filter.selectedFromValue = null;
|
filter.selectedFromValue = null;
|
||||||
filter.selectedToValue = null;
|
filter.selectedToValue = null;
|
||||||
|
@ -718,42 +698,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Set selected the value of the custom filter.
|
|
||||||
*/
|
|
||||||
addCustomFilter() {
|
|
||||||
this.customFilter.selected = true;
|
|
||||||
this.customFilterEnabled = true;
|
|
||||||
if (this.refineFields.indexOf(this.customFilter.queryFieldName) != -1) {
|
|
||||||
let found = false;
|
|
||||||
for (let filter of this.filters) {
|
|
||||||
if (this.customFilter.queryFieldName == filter.filterId) {
|
|
||||||
for (let value of filter.values) {
|
|
||||||
if (value.id == this.customFilter.valueId) {
|
|
||||||
value.selected = true;
|
|
||||||
filter.countSelectedValues++;
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//add filter when field exist in refine but not in the refine values
|
|
||||||
if (!found) {
|
|
||||||
filter.countSelectedValues++;
|
|
||||||
filter.values.push({
|
|
||||||
selected: true,
|
|
||||||
name: this.customFilter.valueName,
|
|
||||||
id: this.customFilter.valueId,
|
|
||||||
number: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.filterChanged(null);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// for loading
|
// for loading
|
||||||
public openLoading() {
|
public openLoading() {
|
||||||
this.loading.open();
|
this.loading.open();
|
||||||
|
@ -1112,8 +1057,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
allFqs += fq;
|
allFqs += fq;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.customFilterEnabled = URLparams["cf"] == "true";
|
if (this.customFilter && (this.customFilter.isHiddenFilter)) {
|
||||||
if (this.customFilter && (this.customFilter.isHiddenFilter || this.customFilterEnabled)) {
|
|
||||||
allFqs += "&fq=" + StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId)));
|
allFqs += "&fq=" + StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1455,12 +1399,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
this.parameterNames.push("keyword");
|
this.parameterNames.push("keyword");
|
||||||
this.parameterValues.push(this.searchUtils.keyword);
|
this.parameterValues.push(this.searchUtils.keyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this.customFilterEnabled) {
|
|
||||||
this.parameterNames.push("cf");
|
|
||||||
this.parameterValues.push("true");
|
|
||||||
}
|
|
||||||
// if (this.searchUtils.size != this.resultsPerPage) {
|
// if (this.searchUtils.size != this.resultsPerPage) {
|
||||||
// // allLimits += ((allLimits.length == 0) ? '?' : '&') + 'size=' + this.searchUtils.size;
|
// // allLimits += ((allLimits.length == 0) ? '?' : '&') + 'size=' + this.searchUtils.size;
|
||||||
// this.parameterNames.push("size");
|
// this.parameterNames.push("size");
|
||||||
|
|
|
@ -27,7 +27,6 @@ export class SearchCustomFilter{
|
||||||
valueName:string; // Greece
|
valueName:string; // Greece
|
||||||
isHiddenFilter:boolean;
|
isHiddenFilter:boolean;
|
||||||
selected:boolean;
|
selected:boolean;
|
||||||
promptToAddFilter:boolean;
|
|
||||||
constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){
|
constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){
|
||||||
if(valueId == "test" && properties.environment == "development"){
|
if(valueId == "test" && properties.environment == "development"){
|
||||||
valueId = "covid-19";
|
valueId = "covid-19";
|
||||||
|
@ -38,7 +37,6 @@ export class SearchCustomFilter{
|
||||||
this.valueId = valueId;
|
this.valueId = valueId;
|
||||||
this.valueName = valueName;
|
this.valueName = valueName;
|
||||||
this.selected = null;
|
this.selected = null;
|
||||||
this.promptToAddFilter = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getParameters(params={}){
|
public getParameters(params={}){
|
||||||
|
|
Loading…
Reference in New Issue