Skip to content

Commit

Permalink
chore: rename properties of UserMenuAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-bobev committed Nov 26, 2024
1 parent aa6540e commit e0b23aa
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 41 deletions.
24 changes: 12 additions & 12 deletions packages/fiori/src/UserMenu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<ui5-icon slot="icon" name="edit" show-tooltip accessible-name="{{_editAvatarTooltip}}"></ui5-icon>
</ui5-tag>
</ui5-avatar>
{{#if _selectedAccount.text}}
<ui5-title>{{_selectedAccount.text}}</ui5-title>
{{#if _selectedAccount.titleText}}
<ui5-title>{{_selectedAccount.titleText}}</ui5-title>
{{/if}}
{{#if _selectedAccount.subtitle1}}
<ui5-text>{{_selectedAccount.subtitle1}}</ui5-text>
{{#if _selectedAccount.additionalText}}
<ui5-text>{{_selectedAccount.additionalText}}</ui5-text>
{{/if}}
{{#if _selectedAccount.subtitle2}}
<ui5-text>{{_selectedAccount.subtitle2}}</ui5-text>
{{#if _selectedAccount.description}}
<ui5-text>{{_selectedAccount.description}}</ui5-text>
{{/if}}

{{#if showManageAccount}}
Expand All @@ -54,14 +54,14 @@
{{/if}}
</ui5-avatar>
<div>
{{#if text}}
<ui5-title>{{text}}</ui5-title>
{{#if titleText}}
<ui5-title>{{titleText}}</ui5-title>
{{/if}}
{{#if subtitle1}}
<ui5-label>{{subtitle1}}</ui5-label>
{{#if additionalText}}
<ui5-label>{{additionalText}}</ui5-label>
{{/if}}
{{#if subtitle2}}
<ui5-label>{{subtitle2}}</ui5-label>
{{#if description}}
<ui5-label>{{description}}</ui5-label>
{{/if}}
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion packages/fiori/src/UserMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ class UserMenu extends UI5Element {
}

get accessibleNameText() {
return `${UserMenu.i18nBundle.getText(USER_MENU_POPOVER_ACCESSIBLE_NAME)} ${this._selectedAccount?.text}`;
if (!this._selectedAccount) {
return "";
}
return `${UserMenu.i18nBundle.getText(USER_MENU_POPOVER_ACCESSIBLE_NAME)} ${this._selectedAccount.titleText}`;
}
}

Expand Down
10 changes: 5 additions & 5 deletions packages/fiori/src/UserMenuAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ class UserMenuAccount extends UI5Element {
* @public
*/
@property({ type: String })
text = "";
titleText = "";

/**
* Defines subtitle 1 of the user.
* Defines additional text of the user.
*
* @default ""
* @public
*/
@property({ type: String })
subtitle1 = "";
additionalText = "";

/**
* Defines subtitle 2 of the user.
* Defines description of the user.
*
* @default ""
* @public
*/
@property({ type: String })
subtitle2 = "";
description = "";

/**
* Defines if the user is selected.
Expand Down
23 changes: 11 additions & 12 deletions packages/fiori/test/pages/UserMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@
<ui5-button id="btnOpenUserMenu">User menu</ui5-button>
<ui5-user-menu id="userMenu" show-manage-account show-other-accounts opener="btnOpenUserMenu">
<ui5-user-menu-account slot="accounts"
avatar="./img/man_avatar_1.png"
text="Alain Chevalier 1"
subtitle1="[email protected]"
subtitle2="Delivery Manager, SAP SE"
selected>
avatar="./img/man_avatar_1.png"
title-text="Alain Chevalier 1"
additional-text="[email protected]"
description="Delivery Manager, SAP SE"
selected>
</ui5-user-menu-account>
<ui5-user-menu-account slot="accounts"
initials="AC"
text="Alain Chevalier 2"
subtitle1="[email protected]">
initials="AC"
title-text="Alain Chevalier 2"
additional-text="[email protected]">
</ui5-user-menu-account>
<ui5-user-menu-account slot="accounts"

text="Alain Chevalier 3"
subtitle1="[email protected]"
subtitle2="Account Manager">
title-text="Alain Chevalier 3"
additional-text="[email protected]"
description="Account Manager">
</ui5-user-menu-account>
<ui5-user-menu-item icon="action-settings" text="Setting" data-id="setting" additional-text="selected value"></ui5-user-menu-item>
<ui5-user-menu-item icon="globe" text="Product-specific account action" data-id="account-action1"></ui5-user-menu-item>
Expand Down
22 changes: 11 additions & 11 deletions packages/website/docs/_samples/fiori/UserMenu/Basic/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@
<ui5-button id="btnOpenUserMenu">User menu</ui5-button>
<ui5-user-menu id="userMenu" show-manage-account show-other-accounts opener="btnOpenUserMenu">
<ui5-user-menu-account slot="accounts"
avatar="../assets/images/avatars/Lamp_avatar_01.jpg"
text="Alain Chevalier 1"
subtitle1="[email protected]"
subtitle2="Delivery Manager, SAP SE"
selected>
avatar="../assets/images/avatars/Lamp_avatar_01.jpg"
title-text="Alain Chevalier 1"
additional-text="[email protected]"
description="Delivery Manager, SAP SE"
selected>
</ui5-user-menu-account>
<ui5-user-menu-account slot="accounts"
initials="AC"
text="Alain Chevalier 2"
subtitle1="[email protected]">
initials="AC"
title-text="Alain Chevalier 2"
additional-text="[email protected]">
</ui5-user-menu-account>
<ui5-user-menu-account slot="accounts"
text="Alain Chevalier 3"
subtitle1="[email protected]"
subtitle2="Account Manager">
title-text="Alain Chevalier 3"
additional-text="[email protected]"
description="Account Manager">
</ui5-user-menu-account>
<ui5-user-menu-item icon="action-settings" text="Setting" data-id="setting" additional-text="selected value"></ui5-user-menu-item>
<ui5-user-menu-item icon="globe" text="Product-specific account action" data-id="account-action1"></ui5-user-menu-item>
Expand Down

0 comments on commit e0b23aa

Please sign in to comment.