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

Enhance tour version #81

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Hide empty value for select
fcollonval committed Nov 5, 2023

Unverified

This user has not yet uploaded their public signing key.
commit 9a2eaaf9211bdde16a20cf424d6f7622e4302514
14 changes: 10 additions & 4 deletions src/notebookButton.tsx
Original file line number Diff line number Diff line change
@@ -44,7 +44,9 @@ export class TourButton extends ReactWidget {
const errors = this._manager.getNotebookValidationErrors(this._notebook);

if (errors.length) {
title = `${this.translator.__('Tour Validation Errors')}: ${errors.length}`;
title = `${this.translator.__('Tour Validation Errors')}: ${
errors.length
}`;
icon = errorTourIcon;
}

@@ -56,7 +58,7 @@ export class TourButton extends ReactWidget {
title={title}
value=""
>
<option value=""></option>
<option style={{ display: 'none' }} value=""></option>
{errors.length ? (
<option>
{trans.__('Tour metadata is not valid: see the browser console!')}
@@ -67,7 +69,9 @@ export class TourButton extends ReactWidget {
{tourIds.length ? (
<option value="ALL">{trans.__('Run all Tours')}</option>
) : (
<optgroup label={trans.__('No Tours found in this Notebook')}></optgroup>
<optgroup
label={trans.__('No Tours found in this Notebook')}
></optgroup>
)}
{tourIds.length ? (
<optgroup label={trans.__('Notebook Tours')}>
@@ -83,7 +87,9 @@ export class TourButton extends ReactWidget {
/**
* Handle `change` events for the HTMLSelect component.
*/
handleChange = async (event: React.ChangeEvent<HTMLSelectElement>): Promise<void> => {
handleChange = async (
event: React.ChangeEvent<HTMLSelectElement>
): Promise<void> => {
const { value } = event.target;
switch (value) {
case '-':