Skip to content

Commit

Permalink
Merge pull request #6379 from jtpio/page-config
Browse files Browse the repository at this point in the history
Fix opening JupyterLab from Notebook
  • Loading branch information
jtpio authored Apr 27, 2022
2 parents b40b7b4 + 2dc3dec commit 4076882
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
25 changes: 12 additions & 13 deletions notebook/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ def get_page_config(self):
config = LabConfig()
app = self.extensionapp
base_url = self.settings.get("base_url")
page_config = self.settings.setdefault("page_config_data", {})
page_config.update(
{
"appVersion": version,
"baseUrl": self.base_url,
"terminalsAvailable": self.settings.get("terminals_available", False),
"token": self.settings["token"],
"fullStaticUrl": ujoin(self.base_url, "static", self.name),
"frontendUrl": ujoin(self.base_url, "/"),
"exposeAppInBrowser": app.expose_app_in_browser,
"collaborative": app.collaborative,
}
)
page_config_data = self.settings.setdefault("page_config_data", {})
page_config = {
**page_config_data,
"appVersion": version,
"baseUrl": self.base_url,
"terminalsAvailable": self.settings.get("terminals_available", False),
"token": self.settings["token"],
"fullStaticUrl": ujoin(self.base_url, "static", self.name),
"frontendUrl": ujoin(self.base_url, "/"),
"exposeAppInBrowser": app.expose_app_in_browser,
"collaborative": app.collaborative,
}

if "hub_prefix" in app.serverapp.tornado_settings:
tornado_settings = app.serverapp.tornado_settings
Expand Down
14 changes: 14 additions & 0 deletions ui-tests/test/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,18 @@ test.describe('Smoke', () => {

expect(true).toBe(true);
});

test('JupyterLab', async ({ page, tmpPath }) => {
// Open the tree page
await page.goto(`tree/${tmpPath}`);

// Open JupyterLab
await page.menu.clickMenuItem('View>Open JupyterLab');

const lab = await page.waitForEvent('popup');
await lab.waitForSelector('.jp-Launcher');
await lab.close();

expect(true).toBe(true);
});
});

0 comments on commit 4076882

Please sign in to comment.