From 957e08cf1c0e3c1de120c6801491b612f41b2997 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 4 Mar 2021 09:37:46 +0100 Subject: [PATCH] added empty state to list --- src/clients/initial-access/CreateInitialAccessToken.tsx | 8 +++++++- src/clients/initial-access/InitialAccessTokenList.tsx | 9 +++++++++ src/clients/messages.json | 4 +++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/clients/initial-access/CreateInitialAccessToken.tsx b/src/clients/initial-access/CreateInitialAccessToken.tsx index 11d1ab273c..47eb10a613 100644 --- a/src/clients/initial-access/CreateInitialAccessToken.tsx +++ b/src/clients/initial-access/CreateInitialAccessToken.tsx @@ -47,7 +47,13 @@ export const CreateInitialAccessToken = () => { return ( <> {token && ( - setToken("")} /> + { + setToken(""); + history.push(`/${realm}/clients/initialAccessToken`); + }} + /> )} { const { t } = useTranslation("clients"); @@ -56,6 +57,14 @@ export const InitialAccessTokenList = () => { displayKey: "clients:remainingCount", }, ]} + emptyState={ + history.push(`${url}/create`)} + /> + } /> ); }; diff --git a/src/clients/messages.json b/src/clients/messages.json index 97c0357847..1bae7eac85 100644 --- a/src/clients/messages.json +++ b/src/clients/messages.json @@ -77,10 +77,12 @@ "createToken": "Create initial access token", "id": "ID", "timestamp": "Created date", - "expirs": "Expires", + "expires": "Expires", "count": "Count", "remainingCount": "Remaining count", "expiration": "Expiration", + "noTokens": "No initial access tokens", + "noTokensInstructions": "You haven't created any initial access tokens. Create a initial access tokens by clicking \"Create\"", "tokenSaveError": "Could not create initial access token {{error}}", "initialAccessTokenDetails": "Initial access token details", "copyInitialAccessToken": "Please copy and paste the initial access token before closing as it can not be retrieved later.",