From 2cb4fcc29da3969ffa1e19e1a0761800931252c2 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 7 Mar 2022 15:28:26 +0100 Subject: [PATCH] Hide clustering section when not publicClient (#2186) --- src/clients/AdvancedTab.tsx | 240 ++++++++++++++++++------------------ 1 file changed, 123 insertions(+), 117 deletions(-) diff --git a/src/clients/AdvancedTab.tsx b/src/clients/AdvancedTab.tsx index a10dc67cdc..651f20dd36 100644 --- a/src/clients/AdvancedTab.tsx +++ b/src/clients/AdvancedTab.tsx @@ -50,6 +50,7 @@ export const AdvancedTab = ({ save, client: { id, + publicClient, registeredNodes, attributes, protocol, @@ -175,6 +176,9 @@ export const AdvancedTab = ({ if (protocol === openIdConnect) { sections.splice(3, 0, t("openIdConnectCompatibilityModes")); } + if (!publicClient) { + sections.splice(1, 1); + } return ( @@ -247,128 +251,130 @@ export const AdvancedTab = ({ - <> - - - } - > - - - ( - - )} - /> - - - - - - - + {publicClient && ( <> - - { - nodes[node] = moment.now() / 1000; - refresh(); - }} - onClose={() => setAddNodeOpen(false)} - /> - - - Promise.resolve( - Object.entries(nodes || {}).map((entry) => { - return { host: entry[0], registration: entry[1] }; - }) - ) - } - toolbarItem={ - <> - - - - - - - - } - actions={[ - { - title: t("common:delete"), - onRowClick: (node) => { - setSelectedNode(node.host); - toggleDeleteNodeConfirm(); - }, - }, - ]} - columns={[ - { - name: "host", - displayKey: "clients:nodeHost", - }, - { - name: "registration", - displayKey: "clients:lastRegistration", - cellFormatters: [ - (value) => - value - ? moment(parseInt(value.toString()) * 1000).format( - "LLL" - ) - : "", - ], - }, - ]} - emptyState={ - setAddNodeOpen(true)} + + } + > + + + ( + + )} + /> + + + + + + + + <> + + { + nodes[node] = moment.now() / 1000; + refresh(); + }} + onClose={() => setAddNodeOpen(false)} /> - + + + Promise.resolve( + Object.entries(nodes || {}).map((entry) => { + return { host: entry[0], registration: entry[1] }; + }) + ) + } + toolbarItem={ + <> + + + + + + + + } + actions={[ + { + title: t("common:delete"), + onRowClick: (node) => { + setSelectedNode(node.host); + toggleDeleteNodeConfirm(); + }, + }, + ]} + columns={[ + { + name: "host", + displayKey: "clients:nodeHost", + }, + { + name: "registration", + displayKey: "clients:lastRegistration", + cellFormatters: [ + (value) => + value + ? moment(parseInt(value.toString()) * 1000).format( + "LLL" + ) + : "", + ], + }, + ]} + emptyState={ + setAddNodeOpen(true)} + /> + } + /> + + - + )} <> {protocol === openIdConnect && ( <>