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
[Publisher][Superagencies] Add dropdown for child agencies #1314
Conversation
…to nasaownsky/1275-child-agencies-dropdown
Hi @mxosman! Sorry for this issue, it was totally on my end! New getting method for superagency id should work as expected. I've also added dropdown in Explore Data page in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick fix @nasaownsky! This was totally my bad too for not testing with multiple agencies! Left some comments, but overall, this is working properly for me!
publisher/src/stores/AgencyStore.ts
Outdated
this.childAgencies = []; | ||
} | ||
loadChildAgencies(superagencyId: string) { | ||
this.getChildAgencies(superagencyId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that it's just calling this one function - we can lose this extra function (loadChildAgencies
) and just use getChildAgencies
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small request - in getChildAgencies
, if the BE sends a non-200 status, can we add a toast message before throwing an error w/ the same message as the error?
@mxosman please check my fixes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So close with this one @nasaownsky! A couple of things and I think this will be ready to go soon:
- There are now two dropdowns in the Explore Data page - the responsive one is appearing in the normal view.
- If you remove yourself from the superagency via the admin panel, and go to one of its child agencies, the dropdowns hide, which is expected -- but you always get an error toast that there was an issue getting a list of child agencies. Since there maybe a chance that a user will not have access to the superagency but just the child agencies, can we only run
getChildAgencies
function if the user has access to the superagency? Let me know if I'm not making sense!
@mxosman Oh, great catches, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @nasaownsky - thank you so much! Left one suggested change, but feel free to merge after.
@@ -38,8 +38,9 @@ export const ChildAgenciesDropdown: React.FC<{ | |||
const isSuperagency = userStore.isAgencySuperagency(agencyId); | |||
const superagencyId = currentAgency?.super_agency_id ?? agencyId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - suggested change here to make this a bit more accurate:
const superagencyId = isSuperagency
? agencyId
: currentAgency?.super_agency_id;
Description of the change
New PR with fixed superagency id getting method and dropdown added to Explore Data page.
Type of change
Related issues
closes #1275
closes #1276
Checklists
Development
This box MUST be checked by the submitter prior to merging:
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: