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

Fix Angular SSR menu issues #2504

Merged
merged 2 commits into from
Oct 19, 2023
Merged

Conversation

YanaDePauw
Copy link
Contributor

References

Description

This PR fixes both the menu duplication issue when a '' child route is present as the issue with menus not rendering OnClickMenuItemModel correctly for route dependent menus.
For more information refer to the issue #2503.

Instructions for Reviewers

Add an extra menu similarly to the explanation in the issue:

  1. Add a menu section for a button in the ItemPageRoutingModule to the '' route. Leave the statistics menu as is. This will result in the following route segment:
          {
            path: '',
            component: ThemedItemPageComponent,
            pathMatch: 'full',
            data: {
              menu: {
                public: [{
                  id: 'function-test',
                  active: false,
                  visible: true,
                  model: {
                    type: MenuItemType.ONCLICK,
                    text: 'Click me and verify a console log is printed.',
                    function: () => console.log('Clicking the button worked!')
                  } as OnClickMenuItemModel,
                  icon: 'hand-paper',
                  index: 3,
                }],
              },
            }
          }

  1. Build the DSpace in production mode
  2. Go to an item page
  3. Open the console log in your browser and hard refresh the page
  4. Click the entry in the navbar menu saying "Click me and verify a console log is printed."
  5. Verify that no error shows up but that instead the following message is shown: "Clicking the button worked!"

Checklist

  • 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.
  • If my PR fixes an issue ticket, I've linked them together.

@artlowel artlowel added bug port to main This PR needs to be ported to `main` branch for the next major release labels Sep 19, 2023
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Sep 19, 2023
@alanorth alanorth changed the title Fix Angular SRR menu issues Fix Angular SSR menu issues Sep 22, 2023
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.

@YanaDePauw

thanks for this PR. Ican reproduce the bug and i verified this PR solve it.
LGTM

@tdonohue tdonohue merged commit c25b80a into DSpace:dspace-7_x Oct 19, 2023
11 checks passed
@tdonohue tdonohue added this to the 7.6.1 milestone Oct 19, 2023
@dspace-bot
Copy link
Contributor

Successfully created backport PR for main:

@tdonohue tdonohue removed the port to main This PR needs to be ported to `main` branch for the next major release label Nov 14, 2023
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 bug
Projects
Development

Successfully merging this pull request may close these issues.

5 participants