From 910b439a777436546a40a932278770cb263bece1 Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Mon, 10 Jan 2022 15:36:19 +0000 Subject: [PATCH] change some titles and make ui a bit more pretty i guess --- src/api/types/user.ts | 1 + src/translations/en.js | 2 ++ src/ui/pages/Access/Auth/AuthHome.tsx | 17 +++++++------- .../Access/Auth/userpass/UserPassUserEdit.tsx | 23 ++++++++++--------- .../Access/Auth/userpass/UserPassUserView.tsx | 6 +---- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/api/types/user.ts b/src/api/types/user.ts index 0ad4a69..d6e1c04 100644 --- a/src/api/types/user.ts +++ b/src/api/types/user.ts @@ -1,4 +1,5 @@ export type UserType = { + username?: string; password?: string; token_bound_cidrs: string[]; token_explicit_max_ttl: number; diff --git a/src/translations/en.js b/src/translations/en.js index 23bca91..c906651 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -12,6 +12,7 @@ module.exports = { // Common buttons / placeholders common_new: "New", + common_view: "View", common_edit: "Edit", common_create: "Create", common_delete: "Delete", @@ -265,6 +266,7 @@ module.exports = { auth_common_token_peroid: "Period (seconds)", auth_common_policies: "Policies", auth_common_type: "Token Type", + auth_common_token_config: "Token Config", // userpass Users List userpass_users_list_title: "Users List", diff --git a/src/ui/pages/Access/Auth/AuthHome.tsx b/src/ui/pages/Access/Auth/AuthHome.tsx index 72913bc..0a482e1 100644 --- a/src/ui/pages/Access/Auth/AuthHome.tsx +++ b/src/ui/pages/Access/Auth/AuthHome.tsx @@ -14,9 +14,9 @@ export type AuthListElementProps = { }; export function AuthListElement(props: AuthListElementProps): JSX.Element { - const isClickable = props.method.type != "token"; + const isViewable = ["userpass"].includes(props.method.type); - const onHeaderLinkClick = async (props: AuthListElementProps) => { + const onViewClick = (props: AuthListElementProps) => { if (props.method.type == "userpass") { route(userPassUserListURL(props.path)); } @@ -24,15 +24,14 @@ export function AuthListElement(props: AuthListElementProps): JSX.Element { return (
- {isClickable ? ( - onHeaderLinkClick(props)}> - {props.path} - - ) : ( - {props.path} - )} + {props.path} {` (${props.method.accessor})`}
+ {isViewable && ( + + )}