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

feat(notebooks): add polling to Jupyter button in notebook preview #582

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

lorenzo-cavazzi
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi commented Aug 28, 2019

The LaunchJupyter component has been superseded by JupyterButton. It gives more detailed feedback on the current interactive environment status and it keeps the information updated by polling the /servers API.

This implied a few changes:

  • move part of the logic from components in File to new ones in Notebooks
  • get rid of all the code checking notebooks status only once at component load
  • remove unused svg icons from css files
  • create a new JupyterIcon component -- the svg icon may be handled differently (http://tiny.cc/i4p7bz) but that requires changing the SVG code to properly handle greyscale with the fill property. The current approach is close to what we do with react-fontawesome, so it should look familiar.

Preview available here: https://lorenzotest.dev.renku.ch

How to test: open any notebook files from the File tab of a project and try to click on the Jupyter icon on the top right.
E.G. https://lorenzotest.dev.renku.ch/projects/lorenzo.cavazzi.tech/zurich-bikes-tutorial/files/blob/notebooks/zhbikes-notebook.ipynb

fix #559

Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the way this works a lot. The gray/colored in jupyter icon is a nice touch. I have one question about a place where I see explicitly a reference to the "master" branch. Not sure if that is ok or needs to be changed in case the default branch is not master.

if (this.props.accessLevel < ACCESS_LEVELS.MAINTAINER)
return (<CheckNotebookIcon fetched={true} launchNotebookUrl={this.props.launchNotebookUrl} />);

const scope = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it appropriate to hardcode the master branch here?

@lorenzo-cavazzi
Copy link
Member Author

As discussed, I'll handle this case in #597 by adopting a coherent solution (checking the existence of "master" and selecting another branch if not available) since it wouldn't make sense to ask the user to start a new environment and then not being able to detect it.

@lorenzo-cavazzi lorenzo-cavazzi merged commit e992fe8 into master Sep 6, 2019
@lorenzo-cavazzi lorenzo-cavazzi deleted the 559-polling-launchnotebook-button branch September 6, 2019 09:24
@ciyer ciyer added this to the sprint-2019-08-16 milestone Sep 6, 2019
@ciyer ciyer modified the milestones: sprint-2019-08-16, 0.7.0 Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add polling capability to LaunchNotebookButton component
2 participants