-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
264 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script setup lang="ts"> | ||
import ConfigurationMarkdown from "@/components/ObjectStore/ConfigurationMarkdown.vue"; | ||
interface Props { | ||
target: any; | ||
help: string; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
|
||
<template> | ||
<b-popover | ||
:target="target" | ||
triggers="hover" | ||
placement="bottom"> | ||
<ConfigurationMarkdown :markdown="help" :admin="true" /> | ||
</b-popover> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { computed,type Ref } from "vue"; | ||
|
||
import { hasHelp as hasHelpText, help as helpText } from "./terms"; | ||
|
||
export function useHelp( | ||
uri: Ref<string>, | ||
) { | ||
const hasHelp = computed<boolean>(() => { | ||
return hasHelpText(uri.value); | ||
}); | ||
|
||
const help = computed<string>(() => { | ||
return helpText(uri.value) as string; | ||
}); | ||
|
||
return { hasHelp, help }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,19 @@ | ||
<script setup> | ||
import { useFormattedToolHelp } from "composables/formattedToolHelp"; | ||
<script setup lang="ts"> | ||
import ToolHelpMarkdown from "./ToolHelpMarkdown.vue"; | ||
import ToolHelpRst from "./ToolHelpRst.vue"; | ||
const props = defineProps({ | ||
content: { | ||
type: String, | ||
required: true, | ||
}, | ||
}); | ||
defineProps<{ | ||
type: string; | ||
content: string; | ||
}>(); | ||
const { formattedContent } = useFormattedToolHelp(props.content); | ||
</script> | ||
|
||
<template> | ||
<div class="form-help form-text" v-html="formattedContent" /> | ||
<span> | ||
<ToolHelpMarkdown v-if="type=='markdown'" :content="content" /> | ||
<ToolHelpRst v-else-if="type=='restructuredtext'" :content="content" /> | ||
<div v-else class="form-help form-text"> | ||
{{ content }} | ||
</div> | ||
</span> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "scss/theme/blue.scss"; | ||
.form-help { | ||
&:deep(h3) { | ||
font-size: $h4-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h4) { | ||
font-size: $h5-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h5) { | ||
font-size: $h6-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h6) { | ||
font-size: $h6-font-size; | ||
text-decoration: underline; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<script setup lang="ts"> | ||
import { computed, onMounted, ref } from "vue"; | ||
import { hasHelp, help } from "@/components/Help/terms"; | ||
import { markup } from "@/components/ObjectStore/configurationMarkdown"; | ||
import { useFormattedToolHelp } from "@/composables/formattedToolHelp"; | ||
import HelpPopover from "@/components/Help/HelpPopover.vue"; | ||
const props = defineProps<{ | ||
content: string; | ||
}>(); | ||
const markdownHtml = computed(() => markup(props.content ?? "", false)); | ||
// correct links and header information... this should work the same between rst and | ||
// markdown entirely I think. | ||
const { formattedContent } = useFormattedToolHelp(markdownHtml); | ||
const helpHtml = ref<HTMLDivElement>(); | ||
interface InternalTypeReference { | ||
element: HTMLElement; | ||
markdown: string; | ||
} | ||
const internalHelpReferences = ref<InternalTypeReference[]>([]); | ||
function setupPopovers() { | ||
internalHelpReferences.value.length = 0; | ||
if (helpHtml.value) { | ||
const links = helpHtml.value.getElementsByTagName("a"); | ||
Array.from(links).forEach((link) => { | ||
if (link.href.startsWith("help://")) { | ||
const uri = link.href.substr("help://".length); | ||
if( hasHelp(uri)) { | ||
const helpMarkdown = help(uri); | ||
internalHelpReferences.value.push({element: link, markdown: helpMarkdown}); | ||
} | ||
link.href = "#"; | ||
link.style.color = "inherit"; | ||
link.style.textDecorationLine = "underline"; | ||
link.style.textDecorationStyle = "dashed"; | ||
} | ||
}); | ||
} | ||
} | ||
onMounted(setupPopovers); | ||
</script> | ||
|
||
|
||
<template> | ||
<span> | ||
<!-- Disable v-html warning because we allow markdown generated HTML | ||
in various places in the Galaxy interface. Raw HTML is not allowed | ||
here because admin = false in the call to markup. | ||
--> | ||
<!-- eslint-disable-next-line vue/no-v-html --> | ||
<div ref="helpHtml" v-html="formattedContent" /> | ||
<span v-for="(value, i) in internalHelpReferences" v:key="i"> | ||
Check failure on line 60 in client/src/components/Tool/ToolHelpMarkdown.vue GitHub Actions / client-unit-test (18)
|
||
<HelpPopover :target="value.element" :help="value.markdown" /> | ||
</span> | ||
</span> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script setup> | ||
import { useFormattedToolHelp } from "composables/formattedToolHelp"; | ||
const props = defineProps({ | ||
content: { | ||
type: String, | ||
required: true, | ||
}, | ||
}); | ||
const { formattedContent } = useFormattedToolHelp(props.content); | ||
</script> | ||
|
||
<template> | ||
<div class="form-help form-text" v-html="formattedContent" /> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "scss/theme/blue.scss"; | ||
.form-help { | ||
&:deep(h3) { | ||
font-size: $h4-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h4) { | ||
font-size: $h5-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h5) { | ||
font-size: $h6-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h6) { | ||
font-size: $h6-font-size; | ||
text-decoration: underline; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.