Skip to content

Commit

Permalink
ensure all files present in filters
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
  • Loading branch information
colin-grant-work committed Jun 22, 2020
1 parent 52a43ce commit a6ced80
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ export class FileDialogTreeFilters {

export class FileDialogTreeFiltersRenderer extends ReactRenderer {

readonly filters: FileDialogTreeFilters;

constructor(
readonly filters: FileDialogTreeFilters,
filters: FileDialogTreeFilters,
readonly fileDialogTree: FileDialogTree
) {
super();
this.filters = { 'All Files': [], ...filters, };
}

protected readonly handleFilterChanged = (e: React.ChangeEvent<HTMLSelectElement>) => this.onFilterChanged(e);
Expand All @@ -50,12 +53,7 @@ export class FileDialogTreeFiltersRenderer extends ReactRenderer {
return undefined;
}

const fileTypes = ['All Files'];
Object.keys(this.filters).forEach(element => {
fileTypes.push(element);
});

const options = fileTypes.map(value => this.renderLocation(value));
const options = Object.keys(this.filters).map(value => this.renderLocation(value));
return <select className={'theia-select ' + FILE_TREE_FILTERS_LIST_CLASS} onChange={this.handleFilterChanged}>{...options}</select>;
}

Expand Down

0 comments on commit a6ced80

Please sign in to comment.