Skip to content

Commit a8c7df7

Browse files
authored
Merge pull request #20814 from itisAliRH/fix-trs-import-markdown-rendering
[25.0] Render Tool Descriptions in Markdown in TRS imports
2 parents 66940ca + c932eb4 commit a8c7df7

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

client/src/components/Workflow/Import/TrsSearch.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useRouter } from "vue-router/composables";
99
1010
import { getRedirectOnImportPath } from "@/components/Workflow/redirectPath";
1111
import { Services } from "@/components/Workflow/services";
12+
import { useMarkdown } from "@/composables/markdown";
1213
import { withPrefix } from "@/utils/redirect";
1314
1415
import type { TrsSelection } from "./types";
@@ -26,6 +27,8 @@ type TrsSearchData = {
2627
[key: string]: unknown;
2728
};
2829
30+
const { renderMarkdown } = useMarkdown({ openLinksInNewPage: true });
31+
2932
const fields = [
3033
{ key: "name", label: "Name" },
3134
{ key: "description", label: "Description" },
@@ -195,7 +198,22 @@ async function importVersion(trsId?: string, toolIdToImport?: string, version?:
195198
@onImport="(versionId) => importVersion(trsSelection?.id, row.item.data.id, versionId)" />
196199
</BCard>
197200
</template>
201+
202+
<template v-slot:cell(description)="row">
203+
<span class="trs-description" v-html="renderMarkdown(row.item.data.description)" />
204+
</template>
198205
</BTable>
199206
</div>
200207
</BCard>
201208
</template>
209+
210+
<style>
211+
.trs-description {
212+
position: relative;
213+
overflow: hidden;
214+
display: -webkit-box;
215+
-webkit-box-orient: vertical;
216+
-webkit-line-clamp: 3;
217+
line-clamp: 3;
218+
}
219+
</style>

client/src/components/Workflow/Import/TrsTool.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { faUpload } from "@fortawesome/free-solid-svg-icons";
44
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
55
import { BButton } from "bootstrap-vue";
66
7+
import { useMarkdown } from "@/composables/markdown";
8+
79
import type { TrsTool, TrsToolVersion } from "./types";
810
911
library.add(faUpload);
@@ -18,6 +20,8 @@ const emit = defineEmits<{
1820
(e: "onImport", versionId: string): void;
1921
}>();
2022
23+
const { renderMarkdown } = useMarkdown({ openLinksInNewPage: true });
24+
2125
function importVersion(version: TrsToolVersion) {
2226
const version_id = version.id.includes(`:${version.name}`) ? version.name : version.id;
2327
emit("onImport", version_id);
@@ -34,7 +38,7 @@ function importVersion(version: TrsToolVersion) {
3438
<div>
3539
<b>Description:</b>
3640

37-
<span>{{ props.trsTool.description }}</span>
41+
<span v-html="renderMarkdown(props.trsTool.description)" />
3842
</div>
3943
<div>
4044
<b>Organization</b>

client/src/utils/navigation/navigation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ trs_search:
680680
search: "#trs-search-query"
681681
search_result:
682682
type: xpath
683-
selector: "//td[contains(text(), '${workflow_name}')]"
683+
selector: "//td[contains(., '${workflow_name}')]"
684684
import_button: ".workflow-import"
685685
select_server_button: "#dropdownTrsServer"
686686
import_version: '[data-version-name*="${version}"]'

0 commit comments

Comments
 (0)