[EOSC Explore]: package.json & CHANGELOG.md: Updated v1.0.2 | newSearchPage.component.html: Updated margins and paddings in search form | advancedSearchForm.component: Bug fix in advanced search form (fixed in angular 14) & smooth scroll to the last rule when adding new.

This commit is contained in:
Konstantina Galouni 2022-11-18 15:03:08 +02:00
parent 95152eef04
commit 4734c7b821
3 changed files with 17 additions and 9 deletions

View File

@ -19,14 +19,14 @@
<button type="submit" class="uk-hidden"></button> <button type="submit" class="uk-hidden"></button>
<div class="uk-grid uk-grid-small uk-grid-divider uk-flex-between" uk-grid> <div class="uk-grid uk-grid-small uk-grid-divider uk-flex-between" uk-grid>
<div class="uk-width-expand"> <div class="uk-width-expand">
<div class="uk-padding-small uk-padding-remove-left uk-overflow-auto" style="height: 200px; overflow-x: hidden; direction: rtl; scrollbar-gutter: stable;"> <div #container class="uk-padding-small uk-padding-remove-left uk-overflow-auto" style="height: 150px; overflow-x: hidden; direction: rtl; scrollbar-gutter: stable;">
<div style="direction: ltr;"> <div style="direction: ltr;">
<table class="uk-table uk-text-small uk-table-responsive uk-table-small uk-margin-remove"> <table class="uk-table uk-text-small uk-table-responsive uk-table-small uk-margin-remove">
<tr> <tr>
<td class="uk-text-bold uk-text-uppercase uk-width-1-3">Searching Fields</td> <td class="uk-text-bold uk-text-uppercase uk-width-1-3">Searching Fields</td>
<td class="uk-text-bold uk-text-uppercase uk-width-2-5">Terms</td> <td class="uk-text-bold uk-text-uppercase uk-width-2-5">Terms</td>
</tr> </tr>
<tr *ngFor="let selectedField of selectedFields; let i = index"> <tr *ngFor="let selectedField of selectedFields; let i = index; trackBy: trackByFn">
<td> <td>
<div class="uk-grid uk-flex-middle uk-child-width-1-2@m uk-child-width-1-1"> <div class="uk-grid uk-flex-middle uk-child-width-1-2@m uk-child-width-1-1">
<div input [(value)]="selectedField.id" inputClass="border-bottom" <div input [(value)]="selectedField.id" inputClass="border-bottom"

View File

@ -7,7 +7,7 @@ import {
OnDestroy, OnDestroy,
OnInit, OnInit,
Output, Output,
SimpleChanges SimpleChanges, ViewChild
} from '@angular/core'; } from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
@ -25,6 +25,7 @@ import {Option} from "../../sharedComponents/input/input.component";
templateUrl: 'advancedSearchForm.component.html' templateUrl: 'advancedSearchForm.component.html'
}) })
export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges { export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges {
@ViewChild("container") container;
@Input() entityType; @Input() entityType;
@Input() fieldIds: string[]; @Input() fieldIds: string[];
@Input() fieldIdsMap; @Input() fieldIdsMap;
@ -157,7 +158,9 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
} else { } else {
this.selectedFields.push(new AdvancedField(this.newFieldId, this.fieldIdsMap[this.newFieldId].param, this.fieldIdsMap[this.newFieldId].name, type, "", "and")); this.selectedFields.push(new AdvancedField(this.newFieldId, this.fieldIdsMap[this.newFieldId].param, this.fieldIdsMap[this.newFieldId].name, type, "", "and"));
} }
this.cdr.detectChanges();
this.container.nativeElement.scrollTo({top: this.container.nativeElement.scrollHeight, behavior: 'smooth'});
} }
removeField(index: number) { removeField(index: number) {
@ -210,4 +213,8 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
onlyIncludesSupported(index: number) { onlyIncludesSupported(index: number) {
return (this.selectedFields[index] && this.selectedFields[index].operatorId === 'or') || (this.selectedFields[index+1] && this.selectedFields[index+1].operatorId === 'or') return (this.selectedFields[index] && this.selectedFields[index].operatorId === 'or') || (this.selectedFields[index+1] && this.selectedFields[index+1].operatorId === 'or')
} }
trackByFn(index, item) {
return item.id;
}
} }

View File

@ -121,10 +121,10 @@
[attr.uk-sticky]="(stickyForm?'{animation:false;offset:100;top:90;cls-active:uk-active uk-sticky-below;cls-inactive:uk-sticky '+ [attr.uk-sticky]="(stickyForm?'{animation:false;offset:100;top:90;cls-active:uk-active uk-sticky-below;cls-inactive:uk-sticky '+
(usedBy != 'deposit' && usedBy != 'orcid' && (!customFilter || customFilter.queryFieldName != 'communityId') ? (usedBy != 'deposit' && usedBy != 'orcid' && (!customFilter || customFilter.queryFieldName != 'communityId') ?
' uk-position-relative ' :(' uk-section ' ))+'}':null)"> ' uk-position-relative ' :(' uk-section ' ))+'}':null)">
<div class="uk-background-norepeat uk-background-bottom-center uk-padding-remove-bottom uk-section uk-section-small" [ngClass]="searchForm.class"> <div class="uk-background-norepeat uk-background-bottom-center" [ngClass]="searchForm.class">
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<div *ngIf="showBreadcrumb" class="uk-container uk-container-large" [class.uk-light]="searchForm.dark"> <div *ngIf="showBreadcrumb" class="uk-container uk-container-large" [class.uk-light]="searchForm.dark">
<div class="uk-padding-small uk-padding-remove-horizontal"> <div class="uk-margin-top">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs> <breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div> </div>
</div> </div>
@ -132,7 +132,7 @@
<div class="uk-container uk-section uk-section-small uk-margin-bottom" id="searchForm"> <div class="uk-container uk-section uk-section-small uk-margin-bottom" id="searchForm">
<div class="uk-grid uk-flex uk-flex-middle uk-flex-center" uk-grid> <div class="uk-grid uk-flex uk-flex-middle uk-flex-center" uk-grid>
<div [class]="'uk-width-1-1'+(simpleView?' uk-width-auto@m' : '')"><div id="searchImage"></div></div> <div [class]="'uk-width-1-1'+(simpleView?' uk-width-auto@m' : '')"><div id="searchImage"></div></div>
<advanced-search-form class="uk-width-expand uk-padding uk-padding-remove-vertical" <advanced-search-form class="uk-width-expand uk-padding-remove-vertical"
[entityType]="entityType" [entityType]="entityType"
[fieldIds]="fieldIds" [fieldIds]="fieldIds"
[fieldIdsMap]="fieldIdsMap" [fieldIdsMap]="fieldIdsMap"
@ -156,7 +156,8 @@
</div> </div>
<schema2jsonld *ngIf="url" [URL]="url" type="search" [name]=pageTitleWithFilters <schema2jsonld *ngIf="url" [URL]="url" type="search" [name]=pageTitleWithFilters
[searchAction]=false [description]="metaDescription"></schema2jsonld> [searchAction]=false [description]="metaDescription"></schema2jsonld>
<div id="tm-main" [class.uk-margin-medium-top]="!includeOnlyResultsAndFilter" [class.uk-margin-top]="stickyForm"> <div id="tm-main" [class.uk-margin-medium-top]="!includeOnlyResultsAndFilter && properties.adminToolsPortalType != 'eosc'"
[class.uk-margin-top]="stickyForm || properties.adminToolsPortalType == 'eosc'">
<ng-template #loading> <ng-template #loading>
<loading [ngClass]="'uk-height-medium uk-display-block uk-margin-xlarge-top'"></loading> <loading [ngClass]="'uk-height-medium uk-display-block uk-margin-xlarge-top'"></loading>
</ng-template> </ng-template>
@ -212,7 +213,7 @@
search search
</a> </a>
</div> </div>
<div class="uk-grid uk-margin-large-top uk-margin-large-bottom" uk-grid> <div class="uk-grid uk-margin-medium-top uk-margin-large-bottom" uk-grid>
<div *ngIf="showRefine && (results.length > 0 <div *ngIf="showRefine && (results.length > 0
|| (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING)
|| (!hideFilters && || (!hideFilters &&