From 6d4a1987e91008162c241d7d8258ead6ff3a4b8c Mon Sep 17 00:00:00 2001 From: Kenneth Bruskiewicz Date: Tue, 21 May 2024 16:32:09 -0700 Subject: [PATCH] promote context to mandatory argument across objects --- lib/Toolbar.js | 2 +- lib/utils/content.js | 2 +- web/index.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Toolbar.js b/lib/Toolbar.js index 99a2aa3a..a216b18d 100644 --- a/lib/Toolbar.js +++ b/lib/Toolbar.js @@ -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 || ''; diff --git a/lib/utils/content.js b/lib/utils/content.js index 2930ad53..a05566e9 100644 --- a/lib/utils/content.js +++ b/lib/utils/content.js @@ -23,7 +23,7 @@ const URL_MATCH = /(?@^(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})`); diff --git a/web/index.js b/web/index.js index a1138a17..8f5e98ac 100644 --- a/web/index.js +++ b/web/index.js @@ -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',