<commit_before>import React from "react";

import ColumnHeaderTooltip from "~ui/containers/ColumnHeaderTooltip";
import Dropdown from "~ui/controls/dropdowns/Dropdown";
import RadioButton from "~ui/controls/RadioButton";
import IconSample from "~ui/icons/IconSample";
import InfoIconSmall from "~ui/icons/InfoIconSmall";
import { CONSENSUS_GENOME_DOC_LINK } from "~utils/documentationLinks";
import PropTypes from "~utils/propTypes";
import { WORKFLOWS } from "~utils/workflows";
import { logAnalyticsEvent, withAnalytics } from "~/api/analytics";

import cs from "./workflow_selector.scss";

const WETLAB_OPTIONS = [
  {
    text: "ARTIC v3",
    value: "artic",
  },
  {
    text: "MSSPE",
    value: "msspe",
  },
  {
    text: "SNAP",
    value: "snap",
  },
];

class WorkflowSelector extends React.Component {
  renderWetlabSelector = () => {
    const { onWetlabProtocolChange, selectedWetlabProtocol } = this.props;
    return (
      <div className={cs.wetlabOption}>
        <div className={cs.title}>Wetlab protocol:</div>
        <Dropdown
          className={cs.dropdown}
          onChange={value =>
            withAnalytics(
              onWetlabProtocolChange(value),
              "WorkflowSelector_wetlab-protocol_selected",
              {
                wetlabOption: value,
              }
            )
          }
          options={WETLAB_OPTIONS}
          placeholder="Select"
          value={selectedWetlabProtocol}
        ></Dropdown>
      </div>
    );
  };

  render() {
    const { onWorkflowToggle, selectedWorkflows = new Set() } = this.props;
    return (
      <div className={cs.workflowSelector}>
        <div className={cs.header}>Analysis Type</div>
        <div
          className={cs.workflowOption}
          onClick={() => onWorkflowToggle(WORKFLOWS.SHORT_READ_MNGS.value)}
        >
          <RadioButton
            selected={selectedWorkflows.has(WORKFLOWS.SHORT_READ_MNGS.value)}
            className={cs.radioButton}
          />
          <IconSample className={cs.iconSample} />
          <div className={cs.optionText}>
            <div className={cs.title}>Metagenomics</div>
            <div className={cs.description}>
              Run your samples through our metagenomics pipeline.
            </div>
          </div>
        </div>
        <div
          className={cs.workflowOption}
          onClick={() => onWorkflowToggle(WORKFLOWS.CONSENSUS_GENOME.value)}
        >
          <RadioButton
            selected={selectedWorkflows.has(WORKFLOWS.CONSENSUS_GENOME.value)}
            className={cs.radioButton}
          />
          <IconSample className={cs.iconSample} />
          <div className={cs.optionText}>
            <div className={cs.title}>
              SARS-CoV-2 Consensus Genome
              <ColumnHeaderTooltip
                trigger={
                  <span>
                    <InfoIconSmall className={cs.infoIcon} />
                  </span>
                }
                content="Consensus genome aligns short reads to a SARS-CoV-2 reference genome."
                link={CONSENSUS_GENOME_DOC_LINK}
                onClick={() =>
                  logAnalyticsEvent(
                    "WorkflowSelector_consensus-genome-doc-link_clicked"
                  )
                }
              />
            </div>
            <div className={cs.description}>
              Run your samples through our new pipeline to get consensus genomes
              for SARS-CoV-2. Our assembly supports wet lab protocols ARTIC v3
              and MSSPE.
            </div>
            {selectedWorkflows.has(WORKFLOWS.CONSENSUS_GENOME.value) &&
              this.renderWetlabSelector()}
          </div><commit_msg>Add SNAP protocol to copy (#573)<commit_after>import React from "react";

import ColumnHeaderTooltip from "~ui/containers/ColumnHeaderTooltip";
import Dropdown from "~ui/controls/dropdowns/Dropdown";
import RadioButton from "~ui/controls/RadioButton";
import IconSample from "~ui/icons/IconSample";
import InfoIconSmall from "~ui/icons/InfoIconSmall";
import { CONSENSUS_GENOME_DOC_LINK } from "~utils/documentationLinks";
import PropTypes from "~utils/propTypes";
import { WORKFLOWS } from "~utils/workflows";
import { logAnalyticsEvent, withAnalytics } from "~/api/analytics";

import cs from "./workflow_selector.scss";

const WETLAB_OPTIONS = [
  {
    text: "ARTIC v3",
    value: "artic",
  },
  {
    text: "MSSPE",
    value: "msspe",
  },
  {
    text: "SNAP",
    value: "snap",
  },
];

class WorkflowSelector extends React.Component {
  renderWetlabSelector = () => {
    const { onWetlabProtocolChange, selectedWetlabProtocol } = this.props;
    return (
      <div className={cs.wetlabOption}>
        <div className={cs.title}>Wetlab protocol:</div>
        <Dropdown
          className={cs.dropdown}
          onChange={value =>
            withAnalytics(
              onWetlabProtocolChange(value),
              "WorkflowSelector_wetlab-protocol_selected",
              {
                wetlabOption: value,
              }
            )
          }
          options={WETLAB_OPTIONS}
          placeholder="Select"
          value={selectedWetlabProtocol}
        ></Dropdown>
      </div>
    );
  };

  render() {
    const { onWorkflowToggle, selectedWorkflows = new Set() } = this.props;
    return (
      <div className={cs.workflowSelector}>
        <div className={cs.header}>Analysis Type</div>
        <div
          className={cs.workflowOption}
          onClick={() => onWorkflowToggle(WORKFLOWS.SHORT_READ_MNGS.value)}
        >
          <RadioButton
            selected={selectedWorkflows.has(WORKFLOWS.SHORT_READ_MNGS.value)}
            className={cs.radioButton}
          />
          <IconSample className={cs.iconSample} />
          <div className={cs.optionText}>
            <div className={cs.title}>Metagenomics</div>
            <div className={cs.description}>
              Run your samples through our metagenomics pipeline.
            </div>
          </div>
        </div>
        <div
          className={cs.workflowOption}
          onClick={() => onWorkflowToggle(WORKFLOWS.CONSENSUS_GENOME.value)}
        >
          <RadioButton
            selected={selectedWorkflows.has(WORKFLOWS.CONSENSUS_GENOME.value)}
            className={cs.radioButton}
          />
          <IconSample className={cs.iconSample} />
          <div className={cs.optionText}>
            <div className={cs.title}>
              SARS-CoV-2 Consensus Genome
              <ColumnHeaderTooltip
                trigger={
                  <span>
                    <InfoIconSmall className={cs.infoIcon} />
                  </span>
                }
                content="Consensus genome aligns short reads to a SARS-CoV-2 reference genome."
                link={CONSENSUS_GENOME_DOC_LINK}
                onClick={() =>
                  logAnalyticsEvent(
                    "WorkflowSelector_consensus-genome-doc-link_clicked"
                  )
                }
              />
            </div>
            <div className={cs.description}>
              Run your samples through our new pipeline to get consensus genomes
              for SARS-CoV-2. Our assembly supports wet lab protocols ARTIC v3,
              MSSPE, and SNAP.
            </div>
            {selectedWorkflows.has(WORKFLOWS.CONSENSUS_GENOME.value) &&
              this.renderWetlabSelector()}
          </div>
{'fraction_non_alphanumeric': 0.10939597315436242, 'fraction_numerical': 0.00174496644295302, 'mean_word_length': 1.981592637054822, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '419119', 'n_tokens_mistral': 2127, 'n_tokens_neox': 2034, 'n_words': 389}