Skip to content

Commit 890f31f

Browse files
authored
Merge pull request #5255 from fedspendingtransparency/fix/DEV15034
DEV-15034 fix links that error
2 parents 1a16d12 + 90648e3 commit 890f31f

4 files changed

Lines changed: 33 additions & 37 deletions

File tree

src/js/components/analystGuide/AnalystGuideIntro.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const AnalystGuideIntro = () => (
66
<h3 className="analyst-guide__topTitle">What is the Federal Spending Guide?</h3>
77
<div className="analyst-guide__bodyText">
88
<p>Welcome to the Federal Spending Guide. You’ll find answers here to commonly asked questions about federal spending concepts and USAspending data. We hope this guide makes it easier for you to conduct your own analyses and develop your own tools.</p>
9-
<p>If you'd like to recommend a question to be added to this guide, please share it on our <a href="https://fiscalservice.force.com/usaspending/s/" alt="Community Page" target="_blank" rel="noopener noreferrer">Community page</a> or send an email to <a href="mailto:USAspending.Help@fiscal.treasury.gov" alt="email link USAspending.help@fiscal.treasury.gov">USAspending.Help@fiscal.treasury.gov</a>. We look forward to hearing from you!
9+
<p>If you'd like to recommend a question to be added to this guide, please share it on our <a href="https://onevoicecrm.my.site.com/usaspending/s/" alt="Community Page" target="_blank" rel="noopener noreferrer">Community page</a> or send an email to <a href="mailto:USAspending.Help@fiscal.treasury.gov" alt="email link USAspending.help@fiscal.treasury.gov">USAspending.Help@fiscal.treasury.gov</a>. We look forward to hearing from you!
1010
</p>
1111
</div>
1212
</>

src/js/components/analystGuide/AnalystGuidePage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const AnalystGuidePage = () => {
8888
</div>
8989
</div>
9090
<AnalystGuideIntro onExternalLinkClick={onExternalLinkClick} />
91-
<AnalystGuideQuestions onExternalLinkClick={onExternalLinkClick} />
91+
<AnalystGuideQuestions />
9292
</FlexGridCol>
9393
</FlexGridRow>
9494
</main>

src/js/components/analystGuide/AnalystGuideQuestions.jsx

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
/* eslint-disable react/no-array-index-key */
33
/* eslint-disable max-len */
44
import React from 'react';
5-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
65
import { Link } from "react-router";
76
import Accordion from "../sharedComponents/accordion/Accordion";
87
import GlossaryLink from '../sharedComponents/GlossaryLink';
8+
import ExternalLink from '../sharedComponents/ExternalLink';
99

10-
const AnalystGuideQuestions = ({ onExternalLinkClick }) => {
10+
const AnalystGuideQuestions = () => {
1111
const jumpToSection = (section = '') => {
1212
const sectionDom = document.querySelector(`#${section}`);
1313
if (!sectionDom) {
@@ -79,19 +79,15 @@ const AnalystGuideQuestions = ({ onExternalLinkClick }) => {
7979
<p className="analyst-guide__answerStyle">The award_unique_key field contains both financial assistance and contract prime award summary identifier information. This field is available in Treasury and federal account level account breakdown by award account download files. The assistance_award_unique_key field contains financial assistance prime award summary identifier information. This field is available in financial assistance prime award transaction and summary download files. The contract_award_unique_key field contains contract prime award summary identifier information. This field is available in contract prime award transaction and summary download files. </p>
8080
<p className="analyst-guide__answerStyle">These fields may be used to aggregate, filter, or join account breakdown by award, prime award summary, and prime award transaction download files by prime award summary.</p>
8181
<p className="analyst-guide__answerStyle">More information about these identifiers is{' '}
82-
<button
83-
value="https://github.com/fedspendingtransparency/usaspending-api/wiki/Award-Identifiers"
84-
role="link"
82+
<ExternalLink
83+
84+
url="https://github.com/fedspendingtransparency/usaspending-api/wiki/Award-Identifiers"
8585
className="analyst-guide__external-link"
86-
onClick={onExternalLinkClick}>
86+
isCard
87+
showIcon>
8788
available online{' '}
88-
<span
89-
data-href="https://github.com/fedspendingtransparency/usaspending-api/wiki/Award-Identifiers"
90-
className="usa-button-link__icon">
91-
<FontAwesomeIcon data-href="https://github.com/fedspendingtransparency/usaspending-api/wiki/Award-Identifiers" icon="external-link-alt" />
92-
</span>
93-
.
94-
</button>
89+
</ExternalLink>
90+
.
9591
</p>
9692
<p className="analyst-guide__answerStyle">The Award ID filter on <Link to="/search">Advanced Search</Link> can be used to filter award spending by the PIID, FAIN and URI data elements. These data elements are important components of prime award summary identifier information.</p>
9793
<p className="analyst-guide__answerStyle">More information about these fields is available in the <Link to="/data-dictionary">Data Dictionary</Link> and the <a href="https://files.usaspending.gov/docs/Custom+Account+Data+Dictionary.xlsx">Custom Account Data Dictionary</a>.</p>
@@ -361,7 +357,7 @@ const AnalystGuideQuestions = ({ onExternalLinkClick }) => {
361357
{
362358
question: "How can I download a copy of the full database?",
363359
answer: (<>
364-
<p className="analyst-guide__answerStyle">The USAspending <a href="https://files.usaspending.gov/database_download/">SQL Database Downloads page</a> includes instructions and links to help download snapshots of the USAspending database as a PostgreSQL archive. This resource is intended for advanced users. The full database is over 1.5 terabytes and will continue to increase in size. The process to complete a full database restore can take many hours to complete.</p>
360+
<p className="analyst-guide__answerStyle">The USAspending <a href="https://onevoicecrm.my.site.com/usaspending/s/database-download">SQL Database Downloads page</a> includes instructions and links to help download snapshots of the USAspending database as a PostgreSQL archive. This resource is intended for advanced users. The full database is over 1.5 terabytes and will continue to increase in size. The process to complete a full database restore can take many hours to complete.</p>
365361
</>)
366362
}];
367363

@@ -725,18 +721,13 @@ const AnalystGuideQuestions = ({ onExternalLinkClick }) => {
725721
question: "What other resources are available to help understand the data in USAspending?",
726722
answer: (<>
727723
<p className="analyst-guide__answerStyle">The github{' '}
728-
<button
729-
value="https://github.com/fedspendingtransparency/usaspending-api/wiki"
730-
role="link"
724+
<ExternalLink
725+
url="https://github.com/fedspendingtransparency/usaspending-api/wiki"
731726
className="analyst-guide__external-link"
732-
onClick={onExternalLinkClick}>
733-
wiki{' '}
734-
<span
735-
data-href="https://github.com/fedspendingtransparency/usaspending-api/wiki"
736-
className="usa-button-link__icon">
737-
<FontAwesomeIcon data-href="https://github.com/fedspendingtransparency/usaspending-api/wiki" icon="external-link-alt" />
738-
</span>
739-
</button>
727+
isCard
728+
showIcon>
729+
wiki{' '}
730+
</ExternalLink>
740731
{' '}provides information for developers on how the USAspending application works.
741732
</p>
742733
<p className="analyst-guide__answerStyle">The USAspending&apos;s{' '}<a href="https://onevoicecrm.my.site.com/usaspending/s/recordlist/Knowledge__kav/00B3d000000V4WDEA0">FAQ page{' '}</a>provides additional advice for getting the most out of the site.

src/js/components/sharedComponents/ExternalLink.jsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ import { showModal } from 'redux/actions/modal/modalActions';
1212
const propTypes = {
1313
url: PropTypes.string.isRequired,
1414
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.node]),
15-
isCard: PropTypes.bool
15+
isCard: PropTypes.bool,
16+
showIcon: PropTypes.bool
1617
};
1718

18-
const ExternalLink = ({ url, children, isCard }) => {
19+
const ExternalLink = ({
20+
url, children, isCard, showIcon = false
21+
}) => {
1922
const dispatch = useDispatch();
2023
const redirect = () => {
2124
dispatch(showModal(url));
@@ -27,14 +30,16 @@ const ExternalLink = ({ url, children, isCard }) => {
2730
dispatch(showModal(url));
2831
}
2932
};
30-
return (<>
31-
{isCard ?
32-
<a className="usda-external-link__card" role="link" onClick={redirect} onKeyPress={keyPressHandler} tabIndex={0}>{children}</a>
33-
:
34-
<button className="usda-external-link" onClick={redirect}>
35-
{children || url} <FontAwesomeIcon icon="external-link-alt" />
36-
</button>}
37-
</>);
33+
if (isCard) {
34+
if (showIcon) {
35+
return <a className="usda-external-link__card" role="link" onClick={redirect} onKeyPress={keyPressHandler} tabIndex={0}>{children} <FontAwesomeIcon icon="external-link-alt" /></a>;
36+
}
37+
return <a className="usda-external-link__card" role="link" onClick={redirect} onKeyPress={keyPressHandler} tabIndex={0}>{children}</a>;
38+
}
39+
return (
40+
<button className="usda-external-link" onClick={redirect}>
41+
{children || url} <FontAwesomeIcon icon="external-link-alt" />
42+
</button>);
3843
};
3944

4045
ExternalLink.propTypes = propTypes;

0 commit comments

Comments
 (0)