2020-02-13 15:44:51 +01:00
|
|
|
<div *ngIf="!simpleView">
|
|
|
|
<a *ngIf="simpleSearchLink && simpleSearchLink.length > 0" routerLinkActive="router-link-active"
|
|
|
|
[routerLink]=simpleSearchLink style="z-index:1;"
|
|
|
|
[class]="(isDisabled)?'uk-float-right uk-disabled uk-link-muted portal-link uk-margin-right ':'uk-float-right portal-link uk-margin-right '">Quick search
|
|
|
|
</a>
|
|
|
|
<div class="uk-h5 uk-margin-small-bottom">
|
|
|
|
Advanced search in
|
|
|
|
<entities-selection [simpleView]="false" [currentEntity]="entityType"
|
|
|
|
[properties]="properties"></entities-selection>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<form *ngIf="!simpleView"
|
2020-02-25 16:40:56 +01:00
|
|
|
[class]="((isDisabled )?'uk-disabled ':'')
|
|
|
|
+' advancedSearchForm uk-tile uk-padding-small uk-margin-medium-bottom'">
|
2020-02-13 15:44:51 +01:00
|
|
|
<div>
|
|
|
|
|
|
|
|
|
2020-02-11 12:58:51 +01:00
|
|
|
<quick-selections [resultTypes]="resultTypes" (typeChange)="queryChanged()" [isDisabled]="isDisabled"
|
|
|
|
[quickFilter]="quickFilter" [QFselected]="(quickFilter)?quickFilter.selected:null"
|
2020-02-13 15:44:51 +01:00
|
|
|
[properties]="properties"
|
2020-02-11 12:58:51 +01:00
|
|
|
></quick-selections>
|
2020-02-25 16:40:56 +01:00
|
|
|
<hr *ngIf="resultTypes || quickFilter">
|
|
|
|
<table class=" uk-table 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">Term</td>
|
|
|
|
</tr>
|
2020-01-31 16:12:51 +01:00
|
|
|
<tr *ngFor="let selectedField of selectedFields; let i = index" class="-row ">
|
|
|
|
<td><select [(ngModel)]="selectedField.id" name="selectField_{{i}}"
|
|
|
|
(ngModelChange)="fieldIdsChanged(i,selectedField.id)"><!--(click)="fieldIdsChanged(i)" -->
|
|
|
|
<option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}} </option>
|
|
|
|
</select></td>
|
2020-02-25 16:40:56 +01:00
|
|
|
<td *ngIf="selectedField.type == 'keyword'">
|
2020-03-04 13:42:52 +01:00
|
|
|
<div class="uk-inline uk-width-expand">
|
2020-02-25 16:40:56 +01:00
|
|
|
<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"
|
|
|
|
placeholder="Type keywords..."
|
|
|
|
[(ngModel)]="selectedField.value" name="value[{{i}}]">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
2020-01-31 16:12:51 +01:00
|
|
|
<td *ngIf="selectedField.type == 'date'">
|
2020-02-25 16:40:56 +01:00
|
|
|
<date-filter [dateValue]=selectedField.dateValue [validDateFrom]=validDateFrom
|
|
|
|
[validDateTo]=validDateTo></date-filter>
|
2020-01-31 16:12:51 +01:00
|
|
|
</td>
|
|
|
|
<td *ngIf=" selectedField.id && selectedField.type == 'vocabulary'">
|
2020-02-25 16:40:56 +01:00
|
|
|
<static-autocomplete [properties]=properties *ngIf=" selectedField.id" [vocabularyId]=selectedField.param
|
2020-01-31 16:12:51 +01:00
|
|
|
[fieldId]=selectedField.id
|
2020-02-25 16:40:56 +01:00
|
|
|
[list]=this.fieldList[selectedField.id] [entityName]="entityType"
|
2020-01-31 16:12:51 +01:00
|
|
|
[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">
|
2020-02-25 16:40:56 +01:00
|
|
|
<static-autocomplete [properties]=properties [list]=this.fieldList[selectedField.id]
|
2020-01-31 16:12:51 +01:00
|
|
|
[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)"></static-autocomplete>
|
|
|
|
</td>
|
|
|
|
<td *ngIf="selectedField.type == 'entity'">
|
2020-02-25 16:40:56 +01:00
|
|
|
<entities-autocomplete [properties]=properties [fieldId]=selectedField.id [entityType]=selectedField.param
|
2020-01-31 16:12:51 +01:00
|
|
|
[selectedValue]=selectedField.value [showSelected]=true
|
|
|
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
|
|
|
[multipleSelections]=false
|
|
|
|
(selectedValueChanged)="valueChanged($event,i)"
|
|
|
|
(listUpdated)="listUpdated($event,selectedField.id)">
|
|
|
|
</entities-autocomplete>
|
|
|
|
</td>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2020-01-31 16:12:51 +01:00
|
|
|
<td *ngIf="selectedField.type == 'boolean'" class="input-group">
|
2017-12-19 13:53:46 +01:00
|
|
|
<span class="input-group-addon">
|
2020-01-31 16:12:51 +01:00
|
|
|
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
|
|
|
value="true">Yes<br>
|
2017-12-19 13:53:46 +01:00
|
|
|
</span>
|
2020-01-31 16:12:51 +01:00
|
|
|
<span class="input-group-addon">
|
|
|
|
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
|
|
|
value="false">No<br>
|
2018-07-26 12:09:06 +02:00
|
|
|
</span>
|
2020-01-31 16:12:51 +01:00
|
|
|
</td>
|
2020-02-25 16:40:56 +01:00
|
|
|
<td style="min-width: 75px;"><select *ngIf="i+1 <selectedFields.length"
|
2020-03-04 13:42:52 +01:00
|
|
|
[(ngModel)]="selectedFields[i+1].operatorId"
|
2020-02-25 16:40:56 +01:00
|
|
|
name="selectOp_{{i}}">
|
2020-03-04 13:42:52 +01:00
|
|
|
<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}}</option>
|
2020-02-25 16:40:56 +01:00
|
|
|
</select>
|
|
|
|
<div *ngIf="i == selectedFields.length-1 " class=" uk-text-right" style="margin-top: 55px;">
|
|
|
|
<span class="uk-text-muted uk-text-uppercase uk-margin-small-right " > Add rule</span>
|
|
|
|
</div>
|
|
|
|
</td>
|
2020-01-31 16:12:51 +01:00
|
|
|
<td class=" ">
|
2020-02-25 16:40:56 +01:00
|
|
|
<span type="button" class="uk-icon-button portal-button-reverse "
|
2020-01-31 16:12:51 +01:00
|
|
|
(click)="removeField(i)">
|
2020-02-25 16:40:56 +01:00
|
|
|
<span uk-icon="minus"> </span>
|
2017-12-19 13:53:46 +01:00
|
|
|
</span>
|
2020-02-25 16:40:56 +01:00
|
|
|
<div *ngIf="i == selectedFields.length-1 " class="uk-margin-small-top">
|
|
|
|
<span type="button"
|
|
|
|
class="uk-icon-button portal-button "
|
2020-01-31 16:12:51 +01:00
|
|
|
(click)="addField()">
|
2020-02-25 16:40:56 +01:00
|
|
|
<span uk-icon="plus">
|
2018-07-19 12:52:29 +02:00
|
|
|
</span>
|
2020-02-25 16:40:56 +01:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</td>
|
2020-01-31 16:12:51 +01:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<div class=" uk-text-center">
|
|
|
|
<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
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-25 16:40:56 +01:00
|
|
|
<button (click)="queryChanged()" type="submit"
|
|
|
|
class=" uk-button uk-padding uk-padding-remove-top uk-padding-remove-bottom portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom " style="position: absolute;bottom: -19px;left: 45%;"> Search
|
|
|
|
</button>
|
2020-01-31 16:12:51 +01:00
|
|
|
</div>
|
2020-02-11 12:58:51 +01:00
|
|
|
</form>
|
2020-02-13 15:44:51 +01:00
|
|
|
|
|
|
|
<div *ngIf="simpleView">
|
2020-02-24 14:33:34 +01:00
|
|
|
<form class=" uk-margin-medium-bottom uk-margin-top ">
|
2020-02-13 15:44:51 +01:00
|
|
|
<div class="uk-grid">
|
2020-02-25 16:40:56 +01:00
|
|
|
<div [class]="(entitiesSelection)?'':'uk-width-medium@m uk-width-small@s'">
|
|
|
|
<entities-selection *ngIf="entitiesSelection" [simpleView]="true" [currentEntity]="entityType"
|
2020-02-13 15:44:51 +01:00
|
|
|
[properties]="properties"
|
|
|
|
(selectionChange)=" simpleEntityChanged($event)"></entities-selection>
|
|
|
|
</div>
|
|
|
|
<div [class]="((resultTypes || quickFilter)?'quickSelectionsBox':'')+' uk-padding-remove-left'">
|
|
|
|
<div class="uk-inline">
|
|
|
|
<a *ngIf="selectedFields[0].value.length > 0" class="uk-form-icon uk-form-icon-flip"
|
|
|
|
(click)="selectedFields[0].value = ''"
|
|
|
|
uk-icon="icon: close"></a>
|
2020-02-25 16:40:56 +01:00
|
|
|
<input type="text" class="uk-input uk-width-xlarge@l uk-width-large@m uk-width-medium"
|
2020-02-13 15:44:51 +01:00
|
|
|
[placeholder]="formPlaceholderText" aria-describedby="sizing-addon2"
|
|
|
|
[(ngModel)]="selectedFields[0].value" name="keyword">
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<quick-selections [resultTypes]="resultTypes" (typeChange)="queryChanged()" [isDisabled]="isDisabled"
|
|
|
|
[quickFilter]="quickFilter" [QFselected]="(quickFilter)?quickFilter.selected:null"
|
|
|
|
[properties]="properties">
|
|
|
|
</quick-selections>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="uk-padding-remove-left">
|
|
|
|
<button (click)="simpleKeywordChanged(null)" type="submit"
|
|
|
|
class=" uk-button portal-button uk-margin-small-left uk-text-bold uk-padding uk-padding-remove-top uk-padding-remove-bottom">
|
|
|
|
Search
|
|
|
|
</button>
|
2020-02-25 16:40:56 +01:00
|
|
|
<div class="uk-margin-small-top" *ngIf="showAdvancedSearchLink">
|
2020-02-19 16:35:48 +01:00
|
|
|
<a *ngIf ="this.entityType == this.selectedEntity && advancedSearchLink" routerLinkActive="router-link-active"
|
2020-02-13 15:44:51 +01:00
|
|
|
[routerLink]="advancedSearchLink" style="z-index:1;" [queryParams]="advancedSearchLinkParameters"
|
|
|
|
[class]="(isDisabled)?' uk-disabled uk-link-muted portal-link uk-margin-left ':' portal-link uk-margin-left '">Advanced search
|
|
|
|
</a>
|
2020-02-19 16:35:48 +01:00
|
|
|
<a *ngIf ="this.entityType != this.selectedEntity && selectedEntityAdvancedUrl " routerLinkActive="router-link-active"
|
2020-02-13 15:44:51 +01:00
|
|
|
[routerLink]="selectedEntityAdvancedUrl" style="z-index:1;"
|
|
|
|
[queryParams]="{q:this.selectedFields[0].value,op:'and'}"
|
|
|
|
[class]="(isDisabled)?' uk-disabled uk-link-muted portal-link uk-margin-left ':' portal-link uk-margin-left '">Advanced search
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|