Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: Application List - Hold down Ctrl+to set the new window opened to still be the application list page

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 5, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

window.open(newUrl)
} else {
router.push({ path: `/application/workspace/${row.id}/workflow` })
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The given code seems to be properly structured and free from syntax errors. However, there are few optimizations that can be considered:

  1. Functionality Simplification: Since row is passed as an argument to the function, you don't need to check if event.ctrlKey exists before accessing it. This can reduce verbosity:

    const { ctrlKey } = event || {};
  2. Avoiding Duplicated Code: The window.open calls in both branches of the conditional statement could share some logic. You might want to refactor them into separate utility functions or a helper method.

  3. Use of Router Functions Directly: Instead of calling router.resolve, you could directly call router.replace or replaceSync depending on whether it needs to trigger a history navigation or not. For opening a new tab without navigating through history:

    window.open(router.resolve({ path: `/application/workspace/${row.id}/workflow` }).href, '_blank');
  4. Type Checking/Validation: Ensure that event and row.id have been defined when this function is called. Proper type checking and validation would prevent runtime errors if either parameter were missing.

Overall, the provided code performs well and should work as expected, but these refinements can make it more robust and concise. Make those changes based on your application's requirements.

@shaohuzhang1 shaohuzhang1 merged commit 36f4dfb into v2 Dec 5, 2025
3 of 6 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_application branch December 5, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants