Fix redirection on remove all associated roles (#3160)

This commit is contained in:
kris2kris 2022-08-23 16:37:09 +02:00 committed by GitHub
parent 9e4ecc8a1b
commit e74969b9e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -264,8 +264,7 @@ export default function RealmRoleTabs() {
AlertVariant.success,
t("compositesRemovedAlertDescription")
);
const loc = url.replace(/\/AssociatedRoles/g, "/details");
navigate(loc);
toDetail();
refresh();
} catch (error) {
addError("roles:roleDeleteError", error);
@ -281,6 +280,20 @@ export default function RealmRoleTabs() {
ClientRoleRoute.path
);
const toDetail = () => {
const to = clientRoleRouteMatch
? toClientRole({
...clientRoleRouteMatch.params,
tab: "details",
})
: toRealmRole({
realm: realm?.realm!,
id,
tab: "details",
});
navigate(to);
};
const toAssociatedRoles = () => {
const to = clientRoleRouteMatch
? toClientRole({