From bf2c63b91c9c30cd319ddded6f7e55b65261e2b3 Mon Sep 17 00:00:00 2001 From: elder-joseph <48804834+elder-joseph@users.noreply.github.com> Date: Fri, 24 Apr 2020 12:25:11 -0400 Subject: [PATCH] 7117: Prod flag removal for 6803 (#11978) * 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 --- .../gi/components/CheckboxGroup.jsx | 9 +- .../gi/components/RadioButtons.jsx | 8 +- .../profile/CautionaryInformation.jsx | 49 +------- .../gi/components/profile/HeadingSummary.jsx | 57 ++------- .../search/InstitutionFilterForm.jsx | 7 +- .../search/InstitutionSearchForm.jsx | 10 +- .../gi/components/search/SearchResult.jsx | 22 ++-- .../vet-tec/VetTecProgramSearchResult.jsx | 6 +- .../components/vet-tec/VetTecSearchForm.jsx | 7 +- src/applications/gi/containers/SearchPage.jsx | 24 ++-- src/applications/gi/sass/gi.scss | 42 +++---- .../gi/sass/partials/_gi-search-page.scss | 11 +- src/applications/gi/utils/render.jsx | 112 +++++++----------- 13 files changed, 98 insertions(+), 266 deletions(-) diff --git a/src/applications/gi/components/CheckboxGroup.jsx b/src/applications/gi/components/CheckboxGroup.jsx index 48a7b6cabfa4..9a2b4649a964 100644 --- a/src/applications/gi/components/CheckboxGroup.jsx +++ b/src/applications/gi/components/CheckboxGroup.jsx @@ -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. @@ -55,13 +54,7 @@ class CheckboxGroup extends React.Component {
- {/* prod flag for bah-7186 */} - + {this.props.label} {this.renderOptions()} diff --git a/src/applications/gi/components/RadioButtons.jsx b/src/applications/gi/components/RadioButtons.jsx index 47f168ed8d75..625fa2eb711a 100644 --- a/src/applications/gi/components/RadioButtons.jsx +++ b/src/applications/gi/components/RadioButtons.jsx @@ -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. @@ -140,10 +139,7 @@ class RadioButtons extends React.Component { if (this.props.required) { requiredSpan = *; } - // prod flag for bah-7186 - const gibctLegendStyle = environment.isProduction() - ? 'gibct-legend-old' - : 'gibct-legend'; + return (
@@ -153,7 +149,7 @@ class RadioButtons extends React.Component { className={ this.props.errorMessage ? 'usa-input-error-label' - : gibctLegendStyle + : 'gibct-legend' } > {this.props.label} diff --git a/src/applications/gi/components/profile/CautionaryInformation.jsx b/src/applications/gi/components/profile/CautionaryInformation.jsx index d1c1e79e8dec..b7aee0990d0d 100644 --- a/src/applications/gi/components/profile/CautionaryInformation.jsx +++ b/src/applications/gi/components/profile/CautionaryInformation.jsx @@ -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; @@ -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; @@ -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') && ( - - More information on Ashford University - - ); - - const flagContent = ( -
-

- {it.cautionFlagReason} {schoolSpecificLink} -

-

- -

-
- ); - const allCampusesLink = ( - {// #6805 prod flag - environment.isProduction() ? ( -
- -
- ) : ( - this.renderNewCautionFlags() - )} + {this.renderCautionFlags()}
- {// #6805 prod flag - !environment.isProduction() &&

Student feedback

} +

Student feedback

diff --git a/src/applications/gi/components/profile/HeadingSummary.jsx b/src/applications/gi/components/profile/HeadingSummary.jsx index 069ca110af17..d6156b60465d 100644 --- a/src/applications/gi/components/profile/HeadingSummary.jsx +++ b/src/applications/gi/components/profile/HeadingSummary.jsx @@ -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; @@ -42,54 +40,15 @@ class HeadingSummary extends React.Component {

{it.name}

- {// #6805 prod flag - environment.isProduction() ? ( - - Are you enrolled in this school?{' '} -
- Find out if you qualify to have your benefits restored. - -

- } - headline="This school is closing soon" - isVisible={!!it.schoolClosing} - status="warning" - /> - ) : ( - - )} +
- {// #6805 prod flag - environment.isProduction() ? ( - - View cautionary information about this school - - } - headline={ -

- This school has cautionary warnings -

- } - isVisible={!!it.cautionFlag} - status="warning" - /> - ) : ( - - )} +

diff --git a/src/applications/gi/components/search/InstitutionFilterForm.jsx b/src/applications/gi/components/search/InstitutionFilterForm.jsx index b6922bdcdcce..d7a59afdbef6 100644 --- a/src/applications/gi/components/search/InstitutionFilterForm.jsx +++ b/src/applications/gi/components/search/InstitutionFilterForm.jsx @@ -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 { @@ -150,15 +149,13 @@ class InstitutionFilterForm extends React.Component { {this.renderCategoryFilter()} {this.renderCountryFilter()} {this.renderStateFilter()} - {environment.isProduction() ? ( - '' - ) : ( + { - )} + } {this.renderProgramFilters()} {this.renderTypeFilter()}

diff --git a/src/applications/gi/components/search/InstitutionSearchForm.jsx b/src/applications/gi/components/search/InstitutionSearchForm.jsx index 1d1e4520d21a..e7ea2102e614 100644 --- a/src/applications/gi/components/search/InstitutionSearchForm.jsx +++ b/src/applications/gi/components/search/InstitutionSearchForm.jsx @@ -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 (
- {/* prod flag for bah-7186 */} -
+
{this.props.search.filterOpened &&

Filter your search

}

Keywords

{ @@ -32,7 +31,6 @@ export class SearchResult extends React.Component { state, country, studentCount, - cautionFlag, cautionFlags, } = this.props; @@ -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 (
@@ -68,16 +58,16 @@ export class SearchResult extends React.Component {

- {(schoolClosing || cautionFlag) && ( + {(schoolClosing || cautionFlags.length > 0) && (
{renderSchoolClosingAlert({ schoolClosing, schoolClosingOn })} - {renderCautionAlert({ cautionFlag, cautionFlags })} + {renderCautionAlert({ cautionFlags })}
)}
-
+

{locationInfo(city, state, country)} @@ -87,7 +77,11 @@ export class SearchResult extends React.Component {

-
+

You may be eligible for up to:

diff --git a/src/applications/gi/components/vet-tec/VetTecProgramSearchResult.jsx b/src/applications/gi/components/vet-tec/VetTecProgramSearchResult.jsx index be351eedcf0e..409463cee797 100644 --- a/src/applications/gi/components/vet-tec/VetTecProgramSearchResult.jsx +++ b/src/applications/gi/components/vet-tec/VetTecProgramSearchResult.jsx @@ -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`; @@ -63,11 +61,11 @@ class VetTecProgramSearchResult extends React.Component { {renderPreferredProviderFlag(this.props.result)}
- {(schoolClosing || cautionFlag) && ( + {(schoolClosing || cautionFlags.length > 0) && (
{renderSchoolClosingAlert({ schoolClosing, schoolClosingOn })} - {renderCautionAlert({ cautionFlag, cautionFlags })} + {renderCautionAlert({ cautionFlags })}
)} diff --git a/src/applications/gi/components/vet-tec/VetTecSearchForm.jsx b/src/applications/gi/components/vet-tec/VetTecSearchForm.jsx index 4d4d905ffa26..9f105365cde3 100644 --- a/src/applications/gi/components/vet-tec/VetTecSearchForm.jsx +++ b/src/applications/gi/components/vet-tec/VetTecSearchForm.jsx @@ -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 { @@ -157,15 +156,13 @@ class VetTecSearchForm extends React.Component { {this.renderCountryFilter()} {this.renderStateFilter()} - {environment.isProduction() ? ( - '' - ) : ( + { - )} + } {this.renderFilterBy()}
diff --git a/src/applications/gi/containers/SearchPage.jsx b/src/applications/gi/containers/SearchPage.jsx index a64bc4b00c15..1b538e615e10 100644 --- a/src/applications/gi/containers/SearchPage.jsx +++ b/src/applications/gi/containers/SearchPage.jsx @@ -4,7 +4,6 @@ import { withRouter } from 'react-router'; import Scroll from 'react-scroll'; import _ from 'lodash'; import classNames from 'classnames'; -import environment from 'platform/utilities/environment'; import { clearAutocompleteSuggestions, @@ -161,20 +160,15 @@ export class SearchPage extends React.Component { pagination: { currentPage, totalPages }, } = search; - // Prod flag for 7183 - const resultsClass = environment.isProduction() - ? classNames( - 'search-results', - 'small-12', - 'usa-width-three-fourths medium-9', - 'columns', - { - opened: !search.filterOpened, - }, - ) - : classNames('search-results', 'small-12', 'medium-9', 'columns', { - opened: !search.filterOpened, - }); + const resultsClass = classNames( + 'search-results', + 'small-12', + 'medium-9', + 'columns', + { + opened: !search.filterOpened, + }, + ); let searchResults; diff --git a/src/applications/gi/sass/gi.scss b/src/applications/gi/sass/gi.scss index aefe3b39e730..491e37f776a4 100644 --- a/src/applications/gi/sass/gi.scss +++ b/src/applications/gi/sass/gi.scss @@ -1,18 +1,17 @@ -@import "~@department-of-veterans-affairs/formation/sass/shared-variables"; -@import "~@department-of-veterans-affairs/formation/sass/modules/m-modal"; +@import '~@department-of-veterans-affairs/formation/sass/shared-variables'; +@import '~@department-of-veterans-affairs/formation/sass/modules/m-modal'; -@import "~@department-of-veterans-affairs/formation/sass/modules/va-pagination"; +@import '~@department-of-veterans-affairs/formation/sass/modules/va-pagination'; -@import "partials/gi-vet-tec"; -@import "partials/gi-preview-banner"; -@import "partials/gi-autocomplete"; -@import "partials/gi-modal"; -@import "partials/gi-landing-page"; -@import "partials/gi-search-page"; -@import "partials/gi-profile-page"; +@import 'partials/gi-vet-tec'; +@import 'partials/gi-preview-banner'; +@import 'partials/gi-autocomplete'; +@import 'partials/gi-modal'; +@import 'partials/gi-landing-page'; +@import 'partials/gi-search-page'; +@import 'partials/gi-profile-page'; .gi-app { - div.military-status-info { font-size: 0.9em; padding: 1em; @@ -51,10 +50,10 @@ line-height: 1.2rem; } - a.link{ + a.link { @include media-maxwidth($small-screen) { margin-left: 1rem; - padding: .5rem; + padding: 0.5rem; } } } @@ -70,14 +69,14 @@ } select.hide-arrows { - background-image: none + background-image: none; } .search-result { i.fa { background: initial; color: initial; - } + } } .benefit-notification { @@ -89,17 +88,6 @@ } } -.gibct-legend-old { - margin-top: 3rem; - display: block; - font-weight: inherit; - font-size: inherit; - color: inherit; - line-height: inherit; - max-width: 46rem; - padding-bottom: 0; -} - .gibct-legend { margin-top: 1rem; display: block; @@ -158,4 +146,4 @@ border-left: 0; } } -} \ No newline at end of file +} diff --git a/src/applications/gi/sass/partials/_gi-search-page.scss b/src/applications/gi/sass/partials/_gi-search-page.scss index 12204ece67af..6e9225f3d21e 100644 --- a/src/applications/gi/sass/partials/_gi-search-page.scss +++ b/src/applications/gi/sass/partials/_gi-search-page.scss @@ -40,12 +40,6 @@ } } - .filters-sidebar-inner-old { - @include media-maxwidth($small-screen) { - padding-bottom: 8rem; - } - } - .filter-button, .results-button { display: none; @@ -192,12 +186,12 @@ .usa-alert { background-color: $color-white; - padding: .5em 1em; + padding: 0.5em 1em; margin-top: 1em; } .usa-alert-text { - margin-top: .25em; + margin-top: 0.25em; } .alert-row { @@ -211,5 +205,4 @@ .usa-alert-heading { font-size: 1em; } - } diff --git a/src/applications/gi/utils/render.jsx b/src/applications/gi/utils/render.jsx index 207ad0e73239..7854927a8d73 100644 --- a/src/applications/gi/utils/render.jsx +++ b/src/applications/gi/utils/render.jsx @@ -1,45 +1,31 @@ import React from 'react'; import AlertBox from '../components/AlertBox'; -import environment from 'platform/utilities/environment'; export const renderSchoolClosingAlert = result => { const { schoolClosing, schoolClosingOn } = result; if (!schoolClosing) return null; - // Prod flag for 6803 - // prod flag for bah-7020 - if (!environment.isProduction()) { - if (schoolClosingOn) { - const currentDate = new Date(); - const schoolClosingDate = new Date(schoolClosingOn); - if (currentDate > schoolClosingDate) { - return ( - School has closed

} - isVisible={!!schoolClosing} - status="warning" - /> - ); - } + + if (schoolClosingOn) { + const currentDate = new Date(); + const schoolClosingDate = new Date(schoolClosingOn); + if (currentDate > schoolClosingDate) { + return ( + School has closed

} + isVisible={!!schoolClosing} + status="warning" + /> + ); } - return ( - School will be closing soon

} - headline="School closing" - isVisible={!!schoolClosing} - status="warning" - /> - ); } - return ( Upcoming campus closure

} - headline="School closure" + content={

School will be closing soon

} + headline="School closing" isVisible={!!schoolClosing} status="warning" /> @@ -47,50 +33,38 @@ export const renderSchoolClosingAlert = result => { }; export const renderCautionAlert = result => { - const { cautionFlag, cautionFlags } = result; + const { cautionFlags } = result; - // Prod flag for 6803 - if (!environment.isProduction()) { - const validFlags = [...cautionFlags] - .filter(flag => flag.title) - .sort((a, b) => (a.title.toLowerCase() < b.title.toLowerCase() ? -1 : 1)); + const validFlags = [...cautionFlags] + .filter(flag => flag.title) + .sort((a, b) => (a.title.toLowerCase() < b.title.toLowerCase() ? -1 : 1)); - return ( - - {validFlags.length === 1 &&

{validFlags[0].title}

} - {validFlags.length > 1 && ( -
    - {validFlags.map(flag => ( -
  • - {flag.title} -
  • - ))} -
- )} - - } - headline={ - validFlags.length > 1 - ? 'This school has cautionary warnings' - : 'This school has a cautionary warning' - } - isVisible={validFlags.length > 0} - status="warning" - /> - ); - } return ( This school has cautionary warnings

} - headline="Caution" - isVisible={cautionFlag} + content={ + + {validFlags.length === 1 &&

{validFlags[0].title}

} + {validFlags.length > 1 && ( +
    + {validFlags.map(flag => ( +
  • + {flag.title} +
  • + ))} +
+ )} +
+ } + headline={ + validFlags.length > 1 + ? 'This school has cautionary warnings' + : 'This school has a cautionary warning' + } + isVisible={validFlags.length > 0} status="warning" /> );