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

Remove History menu option for the tryit notebook (fixes #2114) #2125

Merged
merged 1 commit into from
Aug 8, 2019
Merged

Remove History menu option for the tryit notebook (fixes #2114) #2125

merged 1 commit into from
Aug 8, 2019

Conversation

ZiyaoWei
Copy link
Contributor

@ZiyaoWei ZiyaoWei commented Aug 6, 2019

Addresses #2114 by not showing the History option for the tryit notebook.

Pull Request checklist

  • Documentation: If this feature has or requires documentation, the relevant docs have been updated.
  • Changelog: This PR updates the changelog with any user-visible changes.
  • Tests: This PR includes thorough tests or an explanation of why it does not

Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

This looks good minus the one requested change I have. Could you also add an entry to CHANGELOG.md per the pull request instructions?

Also, generally we add a "(fixes #xxx)" to end in a PR/commit message when a PR fixes an existing issue. If you could add/change that, that would be great too :)

};

render() {
return (
<NotebookIconMenu>
{this.props.isServer && <NotebookMenuItem task={tasks.newNotebook} />}
{this.props.isServer && (
{!this.props.isTrialNotebook && (
<NotebookMenuItem task={tasks.toggleHistoryModal} />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd prefer to disable the item in this case, since there is a way to get access to the functionality (log in). Try this instead:

<NotebookMenuItem task={tasks.toggleHistoryModal} disabled={this.props.isTrialNotebook} />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, good point! Total React n00b - it seems the above code won't work either since the item doesn't get rerendered on login? I'll try to figure out how this actually works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the reason is that the notebook tryit mode boolean isn't set to false after login and notebook creation - PR updated, hope this works!

@ZiyaoWei
Copy link
Contributor Author

ZiyaoWei commented Aug 7, 2019

@wlach thanks for the review! Saw the checklist after submitting - will fix now.

@ZiyaoWei ZiyaoWei changed the title Remove History menu option for the tryit notebook Remove History menu option for the tryit notebook (fixes #2114) Aug 7, 2019
@wlach
Copy link
Contributor

wlach commented Aug 8, 2019

Works great, thank you!

@wlach wlach merged commit 6fda460 into iodide-project:master Aug 8, 2019
@ZiyaoWei ZiyaoWei deleted the wzy/NoHistoryForTryIt branch August 8, 2019 19:30
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.

2 participants