From 3b3901ec4136e42a6d5f28e4fd0bd9f6f2fab791 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Thu, 29 Feb 2024 16:17:11 +0100 Subject: [PATCH] Use existing server settings when creating the `ConfigSection` (#85) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use existing server settings when creating the `ConfigSection` * fix yarn.lock * lint changelog * add serviceManager to mockApp * test * Fix notebook integration test * We of course dont need to select a kernel --------- Co-authored-by: Frédéric Collonval --- CHANGELOG.md | 46 ++++++++++++++++++++++------ src/__tests__/plugin.spec.ts | 4 ++- src/plugin.tsx | 5 +-- ui-tests/tests/notebook-tour.spec.ts | 3 +- yarn.lock | 4 +-- 5 files changed, 45 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd0f75..6d844b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,26 +8,52 @@ ### Enhancements made -- Enhance tour version [#81](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/81) ([@fcollonval](https://github.com/fcollonval)) -- Add support for notebook 7 [#75](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/75) ([@fcollonval](https://github.com/fcollonval)) -- Add notebook tours, icons [#29](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/29) ([@bollwyvl](https://github.com/bollwyvl)) +- Enhance tour version + [#81](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/81) + ([@fcollonval](https://github.com/fcollonval)) +- Add support for notebook 7 + [#75](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/75) + ([@fcollonval](https://github.com/fcollonval)) +- Add notebook tours, icons + [#29](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/29) + ([@bollwyvl](https://github.com/bollwyvl)) ### Bugs fixed -- Fix internationalization [#74](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/74) ([@fcollonval](https://github.com/fcollonval)) +- Fix internationalization + [#74](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/74) + ([@fcollonval](https://github.com/fcollonval)) ### Maintenance and upkeep improvements -- Bump @babel/traverse from 7.22.10 to 7.23.2 [#80](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/80) ([@dependabot](https://github.com/dependabot)) -- Bump postcss from 8.4.27 to 8.4.31 [#79](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/79) ([@dependabot](https://github.com/dependabot)) -- Bump postcss from 8.4.27 to 8.4.31 in /ui-tests [#78](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/78) ([@dependabot](https://github.com/dependabot)) -- Bump systeminformation from 5.18.10 to 5.21.8 in /ui-tests [#77](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/77) ([@dependabot](https://github.com/dependabot)) -- upgrade to jupyterlab4 [#71](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/71) ([@djangoliv](https://github.com/djangoliv)) +- Bump @babel/traverse from 7.22.10 to 7.23.2 + [#80](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/80) + ([@dependabot](https://github.com/dependabot)) +- Bump postcss from 8.4.27 to 8.4.31 + [#79](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/79) + ([@dependabot](https://github.com/dependabot)) +- Bump postcss from 8.4.27 to 8.4.31 in /ui-tests + [#78](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/78) + ([@dependabot](https://github.com/dependabot)) +- Bump systeminformation from 5.18.10 to 5.21.8 in /ui-tests + [#77](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/77) + ([@dependabot](https://github.com/dependabot)) +- upgrade to jupyterlab4 + [#71](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/71) + ([@djangoliv](https://github.com/djangoliv)) ### Contributors to this release ([GitHub contributors page for this release](https://github.com/jupyterlab-contrib/jupyterlab-tour/graphs/contributors?from=2021-10-31&to=2023-11-08&type=c)) -[@bollwyvl](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Abollwyvl+updated%3A2021-10-31..2023-11-08&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adependabot+updated%3A2021-10-31..2023-11-08&type=Issues) | [@djangoliv](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adjangoliv+updated%3A2021-10-31..2023-11-08&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Afcollonval+updated%3A2021-10-31..2023-11-08&type=Issues) | [@github-actions](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Agithub-actions+updated%3A2021-10-31..2023-11-08&type=Issues) +[@bollwyvl](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Abollwyvl+updated%3A2021-10-31..2023-11-08&type=Issues) +| +[@dependabot](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adependabot+updated%3A2021-10-31..2023-11-08&type=Issues) +| +[@djangoliv](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adjangoliv+updated%3A2021-10-31..2023-11-08&type=Issues) +| +[@fcollonval](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Afcollonval+updated%3A2021-10-31..2023-11-08&type=Issues) +| +[@github-actions](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Agithub-actions+updated%3A2021-10-31..2023-11-08&type=Issues) diff --git a/src/__tests__/plugin.spec.ts b/src/__tests__/plugin.spec.ts index 9ba772c..0dc88c1 100644 --- a/src/__tests__/plugin.spec.ts +++ b/src/__tests__/plugin.spec.ts @@ -9,6 +9,7 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry'; import { CommandRegistry } from '@lumino/commands'; import { ReadonlyJSONObject } from '@lumino/coreutils'; import { DocumentRegistry } from '@jupyterlab/docregistry'; +import { ServerConnection } from '@jupyterlab/services'; import { CodeMirrorEditorFactory, CodeMirrorMimeTypeService, @@ -34,7 +35,8 @@ function mockApp(): Partial { return { commands: new CommandRegistry(), restored: Promise.resolve(), - docRegistry: new DocumentRegistry() + docRegistry: new DocumentRegistry(), + serviceManager: { serverSettings: ServerConnection.makeSettings() } as any }; } diff --git a/src/plugin.tsx b/src/plugin.tsx index 50bcc72..3c2aced 100644 --- a/src/plugin.tsx +++ b/src/plugin.tsx @@ -55,13 +55,14 @@ function activate( translator: ITranslator | null ): ITourManager { const CONFIG_SECTION_NAME = corePlugin.id.replace(/[^\w]/g, ''); - const { commands } = app; + const { commands, serviceManager } = app; translator = translator ?? nullTranslator; const restoreState = new PromiseDelegate(); const configReady = ConfigSection.create({ - name: CONFIG_SECTION_NAME + name: CONFIG_SECTION_NAME, + serverSettings: serviceManager.serverSettings }).catch(error => { console.error('Failed to fetch state for jupyterlab-tour.', error); }); diff --git a/ui-tests/tests/notebook-tour.spec.ts b/ui-tests/tests/notebook-tour.spec.ts index 30cd714..13d8ef3 100644 --- a/ui-tests/tests/notebook-tour.spec.ts +++ b/ui-tests/tests/notebook-tour.spec.ts @@ -29,9 +29,8 @@ test('should run the notebook tour', async ({ page }) => { const [notebookPage] = await Promise.all([ page.waitForEvent('popup'), - page.getByText('Notebook', { exact: true }).click() + page.getByText('Python 3 (ipykernel)').click() ]); - await notebookPage.getByRole('button', { name: 'Select Kernel' }).click(); await notebookPage.getByRole('button', { name: 'Start now' }).click(); await notebookPage.getByLabel('Next', { exact: true }).click(); await notebookPage.getByLabel('Next', { exact: true }).click(); diff --git a/yarn.lock b/yarn.lock index 49b5df6..f6db47e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10668,11 +10668,11 @@ __metadata: "typescript@patch:typescript@~5.0.4#~builtin": version: 5.0.4 - resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=b5f058" + resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=85af82" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac + checksum: bb309d320c59a26565fb3793dba550576ab861018ff3fd1b7fccabbe46ae4a35546bc45f342c0a0b6f265c801ccdf64ffd68f548f117ceb7f0eac4b805cd52a9 languageName: node linkType: hard