Skip to content

Commit

Permalink
fix: save task tag filters by project
Browse files Browse the repository at this point in the history
  • Loading branch information
voidpp committed Sep 29, 2019
1 parent 6f83a27 commit 0342e47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pabu/assets/ts/components/IssueList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class IssueList extends React.Component<Props, State> {
layout: pabuLocalStorage.issueListLayout,
statusFilters: pabuLocalStorage.issueTableFilters,
doneDateFilter: pabuLocalStorage.issueDoneDateFilter,
tagFilter: pabuLocalStorage.issueTagFilter,
tagFilter: pabuLocalStorage.issueTagFilter[props.id] || [],
}
}

Expand All @@ -132,7 +132,7 @@ class IssueList extends React.Component<Props, State> {

private changeTagFilter = (tagFilter: Array<number>) => {
this.setState({tagFilter});
pabuLocalStorage.issueTagFilter = tagFilter;
pabuLocalStorage.issueTagFilter = Object.assign({}, pabuLocalStorage.issueTagFilter, {[this.props.id]: tagFilter});
}

render() {
Expand Down Expand Up @@ -160,7 +160,7 @@ class IssueList extends React.Component<Props, State> {
<MultiSelect
placeholder="Filter by tags..."
options={Object.values(this.props.tags).map(t => ({label: t.name, value: t.id}))}
values={tagFilter.map(id => ({value: id, label: this.props.tags[id].name}))}
values={tagFilter.filter(id => this.props.tags[id]).map(id => ({value: id, label: this.props.tags[id].name}))}
onChange={v => this.changeTagFilter(v.map(v => v.value))}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pabu/assets/ts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class LocalStorageSchema {
[IssueStatus.IN_PROGRESS]: true,
[IssueStatus.DONE]: false,
};
issueTagFilter: Array<number> = [];
issueTagFilter: {[n: number]: Array<number>} = {};
lastSeenChangelogVersion: string = 'v0.0.0';
}

Expand Down

0 comments on commit 0342e47

Please sign in to comment.