Fixed link to client (#2489)

This commit is contained in:
Erik Jan de Wit 2022-04-22 10:48:47 +02:00 committed by GitHub
parent 1c296a1641
commit 495c9e917d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,24 +14,15 @@ import { useAdminClient } from "../context/auth/AdminClient";
import { RevocationModal } from "./RevocationModal"; import { RevocationModal } from "./RevocationModal";
import { LogoutAllSessionsModal } from "./LogoutAllSessionsModal"; import { LogoutAllSessionsModal } from "./LogoutAllSessionsModal";
import helpUrls from "../help-urls"; import helpUrls from "../help-urls";
import { toClient } from "../clients/routes/Client";
import { useRealm } from "../context/realm-context/RealmContext";
import "./SessionsSection.css"; import "./SessionsSection.css";
const Clients = (row: UserSessionRepresentation) => {
return (
<>
{Object.values(row.clients!).map((client) => (
<Link key={client} to="" className="pf-u-mx-sm">
{client}
</Link>
))}
</>
);
};
export default function SessionsSection() { export default function SessionsSection() {
const { t } = useTranslation("sessions"); const { t } = useTranslation("sessions");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm } = useRealm();
const [revocationModalOpen, setRevocationModalOpen] = useState(false); const [revocationModalOpen, setRevocationModalOpen] = useState(false);
const [logoutAllSessionsModalOpen, setLogoutAllSessionsModalOpen] = const [logoutAllSessionsModalOpen, setLogoutAllSessionsModalOpen] =
useState(false); useState(false);
@ -80,6 +71,20 @@ export default function SessionsSection() {
return userSessions; return userSessions;
}; };
const Clients = (row: UserSessionRepresentation) => (
<>
{Object.entries(row.clients!).map(([clientId, client]) => (
<Link
key={client}
to={toClient({ clientId, realm, tab: "settings" })}
className="pf-u-mx-sm"
>
{client}
</Link>
))}
</>
);
const dropdownItems = [ const dropdownItems = [
<DropdownItem <DropdownItem
key="toggle-modal" key="toggle-modal"