-
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.
move help mode into side panel (primarily)
Still toggleable into a draggable mode if needed
- Loading branch information
1 parent
047ce4a
commit f968cc8
Showing
9 changed files
with
174 additions
and
46 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
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,50 @@ | ||
<script setup lang="ts"> | ||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | ||
import { BAlert, BTab, BTabs } from "bootstrap-vue"; | ||
import { storeToRefs } from "pinia"; | ||
import { useMarkdown } from "@/composables/markdown"; | ||
import { DEFAULT_HELP_TEXT, useHelpModeStore } from "@/stores/helpmode/helpModeStore"; | ||
import localize from "@/utils/localization"; | ||
import LoadingSpan from "@/components/LoadingSpan.vue"; | ||
const { renderMarkdown } = useMarkdown({ | ||
openLinksInNewPage: true, | ||
html: true, | ||
appendHrRuleToDetails: true, | ||
replaceCodeWithIcon: true, | ||
detectEmojis: true, | ||
}); | ||
// local refs | ||
const { activeTab, contents, loading, currentTabs } = storeToRefs(useHelpModeStore()); | ||
const noHelpTextMsg = localize("No help text available for this component"); | ||
</script> | ||
|
||
<template> | ||
<span v-if="!activeTab" v-localize class="help-mode-container">{{ DEFAULT_HELP_TEXT }}</span> | ||
<BTabs v-else class="help-mode-container"> | ||
<BTab v-for="helpId of currentTabs" :key="helpId" :active="activeTab === helpId"> | ||
<template v-slot:title> | ||
<FontAwesomeIcon v-if="contents[helpId]?.icon" :icon="contents[helpId]?.icon" /> | ||
{{ contents[helpId]?.title }} | ||
</template> | ||
<!-- eslint-disable-next-line vue/no-v-html --> | ||
<div v-if="!loading" v-html="renderMarkdown(contents[helpId]?.content || noHelpTextMsg)" /> | ||
<BAlert v-else variant="info" show> | ||
<LoadingSpan message="Loading help text" /> | ||
</BAlert> | ||
</BTab> | ||
</BTabs> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
.help-mode-container { | ||
margin-top: 0; | ||
padding: 10px; | ||
overflow-y: auto; | ||
height: 100%; | ||
} | ||
</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
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 { library } from "@fortawesome/fontawesome-svg-core"; | ||
import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | ||
import { BButton, BButtonGroup, BCard } from "bootstrap-vue"; | ||
import { storeToRefs } from "pinia"; | ||
import { useHelpModeStore } from "@/stores/helpmode/helpModeStore"; | ||
import { useUserStore } from "@/stores/userStore"; | ||
import HelpModeText from "../Help/HelpModeText.vue"; | ||
import ActivityPanel from "@/components/Panels/ActivityPanel.vue"; | ||
library.add(faExternalLinkAlt); | ||
const { draggableActive } = storeToRefs(useHelpModeStore()); | ||
const userStore = useUserStore(); | ||
function toggleOut() { | ||
const panelActive = userStore.toggledSideBar === "help"; | ||
const togglePanel = panelActive && !draggableActive.value; | ||
draggableActive.value = !draggableActive.value; | ||
if (togglePanel) { | ||
userStore.toggleSideBar("help"); | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<ActivityPanel title="Galaxy Help Mode"> | ||
<template v-slot:header-buttons> | ||
<BButtonGroup> | ||
<BButton | ||
v-b-tooltip.bottom.hover | ||
data-description="toggle out help mode" | ||
size="sm" | ||
:variant="draggableActive ? 'info' : 'link'" | ||
title="Toggle out help mode into a draggable window" | ||
@click="toggleOut"> | ||
<FontAwesomeIcon :icon="faExternalLinkAlt" fixed-width /> | ||
</BButton> | ||
</BButtonGroup> | ||
</template> | ||
|
||
<template v-slot:header> | ||
<div v-localize class="ml-1"> | ||
This is Galaxy's help mode. It shows help text for the current component you are interacting with. | ||
</div> | ||
</template> | ||
|
||
<BCard class="help-text"> | ||
<HelpModeText /> | ||
</BCard> | ||
</ActivityPanel> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.help-text { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: aliceblue; | ||
overflow: auto; | ||
} | ||
</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
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