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

Non-gov & dependabots update #1498

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions assets/client/src/components/ChallengeDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const ChallengeDetails = ({challenge, challengePhases, preview, print, ta
<div className="follow-tooltip__section">
<h4>Follow challenge as guest</h4>
<p>Receive challenge updates to your email. No sign-in required</p>
<a href={preview ? null : challenge.gov_delivery_topic_subscribe_link}>
<a href={preview ? "#" : `${encodeURIComponent(challenge.gov_delivery_topic_subscribe_link)}`}>
<button className="follow-tooltip__button">Follow challenge</button>
</a>
</div>
Expand Down Expand Up @@ -350,7 +350,7 @@ export const ChallengeDetails = ({challenge, challengePhases, preview, print, ta
<div className="logos">
<img
className="agency-logo"
src={imageBase + challenge.agency_logo}
src={`${imageBase}${encodeURIComponent(challenge.agency_logo)}`}
alt={`Agency logo for ${challenge.agency_name}`}
/>

Expand Down Expand Up @@ -404,7 +404,7 @@ export const ChallengeDetails = ({challenge, challengePhases, preview, print, ta
</div>
}
{!print &&
<a className="follow__btn" href={apiUrl + `/public/previews/challenges?challenge=${challenge.uuid}&print=true`} target="_blank">
<a className="follow__btn" href={`${apiUrl}/public/previews/challenges?challenge=${encodeURIComponent(challenge.uuid)}&print=true`} target="_blank" rel="noopener noreferrer">
<span className="details__btn">
<svg className="usa-icon" aria-hidden="true" focusable="false" role="img"
style={{fill: "#FA9441", height: "21px", width: "21px", position: "relative", top: "5px", right: "5px"}}>
Expand Down
6 changes: 3 additions & 3 deletions assets/client/src/components/ChallengeTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const ChallengeTile = ({challenge, preview}) => {
<div className="agency_image_wrapper">
<img
className="agency-logo"
src={imageBase + challenge.agency_logo}
src={`${imageBase}${encodeURIComponent(challenge.agency_logo)}`}
alt={truncateString(`Agency Logo: ${challenge.agency_name}`, 90)}
/>
</div>
Expand All @@ -134,7 +134,7 @@ export const ChallengeTile = ({challenge, preview}) => {
<div className="image_wrapper">
<img
className="agency-logo"
src={imageBase + challenge.agency_logo}
src={`${imageBase}${encodeURIComponent(challenge.agency_logo)}`}
alt={truncateString(`Agency Logo: ${challenge.agency_name}`, 90)}
/>
</div>
Expand All @@ -144,7 +144,7 @@ export const ChallengeTile = ({challenge, preview}) => {
return (
challenge ? (
<div key={challenge.id} className="challenge-tile card">
<a href={challengeTileUrl(challenge, preview)} target={challenge.external_url ? "_blank" : ""} aria-label="">
<a href={encodeURI(challengeTileUrl(challenge, preview))} target={challenge.external_url ? "_blank" : ""} aria-label="">
{renderTileLogo()}
<div className="challenge-tile__text-wrapper">
<h2 className="challenge-tile__title test" aria-label="" style={{ textAlign: 'left', paddingLeft: '20px', paddingTop: '20px', lineHeight: '30px' }}>{truncateString(challenge.title, 90)}</h2>
Expand Down
6 changes: 3 additions & 3 deletions assets/client/src/components/PreviewBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const PreviewBanner = ({challenge}) => {
<div>
<span className="me-3">Preview generated on {formatDateToLLLL()}</span>
<a className="me-3" href={window.location.href}>Refresh page</a>
{!challenge.external_url &&
<a href={apiUrl + `/public/previews/challenges?challenge=${challenge.uuid}&print=true`} target="_blank">Print</a>
}
{!challenge.external_url && (
<a href={`${apiUrl}/public/previews/challenges?challenge=${encodeURIComponent(challenge.uuid)}&print=true`} target="_blank">Print</a>
)}
</div>
<br/>
<div>Link to share for internal agency review:</div>
Expand Down
4 changes: 2 additions & 2 deletions assets/client/src/components/challenge_tabs/Winners.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Winners = ({challenge, challengePhases, print}) => {
if (phaseWinner.overview_image_path) {
return (
<img
src={imageBase + phaseWinner.overview_image_path}
src={`${imageBase}${encodeURIComponent(phaseWinner.overview_image_path)}`}
alt="Phase Winner image"
title="Phase Winner image"
className="phase-winner-image mt-3"
Expand All @@ -23,7 +23,7 @@ export const Winners = ({challenge, challengePhases, print}) => {
const {id, image_path, name, place_title} = winner
return (
<div key={id} className="d-flex flex-row align-items-center usa-tbm-1rem">
{image_path && <img src={imageBase + winner.image_path} alt="winner image" title="winner image" className="phase-winner-image me-3" />}
{image_path && (<img src={`${imageBase}${encodeURIComponent(winner.image_path)}`} alt="winner image" title="winner image" className="phase-winner-image me-3" />)}
{name && <p>{name}</p>}
{place_title && <p>{` - ${place_title}`}</p>}
</div>
Expand Down
4 changes: 2 additions & 2 deletions assets/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ const renderRouter = () => (
)

const rootElement = document.getElementById('challenge-gov-react-app')
const apiUrl = rootElement.getAttribute('data-api-url')
const apiUrl = encodeURI(rootElement.getAttribute('data-api-url'))
const publicUrl = rootElement.getAttribute('data-public-url')
const imageBase = rootElement.getAttribute('data-image-base')
const imageBase = encodeURI(rootElement.getAttribute('data-image-base'))
const bridgeApplyBlocked = rootElement.getAttribute('data-bridge-apply-blocked') != 'false'

ReactDOM.render(renderRouter(), rootElement);
Expand Down
2 changes: 1 addition & 1 deletion assets/client/src/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const renderPreview = () => (
)

const rootElement = document.getElementById('preview');
const imageBase = rootElement.getAttribute('data-image-base');
const imageBase = encodeURI(rootElement.getAttribute('data-image-base'));
ReactDOM.render(renderPreview(), rootElement);

// If you want your app to work offline and load faster, you can change
Expand Down
4 changes: 2 additions & 2 deletions assets/js/app/_custom_url_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function set_custom_url_example() {
if (custom_url_example_text.length > 0) {
if (custom_url_input_value != "") {
challenge_title_slug = title_to_url_slug(custom_url_input_value)
custom_url_example_text.html(challenge_title_slug)
custom_url_example_text.text(challenge_title_slug)
} else {
challenge_title_slug = title_to_url_slug(challenge_title_input_value)
custom_url_example_text.html(challenge_title_slug)
custom_url_example_text.text(challenge_title_slug)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"chokidar": "^3.3.1",
"file-loader": "^6.2.0",
"inputmask": "^5.0.5",
"jquery": "^3.3.1",
"jquery": "^3.7.1",
"moment": "^2.27.0",
"moment-timezone": "^0.5.31",
"node-sass": "^8.0.0",
Expand Down Expand Up @@ -57,4 +57,4 @@
"webpack": "^5.76.0",
"webpack-cli": "^4.7.0"
}
}
}
Loading
Loading