Merge remote-tracking branch 'origin/Development' into Development
This commit is contained in:
commit
54b142000c
|
@ -49,7 +49,7 @@ public class TagController extends BaseController {
|
|||
if (this.getApiContext().getOperationsContext().getElasticRepository().getDatasetRepository().exists()) {
|
||||
DatasetCriteria criteria = new DatasetCriteria();
|
||||
criteria.setHasTags(true);
|
||||
List<Tag> tags = this.getApiContext().getOperationsContext().getElasticRepository().getDatasetRepository().query(criteria).stream().map(Dataset::getTags).flatMap(Collection::stream).filter(StreamDistinctBy.distinctByKey(Tag::getId)).filter(tag -> tag.getName().startsWith(query)).collect(Collectors.toList());
|
||||
List<Tag> tags = this.getApiContext().getOperationsContext().getElasticRepository().getDatasetRepository().query(criteria).stream().map(Dataset::getTags).flatMap(Collection::stream).filter(StreamDistinctBy.distinctByKey(Tag::getId)).filter(tag -> tag.getName().toLowerCase().startsWith(query.toLowerCase())).collect(Collectors.toList());
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<Tag>>().payload(tags).status(ApiMessageCode.NO_MESSAGE));
|
||||
} else {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class LicenseManager {
|
|||
|
||||
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
licenseModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, LicenseModel.class)).collect(Collectors.toList()));
|
||||
licenseModels = licenseModels.stream().filter(licenseModel -> licenseModel.getName().contains(query)).collect(Collectors.toList());
|
||||
licenseModels = licenseModels.stream().filter(licenseModel -> licenseModel.getName().toLowerCase().contains(query.toLowerCase())).collect(Collectors.toList());
|
||||
return licenseModels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class LocalFetchManager {
|
|||
public List<LocalFetchModel> getCurrency(String query) throws Exception {
|
||||
List<Map<String, String>> data = localFetcher.retrieveCurrency();
|
||||
List<LocalFetchModel> result = data.stream().map(entry -> new LocalFetchModel(entry.get("name"), entry.get("value"))).collect(Collectors.toList());
|
||||
result = result.stream().filter(localFetchModel -> localFetchModel.getValue() != null).filter(StreamDistinctBy.distinctByKey(LocalFetchModel::getValue)).filter(localFetchModel -> localFetchModel.getName().contains(query)).collect(Collectors.toList());
|
||||
result = result.stream().filter(localFetchModel -> localFetchModel.getValue() != null).filter(StreamDistinctBy.distinctByKey(LocalFetchModel::getValue)).filter(localFetchModel -> localFetchModel.getName().toLowerCase().contains(query.toLowerCase())).collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<div class="row multiple-auto-complete" ngForm>
|
||||
<!-- style="width: calc(100% - 28px) !important;"-->
|
||||
<mat-chip-list #chipList ngDefaultControl>
|
||||
<!-- style="width: calc(100%) !important;"-->
|
||||
<mat-chip-list #chipList ngDefaultControl style="width: 100% !important;">
|
||||
<ng-container *ngIf="value as values">
|
||||
<mat-chip *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable" [ngClass]="computeClass(value)">
|
||||
<ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem">
|
||||
|
@ -11,22 +9,23 @@
|
|||
</ng-container>
|
||||
</mat-chip>
|
||||
</ng-container>
|
||||
<!-- <div style="height: 0 !important; width: calc(100% - 28px) !important; visibility: hidden !important;" matAutocompleteOrigin #origin="matAutocompleteOrigin"></div>-->
|
||||
<!-- <input matInput #autocompleteInput class="col" [class.hide-placeholder]="hidePlaceholder" [name]="id" autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)">-->
|
||||
<input matInput #autocompleteInput class="col"
|
||||
style="width: calc(100% - 8px) !important;"
|
||||
[class.hide-placeholder]="hidePlaceholder" [name]="id"
|
||||
autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger"
|
||||
[placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue"
|
||||
(keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()"
|
||||
(blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes"
|
||||
[matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur"
|
||||
(matChipInputTokenEnd)="_addItem($event)"
|
||||
[matAutocompleteConnectedTo]="origin">
|
||||
<!-- The attribute autocomplete="nope", set by downshift, is ignored in Chrome 67 and Opera 54 (latest at the time of writing)
|
||||
<input matInput #autocompleteInput class="col" [name]="id" autocomplete="nope" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)"> -->
|
||||
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>arrow_drop_down</mat-icon>
|
||||
<div style="height: 0 !important; width: 100% !important; visibility: hidden !important;" matAutocompleteOrigin #origin="matAutocompleteOrigin"></div>
|
||||
</mat-chip-list>
|
||||
<input matInput #autocompleteInput class="col" [class.hide-placeholder]="hidePlaceholder" [name]="id" autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)">
|
||||
<!-- <input matInput #autocompleteInput class="col"-->
|
||||
<!-- style="width: calc(100% - 28px) !important;"-->
|
||||
<!-- [class.hide-placeholder]="hidePlaceholder" [name]="id"-->
|
||||
<!-- autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger"-->
|
||||
<!-- [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue"-->
|
||||
<!-- (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()"-->
|
||||
<!-- (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes"-->
|
||||
<!-- [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur"-->
|
||||
<!-- (matChipInputTokenEnd)="_addItem($event)"-->
|
||||
<!-- [matAutocompleteConnectedTo]="origin">-->
|
||||
<!-- The attribute autocomplete="nope", set by downshift, is ignored in Chrome 67 and Opera 54 (latest at the time of writing)
|
||||
<input matInput #autocompleteInput class="col" [name]="id" autocomplete="nope" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)"> -->
|
||||
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>arrow_drop_down</mat-icon>
|
||||
|
||||
<mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
|
||||
<span *ngIf="_groupedItems">
|
||||
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
||||
|
@ -36,12 +35,17 @@
|
|||
item: item
|
||||
}"></ng-template>
|
||||
<div *ngIf="!_optionTemplate(item)" class="d-flex">
|
||||
<div class="title-fn">
|
||||
<!-- <div class="title-fn-inner"> <!–remove this if you want to see all the description –>-->
|
||||
<span>{{_titleFn(item)}}</span>
|
||||
<br *ngIf="_subtitleFn(item)">
|
||||
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
|
||||
<!-- </div>-->
|
||||
<div class="title-subtitle-fn">
|
||||
<div class="title-fn">
|
||||
<div class="title-fn-inner">
|
||||
<span *ngIf="!_optionTemplate(item)">{{_titleFn(item)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="_subtitleFn(item)" class="subtitle-fn">
|
||||
<div class="subtitle-fn-inner">
|
||||
<small [innerHTML]="_subtitleFn(item)"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span *ngIf="popupItemActionIcon" class="option-icon" (click)="_optionActionClick(item, $event)"><mat-icon>{{popupItemActionIcon}}</mat-icon></span>
|
||||
</div>
|
||||
|
@ -49,29 +53,34 @@
|
|||
</mat-optgroup>
|
||||
</span>
|
||||
<span *ngIf="!_groupedItems">
|
||||
<div *ngIf="_items | async as autocompleteItems; else loading">
|
||||
<ng-container *ngIf="autocompleteItems.length; else noItems">
|
||||
<ng-container *ngIf="_items | async as autocompleteItems; else loading">
|
||||
<ng-container *ngIf="autocompleteItems.length">
|
||||
<mat-option *ngFor="let item of autocompleteItems" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
|
||||
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
|
||||
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
|
||||
item: item
|
||||
}"></ng-template>
|
||||
<div *ngIf="!_optionTemplate(item)" class="d-flex">
|
||||
<div class="title-fn">
|
||||
<div class="title-fn-inner"> <!--remove this if you want to see all the description -->
|
||||
<span *ngIf="!_optionTemplate(item)">{{_titleFn(item)}}</span>
|
||||
<br *ngIf="_subtitleFn(item)">
|
||||
<small *ngIf="_subtitleFn(item)" [innerHTML]="_subtitleFn(item)"></small>
|
||||
<div class="title-subtitle-fn">
|
||||
<div class="title-fn">
|
||||
<div class="title-fn-inner">
|
||||
<span *ngIf="!_optionTemplate(item)">{{_titleFn(item)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="_subtitleFn(item)" class="subtitle-fn">
|
||||
<div class="subtitle-fn-inner">
|
||||
<small [innerHTML]="_subtitleFn(item)"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span *ngIf="popupItemActionIcon" class="option-icon" (click)="_optionActionClick(item, $event)"><mat-icon>{{popupItemActionIcon}}</mat-icon></span>
|
||||
</div>
|
||||
</mat-option>
|
||||
</ng-container>
|
||||
<ng-template #noItems>
|
||||
<ng-container *ngIf="!autocompleteItems.length && showNoResultsLabel && (queryValue == inputValue)">
|
||||
<mat-option disabled="true">No results found!</mat-option>
|
||||
</ng-template>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<ng-template #loading>
|
||||
<mat-option disabled="true">loading...</mat-option>
|
||||
</ng-template>
|
||||
|
|
|
@ -19,16 +19,34 @@
|
|||
|
||||
}
|
||||
|
||||
.title-subtitle-fn {
|
||||
height: auto;
|
||||
width: calc(100% - 46px);
|
||||
}
|
||||
|
||||
.title-fn-inner {
|
||||
width: inherit;
|
||||
overflow: unset;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.title-fn {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: unset !important;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
|
||||
.subtitle-fn-inner {
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.title-fn {
|
||||
height: inherit;
|
||||
width: calc(100% - 16px);
|
||||
.subtitle-fn {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
display: -webkit-box;
|
||||
|
@ -36,10 +54,10 @@
|
|||
-moz-box-orient: vertical;
|
||||
-ms-box-orient: vertical;
|
||||
box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
-moz-line-clamp: 2;
|
||||
-ms-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-line-clamp: 1;
|
||||
-moz-line-clamp: 1;
|
||||
-ms-line-clamp: 1;
|
||||
line-clamp: 1;
|
||||
}
|
||||
|
||||
.option-icon {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu
|
|||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { isNullOrUndefined } from '@swimlane/ngx-datatable';
|
||||
import { BehaviorSubject, combineLatest, Observable, of as observableOf, Subject, Subscription } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap } from 'rxjs/operators';
|
||||
import {debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap, tap} from 'rxjs/operators';
|
||||
|
||||
export class CustomComponentBase extends BaseComponent {
|
||||
constructor(
|
||||
|
@ -57,6 +57,8 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
|||
onSelectAutoCompleteValue = new BehaviorSubject<any>(null);
|
||||
valueAssignSubscription: Subscription;
|
||||
|
||||
queryValue: string = "";
|
||||
|
||||
focused = false;
|
||||
controlType = 'multiple-autocomplete';
|
||||
describedBy = '';
|
||||
|
@ -73,6 +75,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
|||
|
||||
get shouldLabelFloat() { return this.focused || !this.empty; }
|
||||
|
||||
@Input() showNoResultsLabel: boolean = true;
|
||||
@Input() hidePlaceholder: boolean = false;
|
||||
@Input()
|
||||
get placeholder() { return this._placeholder; }
|
||||
|
@ -264,6 +267,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
|||
debounceTime(this.requestDelay),
|
||||
distinctUntilChanged(),
|
||||
distinctUntilChanged(),
|
||||
tap(query => this.queryValue = query),
|
||||
switchMap(query => this.filter(query)));
|
||||
|
||||
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
||||
|
@ -348,7 +352,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
|||
}
|
||||
|
||||
get requestDelay(): number {
|
||||
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 400;
|
||||
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 600;
|
||||
}
|
||||
|
||||
get minFilteringChars(): number {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
</mat-option>
|
||||
</ng-container>
|
||||
<ng-template #noItems>
|
||||
<mat-option disabled="true">No results found!</mat-option>
|
||||
<mat-option *ngIf="queryValue == inputValue" disabled="true">No results found!</mat-option>
|
||||
</ng-template>
|
||||
</div>
|
||||
<ng-template #loading>
|
||||
|
|
|
@ -9,7 +9,7 @@ import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-grou
|
|||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { Observable, of as observableOf, Subject } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap } from 'rxjs/operators';
|
||||
import {debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap, tap} from 'rxjs/operators';
|
||||
|
||||
|
||||
export class CustomComponentBase extends BaseComponent {
|
||||
|
@ -62,6 +62,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple
|
|||
_groupedItems: Observable<AutoCompleteGroup[]>;
|
||||
_selectedItems: Map<string, any> = new Map<any, any>();
|
||||
|
||||
queryValue: string = "";
|
||||
|
||||
get empty() { return (this.value == null) && (!this.inputValue || this.inputValue.length === 0); }
|
||||
|
||||
|
@ -224,6 +225,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple
|
|||
startWith(null),
|
||||
debounceTime(this.requestDelay),
|
||||
distinctUntilChanged(),
|
||||
tap(query => this.queryValue = query),
|
||||
switchMap(query => this.filter(query)));
|
||||
|
||||
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
||||
|
@ -313,7 +315,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple
|
|||
}
|
||||
|
||||
get requestDelay(): number {
|
||||
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 400;
|
||||
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 600;
|
||||
}
|
||||
|
||||
get minFilteringChars(): number {
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
<div mat-dialog-content class="row content">
|
||||
<mat-form-field class="col pt-0 pb-2 mb-4 search">
|
||||
<!-- <mat-label>{{'INVITATION-EDITOR.AUTOCOMPLETE-USER-EMAIL' | translate}}</mat-label> -->
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('users')" placeholder="{{'INVITATION-EDITOR.AUTOCOMPLETE-USER-EMAIL' | translate}}" [configuration]="usersAutoCompleteConfiguration">
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('users')" placeholder="{{'INVITATION-EDITOR.AUTOCOMPLETE-USER-EMAIL' | translate}}"
|
||||
[configuration]="usersAutoCompleteConfiguration" [showNoResultsLabel]="false">
|
||||
</app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
<p class="d-flex m-0 hint">
|
||||
|
|
Loading…
Reference in New Issue