Skip to content

Commit

Permalink
chore: some small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dobromiraboycheva committed Nov 25, 2024
1 parent 86a4af2 commit 0d85b5d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/fiori/src/UserMenu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<img src={{_selectedAccount.avatar}}/>
{{/if}}
<ui5-tag slot="badge" wrapping-type="None" design="Set1" color-scheme="7">
<ui5-icon slot="icon" name="edit"></ui5-icon>
<ui5-icon slot="icon" name="edit" show-tooltip accessible-name="{{_editAvatarTooltip}}"></ui5-icon>
</ui5-tag>
</ui5-avatar>
{{#if _selectedAccount.text}}
Expand All @@ -41,7 +41,7 @@
<ui5-panel collapsed class="ui5-pm-other-accounts">
<div slot="header" class="ui5-user-menu-account-header">
<ui5-title slot="header" level="H4">{{_otherAccountsButtonText}} ({{_otherAccounts.length}})</ui5-title>
<ui5-button slot="header" design="Transparent" icon="add-employee" @click="{{_handleAddAccountClick}}" />
<ui5-button slot="header" design="Transparent" icon="add-employee" @click="{{_handleAddAccountClick}}" tooltip="{{_addAccountTooltip}}"/>
</div>
{{#if _otherAccounts.length}}
<ui5-list @ui5-item-click="{{_handleAccountSwitch}}">
Expand Down
12 changes: 11 additions & 1 deletion packages/fiori/src/UserMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import {
USER_MENU_MANAGE_ACCOUNT_BUTTON_TXT,
USER_MENU_SIGN_OUT_BUTTON_TXT,
USER_MENU_POPOVER_ACCESSIBLE_NAME,
USER_MENU_EDIT_AVATAR_TXT,
USER_MENU_ADD_ACCOUNT_TXT,
} from "./generated/i18n/i18n-defaults.js";

type UserMenuItemClickEventDetail = {
Expand Down Expand Up @@ -323,8 +325,16 @@ class UserMenu extends UI5Element {
return UserMenu.i18nBundle.getText(USER_MENU_SIGN_OUT_BUTTON_TXT);
}

get _editAvatarTooltip() {
return UserMenu.i18nBundle.getText(USER_MENU_EDIT_AVATAR_TXT);
}

get _addAccountTooltip() {
return UserMenu.i18nBundle.getText(USER_MENU_ADD_ACCOUNT_TXT);
}

get accessibleNameText() {
return UserMenu.i18nBundle.getText(USER_MENU_POPOVER_ACCESSIBLE_NAME);
return `${UserMenu.i18nBundle.getText(USER_MENU_POPOVER_ACCESSIBLE_NAME)} ${this._selectedAccount.text}`;
}
}

Expand Down
3 changes: 1 addition & 2 deletions packages/fiori/src/UserMenuAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ class UserMenuAccount extends UI5Element {
/**
* Defines the avatar initials of the user.
*
* @default null
* @public
*/
@property({ type: String })
initials? = undefined;
initials?: string;

/**
* Defines the title text of the user.
Expand Down
8 changes: 7 additions & 1 deletion packages/fiori/src/i18n/messagebundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -440,5 +440,11 @@ USER_MENU_MANAGE_ACCOUNT_BUTTON_TXT=Manage account
#XTXT: User menu sign out button
USER_MENU_SIGN_OUT_BUTTON_TXT=Sign Out

#XACT: ARIA User menu edit avatar
USER_MENU_EDIT_AVATAR_TXT=Edit avatar

#XACT: ARIA add account
USER_MENU_ADD_ACCOUNT_TXT=Add account

#XACT: ARIA information for the user menu popover
USER_MENU_POPOVER_ACCESSIBLE_NAME=Select an option from the user menu
USER_MENU_POPOVER_ACCESSIBLE_NAME=User menu for

0 comments on commit 0d85b5d

Please sign in to comment.