Skip to content

Commit

Permalink
Updates to actionable genes page
Browse files Browse the repository at this point in the history
- Only show treatment with FDA level. If the treatment is Dx/Px, then the fda level is not available
- Add key to actionable genes page. Multiple tables will be rendered if the key is different. This helps to differentiate the paginated vs non-paginated tables. The react-table lib has issue recognizing remove props.
  • Loading branch information
zhx828 committed Aug 8, 2023
1 parent 88d9e6f commit 9e227eb
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@ export default class ActionableGenesPage extends React.Component<
@computed
get allFdaTreatments() {
const treatments: Treatment[] = [];
this.allOncokbTreatments.map(treatment => {
treatments.push({
...treatment,
level: treatment.fdaLevel,
} as Treatment);
});
this.allOncokbTreatments
.filter(treatment => treatment.fdaLevel)
.map(treatment => {
treatments.push({
...treatment,
level: treatment.fdaLevel,
} as Treatment);
});
return treatments;
}

Expand Down Expand Up @@ -563,6 +565,11 @@ export default class ActionableGenesPage extends React.Component<
return !!this.collapseStatus[LEVEL_TYPES.FDA];
}

@computed
get oncokbTableKey() {
return this.fdaSectionIsOpen ? 'paginated' : 'non-paginated';
}

@autobind
@action
clearFilters() {
Expand Down Expand Up @@ -847,7 +854,7 @@ export default class ActionableGenesPage extends React.Component<
getTable() {
// We need to render two tables, one with fixed header, one with pagination.
// Once page size is specified in the fixed header table, it cannot be overwritten by the defaultPageSize
return <OncoKBTable {...this.oncokbTableProps} />;
return <OncoKBTable key={this.oncokbTableKey} {...this.oncokbTableProps} />;
}

@computed
Expand Down

0 comments on commit 9e227eb

Please sign in to comment.