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

Making user menu component themeable #2362

Merged

Conversation

Leano1998
Copy link
Contributor

@Leano1998 Leano1998 commented Jul 10, 2023

Description

For our dspace-angular frontend, I needed a themed version of the user-menu-component, so I created it and thought it might be helpful to others as well. So this tiny feature allows you to use the user-menu-component in your own themes.

Instructions for Reviewers

The changes I made, are based on the general tips for creating a themed component in the DSpace-Wiki.

List of changes in this PR:

  • I added the themed-user-menu-component in the user-menu folder and imported it in the shared-module.
  • I replaced all uses of <ds-user-menu> with <ds-themed-user-menu>
  • I added the user menu-component to the custom-theme.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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.
  • 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.

Since this is my first pull request in DSpace, I'm no sure, which information I should add. So, if it is not sufficient please tell me!

@Leano1998
Copy link
Contributor Author

Does anyone has an idea, why the Build /tests (18.x) check fails? It seems to be the submission test in submission.cy.ts, but I can't see a problem with it.

@artlowel
Copy link
Member

artlowel commented Jul 12, 2023

If it's an issue with one node version (18.x) and not the other (16.x) it's more than likely a random issue, where something happened to render slightly too slow for the test. I've restarted it. It should hopefully succeed the second time

@Leano1998
Copy link
Contributor Author

Ah, okay! Thank you. I already thought so.

@Leano1998 Leano1998 marked this pull request as ready for review July 12, 2023 10:49
@tdonohue tdonohue added themes 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Jul 13, 2023
@tdonohue tdonohue added this to the 8.0 milestone Jul 13, 2023
@tdonohue tdonohue added bug and removed bug labels Jul 26, 2023
@tdonohue tdonohue modified the milestones: 8.0, 7.6.1 Jul 26, 2023
@tdonohue tdonohue self-requested a review July 27, 2023 14:36
@tdonohue tdonohue removed this from the 7.6.1 milestone Jul 27, 2023
/**
* The input flag to show user details in navbar expandable menu
*/
@Input() inExpandableNavbar = false;
Copy link
Member

Choose a reason for hiding this comment

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

@Leano1998 thanks for this PR, just some minor feedback since #2075 @Input()s should not have default values, because this way we can override the default values in the themed components in the themes folder (more info in #2164). So could you please replace this line with @Input() inExpandableNavbar: boolean;

Copy link
Contributor Author

@Leano1998 Leano1998 Sep 14, 2023

Choose a reason for hiding this comment

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

@alexandrevryghem Thank you for your review!
I took your suggestion and removed the default value.

@github-actions
Copy link

Hi @Leano1998,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

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.

👍 Thank you so much @Leano1998 ! Apologies for the very long delay in getting this reviewed, but we are making a push toward a 7.6.1 release and this will be included. I gave this a test with both the 'dspace' and 'custom' themes and it works as described. Code looks good too.

@tdonohue tdonohue merged commit 3058a4b into DSpace:main Oct 25, 2023
8 checks passed
@tdonohue tdonohue added this to the 8.0 milestone Oct 25, 2023
@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.

git fetch origin dspace-7_x
git worktree add -d .worktree/backport-2362-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-2362-to-dspace-7_x
git checkout -b backport-2362-to-dspace-7_x
ancref=$(git merge-base 7c0fdcbe67d96ad5779b7be467ac82d2b67f868a 7606f476884d60b94f8be1388a899f7712c24285)
git cherry-pick -x $ancref..7606f476884d60b94f8be1388a899f7712c24285

@tdonohue
Copy link
Member

Manual port of this to dspace-7_x in #2576

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Oct 25, 2023
@Leano1998
Copy link
Contributor Author

👍 Thank you so much @Leano1998 ! Apologies for the very long delay in getting this reviewed, but we are making a push toward a 7.6.1 release and this will be included. I gave this a test with both the 'dspace' and 'custom' themes and it works as described. Code looks good too.

No Problem, thank you for merging it. It wasn't a big change, but I hope it helps.

@Leano1998 Leano1998 deleted the making_user-menu-component_themeable branch January 11, 2024 16:08
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 themes
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants