Skip to content

Commit

Permalink
fix(ui): add filter func to repo list for template apply form (#3750) (
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored and yesnault committed Dec 20, 2018
1 parent a16fac9 commit d75dfc3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ export class WorkflowTemplateApplyFormComponent {
}
}

filterRepo(options: Array<string>, query: string): Array<string> | false {
if (!options) {
return false;
}
if (!query || query.length < 3) {
return options.slice(0, 100);
}
let queryLowerCase = query.toLowerCase();
return options.filter(name => name.toLowerCase().indexOf(queryLowerCase) !== -1);
}

clickClose() {
this.close.emit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="four wide field">
<sui-select class="selection" name="parameter-{{parameter.key}}-repo" [(ngModel)]="parameterValues[parameter.key + '-repository']"
[options]="parameterValues[parameter.key + '-repositories']" [isSearchable]="true"
#repositorySelect>
[optionsFilter]="filterRepo" #repositorySelect>
<sui-select-option *ngFor="let repository of repositorySelect.filteredOptions" [value]="repository">
</sui-select-option>
</sui-select>
Expand Down

0 comments on commit d75dfc3

Please sign in to comment.