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

Kw #484

Closed
wants to merge 41 commits into from
Closed

Kw #484

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b8f662f
TTAHUB-138: WIP Added custom survey button.
AdamAdHocTeam Jun 15, 2021
4e489ec
Fix lint errors.
AdamAdHocTeam Jun 15, 2021
a59b6f5
CSS fix for modal
AdamAdHocTeam Jun 15, 2021
985c102
added unit test
AdamAdHocTeam Jun 15, 2021
e410331
Merge branch 'HHS:main' into TTAHUB-138-AL-TP-Survey-On-AR-Landing
AdamAdHocTeam Jun 15, 2021
5ba493e
Merge branch 'main' into TTAHUB-138-AL-TP-Survey-On-AR-Landing
AdamAdHocTeam Jun 15, 2021
0cc41d1
change button name.
AdamAdHocTeam Jun 15, 2021
0a5719f
TTAHUB-138: Fix survey button showing only on AR Landing.
AdamAdHocTeam Jun 16, 2021
4de8ef7
TTAHUB-138: Fix Z index of survey button.
AdamAdHocTeam Jun 16, 2021
8e0fd59
Merge pull request #334 from adhocteam/TTAHUB-138-AL-TP-Survey-On-AR-…
AdamAdHocTeam Jun 16, 2021
47515e8
Add non-grantees; layout changes
kryswisnaskas Jun 20, 2021
121b6e5
Deploy to sandbox
kryswisnaskas Jun 21, 2021
715a860
TTAHUB-138/al-fix-csp-for-script: Test possible fix for TP Script.
AdamAdHocTeam Jun 21, 2021
6b6440a
linter fix
AdamAdHocTeam Jun 21, 2021
104ba14
omit csp directive
AdamAdHocTeam Jun 21, 2021
05eb80e
fix lint
AdamAdHocTeam Jun 21, 2021
8d29e5f
add img src
AdamAdHocTeam Jun 21, 2021
06d6de8
attemp to fix img-src for csp
AdamAdHocTeam Jun 21, 2021
3e52a1a
more SCP testing with data
AdamAdHocTeam Jun 22, 2021
3730a00
fix lint
AdamAdHocTeam Jun 22, 2021
fc6ceb0
fix audit vul
AdamAdHocTeam Jun 22, 2021
6153edb
more fixes for scripts
AdamAdHocTeam Jun 22, 2021
6694aa2
more csp updates'
AdamAdHocTeam Jun 22, 2021
e3a41cc
fix wildcard
AdamAdHocTeam Jun 22, 2021
c71978e
remove comment
AdamAdHocTeam Jun 22, 2021
773c3ef
Merge pull request #336 from adhocteam/TTAHUB-138/al-fix-csp-for-script
AdamAdHocTeam Jun 22, 2021
1442bd6
Include legacy reports in statistics; limit to approved reports only
kryswisnaskas Jun 22, 2021
9a58b02
Merge branch 'main' of https://github.com/adhocteam/Head-Start-TTADP …
kryswisnaskas Jun 22, 2021
08c7c5e
Increase frontend test timeout
kryswisnaskas Jun 22, 2021
16c20f9
Add a script to connect non-grantees to activity reports for legacy data
kryswisnaskas Jun 23, 2021
5a87d3a
Add a script to connect non-grantees to activity reports for legacy data
kryswisnaskas Jun 23, 2021
0363752
Add a script to connect non-grantees to activity reports for legacy data
kryswisnaskas Jun 23, 2021
1e4b607
Fix lint errors
kryswisnaskas Jun 24, 2021
0a4c124
Fix test
kryswisnaskas Jun 24, 2021
d8293a5
Remove non-legacy filter
kryswisnaskas Jun 24, 2021
253d085
Remove statement
kryswisnaskas Jun 24, 2021
537f256
Adjust test
kryswisnaskas Jun 24, 2021
27e1e55
Remove new test
kryswisnaskas Jun 24, 2021
2f527a1
Fix region order and add non-grantees. (#335)
kryswisnaskas Jun 24, 2021
871d4f3
Merge branch 'main' of https://github.com/HHS/Head-Start-TTADP into k…
kryswisnaskas Jun 24, 2021
18f17ea
Merge branch 'main' of https://github.com/adhocteam/Head-Start-TTADP …
kryswisnaskas Jun 24, 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ parameters:
default: "main"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "kw-overview-widget"
default: "kw-fix-region-order"
type: string
prod_new_relic_app_id:
default: "877570491"
Expand Down
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function App() {
<>
<Helmet titleTemplate="%s - TTA Smart Hub" defaultTitle="TTA Smart Hub">
<meta charSet="utf-8" />
<script src="https://touchpoints.app.cloud.gov/touchpoints/7d519b5e.js" async />
</Helmet>
<BrowserRouter>
{authenticated && (
Expand Down
29 changes: 23 additions & 6 deletions frontend/src/components/SiteNav.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
import React from 'react';
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { NavLink as Link } from 'react-router-dom';
import { NavLink as Link, withRouter } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChartBar } from '@fortawesome/free-solid-svg-icons';

Expand Down Expand Up @@ -33,6 +33,7 @@ const SiteNav = ({
authenticated,
logout,
user,
location,
}) => {
const navItems = [
<button type="button" onClick={() => logout(false)} className={`usa-button--unstyled width-full ${navLinkClasses}`}>
Expand All @@ -46,11 +47,25 @@ const SiteNav = ({
</NavLink>,
];

const [showActivityReportSurveyButton, setShowActivityReportSurveyButton] = useState(false);

useEffect(() => {
if (location.pathname === '/activity-reports') {
setShowActivityReportSurveyButton(true);
} else {
setShowActivityReportSurveyButton(false);
}
}, [location.pathname]);

const items = admin ? navItems.concat(adminNavItem) : navItems;

return (
<div className="smart-hub-sitenav pin-y position-fixed z-0 padding-top-9 font-ui text-white smart-hub-bg-blue width-15 tablet:width-card desktop:width-card-lg no-print">
{authenticated && (
<div>
<div className="position-relative z-top">
<button id="tp-ar-landing-survey" className={`usa-button position-fixed bottom-2 right-1 display-${showActivityReportSurveyButton ? 'block' : 'none'}`} aria-label="Please leave feedback" type="button">Please leave feedback</button>
</div>
<div className="smart-hub-sitenav pin-y position-fixed z-0 padding-top-9 font-ui text-white smart-hub-bg-blue width-15 tablet:width-card desktop:width-card-lg no-print">
{authenticated && (
<>
<div className="width-full smart-hub-sitenav-separator--after">
<div role="complementary" className="padding-2 smart-hub-sitenav-word-wrap--break">
Expand Down Expand Up @@ -80,7 +95,8 @@ const SiteNav = ({
</div>
</nav>
</>
)}
)}
</div>
</div>
);
};
Expand All @@ -91,6 +107,7 @@ SiteNav.propTypes = {
authenticated: PropTypes.bool,
logout: PropTypes.func,
user: PropTypes.shape({ name: PropTypes.string, email: PropTypes.string }),
location: PropTypes.shape({ pathname: PropTypes.string }).isRequired,
};

SiteNav.defaultProps = {
Expand All @@ -103,4 +120,4 @@ SiteNav.defaultProps = {
},
};

export default SiteNav;
export default withRouter(SiteNav);
12 changes: 10 additions & 2 deletions frontend/src/pages/Landing/RegionalSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,19 @@ function RegionalSelect(props) {
};

CustomOption.propTypes = {
data: PropTypes.object.isRequired,
innerRef: PropTypes.string.isRequired,
data: PropTypes.shape({
value: PropTypes.number,
label: PropTypes.string,
}),
innerRef: PropTypes.func,
innerProps: PropTypes.object.isRequired,
};

CustomOption.defaultProps = {
data: {},
innerRef: () => 0,
};

const options = [...getUserOptions(regions), { custom: true }];
return (
<Select
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/pages/Landing/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
font-family: 'Merriweather', serif;
}

.fba-modal .fba-modal-dialog {
margin-top: 120px;
}

.pagination {
float: right;
white-space: nowrap;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/Landing/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,9 @@ export const generateXFakeReports = (count) => {
export const overviewRegionOne = {
numReports: '1',
numGrants: '2',
numNonGrantees: '2',
numTotalGrants: '4',
numParticipants: '3',
sumTrainingDuration: '5.0',
sumTaDuration: '1.0',
sumDuration: '0.5',
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ import MutationObserver from '@sheerun/mutationobserver-shim';

window.MutationObserver = MutationObserver;

jest.setTimeout(10000);
jest.setTimeout(30000);
3 changes: 1 addition & 2 deletions frontend/src/widgets/Overview.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
}

.smart-hub--overview-data {
margin-left: -20px;
margin-bottom: -20px;
margin-left: -36px !important;
}

.smart-hub--overview-nowrap {
Expand Down
26 changes: 14 additions & 12 deletions frontend/src/widgets/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ function Field({
Field.propTypes = {
label: PropTypes.string.isRequired,
labelExt: PropTypes.string,
data: PropTypes.string.isRequired,
col: PropTypes.number,
data: PropTypes.string,
col: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
};

Field.defaultProps = {
labelExt: '',
col: 2,
data: '',
};

/*
Expand All @@ -49,15 +53,14 @@ function Overview({ data, region }) {
{' '}
TTA Overview
</h2>
<span className="smart-hub--overview-period"> 3/17/21 to Today</span>
<span className="smart-hub--overview-period"> 9/15/2020 to Today</span>
</Grid>
<Grid row className="smart-hub--overview-data">
<Field label="Grants served " labelExt={`(of ${data.numTotalGrants})`} data={data.numGrants} />
<Field label="Activity reports" data={data.numReports} />
<Field label="Participants" data={data.numParticipants} />
<Field label="Hours of Training" data={data.sumTrainingDuration} />
<Field label="Hours of TA" data={data.sumTaDuration} />
<Field label="Hours of TTA" data={data.sumDuration} />
<Grid row gap className="smart-hub--overview-data">
<Field col="fill" tablet={{ col: true }} label="Grants served " labelExt={`(of ${data.numTotalGrants})`} data={data.numGrants} />
<Field col="fill" label="Non-grantees served" data={data.numNonGrantees} />
<Field col="fill" label="Activity reports" data={data.numReports} />
<Field col="fill" label="Participants" data={data.numParticipants} />
<Field col={2} label="Hours of TTA" data={data.sumDuration} />
</Grid>
</Container>
);
Expand All @@ -67,10 +70,9 @@ Overview.propTypes = {
data: PropTypes.shape({
numReports: PropTypes.string,
numGrants: PropTypes.string,
numNonGrantees: PropTypes.string,
numTotalGrants: PropTypes.string,
numParticipants: PropTypes.string,
sumTrainingDuration: PropTypes.string,
sumTaDuration: PropTypes.string,
sumDuration: PropTypes.string,
}).isRequired,
region: PropTypes.number.isRequired,
Expand Down
Loading