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

Add topics/reasons, filters, and activity reports table to TTA record page, update robots.txt for lower environments, Update Trussworks 2.0, lower export CSV limit #614

Merged
merged 101 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
3b7e3be
Add topic/reasons graph widget
jasalisbury Nov 2, 2021
0e254d3
Bump validator from 13.6.0 to 13.7.0
dependabot[bot] Nov 3, 2021
b2d6cf2
Feedback from PR
jasalisbury Nov 4, 2021
4db64f8
Accessibility updates
jasalisbury Nov 4, 2021
b60743c
Remove export of frequency graph
jasalisbury Nov 4, 2021
71bfb51
Merge branch 'main' into js-394-add-topics-reasons-graph
jasalisbury Nov 4, 2021
6ff0a91
Make the linter happy
jasalisbury Nov 4, 2021
a578e94
Move report table to own component
jasalisbury Nov 5, 2021
d4069c1
Accessibility updates
jasalisbury Nov 8, 2021
1fb7bc6
Pluralize frequency graph type
jasalisbury Nov 8, 2021
b6d4218
Fix tests
jasalisbury Nov 8, 2021
872fb8a
final changes to export message from accessibility spec.
thewatermethod Nov 8, 2021
396d600
welcoming robots in certain situations
thewatermethod Nov 8, 2021
0c5506b
merging upstream
thewatermethod Nov 8, 2021
d8a7a14
Update known vulnerabilities
kryswisnaskas Nov 9, 2021
a4e076f
Merge branch 'main' into dependabot/npm_and_yarn/validator-13.7.0
kryswisnaskas Nov 9, 2021
f9d28ac
Merge pull request #606 from HHS/js-394-add-topics-reasons-graph
jasalisbury Nov 9, 2021
8c8cf12
Merge branch 'main' into js-396-add-activity-reports-to-tta-history
jasalisbury Nov 9, 2021
4058cf3
trying a different approach in the config
thewatermethod Nov 9, 2021
e408022
is this how we set vars?
thewatermethod Nov 9, 2021
eef4486
fix var name
thewatermethod Nov 9, 2021
8e3e926
fix ui tests
thewatermethod Nov 9, 2021
139e7e3
Merge pull request #610 from HHS/js-396-add-activity-reports-to-tta-h…
jasalisbury Nov 9, 2021
a8a74e3
test on dev since sandbox does not do what I thought
thewatermethod Nov 9, 2021
3c59900
update trusworks with modal changes
AdamAdHocTeam Nov 9, 2021
f8833c1
need to learn how to do bash
thewatermethod Nov 9, 2021
b7ed5c5
more bash better
thewatermethod Nov 9, 2021
78be5f7
tweak the export limit
thewatermethod Nov 9, 2021
7116b31
for christmas sake
thewatermethod Nov 9, 2021
2634a59
testing complete
thewatermethod Nov 9, 2021
df1ed94
fix ui test
thewatermethod Nov 9, 2021
ece825e
fix bash script var names
thewatermethod Nov 9, 2021
2eacd1e
Fix plotly import
jasalisbury Nov 9, 2021
6f59aa4
updated file uploader modal
AdamAdHocTeam Nov 9, 2021
e0770cf
Merge pull request #615 from HHS/js-fix-plotly-import
jasalisbury Nov 9, 2021
78c046a
updated external resource modal
AdamAdHocTeam Nov 9, 2021
7071c10
Merge pull request #483 from HHS/main
jasalisbury Nov 9, 2021
93dd0da
move logic to circlci config
thewatermethod Nov 10, 2021
901a356
Merge remote-tracking branch upstream/main into TTAHUB276
thewatermethod Nov 10, 2021
7321977
awaken robot on prod
thewatermethod Nov 10, 2021
d844f45
Update .circleci/config.yml
thewatermethod Nov 10, 2021
aa62b9b
adjust maxiumum number;
thewatermethod Nov 10, 2021
b40e3fc
Merge pull request #613 from HHS/TTAHUB276
thewatermethod Nov 10, 2021
7b7073f
fix unit test again
thewatermethod Nov 10, 2021
828231c
Merge remote-tracking branch 'upstream/main' into TTAHUB-430/add-appr…
thewatermethod Nov 10, 2021
223030d
add approvedat migration
thewatermethod Nov 10, 2021
45c726d
update approvedAt on approval
thewatermethod Nov 10, 2021
c712df7
clean up constants, add new one
thewatermethod Nov 10, 2021
adcabcc
add approved and created dates to fe landing page
thewatermethod Nov 10, 2021
758665a
add approved and created date to csv download
thewatermethod Nov 10, 2021
281d6ac
remove console statement
thewatermethod Nov 10, 2021
be49632
fixing tests
thewatermethod Nov 10, 2021
668ec94
fixed modal unit tests
AdamAdHocTeam Nov 10, 2021
edb0e72
updated my alert test
AdamAdHocTeam Nov 10, 2021
44f3cdf
fixed modal tests for external resource
AdamAdHocTeam Nov 10, 2021
79e1fea
partial fixes for ui tests
thewatermethod Nov 10, 2021
34bca8d
clean up prop type
thewatermethod Nov 11, 2021
7b27f95
cleanup UI tests
thewatermethod Nov 11, 2021
d2ee92a
more unit test fixes for trussworks2
AdamAdHocTeam Nov 11, 2021
63faad4
idle modal test fixes
AdamAdHocTeam Nov 11, 2021
1b95811
add backend tests
thewatermethod Nov 11, 2021
a49453f
Merge branch 'main' of https://github.com/HHS/Head-Start-TTADP into d…
kryswisnaskas Nov 11, 2021
49e9061
fixed accessibility issue and added test coverage
AdamAdHocTeam Nov 11, 2021
d49d796
Merge remote-tracking branch 'upstream/main' into ttahub-451/add-targ…
thewatermethod Nov 11, 2021
d42f2ab
add target populations to ar
thewatermethod Nov 11, 2021
cc9f27e
add approved and created date to ar, table css fixes
thewatermethod Nov 11, 2021
113ae19
fix failing ui test
thewatermethod Nov 11, 2021
9ba70c6
fix failing tooltip test
thewatermethod Nov 11, 2021
5fcb455
Merge branch 'dependabot/npm_and_yarn/validator-13.7.0' of https://gi…
kryswisnaskas Nov 11, 2021
7097b97
unique id value
AdamAdHocTeam Nov 11, 2021
d722740
update known issues
kryswisnaskas Nov 11, 2021
bee703d
fix axe
AdamAdHocTeam Nov 11, 2021
c6c4362
Update known vulnerabilities
kryswisnaskas Nov 11, 2021
ec9b761
Merge pull request #607 from HHS/dependabot/npm_and_yarn/validator-13…
kryswisnaskas Nov 11, 2021
586cb11
fix axe again
AdamAdHocTeam Nov 11, 2021
1a4b0bd
fix axe issues again
AdamAdHocTeam Nov 11, 2021
04060a3
try heading axe fix
AdamAdHocTeam Nov 11, 2021
ae9801f
update test for axe
AdamAdHocTeam Nov 11, 2021
11df756
update
AdamAdHocTeam Nov 11, 2021
3d48d9a
see if remvoing display none fixes issue
AdamAdHocTeam Nov 11, 2021
01d756e
hide headings
AdamAdHocTeam Nov 11, 2021
2f0a8bb
limit number of headings
AdamAdHocTeam Nov 12, 2021
c3f6a8c
added cusom accordion with heading size prop
AdamAdHocTeam Nov 12, 2021
0847c79
added test for accordion
AdamAdHocTeam Nov 12, 2021
feac881
fix capitalizations while we're here
thewatermethod Nov 12, 2021
761638b
fixes based on Kryss comments
AdamAdHocTeam Nov 12, 2021
46480e2
add filters to grantee record page (#479)
thewatermethod Nov 12, 2021
182f83d
Merge pull request #618 from HHS/ttahub-451/add-target-pop
thewatermethod Nov 12, 2021
f170803
Merge pull request #616 from HHS/TTAHUB-430/add-approved-and-created-…
thewatermethod Nov 12, 2021
a063067
Merge branch 'main' into ttahub-345-upgrade-all-packages
AdamAdHocTeam Nov 12, 2021
89d6301
linter fixes
AdamAdHocTeam Nov 15, 2021
296a1f3
audit vuln
AdamAdHocTeam Nov 15, 2021
5e61e12
Merge pull request #617 from HHS/ttahub-345-upgrade-all-packages
AdamAdHocTeam Nov 15, 2021
0990815
change unlock report button css to outline
AdamAdHocTeam Nov 15, 2021
70886b0
Merge pull request #623 from HHS/outline-unlock-report-button
AdamAdHocTeam Nov 15, 2021
97a8eae
Resolve merge conflicts (merge HHS:main into adhoc:main) (#484)
thewatermethod Nov 15, 2021
3fbe926
Resolve new merge conflicts (#485)
thewatermethod Nov 15, 2021
1d127e4
Merge HHS (#486)
thewatermethod Nov 15, 2021
fb7878d
Merge pull request #612 from HHS/TTAHUB-160/final-export-warning-changes
thewatermethod Nov 15, 2021
4ef0353
Merge HHS (#487)
thewatermethod Nov 15, 2021
56c8f39
Merge pull request #622 from adhocteam/main
thewatermethod Nov 15, 2021
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
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ parameters:
type: string
dev_git_branch: # change to feature branch to test deployment
description: "Name of github branch that will deploy to dev"
default: "kw-disable-hses-staging"
default: "TTAHUB276"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "kw-delete-reports-script"
default: "TTAHUB276"
type: string
prod_new_relic_app_id:
default: "877570491"
Expand Down Expand Up @@ -333,6 +333,15 @@ jobs:
- run:
name: Build backend assets
command: yarn build
- when:
condition:
and:
- equal: [<< pipeline.project.git_url >>, << pipeline.parameters.prod_git_url >>]
- equal: [<< pipeline.git.branch >>, << pipeline.parameters.prod_git_branch >>]
steps:
- run:
name: Create production robot
command: ./bin/robot-factory
- run:
name: Build frontend assets
command: yarn --cwd frontend run build
Expand Down
9 changes: 9 additions & 0 deletions bin/robot-factory
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo 'Setting site to be indexable in robots.txt'

cat >frontend/public/robots.txt <<EOL
# Welcome Robots
User-agent: *
Disallow:
EOL
8 changes: 6 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@fortawesome/react-fontawesome": "^0.1.11",
"@hookform/error-message": "^0.0.5",
"@trussworks/react-uswds": "1.11.0",
"@trussworks/react-uswds": "2.4.1",
"@use-it/interval": "^1.0.0",
"draft-js": "^0.11.7",
"draftjs-to-html": "^0.9.1",
Expand All @@ -19,6 +19,7 @@
"lodash": "^4.17.20",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"plotly.js": "^2.5.1",
"plotly.js-basic-dist": "^2.2.1",
"prop-types": "^15.7.2",
"query-string": "^7.0.0",
Expand All @@ -34,6 +35,7 @@
"react-idle-timer": "^4.4.2",
"react-input-autosize": "^3.0.0",
"react-js-pagination": "^3.0.3",
"react-plotly.js": "^2.5.1",
"react-responsive": "^8.1.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
Expand Down Expand Up @@ -155,7 +157,9 @@
"<rootDir>/src/pages/NotFound/index.js",
"<rootDir>/src/polyfills.js",
"<rootDir>/src/pages/Widgets/index.js",
"<rootDir>/src/widgets/Example.js"
"<rootDir>/src/widgets/Example.js",
"<rootDir>/src/pages/RegionalDashboard/formatDateRange.js",
"<rootDir>/src/pages/RegionalDashboard/constants.js"
],
"coverageThreshold": {
"global": {
Expand Down
5 changes: 4 additions & 1 deletion frontend/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# we disallow everything by default
# in production, we allow indexing by removing the slash from the disallow

# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Disallow: /
1 change: 1 addition & 0 deletions frontend/src/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ export const ESCAPE_KEY_CODE = 27;
export const ESCAPE_KEY_CODES = ['Escape', 'Esc'];

export const DATE_FMT = 'YYYY/MM/DD';
export const DATE_DISPLAY_FORMAT = 'MM/DD/YYYY';
export const EARLIEST_INC_FILTER_DATE = moment('2020-08-31');
122 changes: 122 additions & 0 deletions frontend/src/components/Accordion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';

export const AccordionItem = ({
title,
id,
content,
expanded,
className,
handleToggle,
headingSize,
}) => {
const headingClasses = `usa-accordion__heading ${className}`;
const contentClasses = `usa-accordion__content usa-prose ${className}`;
const HeadingSizeTag = `h${headingSize}`;
return (
<>
<HeadingSizeTag className={headingClasses}>
<button
type="button"
className="usa-accordion__button"
aria-expanded={expanded}
aria-controls={id}
data-testid={`accordionButton_${id}`}
onClick={handleToggle}
>
{title}
</button>
</HeadingSizeTag>
<div
id={id}
data-testid={`accordionItem_${id}`}
className={contentClasses}
hidden={!expanded}
>
{content}
</div>
</>
);
};

AccordionItem.propTypes = {
title: PropTypes.string.isRequired,
content: PropTypes.string.isRequired,
expanded: PropTypes.bool.isRequired,
id: PropTypes.string.isRequired,
className: PropTypes.string,
handleToggle: PropTypes.func,
headingSize: PropTypes.number.isRequired,
};

AccordionItem.defaultProps = {
className: '',
handleToggle: () => { },
};

export const Accordion = ({
bordered,
items,
multiselectable,
headingSize,
}) => {
const [openItems, setOpenState] = useState(
items.filter((i) => !!i.expanded).map((i) => i.id),
);

const classes = bordered ? 'usa-accordion usa-accordion--bordered' : 'usa-accordion';

const toggleItem = (itemId) => {
const newOpenItems = [...openItems];
const itemIndex = openItems.indexOf(itemId);
const isMultiselectable = multiselectable;

if (itemIndex > -1) {
newOpenItems.splice(itemIndex, 1);
} else if (isMultiselectable) {
newOpenItems.push(itemId);
} else {
newOpenItems.splice(0, newOpenItems.length);
newOpenItems.push(itemId);
}
setOpenState(newOpenItems);
};

return (
<div
className={classes}
data-testid="accordion"
aria-multiselectable={multiselectable || undefined}
>
{items.map((item) => (
<AccordionItem
key={`accordionItem_${item.id}`}
title={item.title}
id={item.id}
content={item.content}
className={item.className}
expanded={openItems.indexOf(item.id) > -1}
handleToggle={() => {
toggleItem(item.id);
}}
headingSize={headingSize}
/>
))}
</div>
);
};

Accordion.propTypes = {
bordered: PropTypes.bool,
multiselectable: PropTypes.bool,
items: PropTypes.arrayOf(PropTypes.shape(AccordionItem)).isRequired,
headingSize: PropTypes.number,
};

Accordion.defaultProps = {
bordered: false,
multiselectable: false,
headingSize: 2,
};

export default Accordion;
47 changes: 47 additions & 0 deletions frontend/src/components/ActivityReportsTable/ColumnHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
import React from 'react';
import PropTypes from 'prop-types';

function ColumnHeader({
displayName, name, sortBy, sortDirection, onUpdateSort,
}) {
const getClassNamesFor = (n) => (sortBy === n ? sortDirection : '');
const sortClassName = getClassNamesFor(name);
let fullAriaSort;
switch (sortClassName) {
case 'asc':
fullAriaSort = 'ascending';
break;
case 'desc':
fullAriaSort = 'descending';
break;
default:
fullAriaSort = 'none';
break;
}

return (
<th scope="col" aria-sort={fullAriaSort}>
<a
role="button"
tabIndex={0}
onClick={() => onUpdateSort(name)}
onKeyPress={() => onUpdateSort(name)}
className={`sortable ${sortClassName}`}
aria-label={`${displayName}. Activate to sort ${sortClassName === 'asc' ? 'descending' : 'ascending'}`}
>
{displayName}
</a>
</th>
);
}

ColumnHeader.propTypes = {
displayName: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
sortBy: PropTypes.string.isRequired,
sortDirection: PropTypes.string.isRequired,
onUpdateSort: PropTypes.func.isRequired,
};

export default ColumnHeader;
Loading