kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Navbar -> The person icon should lead to the personal info page

Open ShivangRawat30 opened this issue 1 year ago • 14 comments

Observed behavior

Currently the person icon does nothing.

Expected behavior

It should lead to the person's personal information page.

Steps to reproduce

  1. Go to Navbar
  2. Click the icon next to your registered username.

Context

Screenshot 2023-09-19 at 10 57 24 PM

Technical implementation

Because of Kolibri's plugin system, the user profile single page app is a separate and entirely optional plugin for Kolibri. This means that in some installations of Kolibri it could be disabled, or alternatively, that more advanced users may wish to replace it with a different plugin for managing the user profile.

In order to handle this, the link from the profile icon should not be hard coded to the user profile plugin. To achieve the desired effect, the following steps should be followed:

### Tasks
- [ ] Define a hook in kolibri/core/hooks.py to register as a UserProfile
- [ ] It should use the `only_one_registered` flag, so as to avoid a situation where multiple plugins are trying to register as the UserProfile link - see the core ThemeHook for an example of this: https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/core/theme_hook.py#L33
- [ ] The hook should also define an abstract property for the URL that will be linked to, for an example of this on another hook see here: https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/core/hooks.py#L50
- [ ] The registered hook's URL property should then be passed to the frontend through `plugin_data` in the core frontend: https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/core/kolibri_plugin.py#L111
- [ ] This should then be picked up using the Javascript `plugin_data` import - if it is defined, then the icon and text should be clickable (https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/core/assets/src/views/AppBar.vue#L83) linking to the URL
- [ ] If not, neither should be clickable, and should display a regular pointer cursor.
- [ ] Finally, the UserProfile plugin will need to register against the new hook that has been defined in order to expose the appropriate URL - for an example of doing this, see registration against the role based redirect hook: https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/plugins/user_auth/kolibri_plugin.py#L47

For more detailed information see the documentation about the plugin system here: https://kolibri-dev.readthedocs.io/en/develop/backend_architecture/plugins.html

ShivangRawat30 avatar Sep 19 '23 17:09 ShivangRawat30

can i work on this issue? if yes then can you please assign it to me

yash1378 avatar Sep 22 '23 18:09 yash1378

@ShivangRawat30 can i work on this issue

yash1378 avatar Sep 23 '23 10:09 yash1378

@yash1378 I lack the authority to delegate tasks to others since I am also a contributor. Regarding the issue I've raised, if it receives approval, I will be the one handling it.

ShivangRawat30 avatar Sep 23 '23 15:09 ShivangRawat30

@jtamiace @tomiwaoLE Could you confirm that this is expected behavior before we assign to @ShivangRawat30?

MisRob avatar Sep 25 '23 08:09 MisRob

Hello @ShivangRawat30, thanks for your feedback, we appreciate it. From the UX point of view, it's definitely desired and our design team recommends doing so. We'll keep the issue open. However, we won't be opening it for contribution at this very point as there is some work that needs to happen in preparation for us to be able to achieve this eventually.

MisRob avatar Sep 27 '23 17:09 MisRob

I've added some technical notes on appropriate implementation to the issue body.

rtibbles avatar Sep 27 '23 17:09 rtibbles

Can I contribute to this issue? I'm new here, but I have experience contributing to many other organizations. Is there a Discord channel or any other channel where I can discuss and get assistance?

nick2432 avatar Dec 20 '23 05:12 nick2432

Hi @nick2432 - thanks for your interest in contributing to Kolibri! This is a relatively in-depth issue due to how Kolibri is structured, so I'd suggest that it should be something to come back to and pick up once you are a little bit more familiar with our architecture, rather than a first contribution issue. Even if you are comfortable with open source contributions, I'd recommend getting started with a smaller issue or two, to get more familiar with Kolibri, and then if you'd still like to take on this issue, we would welcome your contribution! I think someone from our team has already directed you to our github discussions page which is a great place to learn more and talk with other community contributors and members of our team.

We currently have contributing opportunities in three repositories. You can see the contributing guidelines including links to issues suitable for contribution for each repository here:

marcellamaki avatar Dec 20 '23 18:12 marcellamaki

@marcellamaki thank you

nick2432 avatar Dec 22 '23 11:12 nick2432

@MisRob @marcellamaki Looks like this issue still needs to be worked upon, so can you please assign this issue to me?

shivansh-bhatnagar18 avatar Mar 21 '24 19:03 shivansh-bhatnagar18

Yes, I have assigned you - please target any work to the release-v0.16.x branch, as I have targeted this issue for a future patch there.

rtibbles avatar Mar 21 '24 19:03 rtibbles

@rtibble So should I submit my PR in the release X16.0 branch or continue pushing it in the develop branch.

shivansh-bhatnagar18 avatar Mar 23 '24 13:03 shivansh-bhatnagar18

Screencast from 2024-03-23 19-04-39.webm I have added the desired functionality here

shivansh-bhatnagar18 avatar Mar 23 '24 13:03 shivansh-bhatnagar18

@shivansh-bhatnagar18 please target the branch release-v0.16.x

bjester avatar Mar 25 '24 16:03 bjester