From f9cc471a72b35abb44aa0ed465e45247d672cae7 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Mon, 26 Sep 2022 16:55:54 -0400 Subject: [PATCH 001/316] Change ToolPanel search to client side, advanced search to backend --- client/src/components/Common/DelayedInput.vue | 6 +- .../Panels/Common/ToolAdvancedSearch.vue | 32 ++-- .../Common/ToolAdvancedSearchResults.vue | 172 +++++++++--------- .../Panels/Common/ToolSearch.test.js | 3 +- .../components/Panels/Common/ToolSearch.vue | 60 +++--- client/src/components/Panels/ToolBox.vue | 6 +- .../src/components/Panels/ToolBoxWorkflow.vue | 1 + client/src/components/Panels/utilities.js | 19 +- client/src/store/toolStore.js | 66 ++++--- lib/galaxy/tools/search/__init__.py | 7 +- 10 files changed, 185 insertions(+), 187 deletions(-) diff --git a/client/src/components/Common/DelayedInput.vue b/client/src/components/Common/DelayedInput.vue index ba69b6913f5..0c771ec06c8 100644 --- a/client/src/components/Common/DelayedInput.vue +++ b/client/src/components/Common/DelayedInput.vue @@ -6,14 +6,13 @@ class="search-query" size="sm" autocomplete="off" - :disabled="includeAdvBtn && showAdvanced" :placeholder="placeholder" @input="delayQuery" @change="setQuery" @keydown.esc="setQuery('')" /> @@ -55,7 +53,7 @@ export default { type: Number, default: 1000, }, - includeAdvBtn: { + enableAdvanced: { type: Boolean, default: false, }, diff --git a/client/src/components/Panels/Common/ToolAdvancedSearch.vue b/client/src/components/Panels/Common/ToolAdvancedSearch.vue index 18b3f9aee82..7f9b26e1f82 100644 --- a/client/src/components/Panels/Common/ToolAdvancedSearch.vue +++ b/client/src/components/Panels/Common/ToolAdvancedSearch.vue @@ -1,14 +1,15 @@ @@ -80,6 +81,10 @@ export default { type: Boolean, default: false, }, + isAdmin: { + type: Boolean, + default: false, + }, }, data() { return { diff --git a/client/src/components/login/RegisterForm.test.js b/client/src/components/login/RegisterForm.test.js new file mode 100644 index 00000000000..2413e4ddb48 --- /dev/null +++ b/client/src/components/login/RegisterForm.test.js @@ -0,0 +1,42 @@ +import axios from "axios"; +import MockAdapter from "axios-mock-adapter"; +import { mount } from "@vue/test-utils"; +import { getLocalVue } from "jest/helpers"; +import MountTarget from "./RegisterForm"; + +const localVue = getLocalVue(true); + +describe("RegisterForm", () => { + let wrapper; + let axiosMock; + + beforeEach(() => { + axiosMock = new MockAdapter(axios); + wrapper = mount(MountTarget, { + propsData: {}, + localVue, + }); + }); + + afterEach(() => { + axiosMock.reset(); + }); + + it("basics", async () => { + const cardHeader = wrapper.find(".card-header"); + expect(cardHeader.text()).toBe("Create a Galaxy account"); + const inputs = wrapper.findAll("input"); + expect(inputs.length).toBe(4); + const usernameField = inputs.at(0); + expect(usernameField.attributes("type")).toBe("text"); + await usernameField.setValue("test_user"); + const pwdField = inputs.at(1); + expect(pwdField.attributes("type")).toBe("password"); + await pwdField.setValue("test_pwd"); + const submitButton = wrapper.find("button[type='submit']"); + await submitButton.trigger("submit"); + const postedData = JSON.parse(axiosMock.history.post[0].data); + expect(postedData.email).toBe("test_user"); + expect(postedData.password).toBe("test_pwd"); + }); +}); diff --git a/client/src/components/login/RegisterForm.vue b/client/src/components/login/RegisterForm.vue index 8377ad200f5..98b0f568984 100644 --- a/client/src/components/login/RegisterForm.vue +++ b/client/src/components/login/RegisterForm.vue @@ -79,7 +79,6 @@ import axios from "axios"; import Vue from "vue"; import BootstrapVue from "bootstrap-vue"; -import { getGalaxyInstance } from "app"; import { safePath } from "utils/redirect"; import ExternalLogin from "components/User/ExternalIdentities/ExternalLogin.vue"; @@ -122,9 +121,12 @@ export default { type: String, default: null, }, + isAdmin: { + type: Boolean, + default: false, + }, }, data() { - const galaxy = getGalaxyInstance(); return { disableCreate: false, email: null, @@ -134,7 +136,6 @@ export default { subscribe: null, messageText: null, messageVariant: null, - isAdmin: galaxy.user.isAdmin(), }; }, computed: { diff --git a/client/src/entry/analysis/modules/Login.vue b/client/src/entry/analysis/modules/Login.vue index c210a74be98..066bf16c955 100644 --- a/client/src/entry/analysis/modules/Login.vue +++ b/client/src/entry/analysis/modules/Login.vue @@ -11,6 +11,7 @@ :message-variant="$route.query.status" /> Date: Fri, 28 Oct 2022 10:30:23 +0200 Subject: [PATCH 029/316] Release tool-util package 22.1.4 --- packages/tool_util/HISTORY.rst | 5 +++++ packages/tool_util/galaxy/project_galaxy_tool_util.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/tool_util/HISTORY.rst b/packages/tool_util/HISTORY.rst index 7fa0412ff93..4c87e73604f 100644 --- a/packages/tool_util/HISTORY.rst +++ b/packages/tool_util/HISTORY.rst @@ -5,6 +5,11 @@ History .. to_doc +22.1.4 (2022-10-28) +------------------- + +* Add missing unittest_utils package to galaxy-tool-util + 22.1.3 (2022-10-27) ------------------- diff --git a/packages/tool_util/galaxy/project_galaxy_tool_util.py b/packages/tool_util/galaxy/project_galaxy_tool_util.py index b2754cf5c01..858158b8add 100644 --- a/packages/tool_util/galaxy/project_galaxy_tool_util.py +++ b/packages/tool_util/galaxy/project_galaxy_tool_util.py @@ -1,4 +1,4 @@ -__version__ = "22.1.4.dev0" +__version__ = "22.1.4" PROJECT_NAME = "galaxy-tool-util" PROJECT_OWNER = PROJECT_USERAME = "galaxyproject" From 238ab85379ba6594e3b1f114985a93066bc73eba Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 28 Oct 2022 10:31:56 +0200 Subject: [PATCH 030/316] Start work on galaxy-tool-util 22.1.5 --- packages/tool_util/galaxy/project_galaxy_tool_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tool_util/galaxy/project_galaxy_tool_util.py b/packages/tool_util/galaxy/project_galaxy_tool_util.py index 858158b8add..3c74f7dfbb1 100644 --- a/packages/tool_util/galaxy/project_galaxy_tool_util.py +++ b/packages/tool_util/galaxy/project_galaxy_tool_util.py @@ -1,4 +1,4 @@ -__version__ = "22.1.4" +__version__ = "22.1.5.dev0" PROJECT_NAME = "galaxy-tool-util" PROJECT_OWNER = PROJECT_USERAME = "galaxyproject" From 70892b3ae883965159ed78c006f06ab920fe6079 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 27 Oct 2022 19:20:21 +0200 Subject: [PATCH 031/316] Enable attempt restricted values for input parameter connected to subworkflow input --- lib/galaxy/workflow/modules.py | 32 ++++++++++++++++++------- lib/galaxy_test/api/test_workflows.py | 34 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index 53b7890a004..fd07fd5b4a9 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -285,7 +285,10 @@ class WorkflowModule: return NO_REPLACEMENT visit_input_values( - self.get_runtime_inputs(), state.inputs, update_value, no_replacement_value=NO_REPLACEMENT + self.get_runtime_inputs(connections=step.output_connections), + state.inputs, + update_value, + no_replacement_value=NO_REPLACEMENT, ) if step_updates: @@ -1131,16 +1134,29 @@ class InputParameterModule(WorkflowModule): for connection in connections: # Well this isn't a great assumption... assert connection.input_step + if not hasattr(connection.input_step, "module"): + module_injector = WorkflowModuleInjector(self.trans) + module_injector.inject(connection.input_step, {}) + module = connection.input_step.module - assert isinstance(module, ToolModule) - assert module.tool - tool_inputs = module.tool.inputs # may not be set, but we're catching the Exception below. + if isinstance(module, ToolModule): + assert module.tool + tool_inputs = module.tool.inputs # may not be set, but we're catching the Exception below. - def callback(input, prefixed_name, context, **kwargs): - if prefixed_name == connection.input_name and hasattr(input, "get_options"): # noqa: B023 - static_options.append(input.get_options(self.trans, {})) + def callback(input, prefixed_name, context, **kwargs): + if prefixed_name == connection.input_name and hasattr(input, "get_options"): # noqa: B023 + static_options.append(input.get_options(self.trans, {})) - visit_input_values(tool_inputs, module.state.inputs, callback) + visit_input_values(tool_inputs, module.state.inputs, callback) + elif isinstance(module, SubWorkflowModule): + subworkflow_input_name = connection.input_name + for step in module.subworkflow.input_steps: + if step.input_type == "parameter" and step.label == subworkflow_input_name: + static_options.append( + step.module.get_runtime_inputs(connections=step.output_connections)[ + "input" + ].static_options + ) options = None if static_options and len(static_options) == 1: diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index 83953be8836..4dde07b2796 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -4839,6 +4839,40 @@ steps: assert len(options) == 5 assert options[0] == ["Ex1", "--ex1", False] + def test_value_restriction_with_select_from_subworkflow_input(self): + workflow_id = self.workflow_populator.upload_yaml_workflow( + """ +class: GalaxyWorkflow +inputs: + Outer input parameter: + optional: false + restrictOnConnections: true + type: string +steps: +- in: + inner input parameter: + source: Outer input parameter + run: + class: GalaxyWorkflow + label: Restriction from subworkflow param + inputs: + inner input parameter: + optional: false + restrictOnConnections: true + type: string + steps: + - tool_id: multi_select + in: + select_ex: + source: inner input parameter +""" + ) + with self.dataset_populator.test_history() as history_id: + run_workflow = self._download_workflow(workflow_id, style="run", history_id=history_id) + options = run_workflow["steps"][0]["inputs"][0]["options"] + assert len(options) == 5 + assert options[0] == ["Ex1", "--ex1", False] + @skip_without_tool("random_lines1") def test_run_replace_params_by_tool(self): workflow_request, history_id, workflow_id = self._setup_random_x2_workflow("test_for_replace_tool_params") From 66c143fc12ba73a60bcc15041e34fbb419359573 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 28 Oct 2022 11:01:28 +0200 Subject: [PATCH 032/316] Inject modules & connections, then build runtime state for all steps That means steps can reason about connections that otherwise wouldn't have modules attached when building runtime inputs. --- lib/galaxy/managers/workflows.py | 1 + lib/galaxy/webapps/base/controller.py | 1 + lib/galaxy/workflow/modules.py | 17 +++++++++-------- lib/galaxy/workflow/run.py | 7 ++++++- test/unit/workflows/test_modules.py | 1 + test/unit/workflows/test_workflow_progress.py | 3 +++ 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index 795ea44fa84..584863ba915 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -867,6 +867,7 @@ class WorkflowContentsManager(UsesAnnotations): for step in workflow.steps: try: module_injector.inject(step, steps=workflow.steps, exact_tools=False) + module_injector.compute_runtime_state(step) except exceptions.ToolMissingException as e: # FIXME: if a subworkflow lacks multiple tools we report only the first missing tool if e.tool_id not in missing_tools: diff --git a/lib/galaxy/webapps/base/controller.py b/lib/galaxy/webapps/base/controller.py index c8acef75e83..f7e83eb4b07 100644 --- a/lib/galaxy/webapps/base/controller.py +++ b/lib/galaxy/webapps/base/controller.py @@ -1218,6 +1218,7 @@ class UsesStoredWorkflowMixin(SharableItemSecurityMixin, UsesAnnotations): for step in stored_workflow.latest_workflow.steps: try: module_injector.inject(step, exact_tools=False) + module_injector.compute_runtime_state(step) except exceptions.ToolMissingException: pass diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index fd07fd5b4a9..cfd27b236b8 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -1134,11 +1134,8 @@ class InputParameterModule(WorkflowModule): for connection in connections: # Well this isn't a great assumption... assert connection.input_step - if not hasattr(connection.input_step, "module"): - module_injector = WorkflowModuleInjector(self.trans) - module_injector.inject(connection.input_step, {}) - module = connection.input_step.module + assert isinstance(module, (ToolModule, SubWorkflowModule)) if isinstance(module, ToolModule): assert module.tool tool_inputs = module.tool.inputs # may not be set, but we're catching the Exception below. @@ -2211,7 +2208,6 @@ class WorkflowModuleInjector: If step_args is provided from a web form this is applied to generate 'state' else it is just obtained from the database. """ - step_errors = None step.upgrade_messages = {} # Make connection information available on each step by input name. @@ -2234,11 +2230,13 @@ class WorkflowModuleInjector: subworkflow = step.subworkflow populate_module_and_state(self.trans, subworkflow, param_map=unjsonified_subworkflow_param_map) - state, step_errors = module.compute_runtime_state(self.trans, step, step_args) + def compute_runtime_state(self, step: WorkflowStep, step_args=None): + assert step.module, "module must be injected before computing runtime state" + state, step_errors = step.module.compute_runtime_state(self.trans, step, step_args) step.state = state # Fix any missing parameters - step.upgrade_messages = module.check_and_update_state() + step.upgrade_messages = step.module.check_and_update_state() return step_errors @@ -2251,7 +2249,10 @@ def populate_module_and_state(trans, workflow, param_map, allow_tool_state_corre module_injector = WorkflowModuleInjector(trans, allow_tool_state_corrections) for step in workflow.steps: step_args = param_map.get(step.id, {}) - step_errors = module_injector.inject(step, step_args=step_args) + module_injector.inject(step, step_args=step_args) + for step in workflow.steps: + step_args = param_map.get(step.id, {}) + step_errors = module_injector.compute_runtime_state(step, step_args=step_args) if step_errors: raise exceptions.MessageException(step_errors, err_data={step.order_index: step_errors}) if step.upgrade_messages: diff --git a/lib/galaxy/workflow/run.py b/lib/galaxy/workflow/run.py index e399428aec9..d3170a94def 100644 --- a/lib/galaxy/workflow/run.py +++ b/lib/galaxy/workflow/run.py @@ -284,6 +284,9 @@ class ModuleInjector(Protocol): def inject(self, step, step_args=None, steps=None, **kwargs): pass + def compute_runtime_state(self, step, step_args=None): + pass + class WorkflowProgress: def __init__( @@ -332,7 +335,9 @@ class WorkflowProgress: for step in steps: step_id = step.id if not hasattr(step, "module"): - self.module_injector.inject(step, step_args=self.param_map.get(step.id, {})) + step_args = self.param_map.get(step.id, {}) + self.module_injector.inject(step, step_args=step_args) + self.module_injector.compute_runtime_state(step, step_args=step_args) if step_id not in step_states: raise Exception( f"Workflow invocation [{self.workflow_invocation.id}] has no step state for step {step.log_str()}. States ids are {list(step_states.keys())}." diff --git a/test/unit/workflows/test_modules.py b/test/unit/workflows/test_modules.py index 77ad7802146..02a84de3621 100644 --- a/test/unit/workflows/test_modules.py +++ b/test/unit/workflows/test_modules.py @@ -441,6 +441,7 @@ def __from_step(**kwds): step = __step(**kwds) injector = modules.WorkflowModuleInjector(trans) injector.inject(step, exact_tools=False) + injector.compute_runtime_state(step) module = step.module module.test_step = step return module diff --git a/test/unit/workflows/test_workflow_progress.py b/test/unit/workflows/test_workflow_progress.py index d0bf31a56ed..d45074bd4c8 100644 --- a/test/unit/workflows/test_workflow_progress.py +++ b/test/unit/workflows/test_workflow_progress.py @@ -225,6 +225,9 @@ class MockModuleInjector: def inject(self, step, step_args=None, steps=None, **kwargs): step.module = MockModule(self.progress) + def compute_runtime_state(self, step, step_args=None): + pass + class MockModule: def __init__(self, progress): From 63af4cfbc5cc64ca3397974444a535dedf31e4c4 Mon Sep 17 00:00:00 2001 From: guerler Date: Fri, 28 Oct 2022 10:59:03 -0400 Subject: [PATCH 033/316] Remove global states from new confirmation, remove unused props --- .../src/components/login/ChangePassword.vue | 4 +- client/src/components/login/LoginForm.vue | 25 +++- client/src/components/login/LoginIndex.vue | 120 +++++++++--------- .../components/login/NewUserConfirmation.vue | 46 +++---- client/src/components/login/RegisterForm.vue | 59 ++++----- client/src/entry/analysis/modules/Login.vue | 20 +-- 6 files changed, 136 insertions(+), 138 deletions(-) diff --git a/client/src/components/login/ChangePassword.vue b/client/src/components/login/ChangePassword.vue index 86925c529de..cec0434b678 100644 --- a/client/src/components/login/ChangePassword.vue +++ b/client/src/components/login/ChangePassword.vue @@ -50,9 +50,9 @@ export default { }; }, methods: { - submit(ev) { + submit() { axios - .post(safePath(`/user/change_password`), { + .post(safePath("/user/change_password"), { token: this.token, id: this.expiredUser, current: this.current, diff --git a/client/src/components/login/LoginForm.vue b/client/src/components/login/LoginForm.vue index 9f37f6e89c9..bf192f0c5b9 100644 --- a/client/src/components/login/LoginForm.vue +++ b/client/src/components/login/LoginForm.vue @@ -3,7 +3,7 @@
@@ -95,10 +99,18 @@ export default { type: Boolean, default: false, }, + isAdmin: { + type: Boolean, + default: false, + }, redirect: { type: String, default: null, }, + registrationWarningMessage: { + type: String, + default: null, + }, sessionCsrfToken: { type: String, default: null, @@ -107,6 +119,10 @@ export default { type: Boolean, default: false, }, + termsUrl: { + type: String, + default: null, + }, welcomeUrl: { type: String, default: null, @@ -122,9 +138,6 @@ export default { }; }, computed: { - messageShow() { - return this.messageText != null; - }, confirmURL() { var urlParams = new URLSearchParams(window.location.search); return urlParams.has("confirm") && urlParams.get("confirm") == "true"; @@ -137,7 +150,7 @@ export default { toggleLogin() { this.$emit("toggle-login"); }, - submitLogin(method) { + submitLogin() { let redirect = this.redirect; if (localStorage.getItem("redirect_url")) { redirect = localStorage.getItem("redirect_url"); diff --git a/client/src/components/login/LoginIndex.vue b/client/src/components/login/LoginIndex.vue index 23f9a83a743..d2e8fe3b8b5 100644 --- a/client/src/components/login/LoginIndex.vue +++ b/client/src/components/login/LoginIndex.vue @@ -1,26 +1,28 @@ + + + + + + diff --git a/client/src/components/Workflow/Run/WorkflowRunDefaultStep.vue b/client/src/components/Workflow/Run/WorkflowRunDefaultStep.vue index 815c253d1d9..de3007e4fc7 100644 --- a/client/src/components/Workflow/Run/WorkflowRunDefaultStep.vue +++ b/client/src/components/Workflow/Run/WorkflowRunDefaultStep.vue @@ -27,6 +27,10 @@ import FormMessage from "components/Form/FormMessage"; import FormCard from "components/Form/FormCard"; import { visitInputs } from "components/Form/utilities"; import { getTool } from "./services"; +import { library } from "@fortawesome/fontawesome-svg-core"; +import { faEdit, faUndo } from "@fortawesome/free-solid-svg-icons"; + +library.add(faEdit, faUndo); export default { components: { From 1f95b885a0b5314a7151d80a211c4d301b13484d Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Tue, 25 Oct 2022 19:05:46 +0200 Subject: [PATCH 085/316] move style to component --- client/src/components/Form/FormElement.vue | 49 +++++++++++++++++-- client/src/style/scss/ui.scss | 56 ---------------------- 2 files changed, 46 insertions(+), 59 deletions(-) diff --git a/client/src/components/Form/FormElement.vue b/client/src/components/Form/FormElement.vue index c2c5ea416a2..899cf5feda4 100644 --- a/client/src/components/Form/FormElement.vue +++ b/client/src/components/Form/FormElement.vue @@ -1,5 +1,4 @@ From d61014c769d4ef22d2f2632504fdf3d910305c15 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Thu, 27 Oct 2022 16:46:04 +0200 Subject: [PATCH 096/316] add password type to isEmpty string check --- client/src/components/Form/FormElement.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Form/FormElement.vue b/client/src/components/Form/FormElement.vue index 214096e665a..85a95bf2299 100644 --- a/client/src/components/Form/FormElement.vue +++ b/client/src/components/Form/FormElement.vue @@ -180,7 +180,7 @@ const isEmpty = computed(() => { return true; } - if (["text", "integer", "float"].includes(props.type) && currentValue.value === "") { + if (["text", "integer", "float", "password"].includes(props.type) && currentValue.value === "") { return true; } From f4ca87918cd5d65de4394b66202ee63f10a08463 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Wed, 2 Nov 2022 16:32:21 +0100 Subject: [PATCH 097/316] fix title display --- client/src/components/Form/FormElement.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/components/Form/FormElement.vue b/client/src/components/Form/FormElement.vue index 85a95bf2299..fef2fe1ced9 100644 --- a/client/src/components/Form/FormElement.vue +++ b/client/src/components/Form/FormElement.vue @@ -210,7 +210,7 @@ library.add(faExclamation, faTimes, faArrowsAltH, faCaretSquareDown, faCaretSqua
-
+
- + {{ props.title }} - {{ props.title }} + {{ props.title }} required - - optional + - optional
From 3541c304c6c32054b7e874d9d1d7b5bfd33568f8 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 16 Oct 2022 13:27:59 -0400 Subject: [PATCH 098/316] Consistently serialize tags in Visualization --- lib/galaxy/model/__init__.py | 4 ++-- lib/galaxy/webapps/galaxy/api/visualizations.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 2e3dcd5116a..82cda0e6645 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -8836,7 +8836,7 @@ class CloudAuthz(Base, _HasTable): ) -class Page(Base, Dictifiable, RepresentById): +class Page(Base, HasTags, Dictifiable, RepresentById): __tablename__ = "page" __table_args__ = (Index("ix_page_slug", "slug", mysql_length=200),) @@ -8942,7 +8942,7 @@ class PageUserShareAssociation(Base, UserShareAssociation): page = relationship("Page", back_populates="users_shared_with") -class Visualization(Base, RepresentById): +class Visualization(Base, HasTags, RepresentById): __tablename__ = "visualization" __table_args__ = ( Index("ix_visualization_dbkey", "dbkey", mysql_length=200), diff --git a/lib/galaxy/webapps/galaxy/api/visualizations.py b/lib/galaxy/webapps/galaxy/api/visualizations.py index 3d854f7fb20..2a588e965c6 100644 --- a/lib/galaxy/webapps/galaxy/api/visualizations.py +++ b/lib/galaxy/webapps/galaxy/api/visualizations.py @@ -191,6 +191,7 @@ class VisualizationsController(BaseGalaxyAPIController, UsesVisualizationMixin, slug=visualization.slug, ) dictionary["username"] = visualization.user.username + dictionary["tags"] = visualization.make_tag_string_list() dictionary["annotation"] = self.get_item_annotation_str(trans.sa_session, trans.user, visualization) # need to encode ids in revisions as well encoded_revisions = [] From e35ffce78be64eb8ef996871a4f3c2e10a409c23 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 16 Oct 2022 14:39:50 -0400 Subject: [PATCH 099/316] Restore rating stars and display for published items --- client/package.json | 1 + client/src/components/Common/Published.vue | 35 ++++++++++++---- client/src/components/Common/Ratings.vue | 42 +++++++++++++++++++ .../components/History/HistoryPublished.vue | 11 ++++- .../components/PageDisplay/PageDisplay.vue | 9 +++- .../Visualizations/VisualizationPublished.vue | 11 ++++- .../components/Workflow/WorkflowPublished.vue | 11 ++++- client/yarn.lock | 9 +++- .../webapps/galaxy/controllers/history.py | 1 - 9 files changed, 113 insertions(+), 17 deletions(-) create mode 100644 client/src/components/Common/Ratings.vue diff --git a/client/package.json b/client/package.json index 1ea15517c35..bd139e04005 100644 --- a/client/package.json +++ b/client/package.json @@ -91,6 +91,7 @@ "vue-prismjs": "^1.2.0", "vue-router": "^3.5.3", "vue-rx": "^6.2.0", + "vue-star-rating": "^1.7.0", "vue-virtual-scroll-list": "^2.3.3", "vuedraggable": "2.24.3", "vuex": "^3.6.2", diff --git a/client/src/components/Common/Published.vue b/client/src/components/Common/Published.vue index 063b53a6f10..cd83592585c 100644 --- a/client/src/components/Common/Published.vue +++ b/client/src/components/Common/Published.vue @@ -11,8 +11,8 @@

About this {{ modelTitle }}

-

{{ details.title || details.name }}

- +

{{ item.title || item.name }}

+

Author

{{ owner }}
@@ -24,8 +24,15 @@
Published {{ plural }} by {{ owner }}.
+
+
- +
@@ -33,28 +40,39 @@ diff --git a/client/src/components/Common/Ratings.vue b/client/src/components/Common/Ratings.vue new file mode 100644 index 00000000000..2cacefb5963 --- /dev/null +++ b/client/src/components/Common/Ratings.vue @@ -0,0 +1,42 @@ + + diff --git a/client/src/components/History/HistoryPublished.vue b/client/src/components/History/HistoryPublished.vue index 3ccbdd55779..c827912aa7c 100644 --- a/client/src/components/History/HistoryPublished.vue +++ b/client/src/components/History/HistoryPublished.vue @@ -1,5 +1,5 @@