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

Create Account Page #865

Open
6 tasks
eleanorreem opened this issue Mar 4, 2024 · 12 comments
Open
6 tasks

Create Account Page #865

eleanorreem opened this issue Mar 4, 2024 · 12 comments
Assignees
Labels
complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days feature/enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@eleanorreem
Copy link
Contributor

Overview

We want users to be able to see their account details when they are logged in. This ticket only includes creating the account page and the card where we display profile details. See designs:

Desktop

Screenshot 2024-03-04 at 12 33 43

Mobile

Screenshot 2024-03-04 at 12 40 07

Note that it is not for displaying the delete account or update email preferences. These will be separated into a follow up ticket.

Action Items

  • Pull the most updated version of develop and create your own branch
  • Create a new page with url /account/settings and ensure it is kept behind a firebase auth guard. See /bloom-frontend/pages/_app.tsx for the auth guard.
  • Use state to populate the profile details
  • The link in the profile card goes to https://chayn.typeform.com/to/OY9Wdk4h?typeform-source=bloom.chayn.co
  • Add a new 'Account settings' link to nav bar. Take a look at /components/layout/UserMenu.tsx
  • Write a cypress test that logs in and clicks through the account page and tests the correct details are there.
@eleanorreem eleanorreem added feature/enhancement New feature or request complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days state: approved Ready to go. Not blocked or pending. priority: soon Should be prioritized soon. labels Mar 4, 2024
@kyleecodes kyleecodes added help wanted Extra attention is needed and removed priority: soon Should be prioritized soon. state: approved Ready to go. Not blocked or pending. labels Mar 25, 2024
@kyleecodes kyleecodes added this to the 02. Roadmaps milestone Apr 24, 2024
@anmol-fzr
Copy link
Contributor

@eleanorreem @kyleecodes

Hi!, Could you please assign me an issue to work on for the bloom-frontend project? I'm eager to contribute to the project and the society

Copy link
Contributor

github-actions bot commented May 7, 2024

Thank you for your interest in contributing to Chayn! Please carefully read the CONTRIBUTING.md file and the README.md file for guidance. Let us know if you have any questions. Good luck!

@kyleecodes
Copy link
Member

@anmol-fzr Thank you for your interest in contributing to Chayn!
I've assigned you this issue. Please read the Contributing Guidelines and let us know if you have any questions. 🙂

anmol-fzr added a commit to anmol-fzr/bloom-frontend that referenced this issue May 9, 2024
Added Only UI part of the Account Page described in issue chaynHQ#865
@anmol-fzr
Copy link
Contributor

anmol-fzr commented May 10, 2024

@kyleecodes , I'm getting 403 Foribidden resource error on delete account API can somebody guide me ?

@eleanorreem
Copy link
Contributor Author

eleanorreem commented May 10, 2024

Hi there, sorry for the delay in getting back to you.

If you are looking to delete the account with the following endpoint you need to create a super admin user and log in with them.

  @ApiBearerAuth()
  @Delete(':id')
  @ApiParam({ name: 'id', description: 'User id to delete' })
  @UseGuards(SuperAdminAuthGuard)
  async adminDeleteUser(@Param() { id }): Promise<UserEntity> {
    return await this.userService.deleteUserById(id);
  }

Here is the documentation about how to add different types of bloom users.

How I normally get the access token to authenticate against the backend:

  • login through the UI with the user that has the correct level of access (in this case the super admin). Ensure you are on a page that requires authentication such as /courses.
  • Go into the network tab in the developer tools and look at a request like /user/me.
  • I look at the access token that was sent in the Request Headers Authorisation property. It looks like Bearer xxxxx.
  • I copy the authorisation token into the Request Headers - Authorisation property of the API request I am sending the backend. There is currently no UI to delete users.

We plan to make a shareable Postman Collection at some point to make this easier.

I just wanted to check that I had been clear enough on this ticket. I know the design includes deleting a user and also updating the subscription preferences but it didn't mean implementing the whole design. I.e. you don't need to implement delete user section or the update subscription sections. This ticket required just building the page, adding the link to the UserMenu and displaying the user name and email.

Hope that makes sense!

@anmol-fzr
Copy link
Contributor

Okay If only super admins can delete a user, then how will we impliment delete User functionality on the Account Page as described in this issue.

@eleanorreem
Copy link
Contributor Author

Thanks for your question 😄 The ticket specifies "Note that it is not for displaying the delete account or update email preferences. These will be separated into a follow up ticket." We are implementing the design in stages. This ticket does not cover the whole design. Hope that explains it!

@eleanorreem
Copy link
Contributor Author

eleanorreem commented May 10, 2024

I think my instructions in combination with the design is confusing the situation. For the first iteration - the design below is all we need. Hope that clarifies things!
Screenshot 2024-05-10 at 17 24 34

@anmol-fzr
Copy link
Contributor

Okay, I understand, I have implemented the rest of the part ( UI + functionality ). Should i raise a PR now ?

@anmol-fzr
Copy link
Contributor

Screenshot-2024-05-10_21-10-53
Currently I have this much, working and tested ( except delete Account ). with translations

@eleanorreem
Copy link
Contributor Author

Oh cool! Thats amazing 🎉 Thank you

What was your mechanism for updating the user subscription preferences? Do you have a PR for the backend as well? I think the endpoint exists but the DTO doesn't include the subscription preferences. Also I think the endpoint reuses the getUserDTO and should probably have its own DTO.

@eleanorreem
Copy link
Contributor Author

Make a PR with what you have got and we can chat through your solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days feature/enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants