Skip to content

Commit

Permalink
made publication server a configuration variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rickmcgeer committed Oct 14, 2023
1 parent e4ef85e commit 9d06634
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ jupyterlab-universal-extension/lively_universal_extension.egg-info/PKG-INFO
jupyterlab-universal-extension/lively_universal_extension.egg-info/SOURCES.txt
jupyterlab-universal-extension/package-deploy.json
package-lock.json
config.js
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@
"test": "mocha -r esm galyleo-data/galyleo-data-tests.js"
},
"lively": {
"projectDependencies": [],
"boundLivelyVersion": "4019eb8763648fe55f6bbb9f3f6d3ca9fddcd413",
"projectDependencies": [
{
"name": "LivelyKernel--partsbin",
"version": "0.6.3"
}
],
"boundLivelyVersion": "6a89749513b773c0e01c023d221cc8a9cab7e931",
"canUsePages": true
}
}
13 changes: 4 additions & 9 deletions studio/helpers.cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { Toggle } from './inputs/toggle.cp.js';
import { URL } from 'esm://cache/npm:@jspm/core@2.0.0-beta.26/nodelibs/url';
import { DefaultList } from 'lively.components/list.cp.js';
import { projectAsset } from 'lively.project/helpers.js';

const STUDIO_SECRET = 'g4lyl30-studio';
import { dashboardStoreServer } from '../config.js';

/**
* A Bug Reporter. Very simple: just bundles up the input fields and uses
Expand Down Expand Up @@ -399,7 +398,7 @@ export class PublisherModel extends ViewModel {
this.ui.fileInput.textString = fileName;
}
if (userName) {
const reader = resource(`${this.url}/list_user_dashboards/${userName}`);
const reader = resource(`${dashboardStoreServer.url}/list_user_dashboards/${userName}`);
reader.readJson().then(result => {
this.currentDashboards = result;
this.ui.dashboardList.items = result;
Expand Down Expand Up @@ -456,11 +455,11 @@ export class PublisherModel extends ViewModel {
}

if (await this._sanityCheck(filePath)) {
const r = resource(`${this.url}add_dashboard`, { headers: { 'Content-Type': 'application/json' } });
const r = resource(`${dashboardStoreServer.url}add_dashboard`, { headers: { 'Content-Type': 'application/json' } });
const body = {
name: filePath,
dashboard: this.dashboard.prepareSerialization(),
studio_secret: STUDIO_SECRET
studio_secret: dashboardStoreServer.secret
};
if (this.userName) {
body.user = this.userName;
Expand All @@ -474,10 +473,6 @@ export class PublisherModel extends ViewModel {
}
}

get url () {
return 'https://publication-server-htztskumkq-uw.a.run.app/';
}

close () {
this.view.remove();
}
Expand Down

0 comments on commit 9d06634

Please sign in to comment.