no spinner when no have rights for realm load (#2515)

* no spinner when no have rights for realm load

fixes: #2504

* fixed empty state note

* default to search user

* Update public/resources/en/users.json

Co-authored-by: Stan Silvert <ssilvert@redhat.com>
This commit is contained in:
Erik Jan de Wit 2022-04-28 20:55:06 +02:00 committed by GitHub
parent 60a81c8e86
commit ee6f2f4a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -4,7 +4,7 @@
"userList": "User list", "userList": "User list",
"searchForUser": "Search user", "searchForUser": "Search user",
"startBySearchingAUser": "Start by searching for users", "startBySearchingAUser": "Start by searching for users",
"searchForUserDescription": "This realm has a federated provider. Viewing all users may cause the system to slow down. Please search for a user above.", "searchForUserDescription": "This realm may have a federated provider. Viewing all users may cause the system to slow down, but it can be done by searching for \"*\". Please search for a user above.",
"createUser": "Create user", "createUser": "Create user",
"createNewUser": "Create new user", "createNewUser": "Create new user",
"noUsersFound": "No users found", "noUsersFound": "No users found",
@ -165,4 +165,4 @@
"credentialResetConfirmText": "Are you sure you want to send email to user", "credentialResetConfirmText": "Are you sure you want to send email to user",
"credentialResetEmailSuccess": "Email sent to user.", "credentialResetEmailSuccess": "Email sent to user.",
"credentialResetEmailError": "Failed: {{error}}" "credentialResetEmailError": "Failed: {{error}}"
} }

View file

@ -69,7 +69,7 @@ export default function UsersSection() {
const [kebabOpen, setKebabOpen] = useState(false); const [kebabOpen, setKebabOpen] = useState(false);
const [selectedRows, setSelectedRows] = useState<UserRepresentation[]>([]); const [selectedRows, setSelectedRows] = useState<UserRepresentation[]>([]);
const [key, setKey] = useState(""); const [key, setKey] = useState(0);
const refresh = () => setKey(key + 1); const refresh = () => setKey(key + 1);
useFetch( useFetch(
@ -84,7 +84,7 @@ export default function UsersSection() {
adminClient.realms.findOne({ realm: realmName }), adminClient.realms.findOne({ realm: realmName }),
]); ]);
} catch { } catch {
return [[], undefined] as [ return [[{}], undefined] as [
ComponentRepresentation[], ComponentRepresentation[],
RealmRepresentation | undefined RealmRepresentation | undefined
]; ];
@ -281,10 +281,6 @@ export default function UsersSection() {
</> </>
); );
if (!realm) {
return <KeycloakSpinner />;
}
const route = (tab: UserTab) => const route = (tab: UserTab) =>
routableTab({ routableTab({
to: toUsers({ to: toUsers({