From 3c41bfc3613482fa0dd18543519f26accb724439 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 25 Dec 2022 10:54:55 -0500 Subject: [PATCH 01/10] Add shared arguments for shared markdown features --- lib/galaxy/managers/markdown_parse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/managers/markdown_parse.py b/lib/galaxy/managers/markdown_parse.py index 7b2d4c0cdb97..0e1b75311e41 100644 --- a/lib/galaxy/managers/markdown_parse.py +++ b/lib/galaxy/managers/markdown_parse.py @@ -24,6 +24,7 @@ class DynamicArguments: DYNAMIC_ARGUMENTS = DynamicArguments() +SHARED_ARGUMENTS: List[str] = ["collapsed"] VALID_ARGUMENTS: Dict[str, Union[List[str], DynamicArguments]] = { "history_link": ["history_id"], "history_dataset_display": ["input", "output", "history_dataset_id"], @@ -73,7 +74,7 @@ def invalid_line(template, line_no, **kwd): def _validate_arg(arg_str, valid_args, line_no): if arg_str is not None: arg_name = arg_str.split("=", 1)[0].strip() - if arg_name not in valid_args: + if arg_name not in valid_args and arg_name not in SHARED_ARGUMENTS: invalid_line("Invalid argument to Galaxy directive [{argument}]", line_no, argument=arg_name) expecting_container_close_for = None From dd287fe5e2566648d3e55bf88818f6f190a01c4a Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 25 Dec 2022 11:15:44 -0500 Subject: [PATCH 02/10] Separate out elements into sub component --- client/src/components/Markdown/Markdown.vue | 82 +++----------- .../components/Markdown/MarkdownElement.vue | 107 ++++++++++++++++++ 2 files changed, 122 insertions(+), 67 deletions(-) create mode 100644 client/src/components/Markdown/MarkdownElement.vue diff --git a/client/src/components/Markdown/Markdown.vue b/client/src/components/Markdown/Markdown.vue index 41b1d47ed641..1eeaecf0309e 100644 --- a/client/src/components/Markdown/Markdown.vue +++ b/client/src/components/Markdown/Markdown.vue @@ -41,47 +41,20 @@

-

-
{{ getVersion }}
-
-
-
{{ getTime }}
+
+
+ COLLAPSIBLE +
+
- - - - - - - - - - - - -
@@ -98,20 +71,8 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faDownload, faEdit } from "@fortawesome/free-solid-svg-icons"; import LoadingSpan from "components/LoadingSpan"; -import HistoryDatasetAsImage from "./Elements/HistoryDatasetAsImage"; -import HistoryDatasetDisplay from "./Elements/HistoryDatasetDisplay"; -import HistoryDatasetLink from "./Elements/HistoryDatasetLink"; -import HistoryDatasetIndex from "./Elements/HistoryDatasetIndex"; -import HistoryDatasetCollectionDisplay from "./Elements/HistoryDatasetCollection/CollectionDisplay"; -import HistoryDatasetDetails from "./Elements/HistoryDatasetDetails"; -import HistoryLink from "./Elements/HistoryLink"; -import InvocationTime from "./Elements/InvocationTime"; -import JobMetrics from "./Elements/JobMetrics"; -import JobParameters from "./Elements/JobParameters"; -import ToolStd from "./Elements/ToolStd"; -import WorkflowDisplay from "./Elements/Workflow/WorkflowDisplay"; -import Visualization from "./Elements/Visualization"; import StsDownloadButton from "components/StsDownloadButton"; +import MarkdownElement from "./MarkdownElement.vue"; const FUNCTION_VALUE_REGEX = `\\s*(?:[\\w_\\-]+|\\"[^\\"]+\\"|\\'[^\\']+\\')\\s*`; const FUNCTION_CALL = `\\s*[\\w\\|]+\\s*=` + FUNCTION_VALUE_REGEX; @@ -132,20 +93,7 @@ library.add(faDownload, faEdit); export default { store: store, components: { - HistoryDatasetDetails, - HistoryDatasetAsImage, - HistoryDatasetCollectionDisplay, - HistoryDatasetDisplay, - HistoryDatasetIndex, - HistoryDatasetLink, - HistoryLink, - JobMetrics, - JobParameters, - LoadingSpan, - ToolStd, - WorkflowDisplay, - Visualization, - InvocationTime, + MarkdownElement, FontAwesomeIcon, StsDownloadButton, }, diff --git a/client/src/components/Markdown/MarkdownElement.vue b/client/src/components/Markdown/MarkdownElement.vue new file mode 100644 index 000000000000..fd53da69737b --- /dev/null +++ b/client/src/components/Markdown/MarkdownElement.vue @@ -0,0 +1,107 @@ + + + From a6f6de0a21df3bba86694cce061bc4387bf0d82d Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 25 Dec 2022 11:34:15 -0500 Subject: [PATCH 03/10] Add wrappers to accommodate collapsible --- client/src/components/Markdown/Markdown.vue | 36 +++++----- .../components/Markdown/MarkdownContainer.vue | 67 +++++++++++++++++++ 2 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 client/src/components/Markdown/MarkdownContainer.vue diff --git a/client/src/components/Markdown/Markdown.vue b/client/src/components/Markdown/Markdown.vue index 1eeaecf0309e..a80b76a37d60 100644 --- a/client/src/components/Markdown/Markdown.vue +++ b/client/src/components/Markdown/Markdown.vue @@ -41,20 +41,16 @@

-

-
- COLLAPSIBLE -
- -
+
@@ -72,7 +68,7 @@ import { faDownload, faEdit } from "@fortawesome/free-solid-svg-icons"; import LoadingSpan from "components/LoadingSpan"; import StsDownloadButton from "components/StsDownloadButton"; -import MarkdownElement from "./MarkdownElement.vue"; +import MarkdownContainer from "./MarkdownContainer.vue"; const FUNCTION_VALUE_REGEX = `\\s*(?:[\\w_\\-]+|\\"[^\\"]+\\"|\\'[^\\']+\\')\\s*`; const FUNCTION_CALL = `\\s*[\\w\\|]+\\s*=` + FUNCTION_VALUE_REGEX; @@ -93,7 +89,7 @@ library.add(faDownload, faEdit); export default { store: store, components: { - MarkdownElement, + MarkdownContainer, FontAwesomeIcon, StsDownloadButton, }, @@ -123,9 +119,9 @@ export default { return { markdownObjects: [], markdownErrors: [], - historyDatasets: {}, + datasets: {}, histories: {}, - historyDatasetCollections: {}, + collections: {}, workflows: {}, jobs: {}, invocations: {}, @@ -169,9 +165,9 @@ export default { const markdown = config.content || config.markdown; this.markdownErrors = config.errors || []; this.markdownObjects = this.splitMarkdown(markdown); - this.historyDatasets = config.history_datasets || {}; + this.datasets = config.history_datasets || {}; this.histories = config.histories || {}; - this.historyDatasetCollections = config.history_dataset_collections || {}; + this.collections = config.history_dataset_collections || {}; this.workflows = config.workflows || {}; this.jobs = config.jobs || {}; this.invocations = config.invocations || {}; diff --git a/client/src/components/Markdown/MarkdownContainer.vue b/client/src/components/Markdown/MarkdownContainer.vue new file mode 100644 index 000000000000..1c7461df75f6 --- /dev/null +++ b/client/src/components/Markdown/MarkdownContainer.vue @@ -0,0 +1,67 @@ + + + From c64f31ebf092cfaddafded40eb1a7f9d9348c6f2 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 25 Dec 2022 11:49:27 -0500 Subject: [PATCH 04/10] Use consistent naming, parse collapse title as shared markdown attribute --- client/src/components/Markdown/Markdown.vue | 3 +-- .../components/Markdown/MarkdownContainer.vue | 20 ++++++++++--------- .../components/Markdown/MarkdownElement.vue | 9 +++------ lib/galaxy/managers/markdown_parse.py | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/client/src/components/Markdown/Markdown.vue b/client/src/components/Markdown/Markdown.vue index a80b76a37d60..11b544fd569b 100644 --- a/client/src/components/Markdown/Markdown.vue +++ b/client/src/components/Markdown/Markdown.vue @@ -49,8 +49,7 @@ :histories="histories" :invocations="invocations" :jobs="jobs" - :workflows="workflows" - /> + :workflows="workflows" /> diff --git a/client/src/components/Markdown/MarkdownContainer.vue b/client/src/components/Markdown/MarkdownContainer.vue index 1c7461df75f6..821acf2cfe40 100644 --- a/client/src/components/Markdown/MarkdownContainer.vue +++ b/client/src/components/Markdown/MarkdownContainer.vue @@ -1,9 +1,9 @@ @@ -56,11 +55,14 @@ export default { data() { return { toggle: false, - } + }; }, computed: { + isVisible() { + return !this.isCollapsible || this.toggle; + }, isCollapsible() { - return this.obj.args.collapsed !== undefined; + return this.obj.args.collapse !== undefined; }, }, }; diff --git a/client/src/components/Markdown/MarkdownElement.vue b/client/src/components/Markdown/MarkdownElement.vue index fd53da69737b..0b0f60063d64 100644 --- a/client/src/components/Markdown/MarkdownElement.vue +++ b/client/src/components/Markdown/MarkdownElement.vue @@ -30,12 +30,9 @@ :embedded="obj.name == 'history_dataset_embedded'" /> Date: Sun, 25 Dec 2022 11:56:25 -0500 Subject: [PATCH 05/10] Consolidate components --- .../components/Markdown/MarkdownContainer.vue | 72 ++++++++++-- .../components/Markdown/MarkdownElement.vue | 104 ------------------ 2 files changed, 63 insertions(+), 113 deletions(-) delete mode 100644 client/src/components/Markdown/MarkdownElement.vue diff --git a/client/src/components/Markdown/MarkdownContainer.vue b/client/src/components/Markdown/MarkdownContainer.vue index 821acf2cfe40..1a6d81e0afa3 100644 --- a/client/src/components/Markdown/MarkdownContainer.vue +++ b/client/src/components/Markdown/MarkdownContainer.vue @@ -4,23 +4,77 @@ {{ obj.args.collapse }} - +
{{ getVersion }}
+ +
+
{{ getTime }}
+
+ + + + + + + + + + + + + :embedded="obj.name == 'history_dataset_embedded'" /> +
From f778a4230af988d2545f032a905ff6474f104f4e Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 26 Dec 2022 05:46:21 -0500 Subject: [PATCH 06/10] Resolve loading span --- client/src/components/Markdown/Markdown.vue | 7 ++++--- client/src/components/Markdown/MarkdownContainer.vue | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client/src/components/Markdown/Markdown.vue b/client/src/components/Markdown/Markdown.vue index 11b544fd569b..fcd2006fba98 100644 --- a/client/src/components/Markdown/Markdown.vue +++ b/client/src/components/Markdown/Markdown.vue @@ -1,6 +1,6 @@