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
Modified view-agency component & css for updated interface #326
Conversation
getting rid of errant ]
</Fragment> | ||
)} | ||
</Fragment> | ||
)} | ||
</div> | ||
<NavLink to={EDIT_AGENCIES_PAGE.replace(":id", agency._id)}> |
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.
This line is giving me an error when I run npm start locally on this branch:
Failed to compile.
./src/components/agencies/view-agency/view-agency.component.js
Line 109:58: 'agency' is not defined no-undef
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.
I cannot get this to build....see inline comment.
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.
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.
Hi @deveshchatuphale7 - Can you see the "checks" section of #326 ? I can't review the code until it builds and gets a green checkmark there. It looks like you fixed the first issue, but now there's another issue.
Thanks for informing. Hopefully my latest commit will fix the issue. But I am curious why I was not getting any issue while generating build locally |
Hi there! The build on the website builds the current code with your changes. You probably did not do a "git pull" before your testing and PR submission, so you had older code - the files you didn't change. Github tests the current code plus your changes because there could be issues and it wants to find them first. |
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.
Hi! It built, but I'm not seeing the problem resolved.
I logged in as an Agency Administrator, then went to the Agencies page. Then clicked on my agency, and here's the page I got:
It still shows 0 officers, when there should at least be 1 officer (me!).
I did this against the sandbox; is that what you used?
Yes, Actually also for my login I got officers array with key officers under agencyAdditionalInfo object was empty. Hence dashboard is showing zero officers. Did I miss any step here, could you point me in right direction ? |
Ah! I see. You correctly printed out agencyAdditionalInfo. The problem is that agencyAdditionalInfo object is wrong - how is it populated? is it looking in the wrong place for officers? You might be able to find some clues by looking at src/components/agencies/agencies.component.js - I can see there's a function in there called getAgenciesWithOfficers, which is how that page gets a list of officers, which it then uses to display. |
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.
Hi @deveshchatuphale7 - this is a great start! I'm getting a count and a list of users, but it's not getting them from the right place. I added some inline comments and suggestions.
I'm also not sure if search is supposed to work? Right now it doesn't - if I type something into the search bar and hit "return" nothing happens. It's totally OK if search doesn't work, but it looks like the code intends it to be working, perhaps it is supposed to highlight a search term.
I'm happy to keep the scope of this to just the count and list of officers, and we can make a different ticket for search to work. (but then we should remove the code related to search functionality - though it's OK to keep the UI code in there - it looks great!)
loading: false, | ||
}); | ||
|
||
boardingService.getBoardingsWithFacet(50,0,null,{"agency":data.name}).then((userData)=>{ |
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.
If I'm reading this properly, this gets a list of officers by getting the boarding records for the agency, and finding all the distinct reportingOfficer email addresses.
But we want to see officers, even if they have not submitted any boarding records.
This should use the "searchFacetByUsers" function, which takes in a limit, offset, query, and filter, and returns an array of users (using limit and offset to only return what's needed on the page), a total count of users, and any highlighting needed.
You can see that function at https://github.com/WildAid/o-fish-realm/blob/main/WildAidDemo/functions/searchFacetByUsers/source.js
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.
I tried using getUsers from users.service which calls searchFacetByUsers function. With agency name as filter I received empty array in response & without any filters I received list of users, In my case I received user details of me & another user I created. So what parameters would be helpful to get officer details ?
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.
Ah, you don't need a filter, there are permissions in place to make sure you only see what you're allowed to see. (as an agency admin, you can only see users in your agency)
You say you get the user details for you and the other user you created, which sounds like you have the right link there. What additional details do you need?
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.
Yes I think response from getUsers will suffice the requirement. but one doubt I have is, on agencies page for agency name deveshchatuphale7 respective officer name in the list is Emex Geefy.But, I didn't receive any info about that user in the response of getUsers without any filters & searchQuery.
So just wanted to know if I am receiving a correct response or I have to pass any additional filters or searchQuery ?
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.
To debug, loop through every part of the returned user object, and print it, to see where the issue is. Perhaps there is a different field you should be using? (that's what I'd do, I don't know where the problem is here).
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.
This looks fantastic!
Congratulations! 🎉 🙌 🎆 ㊗️ This PR is great and has been merged into the code. Thanks so much for contributing! If you'd like, you can request to work on another issue. We really appreciate your effort! To claim your O-FISH badge, head on over to the MongoDB Community forums, login, and reply - making sure to link to this PR. |
Sure! |
Related Issue
Fixes #212
Checklist:
Optional items:
Optional: Add any explanations here
Modified view-agency component as well as css file to incorporate design requirements
Optional: Add any relevant screenshots here