Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port security & spaces chrome nav controls to New Platform #44929

Closed
joshdover opened this issue Sep 5, 2019 · 3 comments · Fixed by #52386
Closed

Port security & spaces chrome nav controls to New Platform #44929

joshdover opened this issue Sep 5, 2019 · 3 comments · Fixed by #52386
Labels
Feature:NP Migration Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@joshdover
Copy link
Contributor

The "chrome nav controls" that register the current user dropdown and current space dropdown in the Header are not present when viewing a New Platform application.

This is because no uiExports or legacy code are run in this scenario. We need to port these two components over to the New Platform in order for these UIs to show when the user is in a New Platform application.

Security

chromeHeaderNavControlsRegistry.register((ShieldUser, kbnBaseUrl) => ({
name: 'security',
order: 1000,
side: NavControlSide.Right,
render(el) {
const showSecurityLinks = xpackInfo.get('features.security.showLinks');
if (Path.isUnauthenticated() || !showSecurityLinks) return null;
const props = {
user: ShieldUser.getCurrent(),
editProfileUrl: chrome.addBasePath(`${kbnBaseUrl}#/account`),
logoutUrl: chrome.addBasePath(`/logout`)
};
props.user.$promise.then(() => {
// Wait for the user to be propogated before rendering into the DOM.
ReactDOM.render(
<I18nContext>
<SecurityNavControl {...props} />
</I18nContext>,
el
);
});
return () => ReactDOM.unmountComponentAtNode(el);
}
}));

Spaces

chromeHeaderNavControlsRegistry.register((chrome: any, activeSpace: any) => ({
name: 'spaces',
order: 1000,
side: NavControlSide.Left,
render(el: HTMLElement) {
if (Path.isUnauthenticated()) {
return;
}
const spaceSelectorURL = chrome.getInjected('spaceSelectorURL');
spacesManager = new SpacesManager(spaceSelectorURL);
ReactDOM.render(
<I18nContext>
<NavControlPopover
spacesManager={spacesManager}
activeSpace={activeSpace}
anchorPosition="downLeft"
buttonClass={SpacesHeaderNavButton}
/>
</I18nContext>,
el
);
},
}));

@joshdover joshdover added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! Feature:NP Migration labels Sep 5, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security

@legrego
Copy link
Member

legrego commented Sep 5, 2019

#40856 will resolve the spaces nav control

@legrego
Copy link
Member

legrego commented Dec 6, 2019

#52386 will resolve the security nav control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants