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

CB-4388 add credentials menu #2260

Merged
merged 3 commits into from
Dec 29, 2023
Merged

Conversation

devnaumov
Copy link
Member

No description provided.

@devnaumov devnaumov self-assigned this Dec 28, 2023
<Fragment key="user-credentials-list">
{user.origins.map(origin => (
{visibleCredentials.map(origin => (
<UserCredentials key={origin.type + origin.subType} origin={origin} />
Copy link
Contributor

Choose a reason for hiding this comment

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

string concatenation can sometimes lead to unexpected results. it is better to use concat method. In this case subtype can be undefined so it will lead to something like: "originundefined". And if those keys are duplicated react can rerender incorrect

I believe it is better to give a unique id here with some generateId helper

const title = isLocal ? translate('authentication_administration_user_local') : origin.displayName;

return (
<MenuItem key={origin.type + origin.subType} className={s(styles, { menuItem: true })} title={title}>
Copy link
Contributor

Choose a reason for hiding this comment

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

same here with unique id

@devnaumov devnaumov merged commit 5f26449 into devel Dec 29, 2023
3 checks passed
@serge-rider serge-rider deleted the CB-4388-additional-credentials-menu branch February 21, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants