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 all regions to activity report dropdown if user has central office #357

Merged
merged 12 commits into from
Jul 15, 2021

Conversation

thewatermethod
Copy link
Collaborator

@thewatermethod thewatermethod commented Jul 12, 2021

Description of change

Added "All Regions" to the region select dropdown on the activity-reports page if the user has "central office" as their home region.

How to test

Navigate to the landing page as a user with central office (14) as their home region. Notice that "All regions" is present in the dropdown. Switch between regions. The alerts and reports should change for that region.

Issue(s)

Checklists

Every PR

N/A

  • [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

  • Update JIRA ticket status

@thewatermethod thewatermethod marked this pull request as ready for review July 13, 2021 18:07
@kryswisnaskas
Copy link
Collaborator

Looks good! Thanks for adjusting the width of the region selector to match the mockup.

One question/comment on the code.

I also verified that the "All regions" option displays data from all regions user has read permissions to. As a side note, there could be a slight inconsistency if a central office user wasn't explicitly given a read access to all 12 regions. This shouldn't really happen if an admin is careful, but I think we could point that out so the customers will understand the behavior and not be surprised.

@@ -20,7 +20,7 @@ const DropdownIndicator = (props) => (

const Placeholder = (props) => <components.Placeholder {...props} />;

export const getUserOptions = (regions) => regions.map((region) => ({ value: region, label: `Region ${region}` }));
export const getUserOptions = (regions) => regions.map((region) => ({ value: region, label: `Region ${region}` })).sort((a, b) => a.value - b.value);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the sorting still needed?

Copy link

@jasalisbury jasalisbury left a comment

Choose a reason for hiding this comment

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

A comment and a question:

This region dropdown has the same problem as in the other PR, needs to be a button. Also will need to close on blur. (which doesn't seem to be an issue this PR created)

Do we need to remove the "Create Report" button when central office is the region selected? I think so because we won't know what region to use for the report (unless we want region 14 reports, which my initial reaction is that would be a mistake)

@thewatermethod
Copy link
Collaborator Author

We do have a JIRA I opened on the button/react-select keyboard nav issue when the regional dropdown was originally merged. Since it's fixed in the 167 PR (and already in prod as the react-select component), maybe it's ok to leave alone for this PR? Not sure.

Easy enough remove "Create report" if we think that's best. Right now it will create a report in the first actual region (i.e. the region not 14) even if 14 is selected. Also not sure about this, as far as what the expected behavior is.

@jasalisbury
Copy link

We do have a JIRA I opened on the button/react-select keyboard nav issue when the regional dropdown was originally merged. Since it's fixed in the 167 PR (and already in prod as the react-select component), maybe it's ok to leave alone for this PR? Not sure.

Leaving it to be fixed in #332 sounds good to me!

Easy enough remove "Create report" if we think that's best. Right now it will create a report in the first actual region (i.e. the region not 14) even if 14 is selected. Also not sure about this, as far as what the expected behavior is.

Not having the button seem preferable to clicking it not knowing which region the report is being created in. My understanding is central office users shouldn't be creating activity reports, but maybe check with Patrice at the next standup.

@thewatermethod thewatermethod merged commit 0623692 into main Jul 15, 2021
@thewatermethod thewatermethod deleted the TTAHUB-199/all-regions-selector-ar-page branch July 15, 2021 18:05
thewatermethod added a commit that referenced this pull request Jul 15, 2021
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