From 55bdf14aa23a25186b8bdb830eb1c56ed0bf6898 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Thu, 28 Sep 2023 11:53:24 -0400 Subject: [PATCH 1/9] converting ISO date time to UTC string --- client/src/components/Markdown/Elements/InvocationTime.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/Markdown/Elements/InvocationTime.vue b/client/src/components/Markdown/Elements/InvocationTime.vue index 63355884e82d..9b59273df24f 100644 --- a/client/src/components/Markdown/Elements/InvocationTime.vue +++ b/client/src/components/Markdown/Elements/InvocationTime.vue @@ -19,7 +19,8 @@ export default { computed: { content() { const invocation = this.invocations[this.args.invocation_id]; - return invocation && invocation["create_time"]; + const iso = new Date(invocation && invocation["create_time"]); + return iso.toUTCString(); }, }, }; From 62c084f5046c772eef71469ee0ead8108f4f3490 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Fri, 29 Sep 2023 15:27:21 -0400 Subject: [PATCH 2/9] converting date on PDF generated report to a more readable string time instead of iso --- lib/galaxy/managers/markdown_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/managers/markdown_util.py b/lib/galaxy/managers/markdown_util.py index 4e5219251ccc..0aaf1f50c3d8 100644 --- a/lib/galaxy/managers/markdown_util.py +++ b/lib/galaxy/managers/markdown_util.py @@ -347,7 +347,7 @@ def handle_generate_time(self, line, generate_time): pass def handle_invocation_time(self, line, invocation): - self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.isoformat() + self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S") def handle_dataset_type(self, line, hda): self.extend_history_dataset_rendering_data(hda, "ext", hda.ext, "*Unknown dataset type*") @@ -547,7 +547,7 @@ def handle_generate_time(self, line, generate_time): return (content, True) def handle_invocation_time(self, line, invocation): - content = literal_via_fence(invocation.create_time.isoformat()) + content = literal_via_fence(invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S")) return (content, True) def handle_dataset_name(self, line, hda): From 05e1775291028bafcf6ae2a99606d1df1f9dd1a0 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Mon, 2 Oct 2023 10:10:26 -0400 Subject: [PATCH 3/9] run make format --- lib/galaxy/managers/markdown_util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/managers/markdown_util.py b/lib/galaxy/managers/markdown_util.py index 0aaf1f50c3d8..40787b321693 100644 --- a/lib/galaxy/managers/markdown_util.py +++ b/lib/galaxy/managers/markdown_util.py @@ -347,7 +347,9 @@ def handle_generate_time(self, line, generate_time): pass def handle_invocation_time(self, line, invocation): - self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S") + self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.strftime( + "%m/%d/%Y, %H:%M:%S" + ) def handle_dataset_type(self, line, hda): self.extend_history_dataset_rendering_data(hda, "ext", hda.ext, "*Unknown dataset type*") From 308df0b14639abd1922298871e5587238ae6e9be Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Mon, 2 Oct 2023 10:10:47 -0400 Subject: [PATCH 4/9] update tests to use string UTC format instead of iso --- test/unit/app/managers/test_markdown_export.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/app/managers/test_markdown_export.py b/test/unit/app/managers/test_markdown_export.py index 64c4df408d47..705ffd51bf86 100644 --- a/test/unit/app/managers/test_markdown_export.py +++ b/test/unit/app/managers/test_markdown_export.py @@ -280,7 +280,8 @@ def test_generate_invocation_time(self): invocation = self._new_invocation() self.app.workflow_manager.get_invocation.side_effect = [invocation] # type: ignore[attr-defined,union-attr] result = self._to_basic(example) - assert f"\n {invocation.create_time.isoformat()}" in result + expectedtime = invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S") + assert f"\n {expectedtime}" in result def test_job_parameters(self): job = model.Job() @@ -412,7 +413,7 @@ def test_get_invocation_time(self): result, extra_data = self._ready_export(example) assert "invocations" in extra_data assert "create_time" in extra_data["invocations"]["be8be0fd2ce547f6"] - assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.isoformat() + assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S") def _ready_export(self, example): return ready_galaxy_markdown_for_export(self.trans, example) From 78b454679d1a9c5803df1baf02922036bde99c05 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Mon, 2 Oct 2023 11:44:40 -0400 Subject: [PATCH 5/9] fixing formatting --- test/unit/app/managers/test_markdown_export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/app/managers/test_markdown_export.py b/test/unit/app/managers/test_markdown_export.py index 705ffd51bf86..db3f59e7f5dc 100644 --- a/test/unit/app/managers/test_markdown_export.py +++ b/test/unit/app/managers/test_markdown_export.py @@ -413,7 +413,9 @@ def test_get_invocation_time(self): result, extra_data = self._ready_export(example) assert "invocations" in extra_data assert "create_time" in extra_data["invocations"]["be8be0fd2ce547f6"] - assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S") + assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.strftime( + "%m/%d/%Y, %H:%M:%S" + ) def _ready_export(self, example): return ready_galaxy_markdown_for_export(self.trans, example) From 09dcba76e44ed630caa774d410b99fa9e2212ea1 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Tue, 10 Oct 2023 11:31:14 -0400 Subject: [PATCH 6/9] Update client/src/components/Markdown/Elements/InvocationTime.vue Co-authored-by: Marius van den Beek --- client/src/components/Markdown/Elements/InvocationTime.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/components/Markdown/Elements/InvocationTime.vue b/client/src/components/Markdown/Elements/InvocationTime.vue index 9b59273df24f..b335bb377974 100644 --- a/client/src/components/Markdown/Elements/InvocationTime.vue +++ b/client/src/components/Markdown/Elements/InvocationTime.vue @@ -19,8 +19,7 @@ export default { computed: { content() { const invocation = this.invocations[this.args.invocation_id]; - const iso = new Date(invocation && invocation["create_time"]); - return iso.toUTCString(); + return invocation && new Date(invocation["create_time"]).toUTCString(); }, }, }; From 8384c315a70a990a7f189b975dbb892bb368e818 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Tue, 17 Oct 2023 12:28:31 -0400 Subject: [PATCH 7/9] Update lib/galaxy/managers/markdown_util.py changing format of string time to more closely match iso format --- lib/galaxy/managers/markdown_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/managers/markdown_util.py b/lib/galaxy/managers/markdown_util.py index 40787b321693..375416b70812 100644 --- a/lib/galaxy/managers/markdown_util.py +++ b/lib/galaxy/managers/markdown_util.py @@ -348,7 +348,7 @@ def handle_generate_time(self, line, generate_time): def handle_invocation_time(self, line, invocation): self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.strftime( - "%m/%d/%Y, %H:%M:%S" + "%Y-%m-/%d, %H:%M:%S" ) def handle_dataset_type(self, line, hda): From cdc34a1f36e121750e85582fe0d0afafcde34acb Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Tue, 17 Oct 2023 12:28:45 -0400 Subject: [PATCH 8/9] Update test/unit/app/managers/test_markdown_export.py changing format of string time to more closely match iso format --- test/unit/app/managers/test_markdown_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/app/managers/test_markdown_export.py b/test/unit/app/managers/test_markdown_export.py index db3f59e7f5dc..3710ff6831b8 100644 --- a/test/unit/app/managers/test_markdown_export.py +++ b/test/unit/app/managers/test_markdown_export.py @@ -280,7 +280,7 @@ def test_generate_invocation_time(self): invocation = self._new_invocation() self.app.workflow_manager.get_invocation.side_effect = [invocation] # type: ignore[attr-defined,union-attr] result = self._to_basic(example) - expectedtime = invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S") + expectedtime = invocation.create_time.strftime("%Y-%m-%d, %H:%M:%S") assert f"\n {expectedtime}" in result def test_job_parameters(self): From a7c111b88fc403a19fc2ba41c90f7317f0f0c1ae Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Tue, 17 Oct 2023 14:15:13 -0400 Subject: [PATCH 9/9] fixing tests to use iso-like string format --- lib/galaxy/managers/markdown_util.py | 4 ++-- test/unit/app/managers/test_markdown_export.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/managers/markdown_util.py b/lib/galaxy/managers/markdown_util.py index 375416b70812..e76501b7dc0f 100644 --- a/lib/galaxy/managers/markdown_util.py +++ b/lib/galaxy/managers/markdown_util.py @@ -348,7 +348,7 @@ def handle_generate_time(self, line, generate_time): def handle_invocation_time(self, line, invocation): self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.strftime( - "%Y-%m-/%d, %H:%M:%S" + "%Y-%m-%d, %H:%M:%S" ) def handle_dataset_type(self, line, hda): @@ -549,7 +549,7 @@ def handle_generate_time(self, line, generate_time): return (content, True) def handle_invocation_time(self, line, invocation): - content = literal_via_fence(invocation.create_time.strftime("%m/%d/%Y, %H:%M:%S")) + content = literal_via_fence(invocation.create_time.strftime("%Y-%m-%d, %H:%M:%S")) return (content, True) def handle_dataset_name(self, line, hda): diff --git a/test/unit/app/managers/test_markdown_export.py b/test/unit/app/managers/test_markdown_export.py index 3710ff6831b8..72f5b900a5d7 100644 --- a/test/unit/app/managers/test_markdown_export.py +++ b/test/unit/app/managers/test_markdown_export.py @@ -414,7 +414,7 @@ def test_get_invocation_time(self): assert "invocations" in extra_data assert "create_time" in extra_data["invocations"]["be8be0fd2ce547f6"] assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.strftime( - "%m/%d/%Y, %H:%M:%S" + "%Y-%m-%d, %H:%M:%S" ) def _ready_export(self, example):