forked from USStateDept/State-TalentMAP
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix bid tracker URL #863
Merged
Merged
Fix bid tracker URL #863
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e6cc397
Fix public "Go to Bid Tracker" button directing a CDO to their own Bi…
mjoyce91 1bec50f
Include helper file
mjoyce91 4ccb641
Merge branch 'dev' into fix/bid-tracker-url
mjoyce91 3b6293d
add missing import
mjoyce91 649e30b
Remove unnecessary id props
mjoyce91 90affee
Update snapshots
mjoyce91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { BID_OBJECT } from '../../../Constants/PropTypes'; | ||
import { BID_OBJECT } from 'Constants/PropTypes'; | ||
import { APPROVED_PROP, CLOSED_PROP, HAND_SHAKE_OFFERED_PROP, DRAFT_PROP, | ||
HAND_SHAKE_DECLINED_PROP, IN_PANEL_PROP, DECLINED_PROP, PANEL_RESCHEDULED_PROP } from '../../../Constants/BidData'; | ||
HAND_SHAKE_DECLINED_PROP, IN_PANEL_PROP, DECLINED_PROP, PANEL_RESCHEDULED_PROP } from 'Constants/BidData'; | ||
import ApprovedAlert from './ApprovedAlert'; | ||
import HandshakeOfferedAlert from './HandshakeOfferedAlert'; | ||
import InPanelAlert from './InPanelAlert'; | ||
|
@@ -11,10 +11,12 @@ import DeclinedAlert from './DeclinedAlert'; | |
import ClosedAlert from './ClosedAlert'; | ||
import PanelRescheduledAlert from './PanelRescheduledAlert'; | ||
import DraftAlert from './DraftAlert'; | ||
import { getBidIdUrl } from './helpers'; | ||
|
||
// Alert rendering based on status is handled here. | ||
// eslint-disable-next-line complexity | ||
const OverlayAlert = ({ bid, acceptBid, declineBid, submitBid }, { condensedView }) => { | ||
const OverlayAlert = ({ bid, acceptBid, declineBid, submitBid, userId }, | ||
{ condensedView, readOnly }) => { | ||
const CLASS_PENDING = 'bid-tracker-overlay-alert--pending'; | ||
const CLASS_SUCCESS = 'bid-tracker-overlay-alert--success'; | ||
const CLASS_CLOSED = 'bid-tracker-overlay-alert--closed'; | ||
|
@@ -23,6 +25,8 @@ const OverlayAlert = ({ bid, acceptBid, declineBid, submitBid }, { condensedView | |
const { position } = bid; | ||
const BID_TITLE = `${position.title}${position.position_number ? ` (${position.position_number})` : ''}`; | ||
|
||
const bidIdUrl = getBidIdUrl(bid.id, readOnly, userId); | ||
|
||
let overlayClass = ''; | ||
let overlayContent = ''; | ||
|
||
|
@@ -53,6 +57,7 @@ const OverlayAlert = ({ bid, acceptBid, declineBid, submitBid }, { condensedView | |
userName={bid.user} | ||
acceptBid={acceptBid} | ||
declineBid={declineBid} | ||
bidIdUrl={bidIdUrl} | ||
/> | ||
); | ||
break; | ||
|
@@ -66,16 +71,23 @@ const OverlayAlert = ({ bid, acceptBid, declineBid, submitBid }, { condensedView | |
userName={bid.user} | ||
bureau={position.bureau} | ||
id={bid.id} | ||
bidIdUrl={bidIdUrl} | ||
/> | ||
); | ||
break; | ||
case DECLINED_PROP: | ||
overlayClass = CLASS_CLOSED; | ||
overlayContent = <DeclinedAlert bureau={position.bureau} id={bid.id} />; | ||
overlayContent = <DeclinedAlert bureau={position.bureau} id={bid.id} bidIdUrl={bidIdUrl} />; | ||
break; | ||
case CLOSED_PROP: | ||
overlayClass = CLASS_CLOSED; | ||
overlayContent = <ClosedAlert title={BID_TITLE} date={bid.closed_date} id={bid.id} />; | ||
overlayContent = | ||
(<ClosedAlert | ||
title={BID_TITLE} | ||
date={bid.closed_date} | ||
id={bid.id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need to send in |
||
bidIdUrl={bidIdUrl} | ||
/>); | ||
break; | ||
case PANEL_RESCHEDULED_PROP: | ||
overlayClass = CLASS_PENDING; | ||
|
@@ -109,10 +121,16 @@ OverlayAlert.propTypes = { | |
acceptBid: PropTypes.func.isRequired, | ||
declineBid: PropTypes.func.isRequired, | ||
submitBid: PropTypes.func.isRequired, | ||
userId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
}; | ||
|
||
OverlayAlert.defaultProps = { | ||
userId: '', | ||
}; | ||
|
||
OverlayAlert.contextTypes = { | ||
condensedView: PropTypes.bool, | ||
readOnly: PropTypes.bool, | ||
}; | ||
|
||
export default OverlayAlert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const getBidIdUrl = (id = '', isPublic = false, userId = '') => { | ||
let url = '/profile/bidtracker'; | ||
if (isPublic && userId) { | ||
url = `${url}/public/${userId}`; | ||
} | ||
if (id) { | ||
url = `${url}/${id}`; | ||
} | ||
return url; | ||
}; | ||
|
||
export default getBidIdUrl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other comment:
id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, removed. Re-running tests now