added empty state to list
This commit is contained in:
parent
3fe5d8383a
commit
957e08cf1c
3 changed files with 19 additions and 2 deletions
|
@ -47,7 +47,13 @@ export const CreateInitialAccessToken = () => {
|
|||
return (
|
||||
<>
|
||||
{token && (
|
||||
<AccessTokenDialog token={token} toggleDialog={() => setToken("")} />
|
||||
<AccessTokenDialog
|
||||
token={token}
|
||||
toggleDialog={() => {
|
||||
setToken("");
|
||||
history.push(`/${realm}/clients/initialAccessToken`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<ViewHeader
|
||||
titleKey="clients:createToken"
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Button } from "@patternfly/react-core";
|
|||
import { KeycloakDataTable } from "../../components/table-toolbar/KeycloakDataTable";
|
||||
import { useAdminClient } from "../../context/auth/AdminClient";
|
||||
import { useRealm } from "../../context/realm-context/RealmContext";
|
||||
import { ListEmptyState } from "../../components/list-empty-state/ListEmptyState";
|
||||
|
||||
export const InitialAccessTokenList = () => {
|
||||
const { t } = useTranslation("clients");
|
||||
|
@ -56,6 +57,14 @@ export const InitialAccessTokenList = () => {
|
|||
displayKey: "clients:remainingCount",
|
||||
},
|
||||
]}
|
||||
emptyState={
|
||||
<ListEmptyState
|
||||
message={t("noTokens")}
|
||||
instructions={t("noTokensInstructions")}
|
||||
primaryActionText={t("common:create")}
|
||||
onPrimaryAction={() => history.push(`${url}/create`)}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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.",
|
||||
|
|
Loading…
Reference in a new issue