Skip to content

Commit

Permalink
Remove total grants statistics from the TTA overview widget (#354)
Browse files Browse the repository at this point in the history
* Request errors api

* Request errors api

* Added data provider

* Added show

* Add backend tests

* Address feedback from review, add frontend test

* Deploy to sandbox

* Remove total grants statistics from the TTA overview widget

* Fix export

* Update tests

* Remove extra bracket

* Update text on non-grantees served
  • Loading branch information
kryswisnaskas authored Jul 9, 2021
1 parent 2c717ed commit 0e29348
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/Landing/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ describe('Landing page table menus & selections', () => {
userEvent.click(reportMenu);
const downloadButton = await screen.findByRole('menuitem', { name: /export table data/i });
userEvent.click(downloadButton);
expect(getAllAlertsDownloadURL).toHaveBeenCalledWith('');
expect(getAllAlertsDownloadURL).toHaveBeenCalledWith('region.in[]=1');
});
});
});
Expand All @@ -728,7 +728,7 @@ describe('Landing page table menus & selections', () => {
userEvent.click(reportMenu);
const downloadButton = await screen.findByRole('menuitem', { name: /export table data/i });
userEvent.click(downloadButton);
expect(getAllReportsDownloadURL).toHaveBeenCalledWith('');
expect(getAllReportsDownloadURL).toHaveBeenCalledWith('region.in[]=1');
});
});
});
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/pages/Landing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import 'uswds/dist/css/uswds.css';
import '@trussworks/react-uswds/lib/index.css';
import './index.css';
import MyAlerts from './MyAlerts';
import isAdmin, { hasReadWrite, allRegionsUserHasPermissionTo } from '../../permissions';
import { hasReadWrite, allRegionsUserHasPermissionTo } from '../../permissions';
import { REPORTS_PER_PAGE, ALERTS_PER_PAGE } from '../../Constants';
import Filter, { filtersToQueryString } from './Filter';
import ReportMenu from './ReportMenu';
Expand Down Expand Up @@ -380,13 +380,13 @@ function Landing() {
};

const handleDownloadAllReports = () => {
const filterQuery = filtersToQueryString(filters);
const filterQuery = filtersToQueryString(filters, appliedRegion);
const downloadURL = getAllReportsDownloadURL(filterQuery);
window.location.assign(downloadURL);
};

const handleDownloadAllAlerts = () => {
const filterQuery = filtersToQueryString(alertFilters);
const filterQuery = filtersToQueryString(alertFilters, appliedRegion);
const downloadURL = getAllAlertsDownloadURL(filterQuery);
window.location.assign(downloadURL);
};
Expand Down Expand Up @@ -493,7 +493,7 @@ function Landing() {
<h1 className="landing">Activity Reports</h1>
</Grid>
<Grid col={2} className="flex-align-self-center">
{isAdmin(user) && getUserRegions(user).length > 1
{getUserRegions(user).length > 1
&& (
<RegionalSelect
regions={allRegionsUserHasPermissionTo(user)}
Expand All @@ -509,14 +509,12 @@ function Landing() {
</Grid>
<Grid row gap className="smart-hub--overview">
<Grid col={10}>
{isAdmin(user) && (
<Overview
filters={filters}
region={appliedRegion}
allRegions={getUserRegions(user)}
skipLoading
/>
)}
</Grid>
</Grid>
<Grid row>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/widgets/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function Overview({ data, region }) {
<span className="smart-hub--overview-period"> 9/15/2020 to Today</span>
</Grid>
<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" tablet={{ col: true }} label="Grants served " data={data.numGrants} />
<Field col="fill" label="Non-grantee entities 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} />
Expand Down

0 comments on commit 0e29348

Please sign in to comment.