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 filters to grantee record page #479

Merged
merged 269 commits into from
Nov 12, 2021

Conversation

thewatermethod
Copy link
Collaborator

@thewatermethod thewatermethod commented Oct 28, 2021

Description of change

Add the filter menu to the Grantee record page

How to test

  • Navigate to /grantee, find a record page, go to the TTA History
  • You can add or change date filters and specialist filters

Issue(s)

Checklists

Every PR

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • [n/a] API Documentation updated
  • [n/a] Boundary diagram updated
  • [n/a] Logical Data Model updated
  • [n/a] Architectural Decision Records written for major infrastructure decisions

Production Deploy

  • [n/a] Staging smoke test completed

After merge/deploy

  • [n/a] Update JIRA ticket status

@@ -1,20 +1,3 @@
.smart-hub--button-select-toggle-btn {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a DropdownMenu component that encompasses as much of the press a blue button get a dropdown as possible. The CSS still probably needs a good cleanup

import './DropdownMenu.css';
import triangleDown from '../images/triange_down.png';

export default function DropdownMenu({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

takes a lot of props as button select did but will hopefully be a little easier to work with... also, many of these are optional

*/
const onBlur = (e) => {
// if we're within the same menu, do nothing
if (e.relatedTarget && menuContents.current.contains(e.relatedTarget)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like our usage of Node.contains should be fully supported by ie11
https://developer.mozilla.org/en-US/docs/Web/API/Node/contains

As far as I understand, we will only be calling it on instances of HTMLElement, not a text node or anything like that

<span className="margin-x-1"><select className="usa-select ttahub-dummy-select" disabled aria-label="select a topic and condition first and then select a query" /></span>
);

const onApplyQuery = (q, toggleAllChecked) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this toggleAllChecked is unfortunate - probably need to refactor so we can just derive the label from them all being checked. Hopefully if the usage of "All Specialists" is consistent across pages it will pass UI review

@@ -10,7 +9,7 @@ import { getEditorState } from '../../../../utils';
* Reasoning for another component is to not overload `ReviewItem`
*/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed some code here to improve test coverage - we weren't using the path parameter anywhere we used HtmlReviewItem and it seemed a direct lift from the component we copied this one from

@@ -24,7 +26,7 @@ export default function GranteeRecord({ match, location }) {
granteeId,
});

const defaultFilters = [
const [defaultFilters] = useState([
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I think this could be a common problem for filters, having set filters that aren't exposed to the UI and cannot change. I wonder if there is a better way to handle it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at it with fresh eyes, made some (hopefully) better choices

@@ -134,7 +134,9 @@ function GranteeSearch({ user }) {
</div>
)}
<form role="search" className="ttahub-grantee-search--search-form display-flex" onSubmit={onSubmit}>
<input type="search" name="search" className="ttahub-grantee-search--search-input" ref={inputRef} disabled={loading} />
{ /* eslint-disable-next-line jsx-a11y/label-has-associated-control */ }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making a note to figure out why the linter hates doing it like this

@thewatermethod thewatermethod merged commit 46480e2 into main Nov 12, 2021
@thewatermethod thewatermethod deleted the TTAHUB-301/add-filters-to-grantee-record branch November 12, 2021 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants