Skip to content

Commit

Permalink
fix: aggrid doesn't load in Voila>=0.5
Browse files Browse the repository at this point in the history
Voila uses a different location for extensions, which can be found
in jupyter-config-data. This setting is also available in Lab, so
we should use that. For older versions of Lab there is still a
hard coded fallback.
  • Loading branch information
mariobuikhuizen committed Apr 26, 2024
1 parent 261645f commit d2ae94c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/src/labplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const id = 'ipyaggrid:plugin';
const requires = [base.IJupyterWidgetRegistry];
const autoStart = true;

const baseUrl = JSON.parse(document.getElementById("jupyter-config-data").textContent).baseUrl;
__webpack_public_path__ = `${baseUrl}lab/extensions/ipyaggrid/static/`;
const conf = JSON.parse(document.getElementById("jupyter-config-data").textContent);
__webpack_public_path__ = (conf.fullLabextensionsUrl || `${conf.baseUrl}lab/extensions`) + "/ipyaggrid/static/";

const activate = (app, widgets) => {
console.log('JupyterLab extension ipyaggrid is activated!');
Expand Down

0 comments on commit d2ae94c

Please sign in to comment.