Skip to content

Commit

Permalink
Merge pull request #1700 from dippindots/Mutationstab_Moving_Filters_…
Browse files Browse the repository at this point in the history
…Message

Mutationstab: change to banner alert
  • Loading branch information
alisman authored Nov 12, 2018
2 parents 07525e8 + 7ff5f47 commit 2f5c1ef
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
27 changes: 27 additions & 0 deletions src/pages/resultsView/mutation/Mutations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {observer} from "mobx-react";
import {MSKTabs, MSKTab} from "shared/components/MSKTabs/MSKTabs";
import {ResultsViewPageStore} from "../ResultsViewPageStore";
import ResultsViewMutationMapper from "./ResultsViewMutationMapper";
import ResultsViewMutationMapperStore from "./ResultsViewMutationMapperStore";
import classnames from "classnames";
import {observable, computed} from "mobx";
import AppConfig from 'appConfig';
import "./mutations.scss";
Expand Down Expand Up @@ -50,7 +52,12 @@ export default class Mutations extends React.Component<IMutationsPageProps, {}>
isUnaffected={!this.props.store.queryContainsMutationOql}
onToggle={this.onToggleOql}
/>
{this.props.store.mutationMapperStores.isComplete && ! this.props.store.mutationMapperStores.result[this.mutationsGeneTab].dataStore.showingAllData &&
this.bannerAlert()
}
</div>



{(this.props.store.mutationMapperStores.isComplete) && (
<MSKTabs
Expand Down Expand Up @@ -104,6 +111,26 @@ export default class Mutations extends React.Component<IMutationsPageProps, {}>

return tabs;
}

protected bannerAlert(): JSX.Element|null
{
let dataStore = this.props.store.mutationMapperStores.result[this.mutationsGeneTab].dataStore;

return (
<div className={classnames("alert" , "alert-success")}>
<span style={{verticalAlign:"middle"}}>
{`${dataStore.sortedFilteredData.length}/${dataStore.allData.length} `}
{"mutations are shown based on your filtering."}
<button className="btn btn-default btn-xs"
style={{cursor:"pointer", marginLeft:6}}
onClick={()=>{dataStore.resetFilterAndSelection();}}
>
Show all mutations
</button>
</span>
</div>
);
}

protected handleTabChange(id: string) {
// update the hash if routing exits
Expand Down
8 changes: 2 additions & 6 deletions src/shared/components/mutationMapper/MutationMapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,8 @@ export default class MutationMapper<P extends IMutationMapperProps> extends Reac
</div>
</div>
<hr style={{ marginTop:20 }} />

{!this.props.store.dataStore.showingAllData &&
this.filterResetPanel()
}
{this.mutationTable()}
</div>
{this.mutationTable()}
</div>
)
}
</div>
Expand Down

0 comments on commit 2f5c1ef

Please sign in to comment.