-
Notifications
You must be signed in to change notification settings - Fork 267
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
[backport-2.9]: Fix a problem with deleting role templates from their detail pages #12419
[backport-2.9]: Fix a problem with deleting role templates from their detail pages #12419
Conversation
9dd54a7
to
f0c9047
Compare
… detail pages We were attempting to navigate back to a non-existent page when deleting role templates from their corresponding detail pages. This caused the Prompt Remove dialog to show an error button and not close. rancher#12217
f0c9047
to
7965f2b
Compare
The fix would "change" routes to the same route which vue3 doesn't complain about. However in vue2 you can't change to the same route without emitting an exception. This change ensures the route is different before pushing.
d45ddab
to
bcebd28
Compare
// Only push if the route will change otherwise we'll get a `NavigationDuplicated` exception | ||
const resolvedRoute = this.currentRouter.resolve(this.cachedDoneLocation); | ||
|
||
if (resolvedRoute.resolved.fullPath !== this.$route.fullPath) { | ||
this.currentRouter.push(this.cachedDoneLocation); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not a part of the original PR. This was needed as a part of the backport because vue2 treats pushing to the same location as an error where as vue3 doesn't. Without this change one of our e2e tests would fail.
@@ -131,6 +132,8 @@ describe('Roles Templates', { tags: ['@usersAndAuths', '@adminUser'] }, () => { | |||
createClusterRole.saveAndWaitForRequests('POST', '/v3/roletemplates').then((res) => { | |||
const clusterRoleId = res.response?.body.id; | |||
|
|||
roleTemplatesToDelete.push(clusterRoleId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was also not a part of the PR but was supporting code that was added by a separate pr in 2.10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I just noticed a typo that we missed in the original PR. I don't think this blocks merging in any way.
@@ -516,6 +516,7 @@ export default { | |||
<button | |||
v-if="isView" | |||
ref="actions" | |||
data-testid="mathead-action-menu" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. I'm just noticing a typo in the id for this backport
data-testid="mathead-action-menu" | |
data-testid="masthead-action-menu" |
This is also present in the master
branch, so we can keep it as-is if that's more straightforward for the backport.
@codyrancher Good to merge |
backport of #12270
fixes: #12218
Checklist