Skip to content

Move common Link and LinkContainer into dedicated files.#25146

Open
linuspahl wants to merge 3 commits intomasterfrom
separate-link-component
Open

Move common Link and LinkContainer into dedicated files.#25146
linuspahl wants to merge 3 commits intomasterfrom
separate-link-component

Conversation

@linuspahl
Copy link
Contributor

@linuspahl linuspahl commented Feb 27, 2026

Description

This PR moves the Link and LinkContainer from src/components/common/router.tsx into src/components/common/Link.tsx and src/components/common/LinkContainer.tsx.

This just makes it a little bit easier to find and import these components. Often when I tried to have a look at the implementation of LinkContainer I could not find the component directly, because it was part of the router.tsx.

This change includes:

  • exporting both from components/common (index.tsx)
  • removing src/components/common/router.tsx
  • migrating imports from components/common/router to components/common
    across graylog2-web-interface and enterprise web sources
  • updating eslint guidance message to recommend Link components/common, when importing it from react-router-dom.

/prd https://github.com/Graylog2/graylog-plugin-enterprise/pull/13381

/nocl - refactoring

@linuspahl linuspahl marked this pull request as ready for review February 27, 2026 13:01
@linuspahl linuspahl requested a review from a team February 27, 2026 13:03
@linuspahl linuspahl added the e2e-tests Run PR build with e2e tests. label Feb 27, 2026
Copy link
Member

@dennisoelkers dennisoelkers left a comment

Choose a reason for hiding this comment

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

Looks good, added one suggestion inline which you may or may not implement in this PR!

* All this information will be obtained from the `NodesStore`.
*/

class LinkToNode extends React.PureComponent<
Copy link
Member

Choose a reason for hiding this comment

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

Should we take the opportunity to turn this into a functional component? It is pretty simple and has no state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-tests Run PR build with e2e tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants