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

Close user profile menu after menu entry is selected #3224

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

alisaismailati
Copy link
Contributor

References

Description

After logging in, when the user opens the profile menu and selects an entry (e.g., "MyDSpace"), the menu closes automatically upon clicking. The user is then redirected to the selected page seamlessly.

Instructions for Reviewers

An event emitter is introduced in UserMenuComponent. When a list item is clicked, the event is emitted by ds-base-user-menu, signaling the logged-in dropdown to close.

Include guidance for how to test or review your PR. Steps as mentioned in the description.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added bug accessibility 1 APPROVAL pull request only requires a single approval to merge claimed: 4Science 4Science team is working on this issue & will contribute back funded Task is funded via the DSpace Development Fund port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Jul 29, 2024
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@alisaismailati : Thanks for this PR. We gave this a group code review today. Overall, the code looks reasonable, though @atarix83 mentioned that he's surprised there's not an easier way to get ngbDropdown to close properly after a click. Since you are both at 4Science though, I'll let you talk to determine if there's any other way to remove the EventEmitter from this PR.

Beyond that, this just needs a manual check that it's working for others. The code looks reasonable as-is.

@atarix83 atarix83 self-requested a review November 22, 2024 09:08
Copy link
Contributor

@atarix83 atarix83 left a comment

Choose a reason for hiding this comment

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

@tdonohue

I've checked in deep and the changes look good to me

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @alisaismailati ! I've verified this fixes the bug.

@tdonohue tdonohue added this to the 9.0 milestone Dec 18, 2024
@tdonohue tdonohue merged commit 05c7412 into DSpace:main Dec 18, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Backport failed for dspace-7_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-7_x
git worktree add -d .worktree/backport-3224-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-3224-to-dspace-7_x
git switch --create backport-3224-to-dspace-7_x
git cherry-pick -x fa0ec0bf0c375b2d55a72c0792eb7f2666dbd8da

@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-8_x:

@tdonohue
Copy link
Member

@alisaismailati : Would you be able to backport this to dspace-7_x? As you can see above, we were able to backport this to 8.x automatically. But, the backport to 7.x failed. It would be nice to backport this fix to 7.x as well.

@tdonohue tdonohue removed the port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge accessibility bug claimed: 4Science 4Science team is working on this issue & will contribute back funded Task is funded via the DSpace Development Fund port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

User profile menu remains open after menu entry is selected
4 participants