update advanced search form
This commit is contained in:
parent
b0e77b17a9
commit
68e0aa98a8
|
@ -17,117 +17,128 @@
|
||||||
<div [class.dark]="dark">
|
<div [class.dark]="dark">
|
||||||
<form (ngSubmit)="queryChanged()" class="uk-card uk-card-default uk-box-shadow-medium">
|
<form (ngSubmit)="queryChanged()" class="uk-card uk-card-default uk-box-shadow-medium">
|
||||||
<button type="submit" class="uk-hidden"></button>
|
<button type="submit" class="uk-hidden"></button>
|
||||||
<div class="uk-card-body uk-height-medium uk-overflow-auto">
|
<div class="uk-grid uk-grid-small uk-grid-divider uk-flex-between" uk-grid>
|
||||||
<table class="uk-table uk-text-small uk-table-responsive uk-table-small uk-margin-remove">
|
<div class="uk-width-expand">
|
||||||
<tr>
|
<div class="uk-padding-small uk-padding-remove-left uk-overflow-auto" style="height: 200px; overflow-x: hidden; direction: rtl; scrollbar-gutter: stable;">
|
||||||
<td class="uk-text-bold uk-text-uppercase uk-width-2-5">Searching Fields</td>
|
<div style="direction: ltr;">
|
||||||
<td class="uk-text-bold uk-text-uppercase uk-width-1-3">Terms</td>
|
<table class="uk-table uk-text-small uk-table-responsive uk-table-small uk-margin-remove">
|
||||||
</tr>
|
<tr>
|
||||||
<tr *ngFor="let selectedField of selectedFields; let i = index">
|
<td class="uk-text-bold uk-text-uppercase uk-width-1-3">Searching Fields</td>
|
||||||
<td>
|
<td class="uk-text-bold uk-text-uppercase uk-width-2-5">Terms</td>
|
||||||
<div class="uk-grid uk-flex-middle uk-child-width-1-2@m uk-child-width-1-1">
|
</tr>
|
||||||
<div input [(value)]="selectedField.id" inputClass="border-bottom"
|
<tr *ngFor="let selectedField of selectedFields; let i = index">
|
||||||
[options]="fieldIdsOptions" (valueChange)="fieldIdsChanged(i,selectedField.id)" type="select"></div>
|
<td>
|
||||||
<div input [(value)]="selectedField.includes" inputClass="border-bottom" [options]="getNotOperators(selectedField)" type="select"></div>
|
<div class="uk-grid uk-flex-middle uk-child-width-1-2@m uk-child-width-1-1">
|
||||||
</div>
|
<div input [(value)]="selectedField.id" inputClass="border-bottom"
|
||||||
<!-- <mat-select [(ngModel)]="selectedField.id" name="selectField_{{i}}" [disableOptionCentering]="true" class="matSelection" panelClass="matSelectionPanel"
|
[options]="fieldIdsOptions" (valueChange)="fieldIdsChanged(i,selectedField.id)" type="select"></div>
|
||||||
(ngModelChange)="fieldIdsChanged(i,selectedField.id)"><!–(click)="fieldIdsChanged(i)" –>
|
<div input [(value)]="selectedField.includes" inputClass="border-bottom" [options]="getNotOperators(selectedField)" type="select"></div>
|
||||||
<mat-option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}} </mat-option>
|
</div>
|
||||||
</mat-select>--></td>
|
<!-- <mat-select [(ngModel)]="selectedField.id" name="selectField_{{i}}" [disableOptionCentering]="true" class="matSelection" panelClass="matSelectionPanel"
|
||||||
<td *ngIf="selectedField.type == 'keyword' || selectedField.type == 'identifier'">
|
(ngModelChange)="fieldIdsChanged(i,selectedField.id)"><!–(click)="fieldIdsChanged(i)" –>
|
||||||
<div class="uk-inline uk-width-expand">
|
<mat-option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}} </mat-option>
|
||||||
<a *ngIf="selectedField.value.length > 0" class="uk-form-icon uk-form-icon-flip"
|
</mat-select>--></td>
|
||||||
(click)="selectedField.value = ''"
|
<td *ngIf="selectedField.type == 'keyword' || selectedField.type == 'identifier'">
|
||||||
uk-icon="icon: close"></a>
|
<div class="uk-inline uk-width-expand">
|
||||||
<input type="text" class="form-control uk-input"
|
<a *ngIf="selectedField.value.length > 0" class="uk-form-icon uk-form-icon-flip"
|
||||||
placeholder="Type keywords..."
|
(click)="selectedField.value = ''"
|
||||||
[(ngModel)]="selectedField.value" name="value[{{i}}]">
|
uk-icon="icon: close"></a>
|
||||||
</div>
|
<input type="text" class="form-control uk-input"
|
||||||
|
placeholder="Type keywords..."
|
||||||
|
[(ngModel)]="selectedField.value" name="value[{{i}}]">
|
||||||
</td>
|
</div>
|
||||||
<td *ngIf="selectedField.type == 'date'">
|
|
||||||
<date-filter [dateValue]=selectedField.dateValue [validDateFrom]=validDateFrom class="uk-width-expand"
|
|
||||||
[validDateTo]=validDateTo></date-filter>
|
</td>
|
||||||
</td>
|
<td *ngIf="selectedField.type == 'date'">
|
||||||
<td *ngIf=" selectedField.id && selectedField.type == 'vocabulary'">
|
<date-filter [dateValue]=selectedField.dateValue [validDateFrom]=validDateFrom class="uk-width-expand"
|
||||||
<static-autocomplete [properties]=properties *ngIf=" selectedField.id" [vocabularyId]=selectedField.param
|
[validDateTo]=validDateTo></date-filter>
|
||||||
[fieldId]=selectedField.id
|
</td>
|
||||||
[list]=this.fieldList[selectedField.id] [entityName]="entityType"
|
<td *ngIf=" selectedField.id && selectedField.type == 'vocabulary'">
|
||||||
[selectedValue]=selectedField.value [showSelected]=true
|
<static-autocomplete [properties]=properties *ngIf=" selectedField.id" [vocabularyId]=selectedField.param
|
||||||
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
[fieldId]=selectedField.id
|
||||||
[multipleSelections]=false
|
[list]=this.fieldList[selectedField.id] [entityName]="entityType"
|
||||||
(selectedValueChanged)="valueChanged($event,i)"
|
[selectedValue]=selectedField.value [showSelected]=true
|
||||||
(listUpdated)="listUpdated($event,selectedField.id)"
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
||||||
[id]="'autocomplete-'+i"></static-autocomplete>
|
[multipleSelections]=false
|
||||||
</td>
|
(selectedValueChanged)="valueChanged($event,i)"
|
||||||
<td *ngIf=" selectedField.id && selectedField.type == 'refine'" class="uk-width-1-3">
|
(listUpdated)="listUpdated($event,selectedField.id)"
|
||||||
<static-autocomplete [properties]=properties [list]=this.fieldList[selectedField.id]
|
[id]="'autocomplete-'+i"></static-autocomplete>
|
||||||
[fieldId]=selectedField.id [entityName]="entityType" [fieldName]=[selectedField.id]
|
</td>
|
||||||
[selectedValue]=selectedField.value [showSelected]=true
|
<td *ngIf=" selectedField.id && selectedField.type == 'refine'" class="uk-width-1-3">
|
||||||
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
<static-autocomplete [properties]=properties [list]=this.fieldList[selectedField.id]
|
||||||
[multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)"
|
[fieldId]=selectedField.id [entityName]="entityType" [fieldName]=[selectedField.id]
|
||||||
(listUpdated)="listUpdated($event,selectedField.id)"
|
[selectedValue]=selectedField.value [showSelected]=true
|
||||||
(updateValueLabel)="updatedValueLabel($event, i)"
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
||||||
[id]="'autocomplete-'+i"></static-autocomplete>
|
[multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)"
|
||||||
</td>
|
(listUpdated)="listUpdated($event,selectedField.id)"
|
||||||
<td *ngIf="selectedField.type == 'entity'">
|
(updateValueLabel)="updatedValueLabel($event, i)"
|
||||||
<entities-autocomplete [properties]=properties [fieldId]=selectedField.id [entityType]=selectedField.param
|
[id]="'autocomplete-'+i"></static-autocomplete>
|
||||||
[selectedValue]=selectedField.value [showSelected]=true
|
</td>
|
||||||
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
<td *ngIf="selectedField.type == 'entity'">
|
||||||
[multipleSelections]=false
|
<entities-autocomplete [properties]=properties [fieldId]=selectedField.id [entityType]=selectedField.param
|
||||||
(selectedValueChanged)="valueChanged($event,i)"
|
[selectedValue]=selectedField.value [showSelected]=true
|
||||||
(updateValueLabel)="updatedValueLabel($event, i)"
|
[placeHolderMessage]="'Search for '+selectedField.name" [title]="selectedField.name"
|
||||||
[id]="'autocomplete-'+i">
|
[multipleSelections]=false
|
||||||
</entities-autocomplete>
|
(selectedValueChanged)="valueChanged($event,i)"
|
||||||
</td>
|
(updateValueLabel)="updatedValueLabel($event, i)"
|
||||||
|
[id]="'autocomplete-'+i">
|
||||||
<td *ngIf="selectedField.type == 'boolean'" class="input-group">
|
</entities-autocomplete>
|
||||||
<span class="input-group-addon">
|
</td>
|
||||||
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
|
||||||
value="true">Yes<br>
|
<td *ngIf="selectedField.type == 'boolean'" class="input-group">
|
||||||
</span>
|
<span class="input-group-addon">
|
||||||
<span class="input-group-addon">
|
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
||||||
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
value="true">Yes<br>
|
||||||
value="false">No<br>
|
</span>
|
||||||
</span>
|
<span class="input-group-addon">
|
||||||
</td>
|
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param
|
||||||
<td class="uk-width-small">
|
value="false">No<br>
|
||||||
<div *ngIf="i+1 <selectedFields.length" [(value)]="selectedFields[i+1].operatorId" (valueChange)="fieldOperatorChanged(i+1, $event, $event)"
|
</span>
|
||||||
input [options]="operators" inputClass="border-bottom" type="select"></div>
|
</td>
|
||||||
<!-- <div *ngIf="i+1 <selectedFields.length && onlyAndSupported(i)">and</div>-->
|
<td class="uk-width-small">
|
||||||
</td>
|
<div *ngIf="i+1 <selectedFields.length" [(value)]="selectedFields[i+1].operatorId" (valueChange)="fieldOperatorChanged(i+1, $event, $event)"
|
||||||
<td [class.uk-invisible]="selectedFields.length === 1">
|
input [options]="operators" inputClass="border-bottom" type="select"></div>
|
||||||
<button class="uk-icon uk-close"
|
</td>
|
||||||
(click)="removeField(i)">
|
<td [class.uk-invisible]="selectedFields.length === 1">
|
||||||
<icon name="close" [flex]="true" [ratio]="1.2"></icon>
|
<button class="uk-icon uk-close"
|
||||||
</button>
|
(click)="removeField(i)">
|
||||||
</td>
|
<icon name="close" [flex]="true" [ratio]="1.2"></icon>
|
||||||
</tr>
|
</button>
|
||||||
</table>
|
</td>
|
||||||
<div class="uk-margin-small-top">
|
</tr>
|
||||||
<button type="button" (click)="addField()" class="uk-button uk-button-link uk-flex uk-flex-middle">
|
</table>
|
||||||
<icon name="add" [flex]="true"></icon>
|
<!-- <div class="uk-margin-small-top">
|
||||||
<span class="uk-margin-small-left">Add rule</span>
|
<button type="button" (click)="addField()" class="uk-button uk-button-link uk-flex uk-flex-middle">
|
||||||
</button>
|
<icon name="add" [flex]="true"></icon>
|
||||||
</div>
|
<span class="uk-margin-small-left">Add rule</span>
|
||||||
<div class=" uk-text-center uk-margin-small-top">
|
</button>
|
||||||
<div *ngIf="!validDateFrom && validDateTo" class="uk-text-danger">
|
</div> -->
|
||||||
Please check your <u>from</u> date
|
<div class=" uk-text-center uk-margin-small-top">
|
||||||
</div>
|
<div *ngIf="!validDateFrom && validDateTo" class="uk-text-danger">
|
||||||
<div *ngIf="!validDateTo && validDateFrom" class="uk-text-danger">
|
Please check your <u>from</u> date
|
||||||
Please check your <u>to</u> date
|
</div>
|
||||||
</div>
|
<div *ngIf="!validDateTo && validDateFrom" class="uk-text-danger">
|
||||||
<div *ngIf="!validDateFrom && !validDateTo" class="uk-text-danger">
|
Please check your <u>to</u> date
|
||||||
Please check your dates
|
</div>
|
||||||
</div>
|
<div *ngIf="!validDateFrom && !validDateTo" class="uk-text-danger">
|
||||||
</div>
|
Please check your dates
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="uk-flex uk-flex-column uk-flex-center uk-margin-right">
|
||||||
|
<button type="button" (click)="addField()" class="uk-icon-button uk-icon-button-xsmall uk-flex uk-flex-middle">
|
||||||
|
<icon name="add" [flex]="true"></icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<a (click)="queryChanged()" class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light">
|
<a (click)="queryChanged()" class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light">
|
||||||
<button class="uk-button uk-button-text">
|
<button class="uk-button uk-button-text">
|
||||||
<span class="uk-flex uk-flex-middle">
|
<span class="uk-flex uk-flex-middle">
|
||||||
<icon name="search" [flex]="true"></icon>
|
<icon name="search" [flex]="true"></icon>
|
||||||
<span class="uk-margin-small-left">Search</span>
|
<span class="uk-margin-small-left">Search</span>
|
||||||
|
<span *ngIf="selectedFields.length >= 2" class="uk-margin-xsmall-left">({{selectedFields.length}} Rules)</span>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-position-relative">
|
<div class="uk-position-relative">
|
||||||
<div class="uk-container uk-container-small 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 uk-padding-remove-vertical"
|
||||||
|
|
Loading…
Reference in New Issue