Skip to content

Commit

Permalink
Fixed conflicts in Organizations.tsx and messages
Browse files Browse the repository at this point in the history
Signed-off-by: Agnieszka Gancarczyk <[email protected]>
  • Loading branch information
agagancarczyk committed Nov 27, 2024
1 parent 9c218e5 commit ade1f11
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,17 @@ duplicateAGroup=Duplicate group
couldNotFetchClientRoleMappings=Could not fetch client role mappings\: {{error}}
duplicateGroupWarning=Duplication of groups with a large number of subgroups is not supported. Please ensure that the group you are duplicating does not have a large number of subgroups.
errorSavingTranslations=Error saving translations\: '{{error}}'
clearCachesTitle=Clear Caches
realmCache=Realm Cache
userCache=User Cache
keysCache=Keys Cache
clearButtonTitle=Clear
clearRealmCacheHelp=This will clear entries for all realms.
clearUserCacheHelp=This will clear entries for all realms.
clearKeysCacheHelp=Clears all entries from the cache of external public keys. These are keys of external clients or identity providers. This will clear all entries for all realms.
clearCacheSuccess=Cache cleared successfully
clearCacheError=Could not clear cache\: {{error}}
expandRow=Expand row
membershipType=Membership type
managedMembership=Managed membership
filterByMembershipType=Filter by Membership Type
Expand Down
8 changes: 7 additions & 1 deletion js/apps/admin-ui/src/user/Organizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import {
} from "@patternfly/react-core";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useParams } from "react-router-dom";
import { Link, useNavigate, useParams } from "react-router-dom";
import { useAdminClient } from "../admin-client";
import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
import { useRealm } from "../context/realm-context/RealmContext";
import { OrganizationModal } from "../organizations/OrganizationModal";
import { toEditOrganization } from "../organizations/routes/EditOrganization";
import useToggle from "../utils/useToggle";
import { UserParams } from "./routes/User";
import { toUsers } from "./routes/Users";
import { CheckboxFilterComponent } from "../components/dynamic/CheckboxFilterComponent";
import { capitalizeFirstLetterFormatter } from "../util";
import { SearchInputComponent } from "../components/dynamic/SearchInputComponent";
Expand All @@ -42,6 +43,7 @@ export const Organizations = ({ user }: OrganizationProps) => {
const { adminClient } = useAdminClient();
const { t } = useTranslation();
const { id } = useParams<UserParams>();
const navigate = useNavigate();
const { addAlert, addError } = useAlerts();
const { realm } = useRealm();
const [key, setKey] = useState(0);
Expand Down Expand Up @@ -161,6 +163,10 @@ export const Organizations = ({ user }: OrganizationProps) => {
),
);
addAlert(t("organizationRemovedSuccess"));
const user = await adminClient.users.findOne({ id: id! });
if (!user) {
navigate(toUsers({ realm: realm }));
}
setSelectedOrgs([]);
refresh();
} catch (error) {
Expand Down

0 comments on commit ade1f11

Please sign in to comment.