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

Logout button cannot be hidden #6300

Open
fcollonval opened this issue May 2, 2019 · 4 comments
Open

Logout button cannot be hidden #6300

fcollonval opened this issue May 2, 2019 · 4 comments

Comments

@fcollonval
Copy link
Member

fcollonval commented May 2, 2019

Describe the enhancement

Hey, this is an enhancement.

I was looking at the Logout behaviour in the classical notebook because I was surprised by the PR #6087 not having a way to hide it as for the Shut down button. Actually, it will not appear in the menu if the server option quit_button is True. But this is not coherent with the classical notebook.

In the classical notebook, the Login/Logout buttons display depends on logged_in and login_available properties of AuthenticatedHandler.

https://github.com/jupyter/notebook/blob/9560e0cf4c3a3612f7e0f869035e7e3eeb5853a0/notebook/templates/page.html#L139-L145

https://github.com/jupyter/notebook/blob/9560e0cf4c3a3612f7e0f869035e7e3eeb5853a0/notebook/base/handlers.py#L174-L177

https://github.com/jupyter/notebook/blob/9560e0cf4c3a3612f7e0f869035e7e3eeb5853a0/notebook/base/handlers.py#L184-L194

Those parameters are passed to the jinja template as parameters.

Basically if the user equals "anonymous", those buttons should be hidden. This can be obtain by customizing the login handler class.

Now the question is how to apply a similar behaviour in JupyterLab. I presume the main point is to figure out how to send the information to the frontend through the page_config_data as for the Shut down button.

settings['page_config_data']['quitButton'] = getattr(self, 'quit_button', False)

@blink1073
Copy link
Contributor

Yep, that sounds right.

@jasongrout jasongrout added this to the 1.1 milestone May 8, 2019
@blink1073 blink1073 modified the milestones: 1.1, 1.2 Aug 27, 2019
@jasongrout jasongrout modified the milestones: 1.2, 2.0 Oct 11, 2019
@jasongrout jasongrout modified the milestones: 2.0, Future Dec 2, 2019
@blink1073 blink1073 modified the milestones: Future, 3.0 May 28, 2020
@blink1073
Copy link
Contributor

Note: this would require changes to jupyterlab_server to add handling of parameters passed as page_config, as well as changes to jupyterlab to separate handling of shutdown from logout using this new page config.

const quitButton = PageConfig.getOption('quitButton').toLowerCase();

@jasongrout jasongrout modified the milestones: 3.0, 3.1 Sep 16, 2020
@blink1073 blink1073 modified the milestones: 3.1, 4.0 Jun 15, 2021
@jtpio
Copy link
Member

jtpio commented Aug 17, 2022

@fcollonval probably this could be closed since the menu items can now be customized via the settings system?

@fcollonval
Copy link
Member Author

I would not close it as the logout button should be conditioned on server settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants