Skip to content

Commit

Permalink
Update background model help link, cleanup feature flag (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-x-han authored Jul 27, 2020
1 parent 24add0a commit ea97a51
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from "react";

import { UserContext } from "~/components/common/UserContext";
import PropTypes from "../../../utils/propTypes";
import SubtextDropdown from "~ui/controls/dropdowns/SubtextDropdown";
import Dropdown from "~ui/controls/dropdowns/Dropdown";

class BackgroundModelFilter extends React.Component {
render() {
Expand Down Expand Up @@ -36,28 +34,13 @@ class BackgroundModelFilter extends React.Component {
disabled = true;
}
return (
<UserContext.Consumer>
{currentUser =>
currentUser.allowedFeatures &&
currentUser.allowedFeatures.includes("mass_normalized") ? (
<SubtextDropdown
{...this.props}
options={backgroundOptions}
initialSelectedValue={value}
disabled={disabled}
onChange={onChange}
/>
) : (
<Dropdown
{...this.props}
options={backgroundOptions}
value={value}
disabled={disabled}
onChange={onChange}
/>
)
}
</UserContext.Consumer>
<SubtextDropdown
{...this.props}
options={backgroundOptions}
initialSelectedValue={value}
disabled={disabled}
onChange={onChange}
/>
);
}
}
Expand Down
44 changes: 22 additions & 22 deletions app/assets/src/components/views/samples/CollectionModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class CollectionModal extends React.Component {

renderForm = () => {
const { numDescriptionRows } = this.props;
const { allowedFeatures = {} } = this.context || {};

const { enableMassNormalizedBackgrounds, appliedMethod } = this.state;

Expand Down Expand Up @@ -170,29 +169,30 @@ class CollectionModal extends React.Component {
rows={numDescriptionRows}
onChange={this.handleDescriptionChange}
/>
{allowedFeatures.includes("mass_normalized") && (
<div>
<div className={cs.label}>
Applied Correction Method
<ColumnHeaderTooltip
trigger={
<span>
<InfoIconSmall className={cs.infoIcon} />
</span>
}
content="Applied Correction Method is the method used when comparing a chosen set of samples against a background model."
link="https://chanzuckerberg.zendesk.com/hc/en-us/articles/360035166174-How-do-I-create-and-use-background-models-in-IDseq-"
/>
</div>
<SubtextDropdown
fluid
className={cs.dropdown}
options={Object.values(dropdownOptions)}
initialSelectedValue={appliedMethod}
onChange={this.handleMethodChange}
<div>
<div className={cs.label}>
Applied Correction Method
<ColumnHeaderTooltip
trigger={
<span>
<InfoIconSmall className={cs.infoIcon} />
</span>
}
content="Applied Correction Method is the method used when comparing a chosen set of samples against a background model."
link="https://chanzuckerberg.zendesk.com/hc/en-us/articles/360050883054#h_01ECWXA46KAHRF7N61D7SE1M1F"
/>
</div>
)}
<SubtextDropdown
fluid
className={cs.dropdown}
options={Object.values(dropdownOptions)}
initialSelectedValue={appliedMethod}
onChange={withAnalytics(
this.handleMethodChange,
"CollectionModal_applied-correction-method_changed"
)}
/>
</div>
{this.renderSampleList()}
<div className={cs.buttons}>
<PrimaryButton
Expand Down

0 comments on commit ea97a51

Please sign in to comment.