-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove legacy Visualization Mako and Controllers #21133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 61 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
dba1060
Switch from VisualizationFrame with backend mako to client Visualizat…
guerler ce6f775
Switch to VisualizationWrapper
guerler 5f31037
Dump legacy saved visualization controller endpoint
guerler a3d47dc
Remove visualization rendering controller
guerler d672442
Remove rendered_saved from visualization framework
guerler e80f8d6
Remove server side rendering from visualization framework
guerler a716dfd
Remove mako based visualization layer from visualization framework
guerler f177a67
Remove visualization mako
guerler 072a845
Keep href for now
guerler 357253b
Remove parsing for now unused mako, and html entry types
guerler 3a6061b
Remove unused target iframe name from visualization config
guerler efda303
Remove legacy visualization controller endpoint
guerler f8b667f
Fix path, used to point at legacy controller
guerler d2bb6c4
No need to parse template directory anymore to registry
guerler 27674bc
Remove unused imports
guerler df1af66
Remove unused target iframe specifier
guerler 72fd7e7
Remove unused import
guerler 661ad9d
Adjust unit test
guerler c881820
Remove unused plugin options, simplify handling
guerler 54d8f5b
Remove unused import
guerler 1a8bf0e
Fix linting
guerler 9438956
Remove unused regex import
guerler 96f539f
Remove unused escape import
guerler 3f73927
Adjust test cases
guerler 3427bdd
Remove unused imports
guerler f3f7c43
Prep consolidation and refactoring of options
guerler 236d7f0
Add id galaxy_visualization to visualization frame
guerler 10b3956
Add full height class, prep for refactoring
guerler 8a70be8
Rename frame to display
guerler b1af65f
Add visualization frame component
guerler 9b24cc7
Remove full height option from embedded visualization container
guerler 07ebecb
Reuse Visualization Frame component in Markdown Wrapper
guerler 70a7e5b
Move visualization wrapper to markdown components
guerler 699db58
Update nora to 1.2.2
guerler e3aef2b
Update mvpapp to 0.0.2
guerler f242864
Update chiraviz, layout fixes
guerler 354fbbc
Update hivtrace
guerler f4d663f
Remove unused param options
guerler e99d30e
Remove unused variable
guerler 704a040
Use api schema to request visualization details
guerler caa92b3
Remove unnecessary error parser
guerler 53dea64
Update igv
guerler 97d8589
Add hyphyvision
guerler 6f9916a
Allow alternative script entry point type
guerler 6755322
Update hyphyvision to 2.15.10
guerler f3ceae8
Fix igv test
guerler 626fcd7
Update hyphyvision, add fontawesome icons
guerler a89ab3a
Allow hyphy_results.json to be displayed in uploader
guerler f255deb
Assign hyphyvision to hyphy_results.json files
guerler 312704b
Improve error handling
guerler d2f27e9
Update lib/galaxy/visualization/plugins/registry.py
guerler bc6e949
Update lib/galaxy/visualization/plugins/plugin.py
guerler 1871971
Update lib/galaxy/visualization/plugins/registry.py
guerler 1d73a19
Update lib/galaxy/visualization/plugins/registry.py
guerler 5dfd6d3
Update lib/galaxy/visualization/plugins/plugin.py
guerler 34ae6bc
Update test/unit/app/visualizations/plugins/test_VisualizationsRegist…
guerler 3d61ead
Update test/unit/app/visualizations/plugins/test_VisualizationsRegist…
guerler a4d79cd
Update test/unit/app/visualizations/plugins/test_VisualizationsRegist…
guerler 48da2bb
Add typing import to registry.py
guerler f534435
Add conditional StructuredApp import after last import
guerler 8764d75
Remove template_cache_dir from test
guerler e571dcd
Apply additional StructuredApp mocking
guerler c8a0827
Add explicit typing to plugins
guerler 973b6d5
Properly pass title prop to frame component
guerler fdf6013
Restore root and plugin path
guerler 4e1b346
Use visualization frame for published visualizations
guerler a449af1
Add explicit types to refs in visualization display
guerler 14d9568
Add visualization config condition
guerler 51abfe9
Refactors VisualizationWrapper props definition
itisAliRH 9966d69
Improves VisualizationDisplay component
itisAliRH 2fca63a
Refines type definitions for props and emits
itisAliRH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
99 changes: 99 additions & 0 deletions
99
client/src/components/Markdown/Sections/VisualizationWrapper.vue
This file contains hidden or 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,99 @@ | ||
| <script setup lang="ts"> | ||
| import { faExpand, faWindowMaximize } from "@fortawesome/free-solid-svg-icons"; | ||
| import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | ||
| import { BAlert, BButton } from "bootstrap-vue"; | ||
| import { computed, ref } from "vue"; | ||
|
|
||
| import VisualizationFrame from "@/components/Visualizations/VisualizationFrame.vue"; | ||
|
|
||
| const props = withDefaults( | ||
| defineProps<{ | ||
| config: object; | ||
| name: string; | ||
| title?: string; | ||
| height?: number; | ||
| }>(), | ||
| { | ||
| height: 400, | ||
| }, | ||
| ); | ||
|
|
||
| const emit = defineEmits(["change", "load"]); | ||
|
|
||
| const errorMessage = ref(""); | ||
| const expand = ref(false); | ||
|
|
||
| const fixedHeight = computed(() => | ||
| expand.value ? {} : { maxHeight: `${props.height}px`, minHeight: `${props.height}px` }, | ||
| ); | ||
| </script> | ||
|
|
||
| <template> | ||
| <div v-if="errorMessage"> | ||
| <BAlert variant="danger" show>{{ errorMessage }}</BAlert> | ||
| </div> | ||
| <div v-else class="position-relative h-100"> | ||
| <div :class="`visualization-pop${expand ? 'out' : 'in'}`"> | ||
| <VisualizationFrame | ||
| title="visualization" | ||
| :config="props.config" | ||
| :name="props.name" | ||
| :style="fixedHeight" | ||
| @change="emit('change', $event)" | ||
| @load="emit('load')" /> | ||
| </div> | ||
| <BButton | ||
| class="visualization-popout-expand" | ||
| variant="link" | ||
| size="sm" | ||
| title="Maximize" | ||
| @click="expand = !expand"> | ||
| <FontAwesomeIcon :icon="faExpand" /> | ||
| </BButton> | ||
| <BButton | ||
| v-if="expand" | ||
| class="visualization-popout-close" | ||
| variant="link" | ||
| size="sm" | ||
| title="Minimize" | ||
| @click="expand = !expand"> | ||
| <FontAwesomeIcon :icon="faWindowMaximize" /> | ||
| </BButton> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style lang="scss"> | ||
| @import "theme/blue.scss"; | ||
|
|
||
| .visualization-popin { | ||
| border: none; | ||
| width: 100%; | ||
| padding-top: 1.5rem; | ||
| } | ||
| .visualization-popout { | ||
| background: $white; | ||
| border: $border-default; | ||
| border-radius: $border-radius-base; | ||
| height: calc(100vh - 2rem); | ||
| left: 1rem; | ||
| padding-top: 1.5rem; | ||
| position: fixed; | ||
| top: 1rem; | ||
| width: calc(100vw - 2rem); | ||
| z-index: 1000; | ||
| } | ||
| .visualization-popout-close { | ||
| left: 1rem; | ||
| position: fixed; | ||
| margin: 0.2rem; | ||
| padding: 0 0.5rem; | ||
| top: 1rem; | ||
| z-index: 1001; | ||
| } | ||
| .visualization-popout-expand { | ||
| left: 0; | ||
| padding: 0 0.5rem; | ||
| position: absolute; | ||
| top: 0; | ||
| } | ||
| </style> | ||
120 changes: 120 additions & 0 deletions
120
client/src/components/Visualizations/VisualizationDisplay.vue
This file contains hidden or 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,120 @@ | ||
| <script setup lang="ts"> | ||
| import { BAlert } from "bootstrap-vue"; | ||
| import { onMounted, ref } from "vue"; | ||
| import { onBeforeRouteLeave } from "vue-router/composables"; | ||
|
|
||
| import { GalaxyApi } from "@/api"; | ||
|
|
||
| import VisualizationFrame from "./VisualizationFrame.vue"; | ||
| import LoadingSpan from "@/components/LoadingSpan.vue"; | ||
|
|
||
| const emit = defineEmits(["load"]); | ||
|
|
||
| export interface Props { | ||
| datasetId?: string; | ||
| visualization: string; | ||
| visualizationId?: string; | ||
| } | ||
|
|
||
| const props = defineProps<Props>(); | ||
|
|
||
| const errorMessage = ref(""); | ||
| const iframeRef = ref<HTMLIFrameElement | null>(null); | ||
| const isLoading = ref(true); | ||
| const hasUnsavedChanges = ref(false); | ||
| const visualizationConfig = ref(); | ||
|
|
||
| function handleLoad() { | ||
| isLoading.value = false; | ||
| emit("load"); | ||
| setupChangeDetection(); | ||
| } | ||
|
|
||
| function setupChangeDetection() { | ||
| const iframe = iframeRef.value; | ||
| if (!iframe?.contentWindow) { | ||
| return; | ||
| } | ||
|
|
||
| setTimeout(() => { | ||
| try { | ||
| const iframeDoc = iframe.contentDocument; | ||
| if (!iframeDoc) { | ||
| return; | ||
| } | ||
|
|
||
| const markAsChanged = () => { | ||
| if (!hasUnsavedChanges.value) { | ||
| hasUnsavedChanges.value = true; | ||
| } | ||
| }; | ||
|
|
||
| // Monitor DOM changes (skip initial load) | ||
| setTimeout(() => { | ||
| const observer = new MutationObserver(() => markAsChanged()); | ||
| observer.observe(iframeDoc.body, { | ||
| childList: true, | ||
| subtree: true, | ||
| characterData: true, | ||
| }); | ||
| }, 2000); | ||
|
|
||
| // Monitor user input | ||
| ["input", "change", "keyup", "paste"].forEach((type) => { | ||
| iframeDoc.addEventListener(type, markAsChanged, true); | ||
| }); | ||
| } catch (e) { | ||
| console.warn("Cannot monitor iframe for changes:", e); | ||
| } | ||
| }, 1000); | ||
| } | ||
|
|
||
| onBeforeRouteLeave((to, from, next) => { | ||
| if (hasUnsavedChanges.value && !window.confirm("Unsaved changes will be lost. Continue?")) { | ||
| next(false); | ||
| } else { | ||
| next(); | ||
| } | ||
| }); | ||
|
|
||
| onMounted(async () => { | ||
| if (props.visualizationId) { | ||
| const { data, error } = await GalaxyApi().GET("/api/visualizations/{id}", { | ||
| params: { path: { id: props.visualizationId } }, | ||
| }); | ||
| if (error) { | ||
| errorMessage.value = error.err_msg; | ||
| } else if (data?.latest_revision?.config) { | ||
| visualizationConfig.value = data.latest_revision.config; | ||
| errorMessage.value = ""; | ||
| } else { | ||
| errorMessage.value = "Failed to access visualization details."; | ||
| } | ||
| } else { | ||
| visualizationConfig.value = { dataset_id: props.datasetId }; | ||
| } | ||
|
|
||
| window.addEventListener("beforeunload", (e) => { | ||
| if (hasUnsavedChanges.value) { | ||
| e.preventDefault(); | ||
| e.returnValue = ""; | ||
| } | ||
| }); | ||
| }); | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="position-relative h-100 overflow-hidden"> | ||
| <BAlert v-if="errorMessage" variant="danger" show> | ||
| {{ errorMessage }} | ||
| </BAlert> | ||
| <div v-else-if="isLoading" class="iframe-loading bg-light"> | ||
| <LoadingSpan message="Loading visualization" /> | ||
| </div> | ||
| <VisualizationFrame | ||
| v-if="visualizationConfig" | ||
| :config="visualizationConfig" | ||
| :name="visualization" | ||
| @load="handleLoad" /> | ||
| </div> | ||
| </template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.