Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using tracks and groups in visualization xml #18779

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Markdown/MarkdownVisualization", () => {
argumentName: "name",
argumentPayload: {
settings: [{}, {}],
groups: [{}],
tracks: [{}],
},
history: "history_id",
labels: [],
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Markdown/MarkdownVisualization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ export default {
if (this.argumentPayload.settings && this.argumentPayload.settings.length > 0) {
settings = this.argumentPayload.settings.slice();
}
if (this.argumentPayload.groups && this.argumentPayload.groups.length > 0) {
if (this.argumentPayload.tracks && this.argumentPayload.tracks.length > 0) {
settings = settings || [];
settings.push({
type: "repeat",
title: "Columns",
name: "groups",
name: "tracks",
min: 1,
inputs: this.argumentPayload.groups.map((x) => {
inputs: this.argumentPayload.tracks.map((x) => {
if (x.type == "data_column") {
x.is_workflow = true;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/mvc/visualization/chart/components/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Backbone from "backbone";
import { Visualization } from "mvc/visualization/visualization-model";
import Utils from "utils/utils";

const MATCH_GROUP = /^groups_([0-9]+)\|([\w]+)/;
const MATCH_GROUP = /^(groups|tracks)_([0-9]+)\|([\w]+)/;

export default Backbone.Model.extend({
defaults: {
Expand Down
2 changes: 1 addition & 1 deletion client/src/mvc/visualization/chart/views/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default Backbone.View.extend({
)
.append(new Settings(this.app).$el),
});
if (this.chart.plugin.groups) {
if (this.chart.plugin.tracks) {
this.tabs.add({
id: "groups",
icon: "fa-database",
Expand Down
4 changes: 2 additions & 2 deletions client/src/mvc/visualization/chart/views/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var GroupView = Backbone.View.extend({
},
render: function () {
var self = this;
var inputs = Utils.clone(this.chart.plugin.groups) || [];
var inputs = Utils.clone(this.chart.plugin.tracks) || [];
var dataset_id = this.chart.get("dataset_id");
if (dataset_id) {
this.chart.state("wait", "Loading metadata...");
Expand Down Expand Up @@ -127,7 +127,7 @@ export default Backbone.View.extend({
});
},
render: function () {
if (_.size(this.chart.plugin.groups) > 0) {
if (_.size(this.chart.plugin.tracks) > 0) {
this.repeat.$el.show();
} else {
this.repeat.$el.hide();
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/visualization/plugins/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ def parse_visualization(self, xml_tree):
if (specs_section := xml_tree.find("specs")) is not None:
returned["specs"] = DictParser(specs_section)

# load group specifiers
if (groups_section := xml_tree.find("groups")) is not None:
returned["groups"] = ListParser(groups_section)
# load tracks specifiers (allow 'groups' section for backward compatibility)
if (tracks_section := xml_tree.find("tracks") or xml_tree.find("groups")) is not None:
returned["tracks"] = ListParser(tracks_section)

# load settings specifiers
if (settings_section := xml_tree.find("settings")) is not None:
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/visualization/plugins/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def to_dict(self):
"embeddable": self.config.get("embeddable"),
"entry_point": self.config.get("entry_point"),
"settings": self.config.get("settings"),
"groups": self.config.get("groups"),
"specs": self.config.get("specs"),
"tracks": self.config.get("tracks"),
"href": self._get_url(),
}

Expand Down
Loading