Skip to content

Commit

Permalink
Merge pull request #5121 from KommunikativCh/bugfix/title-attribute-f…
Browse files Browse the repository at this point in the history
…or-impersonate-button-in-user-management

BUGFIX: Fix title attribute for impersonate button in user management
  • Loading branch information
crydotsnake authored Jun 4, 2024
2 parents 9e3a9c9 + 851effd commit 068508d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {isNil} from "../Helper"

const impersonateIcon = '<i class="fas fa-random icon-white"></i>'
const localizedTooltip = !isNil(window.Typo3Neos) ?
window.NeosCMS.I18n.translate('impersonate.tooltip.impersonateUserButton', 'Login as this user', 'Neos.Neos') :
'Login as this user';

const ImpersonateButton = (identifier, disabled) => {
const localizedTooltip = !isNil(window.NeosCMS) ?
window.NeosCMS.I18n.translate('impersonate.tooltip.impersonateUserButton', 'Login as this user', 'Neos.Neos') :
'Login as this user';
const attributesObject = {
'data-neos-toggle': 'tooltip',
'title': localizedTooltip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ const RestoreButton = (user) => {
attributes += `${key}="${attributesObject[key]}" `
})

const restoreLabel = isNil(window.NeosCMS)
const restoreLabel = !isNil(window.NeosCMS)
? window.NeosCMS.I18n.translate(
'impersonate.label.restoreUserButton',
'Back to user "{0}"',
'Neos.Neos',
'Main',
user.accountIdentifier
[user.fullName]
)
: `Restore user "${user.accountIdentifier}"`
: `Restore user "${user.fullName}"`
return `<button ${attributes}>${impersonateIcon} ${restoreLabel}</button>`
}

Expand Down

0 comments on commit 068508d

Please sign in to comment.