Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutationstab: change to banner alert #1700

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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