2022-04-18 10:29:14 +02:00
|
|
|
<ng-container *ngIf="!simpleView">
|
2022-04-19 01:09:42 +02:00
|
|
|
<div class="uk-margin-small-bottom uk-grid uk-grid-small uk-flex-middle" uk-grid>
|
2022-05-19 11:14:28 +02:00
|
|
|
<div class="uk-width-large@m uk-width-2-5@xl uk-width-1-1 uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
|
2022-04-18 13:43:33 +02:00
|
|
|
<span class="uk-text-small" [class.uk-light]="dark">Advanced search in
|
|
|
|
<span *ngIf="disableSelect" class="uk-text-small uk-text-bold" [class.uk-light]="dark">{{entities.getLabel(entityType)}}</span>
|
|
|
|
</span>
|
|
|
|
<entities-selection #entities [class.uk-hidden]="disableSelect" class="uk-width-expand uk-margin-small-left" [simpleView]="false"
|
2022-04-18 10:29:14 +02:00
|
|
|
[currentEntity]="entityType" [customFilter]="customFilter" (disableSelectEmitter)="disableSelectChange($event)"></entities-selection>
|
|
|
|
</div>
|
|
|
|
<div class="uk-width-expand uk-text-small uk-flex uk-flex-center uk-flex-right@m" [class.uk-light]="dark">
|
|
|
|
<a *ngIf="showSwitchSearchLink && simpleSearchLink && simpleSearchLink.length > 0"
|
|
|
|
[routerLink]=simpleSearchLink
|
|
|
|
[queryParams]="customFilter?customFilter.getParameters():{}"
|
|
|
|
[ngClass]="(isDisabled)?'uk-disabled uk-link-muted':null">Simple Search</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-18 13:43:33 +02:00
|
|
|
<div class="uk-card uk-card-default uk-box-shadow-medium" [class.dark]="dark">
|
2022-04-19 01:09:42 +02:00
|
|
|
<div class="uk-card-body uk-height-medium uk-overflow-auto">
|
2022-04-19 11:33:52 +02:00
|
|
|
<table class="uk-table uk-table-middle uk-table-responsive uk-table-small uk-margin-remove">
|
|
|
|
<tr>
|
|
|
|
<td class="uk-text-muted uk-text-uppercase">Field to search</td>
|
|
|
|
<td class="uk-text-muted uk-text-uppercase uk-width-1-2">Term</td>
|
|
|
|
</tr>
|
|
|
|
<tr *ngFor="let selectedField of selectedFields; let i = index">
|
|
|
|
<td><mat-select [(ngModel)]="selectedField.id" name="selectField_{{i}}" [disableOptionCentering]="true" class="matSelection" panelClass="matSelectionPanel"
|
|
|
|
(ngModelChange)="fieldIdsChanged(i,selectedField.id)"><!--(click)="fieldIdsChanged(i)" -->
|
|
|
|
<mat-option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}} </mat-option>
|
|
|
|
</mat-select></td>
|
|
|
|
<td *ngIf="selectedField.type == 'keyword' || selectedField.type == 'identifier'">
|
|
|
|
<div class="uk-inline uk-width-expand">
|
|
|
|
<a *ngIf="selectedField.value.length > 0" class="uk-form-icon uk-form-icon-flip"
|
|
|
|
(click)="selectedField.value = ''"
|
|
|
|
uk-icon="icon: close"></a>
|
|
|
|
<input type="text" class="form-control uk-input"
|
|
|
|
placeholder="Type keywords..."
|
|
|
|
[(ngModel)]="selectedField.value" name="value[{{i}}]">
|
|
|
|
</div>
|
2020-02-13 15:44:51 +01:00
|
|
|
|
|
|
|
|
2022-04-19 11:33:52 +02:00
|
|
|
</td>
|
|
|
|
<td *ngIf="selectedField.type == 'date'">
|
|
|
|
<date-filter [dateValue]=selectedField.dateValue [validDateFrom]=validDateFrom class="uk-width-expand"
|
|
|
|
[validDateTo]=validDateTo></date-filter>
|
|
|
|
</td>
|
|
|
|
<td *ngIf=" selectedField.id && selectedField.type == 'vocabulary'">
|
|
|
|
<static-autocomplete [properties]=properties *ngIf=" selectedField.id" [vocabularyId]=selectedField.param
|
|
|
|
[fieldId]=selectedField.id
|
|
|
|
[list]=this.fieldList[selectedField.id] [entityName]="entityType"
|
|
|
|
[selectedValue]=selectedField.value [showSelected]=true
|
|
|
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
|
|
|
[multipleSelections]=false
|
|
|
|
(selectedValueChanged)="valueChanged($event,i)"
|
|
|
|
(listUpdated)="listUpdated($event,selectedField.id)"></static-autocomplete>
|
|
|
|
</td>
|
|
|
|
<td *ngIf=" selectedField.id && selectedField.type == 'refine'" class="uk-width-1-3">
|
|
|
|
<static-autocomplete [properties]=properties [list]=this.fieldList[selectedField.id]
|
|
|
|
[fieldId]=selectedField.id [entityName]="entityType" [fieldName]=[selectedField.id]
|
|
|
|
[selectedValue]=selectedField.value [showSelected]=true
|
|
|
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
|
|
|
[multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)"
|
|
|
|
(listUpdated)="listUpdated($event,selectedField.id)"
|
|
|
|
(updateValueLabel)="updatedValueLabel($event, i)"></static-autocomplete>
|
|
|
|
</td>
|
|
|
|
<td *ngIf="selectedField.type == 'entity'">
|
|
|
|
<entities-autocomplete [properties]=properties [fieldId]=selectedField.id [entityType]=selectedField.param
|
|
|
|
[selectedValue]=selectedField.value [showSelected]=true
|
|
|
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
|
|
|
[multipleSelections]=false
|
|
|
|
(selectedValueChanged)="valueChanged($event,i)"
|
|
|
|
(updateValueLabel)="updatedValueLabel($event, i)">
|
|
|
|
</entities-autocomplete>
|
|
|
|
</td>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2022-04-19 11:33:52 +02:00
|
|
|
<td *ngIf="selectedField.type == 'boolean'" class="input-group">
|
|
|
|
<span class="input-group-addon">
|
|
|
|
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
|
|
|
value="true">Yes<br>
|
2020-02-25 16:40:56 +01:00
|
|
|
</span>
|
2022-04-19 11:33:52 +02:00
|
|
|
<span class="input-group-addon">
|
|
|
|
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
|
|
|
value="false">No<br>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td style="min-width: 75px;"><mat-select *ngIf="i+1 <selectedFields.length"
|
|
|
|
[(ngModel)]="selectedFields[i+1].operatorId"
|
|
|
|
name="selectOp_{{i}}" [disableOptionCentering]="true" class="matSelection uk-input" panelClass="matSelectionPanel">
|
|
|
|
<mat-option *ngFor="let op of operators" (change)="fieldOperatorChanged(i+1, op.id, op.id)"
|
|
|
|
(click)="fieldOperatorChanged(i+1, op.id, op.id)" [value]="op.id">{{op.id}}</mat-option>
|
|
|
|
</mat-select>
|
|
|
|
</td>
|
|
|
|
<td [class.uk-invisible]="selectedFields.length === 1">
|
|
|
|
<button class="uk-icon uk-close"
|
|
|
|
(click)="removeField(i)">
|
|
|
|
<icon name="close" [flex]="true" [ratio]="1.5"></icon>
|
|
|
|
</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<div class="uk-margin-small-top">
|
|
|
|
<button (click)="addField()" class="uk-button uk-button-link uk-flex uk-flex-middle">
|
|
|
|
<icon name="add" [flex]="true"></icon>
|
|
|
|
<span class="uk-margin-small-left">Add rule</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class=" uk-text-center uk-margin-small-top">
|
|
|
|
<div *ngIf="!validDateFrom && validDateTo" class="uk-text-danger">
|
|
|
|
Please check your <u>from</u> date
|
|
|
|
</div>
|
|
|
|
<div *ngIf="!validDateTo && validDateFrom" class="uk-text-danger">
|
|
|
|
Please check your <u>to</u> date
|
|
|
|
</div>
|
|
|
|
<div *ngIf="!validDateFrom && !validDateTo" class="uk-text-danger">
|
|
|
|
Please check your dates
|
2022-04-18 10:29:14 +02:00
|
|
|
</div>
|
2022-04-19 11:33:52 +02:00
|
|
|
</div>
|
2022-04-19 01:09:42 +02:00
|
|
|
</div>
|
|
|
|
<a class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light">
|
|
|
|
<button (click)="queryChanged()" class="uk-button uk-button-text">
|
|
|
|
<span class="uk-flex uk-flex-middle">
|
|
|
|
<icon name="search" [flex]="true"></icon>
|
|
|
|
<span class="uk-margin-small-left">Search</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</a>
|
2022-04-15 23:49:35 +02:00
|
|
|
</div>
|
2022-04-18 10:29:14 +02:00
|
|
|
</ng-container>
|
|
|
|
<div *ngIf="simpleView" class="uk-flex uk-flex-center uk-flex-wrap">
|
|
|
|
<div class="uk-width-xlarge@l uk-width-large">
|
|
|
|
<div class="uk-margin-small-bottom uk-text-small uk-flex uk-flex-right" [class.uk-light]="dark" *ngIf="showSwitchSearchLink">
|
|
|
|
<a *ngIf ="this.entityType !='all' && this.entityType == this.selectedEntity && advancedSearchLink"
|
|
|
|
[routerLink]="advancedSearchLink" [queryParams]="advancedSearchLinkParameters"
|
|
|
|
[ngClass]="(isDisabled)?'uk-disabled uk-link-muted':null">Advanced search
|
|
|
|
</a>
|
|
|
|
<a *ngIf =" this.entityType !='all' && this.entityType != this.selectedEntity && selectedEntityAdvancedUrl "
|
|
|
|
[routerLink]="selectedEntityAdvancedUrl"
|
|
|
|
[queryParams]="{q:this.selectedFields[0].value,op:'and'}"
|
|
|
|
[ngClass]="(isDisabled)?'uk-disabled uk-link-muted':null">Advanced search
|
|
|
|
</a>
|
2022-05-13 14:46:54 +02:00
|
|
|
<a *ngIf =" this.entityType =='all'"
|
|
|
|
[routerLink]="properties.searchLinkToAdvancedResults"
|
|
|
|
[queryParams]="advancedSearchLinkParameters"
|
|
|
|
[ngClass]="(isDisabled)?'uk-disabled uk-link-muted':null">Advanced search
|
|
|
|
</a>
|
2022-04-18 10:29:14 +02:00
|
|
|
</div>
|
|
|
|
<div class="uk-flex uk-flex-center uk-child-width-1-1">
|
|
|
|
<ng-container *ngIf="entitiesSelection">
|
|
|
|
<advanced-search-input [class.uk-hidden]="disableSelect" [dark]="dark" [disabled]="isDisabled" (searchEmitter)="simpleKeywordChanged()">
|
|
|
|
<entities-selection [simpleView]="true" [currentEntity]="entityType"
|
|
|
|
(selectionChange)="simpleEntityChanged($event)" (disableSelectEmitter)="disableSelectChange($event)"
|
|
|
|
[onChangeNavigate]="true" [customFilter]="customFilter"></entities-selection>
|
|
|
|
<div input placeholder="Scholary works" [hint]="formPlaceholderText" [(value)]="selectedFields[0].value"></div>
|
|
|
|
</advanced-search-input>
|
|
|
|
<div *ngIf="selectedFields[0] && disableSelect" search-input [disabled]="isDisabled" [(value)]="selectedFields[0].value"
|
|
|
|
[placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()"></div>
|
|
|
|
</ng-container>
|
|
|
|
<div *ngIf="selectedFields[0] && !entitiesSelection" search-input [disabled]="isDisabled" [(value)]="selectedFields[0].value"
|
2022-04-16 00:10:34 +02:00
|
|
|
[placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()"></div>
|
2022-04-18 10:29:14 +02:00
|
|
|
</div>
|
2022-04-15 23:49:35 +02:00
|
|
|
</div>
|
2020-02-13 15:44:51 +01:00
|
|
|
</div>
|