Skip to content

Commit 41a72b2

Browse files
authored
Merge pull request #20592 from jmchilton/tool_landing
Implement Data Landing Requests
2 parents c6e6b5b + 8b17d3f commit 41a72b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3343
-358
lines changed

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"vue-class-component": "^7.2.6",
121121
"vue-echarts": "^7.0.3",
122122
"vue-infinite-scroll": "^2.0.2",
123+
"vue-json-pretty": "^1.9.5",
123124
"vue-multiselect": "^2.1.7",
124125
"vue-observe-visibility": "^1.0.0",
125126
"vue-property-decorator": "^9.1.2",

client/src/api/schema/schema.ts

Lines changed: 865 additions & 73 deletions
Large diffs are not rendered by default.

client/src/api/tools.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ import { type components, GalaxyApi } from "@/api";
22
import { ERROR_STATES, type ShowFullJobResponse } from "@/api/jobs";
33

44
export type HdcaUploadTarget = components["schemas"]["HdcaDataItemsTarget"];
5+
export type HdasUploadTarget = components["schemas"]["DataElementsTarget"];
56
export type FetchDataPayload = components["schemas"]["FetchDataPayload"];
67
export type UrlDataElement = components["schemas"]["UrlDataElement"];
78
export type NestedElement = components["schemas"]["NestedElement"];
9+
export type NestedElementItems = NestedElement["elements"];
10+
export type NestedElementItem = NestedElementItems[number];
11+
export type FetchTargets = FetchDataPayload["targets"];
12+
export type AnyFetchTarget = FetchTargets[number];
813

914
export function urlDataElement(identifier: string, uri: string): UrlDataElement {
1015
const element: UrlDataElement = {

client/src/components/Help/HelpPopover.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ defineProps<Props>();
1111
</script>
1212

1313
<template>
14-
<Popper v-if="target" :reference-el="target" mode="light">
14+
<!-- setting font-size:0 so this span doesn't affect the spacing in the parent component -->
15+
<Popper v-if="target" style="font-size: 0" :reference-el="target" mode="light">
1516
<HelpTerm :term="term" class="p-2 help-popover-content" />
1617
</Popper>
1718
</template>

client/src/components/Help/terms.yml

Lines changed: 0 additions & 188 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/galaxy/schema/terms.yml
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<script setup lang="ts">
2+
import "vue-json-pretty/lib/styles.css";
3+
4+
import { computed } from "vue";
5+
import VueJsonPretty from "vue-json-pretty";
6+
7+
import { useHelpTermsStore } from "@/stores/helpTermsStore";
8+
9+
import HelpText from "@/components/Help/HelpText.vue";
10+
11+
const { hasHelpText } = useHelpTermsStore();
12+
13+
interface Props {
14+
parameterValue: string | object;
15+
}
16+
17+
const props = defineProps<Props>();
18+
19+
const jsonData = computed(() => {
20+
if (typeof props.parameterValue === "string") {
21+
return JSON.parse(props.parameterValue);
22+
}
23+
return props.parameterValue;
24+
});
25+
26+
function shouldLink(key: string): boolean {
27+
return hasHelpText(`galaxy.dataFetch.${key}`);
28+
}
29+
</script>
30+
31+
<template>
32+
<VueJsonPretty :data="jsonData" :virtual="false" :data-request-json="JSON.stringify(jsonData)">
33+
<template v-slot:nodeKey="{ node, defaultKey }">
34+
<span v-if="shouldLink(node.key)">
35+
"<HelpText :uri="`galaxy.dataFetch.${node.key}`" :text="node.key" />"
36+
</span>
37+
<span v-else>
38+
{{ defaultKey }}
39+
</span>
40+
</template>
41+
<template v-slot:nodeValue="{ node, defaultValue }">
42+
<span v-if="node.path.endsWith('destination.type')">
43+
"<HelpText :uri="`galaxy.dataFetch.destinations.${node.content}`" :text="node.content" />"
44+
</span>
45+
<span v-else-if="node.path.endsWith('.src') && shouldLink(`sources.${node.content}`)">
46+
"<HelpText :uri="`galaxy.dataFetch.sources.${node.content}`" :text="node.content" />"
47+
</span>
48+
<span v-else-if="node.path.endsWith('.ext')">
49+
"<HelpText :uri="`galaxy.datatypes.extensions.${node.content}`" :text="node.content" />"
50+
</span>
51+
<span v-else>
52+
{{ defaultValue }}
53+
</span>
54+
</template>
55+
</VueJsonPretty>
56+
</template>

client/src/components/JobParameters/JobParameters.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<td v-if="Array.isArray(parameter.value)">
1919
<JobParametersArrayValue :parameter_value="parameter.value" />
2020
</td>
21+
<td v-else-if="isRequestJson(parameter)" class="tool-parameter-value">
22+
<DataFetchRequestParameter :parameter-value="parameter.value" />
23+
</td>
2124
<td v-else class="tool-parameter-value">
2225
{{ parameter.value }}
2326
</td>
@@ -53,10 +56,13 @@ import Vue from "vue";
5356
import JobOutputs from "../JobInformation/JobOutputs";
5457
import JobParametersArrayValue from "./JobParametersArrayValue";
5558
59+
import DataFetchRequestParameter from "./DataFetchRequestParameter.vue";
60+
5661
Vue.use(BootstrapVue);
5762
5863
export default {
5964
components: {
65+
DataFetchRequestParameter,
6066
JobOutputs,
6167
JobParametersArrayValue,
6268
},
@@ -117,6 +123,9 @@ export default {
117123
this.initJob();
118124
},
119125
methods: {
126+
isRequestJson(parameter) {
127+
return parameter.text == "request_json" && typeof parameter.value == "string";
128+
},
120129
initJob() {
121130
let url;
122131
if (this.jobId) {

0 commit comments

Comments
 (0)