Skip to content

Commit

Permalink
promote context to mandatory argument across objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethbruskiewicz committed May 21, 2024
1 parent 7a24c0c commit 6d4a198
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Toolbar {
*/
constructor(root, context, options = {}) {
const self = this; //For anonymous button functions etc.
this.context = context || options.context; // TODO: promote to mandatory argument
this.context = context
this.root = root;
this.menu = menu;
this.staticAssetPath = options.staticAssetPath || '';
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const URL_MATCH = /(?<!\]\()(?<url>@^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$@iS)/g;

// Convert matched raw URLs to a markdown link, to guarantee the conversion of links to anchored HTML hrefs
// e.g. "https://sfu.ca" -> "[https://sfu.ca](https://sfu.ca)"
// TODO: support URLs without `http[s]://`?
// NOTE: doesn't support URLs without `http[s]://` or `ftp`
export const urlToMarkdownLink = (content) =>
content.replace(URL_MATCH, (_, value) => `[${value}](${value})`);

Expand Down
1 change: 0 additions & 1 deletion web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const main = async function () {

// // TODO: data harmonizers require initialization code inside of the toolbar to fully render? wut
new Toolbar(dhToolbarRoot, context, {
context,
templatePath: context.appConfig.template_path, // TODO: a default should be loaded before Toolbar is constructed! then take out all loading in "toolbar" to an outside context
releasesURL:
'https://github.com/cidgoh/pathogen-genomics-package/releases',
Expand Down

0 comments on commit 6d4a198

Please sign in to comment.