Skip to content

Commit aa9cf2d

Browse files
feat(user-menu): change api name from showAddAccount to showEditAccounts (#10966)
1 parent 27c8bb7 commit aa9cf2d

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

packages/fiori/cypress/specs/UserMenu.cy.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ describe("Initial rendering", () => {
7979
cy.get("@responsivePopover").find("[ui5-button]").should("have.length", 1);
8080
});
8181

82-
it("tests config show-add-account", () => {
82+
it("tests config show-edit-accounts", () => {
8383
cy.mount(
8484
<>
8585
<Button id="openUserMenuBtn">Open User Menu</Button>
86-
<UserMenu open={true} opener="openUserMenuBtn" showOtherAccounts={true} showAddAccount={true}>
86+
<UserMenu open={true} opener="openUserMenuBtn" showOtherAccounts={true} showEditAccounts={true}>
8787
<UserMenuAccount
8888
slot="accounts"
8989
titleText="Alain Chevalier 1"
@@ -342,7 +342,7 @@ describe("Events", () => {
342342
cy.mount(
343343
<>
344344
<Button id="openUserMenuBtn">Open User Menu</Button>
345-
<UserMenu open={true} opener="openUserMenuBtn" showAddAccount={true} showOtherAccounts={true}>
345+
<UserMenu open={true} opener="openUserMenuBtn" showEditAccounts={true} showOtherAccounts={true}>
346346
<UserMenuAccount slot="accounts" titleText="Alain Chevalier 1"></UserMenuAccount>
347347
</UserMenu>
348348
</>
@@ -356,7 +356,7 @@ describe("Events", () => {
356356

357357
cy.get("@userMenu")
358358
.then($userMenu => {
359-
$userMenu.get(0).addEventListener("add-account-click", cy.stub().as("clicked"));
359+
$userMenu.get(0).addEventListener("edit-accounts-click", cy.stub().as("clicked"));
360360
});
361361

362362
cy.get("@addAccountBtn").click();
@@ -614,7 +614,7 @@ describe("Responsiveness", () => {
614614
<UserMenu id="userMenuShellBar" open={true}
615615
opener="openUserMenuBtn"
616616
showManageAccount={true}
617-
showAddAccount={true}>
617+
showEditAccounts={true}>
618618
<UserMenuAccount slot="accounts" titleText="Alain Chevalier 1"></UserMenuAccount>
619619
<UserMenuItem text="Setting1" data-id="setting1"></UserMenuItem>
620620
</UserMenu>
@@ -635,7 +635,7 @@ describe("Responsiveness", () => {
635635
id="userMenuShellBar"
636636
open={true} opener="openUserMenuBtn"
637637
showManageAccount={true}
638-
showAddAccount={true}
638+
showEditAccounts={true}
639639
>
640640
<UserMenuAccount slot="accounts" titleText="Alain Chevalier 1"></UserMenuAccount>
641641
<UserMenuItem text="Setting1" data-id="setting1"></UserMenuItem>

packages/fiori/src/UserMenu.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
USER_MENU_SIGN_OUT_BUTTON_TXT,
2626
USER_MENU_POPOVER_ACCESSIBLE_NAME,
2727
USER_MENU_EDIT_AVATAR_TXT,
28-
USER_MENU_ADD_ACCOUNT_TXT,
28+
USER_MENU_EDIT_ACCOUNTS_TXT,
2929
USER_MENU_CLOSE_DIALOG_BUTTON,
3030
} from "./generated/i18n/i18n-defaults.js";
3131

@@ -78,10 +78,10 @@ type UserMenuOtherAccountClickEventDetail = {
7878
@event("manage-account-click")
7979

8080
/**
81-
* Fired when the "Add Account" button is selected.
81+
* Fired when the "Edit Accounts" button is selected.
8282
* @public
8383
*/
84-
@event("add-account-click")
84+
@event("edit-accounts-click")
8585

8686
/**
8787
* Fired when the account is switched to a different one.
@@ -128,7 +128,7 @@ class UserMenu extends UI5Element {
128128
eventDetails!: {
129129
"avatar-click": void;
130130
"manage-account-click": void;
131-
"add-account-click": void;
131+
"edit-accounts-click": void;
132132
"change-account": UserMenuOtherAccountClickEventDetail;
133133
"item-click": UserMenuItemClickEventDetail;
134134
"sign-out-click": void;
@@ -174,13 +174,13 @@ class UserMenu extends UI5Element {
174174
showOtherAccounts = false;
175175

176176
/**
177-
* Defines if the User Menu shows the Add Account option.
177+
* Defines if the User Menu shows the Edit Accounts option.
178178
*
179179
* @default false
180180
* @public
181181
*/
182182
@property({ type: Boolean })
183-
showAddAccount = false;
183+
showEditAccounts = false;
184184

185185
/**
186186
* Defines if the User menu shows edit button.
@@ -321,8 +321,8 @@ class UserMenu extends UI5Element {
321321
this.fireDecoratorEvent("manage-account-click");
322322
}
323323

324-
_handleAddAccountClick() {
325-
this.fireDecoratorEvent("add-account-click");
324+
_handleEditAccountsClick() {
325+
this.fireDecoratorEvent("edit-accounts-click");
326326
}
327327

328328
_handleAccountSwitch(e: CustomEvent<ListItemClickEventDetail>) {
@@ -415,8 +415,8 @@ class UserMenu extends UI5Element {
415415
return UserMenu.i18nBundle.getText(USER_MENU_EDIT_AVATAR_TXT);
416416
}
417417

418-
get _addAccountTooltip() {
419-
return UserMenu.i18nBundle.getText(USER_MENU_ADD_ACCOUNT_TXT);
418+
get _editAccountsTooltip() {
419+
return UserMenu.i18nBundle.getText(USER_MENU_EDIT_ACCOUNTS_TXT);
420420
}
421421

422422
get _closeDialogAriaLabel() {

packages/fiori/src/UserMenuTemplate.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import personPlaceholder from "@ui5/webcomponents-icons/dist/person-placeholder.
1616
import userSettings from "@ui5/webcomponents-icons/dist/user-settings.js";
1717
import log from "@ui5/webcomponents-icons/dist/log.js";
1818
import decline from "@ui5/webcomponents-icons/dist/decline.js";
19-
import addEmployee from "@ui5/webcomponents-icons/dist/add-employee.js";
19+
import userEdit from "@ui5/webcomponents-icons/dist/user-edit.js";
2020

2121
export default function UserMenuTemplate(this: UserMenu) {
2222
return (
@@ -72,8 +72,8 @@ export default function UserMenuTemplate(this: UserMenu) {
7272
<Panel collapsed={true} class="ui5-pm-other-accounts">
7373
<div slot="header" class="ui5-user-menu-account-header">
7474
<Title slot="header" level="H4">{this._otherAccountsButtonText} ({this._otherAccounts.length})</Title>
75-
{this.showAddAccount &&
76-
<Button slot="header" class="ui5-pm-add-account-btn" design="Transparent" icon={addEmployee} onClick={this._handleAddAccountClick} tooltip={this._addAccountTooltip}/>
75+
{this.showEditAccounts &&
76+
<Button slot="header" class="ui5-pm-add-account-btn" design="Transparent" icon={userEdit} onClick={this._handleEditAccountsClick} tooltip={this._editAccountsTooltip}/>
7777
}
7878
</div>
7979
{this._otherAccounts.length > 0 &&

packages/fiori/src/i18n/messagebundle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ USER_MENU_SIGN_OUT_BUTTON_TXT=Sign Out
504504
#XACT: ARIA User menu edit avatar
505505
USER_MENU_EDIT_AVATAR_TXT=Edit avatar
506506

507-
#XACT: ARIA add account
508-
USER_MENU_ADD_ACCOUNT_TXT=Add account
507+
#XACT: ARIA edit accounts
508+
USER_MENU_EDIT_ACCOUNTS_TXT=Edit accounts
509509

510510
#XACT: ARIA information for the user menu popover
511511
USER_MENU_POPOVER_ACCESSIBLE_NAME=User menu for

packages/fiori/test/pages/UserMenu.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</ui5-avatar>
2828
<img slot="logo" src="./img/sap-logo-svg.svg" />
2929
</ui5-shellbar>
30-
<ui5-user-menu id="userMenuShellBar" show-manage-account show-other-accounts show-add-account show-edit-button>
30+
<ui5-user-menu id="userMenuShellBar" show-manage-account show-other-accounts show-edit-accounts show-edit-button>
3131
<ui5-user-menu-account slot="accounts"
3232
avatar-src="./img/man_avatar_1.png"
3333
title-text="Alain Chevalier 1"

packages/website/docs/_samples/fiori/UserMenu/Advanced/sample.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</ui5-avatar>
3030
<img slot="logo" src="../assets/images/sap-logo-svg.svg" />
3131
</ui5-shellbar>
32-
<ui5-user-menu id="userMenu" show-manage-account show-other-accounts show-add-account show-edit-button>
32+
<ui5-user-menu id="userMenu" show-manage-account show-other-accounts show-edit-accounts show-edit-button>
3333
<ui5-user-menu-account slot="accounts"
3434
avatar-src="../assets/images/avatars/man_avatar_3.png"
3535
title-text="Alain Chevalier 1"

0 commit comments

Comments
 (0)