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 1 commit
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
46 changes: 33 additions & 13 deletions webui/src/pages/auth/users/user/credentials.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,39 @@ const UserCredentialsList = ({ userId, after, onPaginate }) => {
});
};
const content = (
<>
{createError && <AlertError error={createError}/>}
<CredentialsTable
userId={userId}
currentAccessKey={(user) ? user.accessKeyId : ""}
refresh={refresh}
after={after}
onPaginate={onPaginate}
/>
</>
);
<>
{createError && <AlertError error={createError}/>}
<CredentialsTable
userId={userId}
currentAccessKey={(user) ? user.accessKeyId : ""}
refresh={refresh}
after={after}
onPaginate={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
w-50
text-nowrap
overflow-hidden
text-truncate
align-middle
"
title={email}
>
{email}
</strong>
<br/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the newline after the email?
I think it's better to have it on the same line...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I was wondering about that. Okay, I'll move the question mark to the same line as the email.

A related question: In your opinion, what should the expected behavior be?
Currently, long emails wrap to a new line, while short emails remain on the same line. Guy thinks the behavior should be the same for short, long, and overly long (requiring truncation) emails in terms of the line on which they appear.

What do you think should be the standard behavior for all cases?

I believe it would be better if all emails—whether short, long, or too long (requiring truncation)—appear on a new line, with the question mark positioned next to them.

Currently, here's what happens:
image

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be the same - right after the email/name, with no newline.
Any good reasons for the newline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. You're right—the question mark should be placed immediately after the email/name, so I fixed that.
  2. The second question is: Do we agree that regardless of whether the email/name is short, long, or too long, the email/name should always be placed on a new line (with the question mark right after the email/name)? This way, all cases will appear as shown in these images. In other words, the length of the email/name won't determine whether it stays on the same line as "Create..." or moves to the next line.

image
image
image

Instead of the previous behavior, where a short name like "admin" remained on the same line, while a long email moved to the next line.

short email/name:
image

long email/name:
image

{" "}?
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 +119,4 @@ const UserCredentialsPage = () => {
return <UserCredentialsContainer/>;
};

export default UserCredentialsPage;
export default UserCredentialsPage;
Loading