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 badges management to organization view #256

Merged
merged 21 commits into from
Apr 11, 2022
Merged

Conversation

vgeorge
Copy link
Member

@vgeorge vgeorge commented Mar 11, 2022

What I am changing

Adds the ability to manage badges in the organization page.

How I did it

This is WIP. Tasks:

  • Add badges table to organization view
  • Load badges from the API
  • Display success/error toast after add/edit/delete actions Error/warning/info toast component #49
  • Add badge action
  • Edit badge action
  • Delete badge action

This also includes a small lib api-client.js to avoid code repetition while interacting with the API.

How you can test it

Run the development server and perform add/edit/remove badges actions.

Related Issues

Base automatically changed from feature/badges to develop March 14, 2022 13:53
@vgeorge vgeorge requested a review from kamicut March 23, 2022 12:38
@vgeorge
Copy link
Member Author

vgeorge commented Mar 23, 2022

@kamicut ready for review.

@vgeorge
Copy link
Member Author

vgeorge commented Apr 1, 2022

@kamicut I added badges assignment to this. How to test:

  • Create org
  • Create badge at org view
  • Enter badge page by clicking on it at the table
  • Enter user osm id for the existing org member, it should be listed in assigned member table
  • Repeat entering osm id, toast should display "User already assigned"
  • Enter other osm id, toast should display "User is not part of organization"

As this PR is getting too big I left some things out to include later in another PR:

  • Collect badge assignment timeframe (valid_until)
  • Unassign badge (remove)

@vgeorge
Copy link
Member Author

vgeorge commented Apr 7, 2022

@kamicut added a fix for the display name issues, please let me know if you can add members now.

Copy link
Member

@kamicut kamicut left a comment

Choose a reason for hiding this comment

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

There is a 401 Unauthorized error that appears on the main organization dashboard when getting the badges for a user that is not part of an organization. This causes the page to error out to 401. We should catch the 401 and fail silently since it's an expected behavior, or delay the "get badges" call until we know the user has the correct permissions (if they are part of the owners list)

I recommend creating a second OSM user @vgeorge to test this type of behavior.

Otherwise, the PR is good to merge once this is fixed.

@kamicut kamicut self-requested a review April 11, 2022 10:23
@vgeorge vgeorge merged commit 759c366 into develop Apr 11, 2022
@vgeorge vgeorge deleted the feature/badges-frontend branch April 11, 2022 10: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.

2 participants