Skip to content

Commit

Permalink
Renamed 'setUserMenuLinks' to 'addUserMenuLinks' in nav control service
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Nov 5, 2020
1 parent b45467b commit 8d706f2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/cloud/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class CloudPlugin implements Plugin<CloudSetup> {

if (security && this.isCloudEnabled) {
const userMenuLinks = createUserMenuLinks(this.config);
security.navControlService.setUserMenuLinks(userMenuLinks);
security.navControlService.addUserMenuLinks(userMenuLinks);
}
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/security/public/nav_control/index.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import { SecurityNavControlServiceStart } from '.';
export const navControlServiceMock = {
createStart: (): jest.Mocked<SecurityNavControlServiceStart> => ({
getUserMenuLinks$: jest.fn(),
setUserMenuLinks: jest.fn(),
addUserMenuLinks: jest.fn(),
}),
};
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface SecurityNavControlServiceStart {
/**
* Registers the provided user menu links to be displayed in the user menu in the global nav
*/
setUserMenuLinks: (newUserMenuLink: UserMenuLink[]) => void;
addUserMenuLinks: (newUserMenuLink: UserMenuLink[]) => void;
}

export class SecurityNavControlService {
Expand Down Expand Up @@ -72,7 +72,7 @@ export class SecurityNavControlService {
return {
getUserMenuLinks$: () =>
this.userMenuLinks$.pipe(map(this.sortUserMenuLinks), takeUntil(this.stop$)),
setUserMenuLinks: (userMenuLink: UserMenuLink[]) => {
addUserMenuLinks: (userMenuLink: UserMenuLink[]) => {
this.userMenuLinks$.next(userMenuLink);
},
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/security/public/plugin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('Security Plugin', () => {
).toEqual({
navControlService: {
getUserMenuLinks$: expect.any(Function),
setUserMenuLinks: expect.any(Function),
addUserMenuLinks: expect.any(Function),
},
});
});
Expand Down

0 comments on commit 8d706f2

Please sign in to comment.