Compare commits

...

4 Commits

Author SHA1 Message Date
argirok fc2fbb5ba0 fix issue with selected types filter 2022-04-21 16:35:34 +03:00
argirok 020a947687 Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme
 Conflicts:
	searchPages/searchUtils/newSearchPage.component.html
2022-04-21 16:28:09 +03:00
argirok e79275be2a Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme 2022-04-21 15:29:09 +03:00
argirok 01a0a64ff8 update on row slider for selected filters 2022-04-20 11:01:18 +03:00
2 changed files with 22 additions and 23 deletions

View File

@ -3,11 +3,11 @@
<div class=" uk-width-1-1" uk-slider="finite: true"> <div class=" uk-width-1-1" uk-slider="finite: true">
<div class="uk-position-relative " > <div class="uk-position-relative " >
<div class="uk-slider-container "> <div class="uk-slider-container ">
<ul class=" uk-slider-items " style="flex-wrap: nowrap !important;" > <ul class=" uk-slider-items uk-grid uk-grid-small uk-margin-small-right" style="flex-wrap: nowrap !important;" >
<ng-container *ngIf="customFilter && ((customFilterEnabled && <ng-container *ngIf="customFilter && ((customFilterEnabled &&
refineFields.indexOf(customFilter.queryFieldName) == refineFields.indexOf(customFilter.queryFieldName) ==
-1) ||customFilter.isHiddenFilter)"> -1) ||customFilter.isHiddenFilter)">
<li class="uk-margin-small-right 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}}
</span> </span>
@ -16,7 +16,7 @@
<ng-container *ngIf="resultTypes && resultTypes.countSelectedValues > 0"> <ng-container *ngIf="resultTypes && resultTypes.countSelectedValues > 0">
<ng-container *ngFor="let type of resultTypes.values; let i = index;"> <ng-container *ngFor="let type of resultTypes.values; let i = index;">
<ng-container *ngIf="type.selected"> <ng-container *ngIf="type.selected">
<li class="uk-margin-small-right"> <li 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">{{type.name}}</span> <span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{type.name}}</span>
<button [class.uk-disabled]="disabled" (click)="removeResultType(type.id)" class="uk-close uk-icon" [disabled]="disabled"> <button [class.uk-disabled]="disabled" (click)="removeResultType(type.id)" class="uk-close uk-icon" [disabled]="disabled">
@ -30,7 +30,7 @@
<ng-container *ngIf="selectedRangeFilters > 0"> <ng-container *ngIf="selectedRangeFilters > 0">
<ng-container *ngFor="let filter of rangeFilters "> <ng-container *ngFor="let filter of rangeFilters ">
<ng-container *ngIf="filter.selectedFromAndToValues"> <ng-container *ngIf="filter.selectedFromAndToValues">
<li class="uk-margin-small-right"> <li 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">{{filter.selectedFromAndToValues}}</span> <span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{filter.selectedFromAndToValues}}</span>
<button [class.uk-disabled]="disabled" (click)="removeRangeFilter(filter)" class="uk-close uk-icon" [disabled]="disabled"> <button [class.uk-disabled]="disabled" (click)="removeRangeFilter(filter)" class="uk-close uk-icon" [disabled]="disabled">
@ -45,7 +45,7 @@
<ng-container *ngIf="filter.countSelectedValues > 0"> <ng-container *ngIf="filter.countSelectedValues > 0">
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; "> <ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)" <li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
class="uk-margin-small-right"> 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">{{value.name}}</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">
@ -56,9 +56,6 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
</ng-container> </ng-container>
<li class="">
<span class="uk-label uk-flex uk-flex-middle uk-invisible" > &#160;&#160; &#160;<!-- adds space--></span>
</li>
</ul> </ul>
</div> </div>
<div class=""> <div class="">

View File

@ -1468,11 +1468,16 @@ export class NewSearchPageComponent {
}*/ }*/
if ((this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) { if ((this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) {
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', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"};
if (URLparams["type"]) { for (let typeOption of Object.keys(this.resultTypeOptions)) {
let types = URLparams["type"]; let type = typeOption;
types = Array.isArray(types) ? types.join(',').split(",") : types.split(","); if ( URLparams["type"] && URLparams["type"].indexOf(type)==-1 || !URLparams["type"]) {
for (let type of types) { this.resultTypes.values.push({
if (["publications", "datasets", "software", "other"].indexOf(StringUtils.unquote(type)) != -1 && this.resultTypeOptions[StringUtils.unquote(type)]) { name: this.resultTypeOptions[StringUtils.unquote(type)].name,
id: StringUtils.unquote(type),
selected: false,
number: 0
});
}else{
this.resultTypes.values.push({ this.resultTypes.values.push({
name: this.resultTypeOptions[StringUtils.unquote(type)].name, name: this.resultTypeOptions[StringUtils.unquote(type)].name,
id: StringUtils.unquote(type), id: StringUtils.unquote(type),
@ -1482,9 +1487,6 @@ export class NewSearchPageComponent {
this.resultTypes.countSelectedValues++; this.resultTypes.countSelectedValues++;
} }
} }
}
} }
this.URLCreatedFilters = filters; this.URLCreatedFilters = filters;