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

[TTAHUB-278] grantee search page #403

Merged
merged 46 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0a00468
create grantee page
thewatermethod Aug 25, 2021
c8e3672
Merge branch 'main' into TTAHUB-278
thewatermethod Aug 25, 2021
a949e55
Merge branch 'main' into TTAHUB-278
thewatermethod Aug 25, 2021
a3c9f0c
Merge branch 'main' into TTAHUB-278
jasalisbury Aug 26, 2021
eb0b6cd
Merge branch 'main' into TTAHUB-278
thewatermethod Sep 15, 2021
ad51373
building backend route for grantee search
thewatermethod Sep 16, 2021
b8233c1
create query for search
thewatermethod Sep 17, 2021
bc95606
clean up function
thewatermethod Sep 17, 2021
9010f82
add unit test
thewatermethod Sep 17, 2021
b67c34c
add size limit to query
thewatermethod Sep 17, 2021
3eb6fba
Merge branch 'main' into TTAHUB-278
thewatermethod Sep 17, 2021
a6663ce
fix broken ui test
thewatermethod Sep 17, 2021
b2b1e89
Merge branch 'TTAHUB-278' of https://github.com/adhocteam/Head-Start-…
thewatermethod Sep 17, 2021
a5fbd4b
update ui test for new features
thewatermethod Sep 17, 2021
6f99e79
add another ui test
thewatermethod Sep 17, 2021
9f147b6
beefed up unit test
thewatermethod Sep 20, 2021
a8f95ab
beefed up second unit test
thewatermethod Sep 20, 2021
5aff872
Merge branch 'main' into TTAHUB-278
thewatermethod Sep 20, 2021
e55cd57
Merge branch 'main' into TTAHUB-278
thewatermethod Sep 22, 2021
186036d
build out GranteeResults
thewatermethod Sep 24, 2021
f4cab7b
add grantee results table
thewatermethod Sep 24, 2021
bb742f8
write ui test
thewatermethod Sep 24, 2021
c7b9eb6
add additional ui tests
thewatermethod Sep 24, 2021
caa163f
backend unit tests
thewatermethod Sep 27, 2021
a197ed2
update yarn vuln
thewatermethod Sep 27, 2021
6709bb0
starting to fill test coverage gaps
thewatermethod Sep 27, 2021
e84c3cd
more work on ui tests
thewatermethod Sep 27, 2021
408e718
return fetchers to prev state
thewatermethod Sep 27, 2021
57e8100
ui test for grantee search
thewatermethod Sep 27, 2021
560f2ab
another ui test
thewatermethod Sep 27, 2021
2542a12
Merge branch 'main' into TTAHUB-278
thewatermethod Sep 27, 2021
2e8a174
testing linter
thewatermethod Sep 27, 2021
390d205
remove test
thewatermethod Sep 27, 2021
6c03edc
test
thewatermethod Sep 27, 2021
11cb6a4
remove inline function
thewatermethod Sep 27, 2021
4b54b14
fix bug where sort wasn't firing
thewatermethod Sep 27, 2021
f89a575
why not?
thewatermethod Sep 27, 2021
13d6772
removed shot in the dark
thewatermethod Sep 27, 2021
59054ba
test this lint
thewatermethod Sep 27, 2021
8cfcd98
test this lint
thewatermethod Sep 27, 2021
e14a869
on apply remove as a test
thewatermethod Sep 27, 2021
d32aa40
defeated, we add no an eslint ignore
thewatermethod Sep 27, 2021
d1e9bef
finish UI tests
thewatermethod Sep 28, 2021
a1061ac
Merge branch 'main' into TTAHUB-278
thewatermethod Sep 28, 2021
fd03899
Merge branch 'main' into TTAHUB-278
thewatermethod Oct 4, 2021
2d7df35
Merge branch 'main' into TTAHUB-278
thewatermethod Oct 5, 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
9 changes: 9 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import LandingLayout from './components/LandingLayout';
import RequestPermissions from './components/RequestPermissions';
import AriaLiveContext from './AriaLiveContext';
import AriaLiveRegion from './components/AriaLiveRegion';
import FeatureFlag from './components/FeatureFlag';
import ApprovedActivityReport from './pages/ApprovedActivityReport';
import GranteeSearch from './pages/GranteeSearch';

function App() {
const [user, updateUser] = useState();
Expand Down Expand Up @@ -135,6 +137,13 @@ function App() {
)}
/>
)}
<Route
exact
path="/grantee-search"
render={() => (
<FeatureFlag user={user} flag="grantee_record_page" admin={admin} renderNotFound><GranteeSearch user={user} /></FeatureFlag>
)}
/>
<Route
render={() => <NotFound />}
/>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const REPORT_STATUSES = {

export const REPORTS_PER_PAGE = 10;
export const ALERTS_PER_PAGE = 10;
export const GRANTEES_PER_PAGE = 12;
export const GOVERNMENT_HOSTNAME_EXTENSION = '.ohs.acf.hhs.gov';
export const ESCAPE_KEY_CODE = 27;

Expand Down
17 changes: 16 additions & 1 deletion frontend/src/components/SiteNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { NavLink as Link, withRouter } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChartBar, faBorderAll } from '@fortawesome/free-solid-svg-icons';
import { faChartBar, faBorderAll, faUserFriends } from '@fortawesome/free-solid-svg-icons';

import './SiteNav.css';

Expand Down Expand Up @@ -86,6 +86,21 @@ const SiteNav = ({
Activity Reports
</NavLink>
</li>
{admin
? (
<>
<li>
<NavLink
to="/grantee-search"
>
<span className="padding-right-1">
<FontAwesomeIcon color="white" icon={faUserFriends} />
</span>
Grantees
</NavLink>
</li>
</>
) : null }
<li>
<NavLink
to="/regional-dashboard"
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/fetchers/grantee.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import join from 'url-join';
import { get } from './index';
import { DECIMAL_BASE } from '../Constants';

const granteeUrl = join('/', 'api', 'grantee');

// eslint-disable-next-line import/prefer-default-export
export const searchGrantees = async (query, regionId = '', params = { sortBy: 'name', direction: 'asc', offset: 0 }) => {
if (!query) {
throw new Error('Please provide a query string to search grantees');
}

const querySearch = `?s=${query}`;
const regionSearch = regionId ? `&region=${regionId.toString(DECIMAL_BASE)}` : '';

const grantees = await get(
join(granteeUrl, 'search', querySearch, regionSearch, `&sortBy=${params.sortBy}&direction=${params.direction}&offset=${params.offset}`),
);
return grantees.json();
};
Loading