Skip to content

Conversation

@muhammad-ali-pk
Copy link
Contributor

@muhammad-ali-pk muhammad-ali-pk commented Jan 15, 2025

Done

  • Created a context to persist current user's info
  • Display logged in user's name and email in the sidebar
  • Setup query client provider
  • Call /api/current-user on app load.

QA

QA steps

  • Check out this PR
  • Open the file webapp/routes/user.py to see if it has a current-user GET endpoint. If not, paste the following sample endpoint
@user_blueprint.route("/current-user", methods=["GET"])
@login_required
def current_user():
   return (
       jsonify(
           {
               "id": 1,
               "name": "Muhammad Ali",
               "email": "muhammad.ali@canonical.com",
               "team": "Web and Design",
               "department": "Engineering",
               "jobTitle": "Software Engineer I",
           }
       ),
       200,
   )
  • Run the application using dotrun command locally.
  • Open localhost:8104 in your browser.
  • Log in using Ubuntu SSO if not already.
  • Verify the user name and email visible in the left sidebar, on top of log out button.

Fixes

Screenshots

Before
image

After
image

@webteam-app
Copy link

@akbarkz
Copy link
Contributor

akbarkz commented Jan 16, 2025

Please hide user information from the sidebar on tablet width:
Screenshot From 2025-01-16 10-33-53

@akbarkz
Copy link
Contributor

akbarkz commented Jan 16, 2025

As we discussed, please import both "user" object and "setUser" method from either the useAuth hook or from the store, but not from both.

Call auth hook in Main so the store is always populated with User
@muhammad-ali-pk muhammad-ali-pk merged commit 87ada7b into main Jan 17, 2025
7 checks passed
@muhammad-ali-pk muhammad-ali-pk deleted the WD-18147 branch January 17, 2025 04:48
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants