Skip to content

Commit

Permalink
7117: Prod flag removal for 6803 (#11978)
Browse files Browse the repository at this point in the history
* Remove prod flags around caution flags

* 7117: Prod Flag removal for 7185

* 7117: Prod Flag removal for 7186

* 7117: Linting

Co-authored-by: Devin McCurdy <[email protected]>
  • Loading branch information
elder-joseph and Devin McCurdy authored Apr 24, 2020
1 parent e472ac0 commit bf2c63b
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 266 deletions.
9 changes: 1 addition & 8 deletions src/applications/gi/components/CheckboxGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import _ from 'lodash';
import environment from 'platform/utilities/environment';

/**
* A checkbox group with a label.
Expand Down Expand Up @@ -55,13 +54,7 @@ class CheckboxGroup extends React.Component {
<div className={this.props.errorMessage ? 'usa-input-error' : ''}>
<fieldset>
<div>
{/* prod flag for bah-7186 */}
<span
id={`${this.inputId}-legend`}
className={
environment.isProduction() ? 'gibct-legend-old' : 'gibct-legend'
}
>
<span id={`${this.inputId}-legend`} className={'gibct-legend'}>
{this.props.label}
</span>
{this.renderOptions()}
Expand Down
8 changes: 2 additions & 6 deletions src/applications/gi/components/RadioButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import _ from 'lodash';
import ToolTip from './ToolTip';
import ExpandingGroup from '@department-of-veterans-affairs/formation-react/ExpandingGroup';
import { SMALL_SCREEN_WIDTH } from '../constants';
import environment from 'platform/utilities/environment';

/**
* A radio button group with a label.
Expand Down Expand Up @@ -140,10 +139,7 @@ class RadioButtons extends React.Component {
if (this.props.required) {
requiredSpan = <span className="form-required-span">*</span>;
}
// prod flag for bah-7186
const gibctLegendStyle = environment.isProduction()
? 'gibct-legend-old'
: 'gibct-legend';

return (
<div className={this.props.errorMessage ? 'usa-input-error' : ''}>
<fieldset>
Expand All @@ -153,7 +149,7 @@ class RadioButtons extends React.Component {
className={
this.props.errorMessage
? 'usa-input-error-label'
: gibctLegendStyle
: 'gibct-legend'
}
>
{this.props.label}
Expand Down
49 changes: 3 additions & 46 deletions src/applications/gi/components/profile/CautionaryInformation.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import recordEvent from 'platform/monitoring/record-event';
import AlertBox from '../AlertBox';
import CautionFlagDetails from './CautionFlagDetails';
import SchoolClosingDetails from './SchoolClosingDetails';
import environment from 'platform/utilities/environment';

const TableRow = ({ description, thisCampus, allCampuses }) => {
if (!thisCampus && !allCampuses) return null;
Expand Down Expand Up @@ -36,7 +34,7 @@ const ListRow = ({ description, value }) => {
};

export class CautionaryInformation extends React.Component {
renderNewCautionFlags = () => {
renderCautionFlags = () => {
const it = this.props.institution;
if (!it.schoolClosing && it.cautionFlags.length === 0) {
return null;
Expand Down Expand Up @@ -89,35 +87,6 @@ export class CautionaryInformation extends React.Component {
return null;
}

// If Ashford, show specific link.
const schoolSpecificLink = (it.facilityCode === '21007103' ||
it.website === 'http://www.ashford.edu') && (
<a
href="https://www.benefits.va.gov/gibill/comparison_tool/about_this_tool.asp#AshfordSAA"
target="_blank"
rel="noopener noreferrer"
>
More information on Ashford University
</a>
);

const flagContent = (
<div>
<p>
{it.cautionFlagReason} {schoolSpecificLink}
</p>
<p>
<button
type="button"
className="va-button-link learn-more-button"
onClick={this.props.onShowModal.bind(this, 'cautionInfo')}
>
Learn more about these warnings
</button>
</p>
</div>
);

const allCampusesLink = (
<a
href="https://www.benefits.va.gov/gibill/comparison_tool/about_this_tool.asp#complaints_all_campuses"
Expand Down Expand Up @@ -179,22 +148,10 @@ export class CautionaryInformation extends React.Component {

return (
<div className="cautionary-information">
{// #6805 prod flag
environment.isProduction() ? (
<div className="caution-flag">
<AlertBox
content={flagContent}
isVisible={!!it.cautionFlag}
status="warning"
/>
</div>
) : (
this.renderNewCautionFlags()
)}
{this.renderCautionFlags()}

<div className="student-complaints">
{// #6805 prod flag
!environment.isProduction() && <h3>Student feedback</h3>}
<h3>Student feedback</h3>

<div className="link-header">
<h3>
Expand Down
57 changes: 8 additions & 49 deletions src/applications/gi/components/profile/HeadingSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import PropTypes from 'prop-types';
import React from 'react';
import _ from 'lodash';

import AlertBox from '../AlertBox';
import AdditionalResources from '../content/AdditionalResources';
import { formatNumber, locationInfo } from '../../utils/helpers';
import { ariaLabels } from '../../constants';
import CautionFlagHeading from './CautionFlagHeading';
import SchoolClosingHeading from './SchoolClosingHeading';
import environment from 'platform/utilities/environment';

const IconWithInfo = ({ icon, children, present }) => {
if (!present) return null;
Expand Down Expand Up @@ -42,54 +40,15 @@ class HeadingSummary extends React.Component {
<div className="heading row">
<div className="usa-width-two-thirds medium-8 small-12 column">
<h1 tabIndex={-1}>{it.name}</h1>
{// #6805 prod flag
environment.isProduction() ? (
<AlertBox
content={
<p>
Are you enrolled in this school?{' '}
<a
href="https://www.benefits.va.gov/GIBILL/FGIB/Restoration.asp"
rel="noopener noreferrer"
target="_blank"
>
Find out if you qualify to have your benefits restored.
</a>
</p>
}
headline="This school is closing soon"
isVisible={!!it.schoolClosing}
status="warning"
/>
) : (
<SchoolClosingHeading
schoolClosing={it.schoolClosing}
schoolClosingOn={it.schoolClosingOn}
/>
)}
<SchoolClosingHeading
schoolClosing={it.schoolClosing}
schoolClosingOn={it.schoolClosingOn}
/>
<div className="caution-flag">
{// #6805 prod flag
environment.isProduction() ? (
<AlertBox
content={
<a href="#viewWarnings" onClick={this.props.onViewWarnings}>
View cautionary information about this school
</a>
}
headline={
<h2 className="vads-u-font-size--h3 usa-alert-heading">
This school has cautionary warnings
</h2>
}
isVisible={!!it.cautionFlag}
status="warning"
/>
) : (
<CautionFlagHeading
cautionFlags={it.cautionFlags}
onViewWarnings={this.props.onViewWarnings}
/>
)}
<CautionFlagHeading
cautionFlags={it.cautionFlags}
onViewWarnings={this.props.onViewWarnings}
/>
</div>
<div className="column">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
getStateNameForCode,
sortOptionsByStateName,
} from '../../utils/helpers';
import environment from 'platform/utilities/environment';
import CautionaryWarningsFilter from './CautionaryWarningsFilter';

class InstitutionFilterForm extends React.Component {
Expand Down Expand Up @@ -150,15 +149,13 @@ class InstitutionFilterForm extends React.Component {
{this.renderCategoryFilter()}
{this.renderCountryFilter()}
{this.renderStateFilter()}
{environment.isProduction() ? (
''
) : (
{
<CautionaryWarningsFilter
excludeCautionFlags={this.props.filters.excludeCautionFlags}
onChange={this.handleCheckboxChange}
showModal={this.props.showModal}
/>
)}
}
{this.renderProgramFilters()}
{this.renderTypeFilter()}
</div>
Expand Down
10 changes: 1 addition & 9 deletions src/applications/gi/components/search/InstitutionSearchForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@ import EligibilityForm from './EligibilityForm';
import InstitutionFilterForm from './InstitutionFilterForm';
import KeywordSearch from './KeywordSearch';
import OnlineClassesFilter from './OnlineClassesFilter';
import environment from 'platform/utilities/environment';

class InstitutionSearchForm extends React.Component {
render() {
return (
<div className="row">
<div className={this.props.filtersClass}>
{/* prod flag for bah-7186 */}
<div
className={
environment.isProduction()
? 'filters-sidebar-inner-old'
: 'filters-sidebar-inner'
}
>
<div className={'filters-sidebar-inner'}>
{this.props.search.filterOpened && <h1>Filter your search</h1>}
<h2>Keywords</h2>
<KeywordSearch
Expand Down
22 changes: 8 additions & 14 deletions src/applications/gi/components/search/SearchResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
renderCautionAlert,
renderSchoolClosingAlert,
} from '../../utils/render';
import environment from 'platform/utilities/environment';

export class SearchResult extends React.Component {
estimate = ({ qualifier, value }) => {
Expand All @@ -32,7 +31,6 @@ export class SearchResult extends React.Component {
state,
country,
studentCount,
cautionFlag,
cautionFlags,
} = this.props;

Expand All @@ -44,14 +42,6 @@ export class SearchResult extends React.Component {
query: version ? { version } : {},
};

// Prod flags for 7183
const searchResultContentClassnamesLeft = environment.isProduction()
? 'small-12 usa-width-seven-twelfths medium-7 columns'
: 'small-12 medium-6 large-7 columns';
const searchResultContentClassnamesRight = environment.isProduction()
? 'small-12 usa-width-five-twelfths medium-5 columns estimated-benefits'
: 'small-12 medium-6 large-5 columns estimated-benefits';

return (
<div className="search-result">
<div className="outer">
Expand All @@ -68,16 +58,16 @@ export class SearchResult extends React.Component {
</h2>
</div>
</div>
{(schoolClosing || cautionFlag) && (
{(schoolClosing || cautionFlags.length > 0) && (
<div className="row alert-row">
<div className="small-12 columns">
{renderSchoolClosingAlert({ schoolClosing, schoolClosingOn })}
{renderCautionAlert({ cautionFlag, cautionFlags })}
{renderCautionAlert({ cautionFlags })}
</div>
</div>
)}
<div className="row">
<div className={searchResultContentClassnamesLeft}>
<div className={'small-12 medium-6 large-7 columns'}>
<div style={{ position: 'relative', bottom: 0 }}>
<p className="locality" id={`location-${facilityCode}`}>
{locationInfo(city, state, country)}
Expand All @@ -87,7 +77,11 @@ export class SearchResult extends React.Component {
</p>
</div>
</div>
<div className={searchResultContentClassnamesRight}>
<div
className={
'small-12 medium-6 large-5 columns estimated-benefits'
}
>
<h3>You may be eligible for up to:</h3>
<div className="row">
<div className="columns">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class VetTecProgramSearchResult extends React.Component {
? formatCurrency(tuitionAmount)
: 'TBD';

const cautionFlag = cautionFlags && cautionFlags.length > 0;

const displayHours =
lengthInHours === '0' ? 'TBD' : `${lengthInHours} hours`;

Expand Down Expand Up @@ -63,11 +61,11 @@ class VetTecProgramSearchResult extends React.Component {
{renderPreferredProviderFlag(this.props.result)}
</div>
</div>
{(schoolClosing || cautionFlag) && (
{(schoolClosing || cautionFlags.length > 0) && (
<div className="row alert-row">
<div className="small-12 columns">
{renderSchoolClosingAlert({ schoolClosing, schoolClosingOn })}
{renderCautionAlert({ cautionFlag, cautionFlags })}
{renderCautionAlert({ cautionFlags })}
</div>
</div>
)}
Expand Down
7 changes: 2 additions & 5 deletions src/applications/gi/components/vet-tec/VetTecSearchForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { addAllOption, getStateNameForCode } from '../../utils/helpers';
import PropTypes from 'prop-types';
import Dropdown from '../Dropdown';
import VetTecFilterBy from './VetTecFilterBy';
import environment from 'platform/utilities/environment';
import CautionaryWarningsFilter from '../search/CautionaryWarningsFilter';

class VetTecSearchForm extends React.Component {
Expand Down Expand Up @@ -157,15 +156,13 @@ class VetTecSearchForm extends React.Component {

{this.renderCountryFilter()}
{this.renderStateFilter()}
{environment.isProduction() ? (
''
) : (
{
<CautionaryWarningsFilter
excludeCautionFlags={this.props.filters.excludeCautionFlags}
onChange={this.handleCheckboxChange}
showModal={this.props.showModal}
/>
)}
}
{this.renderFilterBy()}
</div>
<div className="results-button">
Expand Down
Loading

0 comments on commit bf2c63b

Please sign in to comment.