Removed unused code (#3198)

This commit is contained in:
Erik Jan de Wit 2022-08-30 11:00:37 +02:00 committed by GitHub
parent 42e8f773fb
commit e84ff41654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 15 deletions

View file

@ -17,14 +17,12 @@ import { emailRegexPattern } from "../util";
import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation"; import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation";
import { useAdminClient, useFetch } from "../context/auth/AdminClient"; import { useAdminClient, useFetch } from "../context/auth/AdminClient";
import { useRealm } from "../context/realm-context/RealmContext"; import { useRealm } from "../context/realm-context/RealmContext";
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
import { useAlerts } from "../components/alert/Alerts"; import { useAlerts } from "../components/alert/Alerts";
import { KeycloakTextInput } from "../components/keycloak-text-input/KeycloakTextInput"; import { KeycloakTextInput } from "../components/keycloak-text-input/KeycloakTextInput";
import type GlobalRequestResult from "@keycloak/keycloak-admin-client/lib/defs/globalRequestResult"; import type GlobalRequestResult from "@keycloak/keycloak-admin-client/lib/defs/globalRequestResult";
type RevocationModalProps = { type RevocationModalProps = {
handleModalToggle: () => void; handleModalToggle: () => void;
activeClients: ClientRepresentation[];
save: () => void; save: () => void;
}; };

View file

@ -1,4 +1,3 @@
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
import { DropdownItem, PageSection } from "@patternfly/react-core"; import { DropdownItem, PageSection } from "@patternfly/react-core";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@ -22,9 +21,6 @@ export default function SessionsSection() {
const { realm } = useRealm(); const { realm } = useRealm();
const [revocationModalOpen, setRevocationModalOpen] = useState(false); const [revocationModalOpen, setRevocationModalOpen] = useState(false);
const [activeClientDetails, setActiveClientDetails] = useState<
ClientRepresentation[]
>([]);
const [noSessions, setNoSessions] = useState(false); const [noSessions, setNoSessions] = useState(false);
const handleRevocationModalToggle = () => { const handleRevocationModalToggle = () => {
@ -43,14 +39,6 @@ export default function SessionsSection() {
setNoSessions(clientSessions.length === 0); setNoSessions(clientSessions.length === 0);
const allClients = await adminClient.clients.find();
const getActiveClientDetails = allClients.filter((x) =>
activeClients.map((y) => y.id).includes(x.id)
);
setActiveClientDetails(getActiveClientDetails);
const userIds = Array.from( const userIds = Array.from(
new Set(clientSessions.map((session) => session.userId)) new Set(clientSessions.map((session) => session.userId))
); );
@ -110,7 +98,6 @@ export default function SessionsSection() {
{revocationModalOpen && ( {revocationModalOpen && (
<RevocationModal <RevocationModal
handleModalToggle={handleRevocationModalToggle} handleModalToggle={handleRevocationModalToggle}
activeClients={activeClientDetails}
save={() => { save={() => {
handleRevocationModalToggle(); handleRevocationModalToggle();
}} }}