Revert "autocomplete component added (#3701)"

This reverts commit 21d7a8aec2.
This commit is contained in:
davidcanonieto
2018-09-14 10:05:59 +01:00
committed by GitHub
parent 23266fa23c
commit 13ff89ee8c
6 changed files with 33 additions and 81 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, EventEmitter, Input, AfterViewInit, OnChanges,
import { Component, EventEmitter, Input, OnChanges,
Output, SimpleChanges, ViewChild, ViewEncapsulation
} from '@angular/core';
import { ActivitiContentService, AppConfigService, AppConfigValues,
@@ -26,9 +26,6 @@ import { ProcessDefinitionRepresentation } from './../models/process-definition.
import { ProcessInstance } from './../models/process-instance.model';
import { ProcessService } from './../services/process.service';
import { AttachFileWidgetComponent, AttachFolderWidgetComponent } from '../../content-widget';
import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs';
import { map, startWith, delay } from 'rxjs/operators';
@Component({
selector: 'adf-start-process',
@@ -36,7 +33,7 @@ import { map, startWith, delay } from 'rxjs/operators';
styleUrls: ['./start-process.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class StartProcessInstanceComponent implements AfterViewInit, OnChanges {
export class StartProcessInstanceComponent implements OnChanges {
/** (optional) Limit the list of processes that can be started to those
* contained in the specified app.
@@ -87,9 +84,6 @@ export class StartProcessInstanceComponent implements AfterViewInit, OnChanges {
errorMessageId: string = '';
processControl = new FormControl();
filteredOptions: Observable<any>;
constructor(private activitiProcess: ProcessService,
private formRenderingService: FormRenderingService,
private activitiContentService: ActivitiContentService,
@@ -98,17 +92,6 @@ export class StartProcessInstanceComponent implements AfterViewInit, OnChanges {
this.formRenderingService.setComponentTypeResolver('select-folder', () => AttachFolderWidgetComponent, true);
}
ngAfterViewInit() {
setTimeout(() => {
this.filteredOptions = this.processControl.valueChanges
.pipe(
startWith(''),
delay(0),
map(value => this._filter(value))
);
});
}
ngOnChanges(changes: SimpleChanges) {
if (changes['values'] && changes['values'].currentValue) {
this.moveNodeFromCStoPS();
@@ -117,23 +100,6 @@ export class StartProcessInstanceComponent implements AfterViewInit, OnChanges {
this.loadStartProcess();
}
private _filter(value) {
let filterValue = '';
if (value && value.name) {
filterValue = value.name.toLowerCase();
} else if (value) {
filterValue = value.toLowerCase();
}
let processDefArray = this.processDefinitions.filter(option => option.name.toLowerCase() === filterValue);
this.selectedProcessDef = processDefArray.length ? processDefArray[0] : null;
return this.processDefinitions.filter(option => option.name.toLowerCase().includes(filterValue));
}
displayFn(processDef): string {
return processDef ? processDef.name : '';
}
public loadStartProcess() {
this.resetSelectedProcessDefinition();
this.resetErrorMessage();
@@ -251,10 +217,6 @@ export class StartProcessInstanceComponent implements AfterViewInit, OnChanges {
}
hasProcessName(): boolean {
return !!this.name;
}
onItemSelect(item) {
this.selectedProcessDef = item;
return this.name ? true : false;
}
}