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

Refactor create superadmin mode #851

Merged
merged 47 commits into from
Jan 12, 2024
Merged

Conversation

longshuicy
Copy link
Member

@longshuicy longshuicy commented Dec 11, 2023

This PR is ready to be reviewed.

Backend changes

  • Store admin and admin mode in UserDoc instead of passing in parameters; remove most of the parameters on routes
  • Made sure admin && adminMode logic is persist in all the method in authorization_deps.py
  • Clean up the code about list all endpoints (see the criteria part)
  • Fix the elasticsearch user clause. Depends can only be used asynchronously on routes somehow. TODO: research on fastAPI depends
  • Refactoring/Adding new endpoints for GET/POST admin state, as well as admin_mode state. Write pytest accordingly
  • Fix a typo on /datasets/{dataset_id}/role/owner} endpoint and /metadata/{metadata_id}/role} endpoint

Frontend changes

  • No need to pass in additional parameters to each endpoint.
  • Clean up the admin mode logic and looks
  • Listening to the adminMode change and enforce request to the backend one more time to reflect the effect of the admin mode in various components
image image

@longshuicy longshuicy changed the base branch from 830-create-superadmin-mode to main December 11, 2023 21:02
@longshuicy longshuicy force-pushed the refactor-create-superadmin-mode branch from 778cac1 to 8d87f45 Compare December 12, 2023 16:42
@longshuicy longshuicy marked this pull request as ready for review December 13, 2023 20:19
@tcnichol
Copy link
Contributor

I am noticing an error on this branch.
I populated data using the populate fake data, but when I tried to upload data through the web interface, I saw this:
Screenshot 2023-12-19 at 3 33 04 PM
Screenshot 2023-12-19 at 3 33 54 PM

@longshuicy
Copy link
Member Author

I am noticing an error on this branch. I populated data using the populate fake data, but when I tried to upload data through the web interface, I saw this: Screenshot 2023-12-19 at 3 33 04 PM Screenshot 2023-12-19 at 3 33 54 PM

For some reason I can't reproduce this issue. I resolved some merge conflict that might have something to do with codegen openapi. Could you try again when you have a chance?

Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

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

Tested. The code looks good and clean. @longshuicy thanks for cleaning it up.

@lmarini lmarini merged commit cb9c447 into main Jan 12, 2024
5 checks passed
@lmarini lmarini deleted the refactor-create-superadmin-mode branch January 12, 2024 15:14
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.

4 participants