Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(grouptype): select the default group type on load
Browse files Browse the repository at this point in the history
  • Loading branch information
sahil143 committed Jul 30, 2018
1 parent 1437b4c commit 55f9471
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,15 @@ export class GroupTypesComponent implements OnInit, OnDestroy {
this.route.queryParams.subscribe(val => {
if (val.hasOwnProperty('q')) {
let selectedTypeGroup: GroupTypeUI;
if (this.context === 'board') {
const selectedTypeGroupId =
this.filterService.queryToFlat(val.q)[0].value;
if (val['q'].includes('boardContextId')) {
//filter service getConditionFromQuery returns undefined for non AND operations
let selectedTypeGroupId = this.filterService.getConditionFromQuery(val.q, 'boardContextId');
if (selectedTypeGroupId === undefined) {
selectedTypeGroupId = this.filterService.queryToFlat(val.q)[0].value;
}
if (selectedTypeGroupId) {
selectedTypeGroup =
this.groupTypes.find(g => g.name === selectedTypeGroupId);
this.groupTypes.find(g => g.id === selectedTypeGroupId);
}
} else {
const selectedTypeGroupName =
Expand All @@ -174,15 +177,6 @@ export class GroupTypesComponent implements OnInit, OnDestroy {
} else {
this.showCompleted = '';
}

// If it's a board view then check for board context ID
// if (val.hasOwnProperty('boardContextId')) {
// const selectedTypeGroup: GroupTypeUI =
// this.groupTypes.find(g => g.id === val.boardContextId);
// if (selectedTypeGroup) {
// this.store.dispatch(new GroupTypeActions.SelectType(selectedTypeGroup));
// }
// }
})
);
}
Expand Down

0 comments on commit 55f9471

Please sign in to comment.