Skip to content

Commit 5b88334

Browse files
add both readme and help to StoredWorkflowDetailed
and show readme in workflow run form.
1 parent c8bab8b commit 5b88334

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

client/src/api/schema/schema.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16448,6 +16448,11 @@ export interface components {
1644816448
* @description The hash of the email of the creator of this workflow
1644916449
*/
1645016450
email_hash: string | null;
16451+
/**
16452+
* Help
16453+
* @description The detailed help text for how to use the workflow and debug problems with it.
16454+
*/
16455+
help: string | null;
1645116456
/**
1645216457
* Hidden
1645316458
* @description TODO
@@ -16507,6 +16512,11 @@ export interface components {
1650716512
* @description Whether this workflow is currently publicly available to all users.
1650816513
*/
1650916514
published: boolean;
16515+
/**
16516+
* Readme
16517+
* @description The detailed markdown readme of the workflow.
16518+
*/
16519+
readme: string | null;
1651016520
/**
1651116521
* Show in Tool Panel
1651216522
* @description Whether to display this workflow in the Tools Panel.

client/src/components/Workflow/WorkflowAnnotation.vue

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { faExclamation, faHdd } from "@fortawesome/free-solid-svg-icons";
44
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
55
import { BBadge } from "bootstrap-vue";
66
import { storeToRefs } from "pinia";
7-
import { computed } from "vue";
7+
import { computed, ref } from "vue";
88
99
import { isRegisteredUser } from "@/api";
10+
import { useMarkdown } from "@/composables/markdown";
1011
import { useWorkflowInstance } from "@/composables/useWorkflowInstance";
1112
import { useHistoryStore } from "@/stores/historyStore";
1213
import { useUserStore } from "@/stores/userStore";
1314
15+
import Heading from "../Common/Heading.vue";
1416
import TextSummary from "../Common/TextSummary.vue";
1517
import SwitchToHistoryLink from "../History/SwitchToHistoryLink.vue";
1618
import StatelessTags from "../TagsMultiselect/StatelessTags.vue";
@@ -56,6 +58,14 @@ const timeElapsed = computed(() => {
5658
const workflowTags = computed(() => {
5759
return workflow.value?.tags || [];
5860
});
61+
62+
const readmeShown = ref(false);
63+
64+
const { renderMarkdown } = useMarkdown({
65+
openLinksInNewPage: true,
66+
removeNewlinesAfterList: true,
67+
increaseHeadingLevelBy: 1,
68+
});
5969
</script>
6070

6171
<template>
@@ -94,7 +104,20 @@ const workflowTags = computed(() => {
94104
<div v-if="props.showDetails">
95105
<TextSummary v-if="description" class="my-1" :description="description" one-line-summary component="span" />
96106
<StatelessTags v-if="workflowTags.length" :value="workflowTags" :disabled="true" />
97-
<hr class="mb-0 mt-2" />
107+
<div v-if="workflow.readme" class="mt-2">
108+
<Heading
109+
h2
110+
separator
111+
bold
112+
size="sm"
113+
:collapse="readmeShown ? 'open' : 'closed'"
114+
@click="readmeShown = !readmeShown">
115+
<span v-localize>Readme</span>
116+
</Heading>
117+
<!-- eslint-disable-next-line vue/no-v-html -->
118+
<p v-if="readmeShown" v-html="renderMarkdown(workflow.readme)" />
119+
</div>
120+
<hr v-if="!workflow.readme" class="mb-0 mt-2" />
98121
</div>
99122
</div>
100123
</template>

lib/galaxy/schema/workflows.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,16 @@ class StoredWorkflowDetailed(StoredWorkflowSummary):
258258
title="Email Hash",
259259
description="The hash of the email of the creator of this workflow",
260260
)
261+
readme: Optional[str] = Field(
262+
...,
263+
title="Readme",
264+
description="The detailed markdown readme of the workflow.",
265+
)
266+
help: Optional[str] = Field(
267+
...,
268+
title="Help",
269+
description="The detailed help text for how to use the workflow and debug problems with it.",
270+
)
261271
slug: Optional[str] = Field(
262272
...,
263273
title="Slug",

0 commit comments

Comments
 (0)