Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncated long value names in confirmation window #8670

Merged
merged 6 commits into from
Feb 18, 2025
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions webui/src/pages/auth/users/user/credentials.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
} from "../../../../lib/components/controls";
import {useRouter} from "../../../../lib/hooks/router";

const EMAIL_TRUNCATION_THRESHOLD_LENGTH = 40;


const UserCredentialsList = ({ userId, after, onPaginate }) => {
const {user} = useUser();
Expand Down Expand Up @@ -43,7 +45,24 @@ const UserCredentialsList = ({ userId, after, onPaginate }) => {
</>
);

const getMsg = (email) => <span>Create new credentials for user <strong>{email}</strong>?</span>;
const getMsg = (email) => (
<span>
Create new credentials for user{" "}
<br/>
<strong
className={`d-inline-block
text-nowrap
overflow-hidden
text-truncate
align-bottom
${email.length > EMAIL_TRUNCATION_THRESHOLD_LENGTH ? "w-75" : ""}`}
title={email}
>
{email}
</strong>
{" "}?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking again:
I would've removed the {" "}, unless there's a good reason.
But that's your decision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it looks better without it :)

</span>
);
return (
<>
<UserHeaderWithContext userId={userId} page={'credentials'}/>
Expand Down Expand Up @@ -99,4 +118,4 @@ const UserCredentialsPage = () => {
return <UserCredentialsContainer/>;
};

export default UserCredentialsPage;
export default UserCredentialsPage;
Loading