Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
* dev-staging-sprint5: (87 commits)
  Add error handling for position details screen (#93)
  Display the service needs filter as a pill on the results page (#95)
  Remove bidListToggleIsLoading since that is handled in BidListButton container
  feature: include org info for domestic positions (#92)
  Remove eslint-disable
  Break out compare elements into their own rows, add Bid List button to comparisons, use Set() for bidListToggleIsLoading
  Conditional rendering of Bid Count on Bid Tracker cards, update Results cards data order and style
  Homepage QA (#90)
  Remove How to Bid section from position details (#89)
  Change dropdown menu link name from "Profile" to "Dashboard"
  Add test coverage, use cancel tokens
  Track old compare choices to maintain sorting during an update
  Comparison drawer component, add event listeners where needed, remove old comparison UI from results page
  Code smells (#86)
  Trigger circleci build
  Update snapshots
  Add link-container class back in
  Reverting the changes to the glossary card due to the new term dialog breaking
  Fix search styles from breaking on the bidder portfolio
  fix: set a width on the cards for the favorite positions profile screen (#80)
  ...

# Conflicts:
#	src/Components/GlossaryEditor/GlossaryEditorCard/GlossaryEditorCard.jsx
#	src/Components/HomePagePositionsList/HomePagePositionsList.jsx
#	src/Components/HomePagePositionsSection/__snapshots__/HomePagePositionsSection.test.jsx.snap
#	src/Components/PositionTitle/PositionTitle.jsx
#	src/Components/PositionTitle/__snapshots__/PositionTitle.test.jsx.snap
#	src/Components/ProfileDashboard/ProfileDashboard.jsx
#	src/sass/_condensedCard.scss
#	src/utilities.js
  • Loading branch information
mjoyce91 committed Mar 7, 2019
2 parents 72a54f9 + c86270c commit 1de3839
Show file tree
Hide file tree
Showing 125 changed files with 2,955 additions and 497 deletions.
4 changes: 3 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ plugins:
enabled: true
exclude_patterns:
- node_modules/
- config/ # build configuration
- build/ # build artifacts
- config/ # build configuration - config/ # build configuration
- coverage/ # test coverage
- scripts/ # build & utility scripts
- src/__mocks__/ # test objects
- src/Constants/PropTypes.js # shape definitions
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"rc-steps": "^3.1.0",
"react": "^15.6.2",
"react-autosuggest": "^9.3.2",
"react-csv": "^1.1.1",
"react-dom": "^15.6.2",
"react-fontawesome": "^1.6.1",
"react-helmet": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Components/AccountDropdown/AccountDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class AccountDropdown extends Component {
<div>Signed in as</div>
<strong>{displayName}</strong>
</div>
<Link className="account-dropdown--identity account-dropdown--segment account-dropdown-link" to="/profile/dashboard" onClick={this.hideDropdown}>Profile</Link>
<Link className="account-dropdown--identity account-dropdown--segment account-dropdown-link" to="/profile/dashboard" onClick={this.hideDropdown}>Dashboard</Link>
<Link className="account-dropdown--identity account-dropdown--segment account-dropdown-link" to="/logout" onClick={this.logout}>Logout</Link>
</DropdownContent>
</Dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`AccountDropdown matches snapshot 1`] = `
replace={false}
to="/profile/dashboard"
>
Profile
Dashboard
</Link>
<Link
className="account-dropdown--identity account-dropdown--segment account-dropdown-link"
Expand Down Expand Up @@ -96,7 +96,7 @@ exports[`AccountDropdown matches snapshot when shouldDisplayName is true 1`] = `
replace={false}
to="/profile/dashboard"
>
Profile
Dashboard
</Link>
<Link
className="account-dropdown--identity account-dropdown--segment account-dropdown-link"
Expand Down
10 changes: 9 additions & 1 deletion src/Components/BidTracker/BidTrackerCard/BidTrackerCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
DRAFT_PROP,
} from '../../../Constants/BidData';

const BidTrackerCard = ({ bid, acceptBid, declineBid, submitBid, deleteBid, userProfile }) => {
const BidTrackerCard = ({ bid, acceptBid, declineBid, submitBid, deleteBid, showBidCount,
userProfile }) => {
// determine whether we render an alert on top of the card
const showAlert = shouldShowAlert(bid);
// determine whether we should show the contacts section based on the status
Expand All @@ -28,6 +29,7 @@ const BidTrackerCard = ({ bid, acceptBid, declineBid, submitBid, deleteBid, user
<BidTrackerCardTop
bid={bid}
deleteBid={deleteBid}
showBidCount={showBidCount}
/>
<div className={`usa-grid-full padded-container-inner bid-tracker-bid-steps-container ${draftClass}`}>
<BidSteps bid={bid} />
Expand Down Expand Up @@ -66,6 +68,12 @@ BidTrackerCard.propTypes = {
submitBid: PropTypes.func.isRequired,
deleteBid: PropTypes.func.isRequired,
userProfile: USER_PROFILE.isRequired,
showBidCount: PropTypes.bool,
};

BidTrackerCard.defaultProps = {
showBidCount: true,
};


export default BidTrackerCard;
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ exports[`BidTrackerCardComponent matches snapshot 1`] = `
}
}
deleteBid={[Function]}
showBidCount={true}
showQuestion={true}
/>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ const BidTrackerCardBottom = (props) => {
};

BidTrackerCardBottom.propTypes = {
reviewer: BID_REVIEWER_OBJECT.isRequired,
reviewer: BID_REVIEWER_OBJECT,
bureau: PropTypes.string.isRequired,
userProfile: USER_PROFILE.isRequired,
};

BidTrackerCardBottom.defaultProps = {
reviewer: null,
};

export default BidTrackerCardBottom;
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { BID_OBJECT, USER_PROFILE } from '../../../Constants/PropTypes';
import BidTrackerCard from '../BidTrackerCard';
import IsPriority from '../PriorityCards/IsPriority';
import IsOnStandby from '../PriorityCards/IsOnStandby';
import { DRAFT_PROP } from '../../../Constants/BidData';

// assign values to constants for equality checks later
const DEFAULT = 'default';
const PRIORITY = 'priority';
const STANDBY = 'standby';

// Here we'll figure out which wrapper to use around the BidTrackerCard, if any.
// We check two things - one, is there even a priority bid in the list (priorityExists).
Expand All @@ -12,22 +18,19 @@ import IsOnStandby from '../PriorityCards/IsOnStandby';
// object to the IsOnStandby component.
const BidTrackerCardContainer = ({ bid, acceptBid, declineBid, priorityExists, userProfile,
submitBid, deleteBid }) => {
const card = (
const getCard = ({ ...props }) => (
<BidTrackerCard
bid={bid}
acceptBid={acceptBid}
declineBid={declineBid}
userProfile={userProfile}
submitBid={submitBid}
deleteBid={deleteBid}
showBidCount={bid.status !== DRAFT_PROP}
{...props}
/>
);

// assign values to constants for equality checks later
const DEFAULT = 'default';
const PRIORITY = 'priority';
const STANDBY = 'standby';

// Set a displayType and change it based on priority.
// This way we can ensure that we only have one output in our return
let displayType = DEFAULT;
Expand All @@ -37,13 +40,13 @@ submitBid, deleteBid }) => {
let cardComponent;
switch (displayType) {
case PRIORITY:
cardComponent = (<IsPriority>{card}</IsPriority>);
cardComponent = (<IsPriority>{getCard({ showBidCount: false })}</IsPriority>);
break;
case STANDBY:
cardComponent = (<IsOnStandby bid={bid} deleteBid={deleteBid} />);
break;
default:
cardComponent = card;
cardComponent = getCard();
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ exports[`BidTrackerCardContainerComponent matches snapshot when priorityExists i
}
declineBid={[Function]}
deleteBid={[Function]}
showBidCount={true}
submitBid={[Function]}
userProfile={
Object {
Expand Down Expand Up @@ -232,6 +233,7 @@ exports[`BidTrackerCardContainerComponent matches snapshot when priorityExists i
}
declineBid={[Function]}
deleteBid={[Function]}
showBidCount={false}
submitBid={[Function]}
userProfile={
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,40 @@ import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { BID_STATISTICS_OBJECT, POST_DETAILS } from '../../../Constants/PropTypes';
import BidCount from '../../BidCount';
import { SUBMITTED_PROP } from '../../../Constants/BidData';
import { getPostName } from '../../../utilities';

const BidTrackerCardTitle = ({ title, id, status, bidStatistics, post }) => (
const BidTrackerCardTitle = ({ title, id, bidStatistics, post, showBidCount }) => (
<div className="usa-grid-full">
<div className="usa-grid-full bid-tracker-card-title-container">
<div className="bid-tracker-card-title-text">{title}</div>
<div className="bid-tracker-card-title-link">
<Link to={`/details/${id}`}>View position</Link>
</div>
</div>
{status === SUBMITTED_PROP &&
<div className="usa-grid-full">
<div className="bid-tracker-card-title-bottom">
<strong>Post:</strong> {getPostName(post)}
</div>
<span className="bid-stats">
<BidCount bidStatistics={bidStatistics} altStyle />
</span>
<div className="usa-grid-full">
<div className="bid-tracker-card-title-bottom">
<strong>Post:</strong> {getPostName(post)}
</div>
}
{
showBidCount &&
<span className="bid-stats">
<BidCount bidStatistics={bidStatistics} altStyle />
</span>
}
</div>
</div>
);

BidTrackerCardTitle.propTypes = {
title: PropTypes.string.isRequired,
id: PropTypes.number.isRequired,
status: PropTypes.string.isRequired,
bidStatistics: BID_STATISTICS_OBJECT.isRequired,
post: POST_DETAILS.isRequired,
showBidCount: PropTypes.bool,
};

BidTrackerCardTitle.defaultProps = {
showBidCount: true,
};

export default BidTrackerCardTitle;
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,45 @@ exports[`BidTrackerCardTitleComponent matches snapshot when status is not "submi
</Link>
</div>
</div>
<div
className="usa-grid-full"
>
<div
className="bid-tracker-card-title-bottom"
>
<strong>
Post:
</strong>
Maseru, Lesotho
</div>
<span
className="bid-stats"
>
<BidCount
altStyle={true}
bidStatistics={
Object {
"approved_bidders": 1,
"available_domestic_positions": 81,
"available_international_positions": 159,
"available_positions": 240,
"bidding_days_remaining": 30,
"cycle_deadline_date": "2018-02-10T00:00:00Z",
"cycle_end_date": "2018-04-10T00:00:00Z",
"cycle_start_date": "2017-10-10T00:00:00Z",
"id": 1,
"in_panel_bidders": 0,
"name": "Demo BidCycle 2018-01-10 15:52:20.583434",
"total_bidders": 4,
"total_bids": 40,
"total_positions": 251,
}
}
hideLabel={false}
label="Bid count:"
/>
</span>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BidTrackerCardTop extends Component {
}

render() {
const { bid, showQuestion } = this.props;
const { bid, showBidCount, showQuestion } = this.props;
const bidStatistics = get(bid, 'position.bid_statistics[0]', {});
const post = get(bid, 'position.post', {});
return (
Expand All @@ -33,6 +33,7 @@ class BidTrackerCardTop extends Component {
status={bid.status}
bidStatistics={bidStatistics}
post={post}
showBidCount={showBidCount}
/>
</div>
<div>
Expand Down Expand Up @@ -64,10 +65,12 @@ BidTrackerCardTop.propTypes = {
bid: BID_OBJECT.isRequired,
showQuestion: PropTypes.bool, // Determine whether or not to show the question text
deleteBid: PropTypes.func.isRequired,
showBidCount: PropTypes.bool,
};

BidTrackerCardTop.defaultProps = {
showQuestion: true,
showBidCount: true,
};

export default BidTrackerCardTop;
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports[`BidTrackerCardTopComponent matches snapshot 1`] = `
},
}
}
showBidCount={true}
status="approved"
title="POLITICAL/ECONOMIC OFFICER"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ const IsOnStandby = ({ bid, deleteBid }) => {
bid-tracker-standby-container ${useDisabledClass && 'standby-container-disabled'}`}
>
<div className="padded-container-inner bid-tracker-standby-title">
<div className="bid-tracker-standby-title-top">
{ useDisabledClass && <FontAwesome name="check-circle-o" /> }
{bidStatus}
<div className="bid-tracker-standby-inner-container">
<div className="bid-tracker-standby-title-top">
{ useDisabledClass && <FontAwesome name="check-circle-o" /> }
{bidStatus}
</div>
{ !useDisabledClass && <div className="bid-tracker-standby-title-bottom">(on-hold)</div> }
</div>
{ !useDisabledClass && <div className="bid-tracker-standby-title-bottom">(on-hold)</div> }
</div>
<div className="bid-tracker-standby-content-container">
<BidTrackerCardTop showQuestion={false} bid={bid} deleteBid={deleteBid} />
<BidTrackerCardTop
showBidCount={false}
showQuestion={false}
bid={bid}
deleteBid={deleteBid}
/>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ exports[`IsOnStandbyComponent matches snapshot 1`] = `
className="padded-container-inner bid-tracker-standby-title"
>
<div
className="bid-tracker-standby-title-top"
className="bid-tracker-standby-inner-container"
>
Approved
</div>
<div
className="bid-tracker-standby-title-bottom"
>
(on-hold)
<div
className="bid-tracker-standby-title-top"
>
Approved
</div>
<div
className="bid-tracker-standby-title-bottom"
>
(on-hold)
</div>
</div>
</div>
<div
Expand Down Expand Up @@ -73,6 +77,7 @@ exports[`IsOnStandbyComponent matches snapshot 1`] = `
}
}
deleteBid={[Function]}
showBidCount={false}
showQuestion={false}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const BidderPortfolioCard = ({ userProfile }) => (
draft={userProfile.bid_statistics[0] ? userProfile.bid_statistics[0].draft : 0}
submitted={userProfile.bid_statistics[0] ? userProfile.bid_statistics[0].submitted : 0}
/>
<BidderPortfolioViewMore useLink />
<BidderPortfolioViewMore useLink id={userProfile.id} />
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ exports[`BidderPortfolioCardComponent matches snapshot 1`] = `
/>
<BidderPortfolioViewMore
className="unstyled-button"
id={1}
isExpanded={false}
onClick={[Function]}
useLink={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class BidderPortfolioGridItem extends Component {
className="tm-button-alt"
onClick={this.expandSection}
isExpanded={expanded}
id={userProfile.id}
/>
</div>
</div>
Expand Down
Loading

0 comments on commit 1de3839

Please sign in to comment.