Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev -> staging #631

Merged
merged 34 commits into from
Dec 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
201c6c1
Add 2 feature flags
scott062 Dec 18, 2019
3b647e8
Create function to spy on generated Mock Adapter, make use in a test
mjoyce91 Dec 18, 2019
e49f0a7
Merge branch 'dev' into tests/mock-request-testing-2
mjoyce91 Dec 19, 2019
2b27f85
Merge branch 'dev' into tests/mock-request-testing-2
mjoyce91 Dec 20, 2019
32f8acd
Ability to "search as client" from their public profile
mjoyce91 Dec 20, 2019
b4cd78b
Fix tests and add conditional render of button
mjoyce91 Dec 20, 2019
78c0886
Apply new utility to additional actions tests
mjoyce91 Dec 20, 2019
a8dd14d
Ignore testUtilities from code coverage
mjoyce91 Dec 20, 2019
e439a73
Add Search as Client to Bid Tracker and fix redirect; add loading ani…
mjoyce91 Dec 20, 2019
4090302
Merge pull request #619 from MetaPhase-Consulting/feature/search-as-c…
mjoyce91 Dec 23, 2019
e48badf
Update view for approved bids
mjoyce91 Dec 23, 2019
eb98893
Merge branch 'dev' into update/approved-bid
mjoyce91 Dec 23, 2019
02089e3
Update snapshot
mjoyce91 Dec 23, 2019
ef5ad32
Merge branch 'update/approved-bid' of github.com:MetaPhase-Consulting…
mjoyce91 Dec 23, 2019
2a39be1
Display updated in-panel information from the api
mjoyce91 Dec 23, 2019
6372c68
Merge pull request #621 from MetaPhase-Consulting/update/approved-bid
mjoyce91 Dec 23, 2019
845af91
Merge pull request #622 from MetaPhase-Consulting/update/in-panel-bid
mjoyce91 Dec 27, 2019
aa0c572
Fix IE11 file download
mjoyce91 Dec 27, 2019
d6a2691
Merge pull request #624 from MetaPhase-Consulting/fix/ie-11-export
mjoyce91 Dec 27, 2019
5eae231
Update flags to compensate for dev updates
scott062 Dec 27, 2019
9bde4df
Add correct feature flag to correct componenet
scott062 Dec 27, 2019
e884a40
Toggle feature flag false
scott062 Dec 27, 2019
d7559f7
Add cdo_bidding flag
scott062 Dec 27, 2019
f1cfc0a
Add feature flag logic to BidderPortfolios
scott062 Dec 27, 2019
fcfb262
Update snapshots
scott062 Dec 27, 2019
4a6d440
Merge conflicts
scott062 Dec 27, 2019
64e88d9
Set cdo flags to true
scott062 Dec 27, 2019
b927354
Display toast notification for submitting bids
mjoyce91 Dec 27, 2019
e3e67a1
Merge pull request #626 from MetaPhase-Consulting/update/add-feature-…
scott062 Dec 27, 2019
7fd95e7
Merge branch 'dev' into update/toast-submit-bid
mjoyce91 Dec 28, 2019
e9b7aaa
Merge pull request #627 from MetaPhase-Consulting/update/toast-submit…
mjoyce91 Dec 28, 2019
38c649c
Merge branch 'dev' into tests/mock-request-testing-2
mjoyce91 Dec 30, 2019
94e8574
Merge pull request #610 from MetaPhase-Consulting/tests/mock-request-…
mjoyce91 Dec 30, 2019
3ac9178
Merge branch 'staging' into dev
mjoyce91 Dec 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
"!src/actions/showStaticContent.js",
"!src/reducers/showStaticContent.js",
"!src/Components/CSV/**/*.{js,jsx}",
"!src/polyfills/**/*.{js,jsx}"
"!src/polyfills/**/*.{js,jsx}",
"!src/testUtilities/**/*"
],
"coverageReporters": [
"text-summary",
Expand Down
4 changes: 3 additions & 1 deletion public/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"bid_count": true,
"personalization": true,
"persona_auth": true,
"client_counts": false
"client_counts": false,
"cdo_season_filter": true,
"cdo_bidding": true
}
}
4 changes: 3 additions & 1 deletion public/config/config_dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"bid_count": true,
"personalization": true,
"persona_auth": true,
"client_counts": false
"client_counts": false,
"cdo_season_filter": true,
"cdo_bidding": true
}
}
3 changes: 2 additions & 1 deletion src/Components/BidTracker/BidHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import getConfig, { isTypeComplete } from './BidPhaseConfig/config';

// determine whether to show an alert on the bid tracker based on the status
export function shouldShowAlert(bid, { condensedView = false }) {
const alertStatusArray = [DRAFT_PROP, APPROVED_PROP, CLOSED_PROP,
// TO-DO - Add APPROVED_PROP back in with meanginful information
const alertStatusArray = [DRAFT_PROP, CLOSED_PROP,
HAND_SHAKE_DECLINED_PROP, DECLINED_PROP];

if (isTypeComplete()) {
Expand Down
4 changes: 3 additions & 1 deletion src/Components/BidTracker/BidPhaseConfig/Complete.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { get } from 'lodash';
import { anyToTitleCase } from 'utilities';
import {
APPROVED_PROP,
CLOSED_PROP,
Expand Down Expand Up @@ -206,7 +208,7 @@ export default function bidClassesFromCurrentStatus(bid = { status: 'draft' }) {
bidClassObject.stages[IN_PANEL_PROP] = {
...DEFAULT_INCOMPLETE_OBJECT,
date: IN_PANEL_DATE,
title: PANEL_TITLE,
title: `${PANEL_TITLE}${get(bid, 'panel_status') ? ` (${anyToTitleCase(bid.panel_status)})` : ''}`,
needsAction: false,
isCurrent: true,
// Only show the rescheduled tooltip if it has a
Expand Down
4 changes: 0 additions & 4 deletions src/Components/BidTracker/BidPhaseConfig/Limited.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { keys } from 'lodash';
import {
APPROVED_PROP,
HAND_SHAKE_OFFERED_PROP,
IN_PANEL_PROP,
GET_HAND_SHAKE_EVALUATING_TITLE,
} from '../../../Constants/BidData';
import getBidObject from './Complete';
Expand All @@ -22,8 +20,6 @@ export default function bidClassesFromCurrentStatus(bid = { status: 'draft' }) {

bidClassObject$.stages[HAND_SHAKE_OFFERED_PROP].title = HAND_SHAKE_EVALUATING_TITLE;
bidClassObject$.stages[HAND_SHAKE_OFFERED_PROP].date = null;
bidClassObject$.stages[IN_PANEL_PROP].date = null;
bidClassObject$.stages[APPROVED_PROP].date = null;

return bidClassObject$;
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ exports[`BidStepsComponent matches snapshot 1`] = `
</div>
<div
className="step-title-sub-text"
/>
>
12/20/2017
</div>
</div>
}
/>
Expand Down Expand Up @@ -194,7 +196,9 @@ exports[`BidStepsComponent matches snapshot 1`] = `
</div>
<div
className="step-title-sub-text"
/>
>
12/20/2017
</div>
</div>
}
/>
Expand Down
2 changes: 2 additions & 0 deletions src/Components/BidTracker/BidTracker.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { get } from 'lodash';
import SearchAsClientButton from 'Components/BidderPortfolio/SearchAsClientButton/SearchAsClientButton';
import { BID_LIST, NOTIFICATION_LIST, USER_PROFILE } from '../../Constants/PropTypes';
import BidTrackerCardList from './BidTrackerCardList';
import ProfileSectionTitle from '../ProfileSectionTitle';
Expand All @@ -18,6 +19,7 @@ userProfileIsLoading, isPublic, useCDOView }) => {
return (
<div className="usa-grid-full profile-content-inner-container bid-tracker-page">
<BackButton />
{ isPublic && <SearchAsClientButton user={userProfile} /> }
{
!isPublic &&
<NotificationsSection
Expand Down
6 changes: 5 additions & 1 deletion src/Components/BidderPortfolio/BidControls/BidControls.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { checkFlag } from 'flags';
import SelectForm from '../../SelectForm';
import { BID_PORTFOLIO_SORTS, BID_PORTFOLIO_FILTERS } from '../../../Constants/Sort';
import ResultsViewBy from '../../ResultsViewBy/ResultsViewBy';
import BidCyclePicker from './BidCyclePicker';
import CDOAutoSuggest from '../CDOAutoSuggest';

const useCDOSeasonFilter = () => checkFlag('flags.cdo_season_filter');

class BidControls extends Component {
constructor(props) {
super(props);
Expand All @@ -28,6 +31,7 @@ class BidControls extends Component {
<div className="portfolio-sort-container-contents" style={{ float: 'left' }}>
<CDOAutoSuggest />
</div>
{useCDOSeasonFilter() &&
<div className="portfolio-sort-container-contents">
<BidCyclePicker />
<SelectForm
Expand All @@ -42,7 +46,7 @@ class BidControls extends Component {
label="Sort by:"
onSelectOption={this.onSortChange}
/>
</div>
</div>}
</div>
<div className="usa-width-one-whole portfolio-sort-container results-dropdown">
<ResultsViewBy initial={viewType} onClick={changeViewType} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { get } from 'lodash';
import { Link } from 'react-router-dom';
import { checkFlag } from 'flags';
import { BIDDER_OBJECT } from '../../../Constants/PropTypes';
import BoxShadow from '../../BoxShadow';
import SkillCodeList from '../../SkillCodeList';
Expand All @@ -9,6 +10,8 @@ import ClientBadgeList from '../ClientBadgeList';
import StaticDevContent from '../../StaticDevContent';
import SearchAsClientButton from '../SearchAsClientButton';

const useCDOBidding = () => checkFlag('flags.cdo_bidding');

const BidderPortfolioStatCard = ({ userProfile }) => {
const currentAssignmentText = get(userProfile, 'pos_location_code');
return (
Expand Down Expand Up @@ -44,9 +47,10 @@ const BidderPortfolioStatCard = ({ userProfile }) => {
/>
</StaticDevContent>
</div>
{useCDOBidding() &&
<div className="button-container" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<SearchAsClientButton user={userProfile} />
</div>
</div>}
</div>
</BoxShadow>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { get } from 'lodash';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { checkFlag } from 'flags';
import { BIDDER_OBJECT } from '../../../Constants/PropTypes';
import SkillCodeList from '../../SkillCodeList';
import { NO_GRADE, NO_POST } from '../../../Constants/SystemMessages';
Expand All @@ -11,6 +12,8 @@ import Avatar from '../../Avatar';
import CheckboxList from '../CheckboxList';
import SearchAsClientButton from '../SearchAsClientButton';

const useCDOBidding = () => checkFlag('flags.cdo_bidding');

const BidderPortfolioStatRow = ({ userProfile, showEdit }) => {
const currentAssignmentText = get(userProfile, 'pos_location_code');
return (
Expand Down Expand Up @@ -54,7 +57,7 @@ const BidderPortfolioStatRow = ({ userProfile, showEdit }) => {
</div>
}
{
!showEdit &&
!showEdit && useCDOBidding() &&
<div className="button-container">
<SearchAsClientButton user={userProfile} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ export class SearchAsClientButton extends Component {
super(props);
this.onClick = this.onClick.bind(this);
this.state = {
hasPushed: false,
clicked: false,
};
}

componentWillReceiveProps(nextProps) {
const { hasPushed } = this.state;
const { clicked } = this.state;
const { client, isLoading, hasErrored, history, user } = nextProps;
const { perdet_seq_number: id } = user;
if (client.perdet_seq_number === id && client && client.perdet_seq_number &&
!isLoading && !hasErrored && !hasPushed) {
!isLoading && !hasErrored && clicked) {
const query = genSearchParams(user);
this.setState({ hasPushed: true }, () => {
this.setState({ clicked: false }, () => {
setTimeout(() => {
history.push(`/results?${query}`);
const offset = document.getElementById(ID).offsetTop;
Expand All @@ -58,15 +58,17 @@ export class SearchAsClientButton extends Component {
const { set, user, isLoading } = this.props;
const { perdet_seq_number: id } = user;
if (!isLoading) {
set(id);
this.setState({
clicked: true,
}, () => set(id));
}
}

render() {
const { buttonProps, className } = this.props;
return (
<button
className={`usa-button-primary ${className}`}
className={`usa-button-primary search-as-client-button ${className}`}
onClick={this.onClick}
{...buttonProps}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ describe('SearchAsClientButton', () => {
expect(wrapper).toBeDefined();
});

it('sets state and pushes to history when newProps client.id matches id', (done) => {
it('sets pushes to history when newProps client.id matches id', (done) => {
const spy = sinon.spy();
global.document.getElementById = () => ({ offsetTop: '50px' });
const wrapper = shallow(<SearchAsClientButton {...props} />);
wrapper.simulate('click');
wrapper.setProps({
...props,
client: { perdet_seq_number: 1 },
history: { push: spy },
client: { perdet_seq_number: 1 },
isLoading: false,
hasErrored: false,
});
setTimeout(() => {
expect(wrapper.instance().state.hasPushed).toBe(true);
sinon.assert.calledOnce(spy);
done();
}, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`SearchAsClientButton matches snapshot 1`] = `
<button
className="usa-button-primary "
className="usa-button-primary search-as-client-button "
onClick={[Function]}
>
Search as Client
Expand Down
39 changes: 26 additions & 13 deletions src/Components/ClientHeader/ClientHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ import { Link } from 'react-router-dom';
import { withRouter } from 'react-router';
import FA from 'react-fontawesome';
import { get } from 'lodash';
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
import { BIDDER_OBJECT } from '../../Constants/PropTypes';
import { unsetClient } from '../../actions/clientView';
import { isCurrentPath } from '../ProfileMenu/navigation';
import { tertiaryCoolBlueLighter, tertiaryCoolBlueLightest } from '../../sass/sass-vars/variables';

export const ID = 'client-header';

const skeletonColors = {
highlightColor: tertiaryCoolBlueLighter,
color: tertiaryCoolBlueLightest,
};

export class ClientHeader extends Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -62,36 +69,42 @@ export class ClientHeader extends Component {
const { client, isLoading, hasErrored, bidderPortfolioSelectedCDO } = this.props;
const name = client && client.name ? client.name : 'Unknown user';

const isSuccess = client && !!client.perdet_seq_number && !isLoading && !hasErrored;
const isSuccess = !!(client && !!client.perdet_seq_number && !isLoading && !hasErrored);

const proxyName = get(bidderPortfolioSelectedCDO, 'name') && !get(bidderPortfolioSelectedCDO, 'isCurrentUser') ?
get(bidderPortfolioSelectedCDO, 'name') : '';

const renderHeader = () => (
<div className="usa-banner client-header">
<div className={`usa-banner client-header ${isLoading ? 'client-header--is-loading' : ''}`}>
<div className="usa-grid usa-banner-inner">
<div className={!showReturnLink ? 'hidden' : ''}>
<Link to={`/profile/public/${client.perdet_seq_number}`}>
<FA name="chevron-left" />
<span>Client Dashboard</span>
</Link>
<SkeletonTheme {...skeletonColors}>
{!isLoading ? <Link to={`/profile/public/${client.perdet_seq_number}`}>
<FA name="chevron-left" />
<span>Client Dashboard</span>
</Link> : <Skeleton width="75%" duration={1.8} />}
</SkeletonTheme>
</div>
<div>
<FA name="clipboard" />
<span id="search-as-name">Position Search for {name}{!!proxyName && ` (Proxying as ${proxyName})`}</span>
<SkeletonTheme {...skeletonColors}>
{!isLoading ? <span><FA name="clipboard" />
<span id="search-as-name">Position Search for {name}{!!proxyName && ` (Proxying as ${proxyName})`}</span></span> : <Skeleton width="75%" duration={1.8} />}
</SkeletonTheme>
</div>
<div>
<button className="unstyled-button" onClick={this.unsetClient}>
<FA name="close" />
<span>Exit client view</span>
</button>
<SkeletonTheme {...skeletonColors}>
{!isLoading ? <button className="unstyled-button" onClick={this.unsetClient}>
<FA name="close" />
<span>Exit client view</span>
</button> : <Skeleton width="75%" duration={1.8} />}
</SkeletonTheme>
</div>
</div>
</div>
);
return (
<div id={ID}>
{isSuccess && renderHeader()}
{isSuccess || isLoading ? renderHeader() : null}
</div>
);
}
Expand Down
Loading