<commit_before>import _ from 'lodash'
import React from 'react'

import { systemMessagesData } from '../../lookups/lookups-system-messages'
import { connectRedux, rebind } from '../../reusable/dispatch'
import { SystemMessages } from '../../reusable/system-messages'
import { SubmissionBase } from '../base_components'

import checkCoreData from './checkCoreData'
import SubmissionNav from './SubmissionNav'
import { PAGES_CONFIG } from './data'

const steps = _.reject(PAGES_CONFIG, {hide_nav: true})
const stepsNOCourses = _.reject(steps, {key: 'courses'})
const stepsNoNqa = (nav) => _.reject(nav, {key: 'next_qtr_accountabilities'})

@connectRedux()
export default class SubmissionFlowRoot extends SubmissionBase {
    static mapStateToProps(state) {
        return {
            browser: state.browser,
            core: state.submission.core,
            systemMessages: systemMessagesData.getMessages(state, 'submission')
        }
    }

    constructor(props) {
        super(props)
        rebind(this, 'onMessageDismiss')
    }

    render() {
        const { core, browser, params, location, systemMessages } = this.props
        if (!this.checkReportingDate()) {
            return this.renderBasicLoading(core.coreInit)
        }
        const regionId = core.lookups.center.region.parentId ? core.lookups.center.region.parentId : core.lookups.center.region.id
        const navSteps1 = [].includes(regionId) ? stepsNOCourses : steps
        const navSteps = (core.lookups.capabilities.nextQtrAccountabilities) ? navSteps1 : stepsNoNqa(navSteps1)
        const largeLayout = browser.greaterThan.large

        const nav = <SubmissionNav params={params} steps={navSteps} location={location} tabbed={!largeLayout} />
        var layout
        if (largeLayout) {
            layout = (
                <div id="submissionWideLayout" className="row submission-layout">
                    <div id="swSidebar">{nav}</div>
                    <div id="swContent">
                        <div className="panel panel-default">
                            <div className="panel-body submission-content">
                                {this.props.children}
                            </div>
                        </div>
                    </div>
                    <div className="clearfix"></div>
                </div>
            )
        } else {
            layout = (
                <div className="submission-layout">
                    {nav}
                    <div className="tab-content">
                        <div className="tab-pane active submission-content">
                            {this.props.children}
                        </div>
                    </div>
                </div>
            )
        }<commit_msg>Hide Submission Courses Tab<commit_after>import _ from 'lodash'
import React from 'react'

import { systemMessagesData } from '../../lookups/lookups-system-messages'
import { connectRedux, rebind } from '../../reusable/dispatch'
import { SystemMessages } from '../../reusable/system-messages'
import { SubmissionBase } from '../base_components'

import checkCoreData from './checkCoreData'
import SubmissionNav from './SubmissionNav'
import { PAGES_CONFIG } from './data'

const steps = _.reject(PAGES_CONFIG, {hide_nav: true})
const stepsNOCourses = _.reject(steps, {key: 'courses'})
const stepsNoNqa = (nav) => _.reject(nav, {key: 'next_qtr_accountabilities'})

@connectRedux()
export default class SubmissionFlowRoot extends SubmissionBase {
    static mapStateToProps(state) {
        return {
            browser: state.browser,
            core: state.submission.core,
            systemMessages: systemMessagesData.getMessages(state, 'submission')
        }
    }

    constructor(props) {
        super(props)
        rebind(this, 'onMessageDismiss')
    }

    render() {
        const { core, browser, params, location, systemMessages } = this.props
        if (!this.checkReportingDate()) {
            return this.renderBasicLoading(core.coreInit)
        }
        const navSteps1 = core.lookups.currentQuarter > 49 ? stepsNOCourses : steps
        const navSteps = (core.lookups.capabilities.nextQtrAccountabilities) ? navSteps1 : stepsNoNqa(navSteps1)
        const largeLayout = browser.greaterThan.large

        const nav = <SubmissionNav params={params} steps={navSteps} location={location} tabbed={!largeLayout} />
        var layout
        if (largeLayout) {
            layout = (
                <div id="submissionWideLayout" className="row submission-layout">
                    <div id="swSidebar">{nav}</div>
                    <div id="swContent">
                        <div className="panel panel-default">
                            <div className="panel-body submission-content">
                                {this.props.children}
                            </div>
                        </div>
                    </div>
                    <div className="clearfix"></div>
                </div>
            )
        } else {
            layout = (
                <div className="submission-layout">
                    {nav}
                    <div className="tab-content">
                        <div className="tab-pane active submission-content">
                            {this.props.children}
                        </div>
                    </div>
                </div>
            )
        }
{'fraction_non_alphanumeric': 0.11326681448632668, 'fraction_numerical': 0.0014781966001478197, 'mean_word_length': 1.87772461456672, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 44, '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': '5043184', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1385, 'n_words': 301}