diff --git a/package.json b/package.json index 4685ba1..82aa4dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stsci-announce", - "version": "0.5.0", + "version": "0.6.0", "description": "A JupyterLab extension.", "keywords": [ "jupyter", diff --git a/src/index.ts b/src/index.ts index 2d0bef1..be086da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,8 @@ import { IStatusBar } from '@jupyterlab/statusbar'; import { Dialog, showDialog } from '@jupyterlab/apputils'; import { ISettingRegistry } from '@jupyterlab/settingregistry'; +import { ServerConnection } from '@jupyterlab/services'; + // =================================================================================== // Use the browser's built-in functionality to quickly and safely escape the string @@ -14,7 +16,7 @@ function escapeHtml(html: string): string { } function dlog(...args: any[]) { - // console.log(...args); +// console.log(...args); } function log_and_throw(...args: any[]) { @@ -189,10 +191,11 @@ class RefreshAnnouncements { async updateAnnouncements(url: string, n: number) { try { dlog(`Updating announcements from ${url} every ${n} microseconds`); - + const serverSettings = ServerConnection.makeSettings(); const response = await fetch(url, { method: 'GET', headers: { + 'Authorization': 'token ' + serverSettings.token, 'Content-Type': 'application/json', 'Cache-Control': 'no-cache' }, diff --git a/stsci_announce/_version.py b/stsci_announce/_version.py index 906ff00..c5d47d2 100644 --- a/stsci_announce/_version.py +++ b/stsci_announce/_version.py @@ -1,4 +1,4 @@ # This file is auto-generated by Hatchling. As such, do not: # - modify # - track in version control e.g. be sure to add to .gitignore -__version__ = VERSION = '0.5.0' +__version__ = VERSION = '0.6.0' diff --git a/yarn.lock b/yarn.lock index c028699..3ce3682 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3601,37 +3601,6 @@ __metadata: languageName: node linkType: hard -"stsci-announce@workspace:.": - version: 0.0.0-use.local - resolution: "stsci-announce@workspace:." - dependencies: - "@jupyterlab/application": ^4.0.0 - "@jupyterlab/builder": ^4.0.0 - "@lumino/widgets": ^2.0.1 - "@types/json-schema": ^7.0.11 - "@types/lodash": ^4.17.0 - "@types/react": ^18.0.26 - "@typescript-eslint/eslint-plugin": ^5.55.0 - "@typescript-eslint/parser": ^5.55.0 - css-loader: ^6.7.1 - eslint: ^8.36.0 - eslint-config-prettier: ^8.7.0 - eslint-plugin-prettier: ^4.2.1 - npm-run-all: ^4.1.5 - prettier: ^2.8.7 - rimraf: ^4.4.1 - source-map-loader: ^1.0.2 - style-loader: ^3.3.1 - stylelint: ^14.9.1 - stylelint-config-prettier: ^9.0.4 - stylelint-config-recommended: ^8.0.0 - stylelint-config-standard: ^26.0.0 - stylelint-prettier: ^2.0.0 - typescript: ~5.0.2 - yjs: ^13.5.40 - languageName: unknown - linkType: soft - "nice-try@npm:^1.0.4": version: 1.0.5 resolution: "nice-try@npm:1.0.5" @@ -4742,6 +4711,37 @@ __metadata: languageName: node linkType: hard +"stsci-announce@workspace:.": + version: 0.0.0-use.local + resolution: "stsci-announce@workspace:." + dependencies: + "@jupyterlab/application": ^4.0.0 + "@jupyterlab/builder": ^4.0.0 + "@lumino/widgets": ^2.0.1 + "@types/json-schema": ^7.0.11 + "@types/lodash": ^4.17.0 + "@types/react": ^18.0.26 + "@typescript-eslint/eslint-plugin": ^5.55.0 + "@typescript-eslint/parser": ^5.55.0 + css-loader: ^6.7.1 + eslint: ^8.36.0 + eslint-config-prettier: ^8.7.0 + eslint-plugin-prettier: ^4.2.1 + npm-run-all: ^4.1.5 + prettier: ^2.8.7 + rimraf: ^4.4.1 + source-map-loader: ^1.0.2 + style-loader: ^3.3.1 + stylelint: ^14.9.1 + stylelint-config-prettier: ^9.0.4 + stylelint-config-recommended: ^8.0.0 + stylelint-config-standard: ^26.0.0 + stylelint-prettier: ^2.0.0 + typescript: ~5.0.2 + yjs: ^13.5.40 + languageName: unknown + linkType: soft + "style-loader@npm:^3.3.1, style-loader@npm:~3.3.1": version: 3.3.4 resolution: "style-loader@npm:3.3.4"