Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
573fde0
Ensure that vega dom is available when changes are to be applied
guerler Mar 18, 2025
8b0d19c
Switch template filter to rely on yaml instead of json
guerler Mar 18, 2025
242d309
Accept workflow labels in cell editor
guerler Mar 18, 2025
bbda568
Add icons and logos to dropdown options
guerler Mar 18, 2025
761d823
Move cell rendering to separate section wrapper component
guerler Mar 18, 2025
3176f65
Adjust configuration requirement handler to consume yml instead of json
guerler Mar 18, 2025
1df79c7
Replace requirements.json by requirements.yml in markdown editor
guerler Mar 18, 2025
b4a225d
Remove unused types module
guerler Mar 18, 2025
c39704c
Replace templates.json with template.yml
guerler Mar 18, 2025
3379082
Adjust markdown editor types
guerler Mar 18, 2025
e6c3136
Use types in label selector
guerler Mar 18, 2025
2527fdc
Revise markdown viewer, move and fix updated date to bottom, align st…
guerler Mar 18, 2025
209c446
Revise Markdown Dialog wrapper to use updated types
guerler Mar 18, 2025
08b41cb
Revise error handling in collection display component
guerler Mar 18, 2025
b35f764
Add history dataset details test
guerler Mar 18, 2025
8fa1835
Fix history dataset details display
guerler Mar 18, 2025
4e0cee7
Adjust invocation time wrapper
guerler Mar 18, 2025
9053d57
Remove debug statement from job parameters component
guerler Mar 18, 2025
5331d8e
Parse labels to markdown wrapper
guerler Mar 18, 2025
901d514
Add markdown component section wrapper
guerler Mar 18, 2025
493a821
Modularize markdown invocation label parser
guerler Mar 18, 2025
24fc22a
Move labels parser to modules, remove unused prop from selection dialog
guerler Mar 18, 2025
3125e5d
Remove unused styles
guerler Mar 18, 2025
f8edc63
Update and correct visualization xmls embeddable flag setting
guerler Mar 18, 2025
37961b4
Sort markdown arguments alphabetically
guerler Mar 18, 2025
611dcfc
Switch embeddable default in visualization xmls to false
guerler Mar 18, 2025
74c3cd5
Hide textarea field showing unstructured markdown text when moving fr…
guerler Mar 18, 2025
72763bd
Adjust markdown selector
guerler Mar 18, 2025
1a25f02
Adjust markdown toolbox labels import
guerler Mar 18, 2025
25cb212
Fix import order
guerler Mar 18, 2025
741bc92
Remove z-index adjustment due to potential conflicts
guerler Mar 18, 2025
b792aa2
Adjust markdown galaxy wrapper test
guerler Mar 18, 2025
febaee6
Pass steps to markdown toolbox for now
guerler Mar 18, 2025
ea61706
Update the heatmap visualization logo to center the squares
guerler Mar 18, 2025
1027d31
Adjust has labels condition
guerler Mar 18, 2025
4ddb37b
Adjust handling in legacy markdown toolbox panel
guerler Mar 18, 2025
dd506bc
Update heatmap, fix tooltip color
guerler Mar 18, 2025
196b880
Update client/src/components/Markdown/Utilities/parseInvocation.ts
guerler Mar 19, 2025
727d6cc
Update client/src/components/Markdown/MarkdownDialog.vue
guerler Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions client/src/components/Common/VegaWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<b-alert v-if="errorMessage" class="p-2" variant="danger" show>
{{ errorMessage }}
</b-alert>
<div ref="chartContainer" :style="style" />
<div ref="chartContainer" :class="fillWidth && 'w-100'" />
</div>
</template>

<script setup lang="ts">
import { useResizeObserver } from "@vueuse/core";
import embed, { type VisualizationSpec } from "vega-embed";
import { computed, onBeforeUnmount, ref, watch } from "vue";
import { nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";

export interface VisSpec {
spec: VisualizationSpec;
Expand All @@ -21,20 +21,14 @@ const props = withDefaults(defineProps<VisSpec>(), {
fillWidth: true,
});

const style = computed(() => {
if (props.fillWidth) {
return { width: "100%" };
}
return {};
});

const chartContainer = ref<HTMLDivElement | null>(null);
const errorMessage = ref<string>("");

let vegaView: any;

async function embedChart() {
try {
await nextTick();
if (vegaView) {
vegaView.finalize();
}
Expand All @@ -48,13 +42,16 @@ async function embedChart() {
}
}

watch(props, embedChart, { deep: true, immediate: true });
watch(props, embedChart, { deep: true });

useResizeObserver(chartContainer, () => {
if (vegaView) {
vegaView.resize();
}
});

onMounted(() => embedChart());

// Cleanup the chart when the component is unmounted
onBeforeUnmount(() => {
if (vegaView) {
Expand Down
16 changes: 4 additions & 12 deletions client/src/components/Markdown/Editor/CellAdd.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ import DelayedInput from "@/components/Common/DelayedInput.vue";
import Popper from "@/components/Popper/Popper.vue";

jest.mock("./templates", () => ({
cellTemplates: [
{
name: "Category 1",
templates: [
{ title: "Option A", description: "Desc A", cell: { id: 1 } },
{ title: "Option B", description: "Desc B", cell: { id: 2 } },
],
},
{
name: "Category 2",
templates: [{ title: "Option C", description: "Desc C", cell: { id: 3 } }],
},
"Category 1": [
{ title: "Option A", description: "Desc A", cell: { id: 1 } },
{ title: "Option B", description: "Desc B", cell: { id: 2 } },
],
"Category 2": [{ title: "Option C", description: "Desc C", cell: { id: 3 } }],
}));

const createContainer = (tag = "div") => {
Expand Down
33 changes: 18 additions & 15 deletions client/src/components/Markdown/Editor/CellAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
<Popper v-if="buttonRef" :reference-el="buttonRef.$el" trigger="click" placement="right" mode="light">
<DelayedInput class="p-1" :delay="100" placeholder="Search" @change="query = $event" />
<div class="cell-add-categories overflow-auto">
<div v-if="filteredTemplates.length > 0">
<div v-for="(category, categoryIndex) of filteredTemplates" :key="categoryIndex">
<div v-if="Object.keys(filteredTemplates).length > 0">
<div v-for="(templates, categoryName) of filteredTemplates" :key="categoryName">
<hr class="solid m-0" />
<span class="d-flex justify-content-between">
<small class="my-1 mx-3 text-info">{{ category.name }}</small>
<small class="my-1 mx-3 text-info">{{ categoryName }}</small>
</span>
<div v-if="category.templates.length > 0" class="cell-add-options popper-close">
<div v-if="templates.length > 0" class="cell-add-options popper-close">
<CellOption
v-for="(option, optionIndex) of category.templates"
v-for="(option, optionIndex) of templates"
:key="optionIndex"
:title="option.title"
:description="option.description"
:logo="option.logo"
@click="$emit('click', { configure: false, toggle: true, ...option.cell })" />
</div>
</div>
Expand All @@ -31,8 +32,8 @@ import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { BAlert } from "bootstrap-vue";
import { computed, ref } from "vue";

import { cellTemplates } from "./templates";
import type { CellType, TemplateCategory } from "./types";
import cellTemplates from "./templates.yml";
import type { CellType, TemplateEntry } from "./types";

import CellButton from "./CellButton.vue";
import CellOption from "./CellOption.vue";
Expand All @@ -46,20 +47,22 @@ defineEmits<{
const buttonRef = ref();
const query = ref("");

const allTemplates = computed(() => {
const result = { ...(cellTemplates as Record<string, Array<TemplateEntry>>) };
return result;
});

const filteredTemplates = computed(() => {
const filteredCategories: Array<TemplateCategory> = [];
cellTemplates.forEach((category) => {
const matchedTemplates = category.templates.filter(
const filteredCategories: Record<string, TemplateEntry[]> = {};
Object.entries(allTemplates.value).forEach(([categoryName, templates]) => {
const matchedTemplates = templates.filter(
(template) =>
category.name.toLowerCase().includes(query.value.toLowerCase()) ||
categoryName.toLowerCase().includes(query.value.toLowerCase()) ||
template.title.toLowerCase().includes(query.value.toLowerCase()) ||
template.description.toLowerCase().includes(query.value.toLowerCase())
);
if (matchedTemplates.length > 0) {
filteredCategories.push({
name: category.name,
templates: matchedTemplates,
});
filteredCategories[categoryName] = matchedTemplates;
}
});
return filteredCategories;
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/Markdown/Editor/CellEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<CellWrapper
:cell-index="cellIndex"
:cell-total="cells.length"
:name="cell.name"
:content="cell.content"
:configure="cell.configure"
:labels="labels"
:name="cell.name"
:toggle="cell.toggle"
@configure="onConfigure(cellIndex)"
@change="onChange(cellIndex, $event)"
Expand All @@ -27,13 +28,14 @@ import { nextTick, ref } from "vue";

import { parseMarkdown } from "@/components/Markdown/parse";

import type { CellType } from "./types";
import type { CellType, WorkflowLabel } from "./types";

import CellAdd from "./CellAdd.vue";
import CellWrapper from "./CellWrapper.vue";

const props = defineProps<{
markdownText: string;
labels?: Array<WorkflowLabel>;
}>();

const emit = defineEmits(["update"]);
Expand Down
19 changes: 15 additions & 4 deletions client/src/components/Markdown/Editor/CellOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@
<div class="font-weight-bold">{{ title }}</div>
<small v-if="description" class="d-inline-block text-wrap text-break">{{ description }}</small>
</div>
<div v-if="icon" class="my-2 mx-3 align-self-center">
<FontAwesomeIcon :icon="icon" />
<div v-if="icon" class="my-2 mx-3 align-self-start">
<FontAwesomeIcon :icon="icon" class="cell-option-icon" />
</div>
<div v-else-if="logo" class="my-2 mx-3 align-self-start">
<Img class="cell-option-logo" :src="logo" :alt="title" />
</div>
</span>
</template>

<script setup lang="ts">
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import type { IconDefinition } from "font-awesome-6";

defineProps<{
title: string;
description?: string;
icon?: any;
description: string;
icon?: IconDefinition;
logo?: string;
}>();

defineEmits<{
Expand All @@ -38,5 +43,11 @@ defineEmits<{
small {
color: $text-muted;
}
.cell-option-icon {
font-size: 1rem;
}
.cell-option-logo {
width: 2rem;
}
}
</style>
28 changes: 18 additions & 10 deletions client/src/components/Markdown/Editor/CellWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
<CellButton v-if="toggle" title="Collapse" :icon="faAngleDoubleUp" />
<CellButton v-else title="Expand" :icon="faAngleDoubleDown" />
</div>
<div class="w-100">
<div class="m-2">
<MarkdownDefault v-if="name === 'markdown'" :content="content" />
<MarkdownGalaxy v-else-if="name === 'galaxy'" :content="content" />
<b-alert v-else variant="danger" show> This cell type `{{ name }}` is not available. </b-alert>
</div>
</div>
<SectionWrapper
class="m-2 w-100"
:name="name"
:content="content"
:labels="labels"
@change="$emit('change', $event)" />
</div>
<div v-if="toggle" class="d-flex">
<div class="d-flex flex-column" :class="{ 'cell-wrapper-hover': hover }">
Expand All @@ -34,9 +33,16 @@
v-if="name === 'galaxy' && configure"
:name="name"
:content="content"
:labels="labels"
@cancel="$emit('configure')"
@change="handleConfigure($event)" />
<CellCode :key="name" class="mt-1" :value="content" :mode="mode" @change="$emit('change', $event)" />
<CellCode
:key="name"
class="mt-1"
:value="content"
:max-lines="30"
:mode="mode"
@change="$emit('change', $event)" />
<small class="cell-wrapper-type position-absolute">
{{ VALID_TYPES.includes(name) ? name : "unknown" }}
</small>
Expand All @@ -49,12 +55,13 @@
import { faAngleDoubleDown, faAngleDoubleUp } from "@fortawesome/free-solid-svg-icons";
import { computed, ref } from "vue";

import MarkdownDefault from "../Sections/MarkdownDefault.vue";
import MarkdownGalaxy from "../Sections/MarkdownGalaxy.vue";
import type { WorkflowLabel } from "./types";

import CellAction from "./CellAction.vue";
import CellButton from "./CellButton.vue";
import CellCode from "./CellCode.vue";
import ConfigureGalaxy from "./Configurations/ConfigureGalaxy.vue";
import SectionWrapper from "@/components/Markdown/Sections/SectionWrapper.vue";

const VALID_TYPES = ["galaxy", "markdown", "vega", "visualization", "vitessce"];

Expand All @@ -63,6 +70,7 @@ const props = defineProps<{
cellTotal: number;
configure?: boolean;
content: string;
labels?: Array<WorkflowLabel>;
name: string;
toggle?: boolean;
}>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:argument-type="requirement"
:argument-name="contentObject?.name"
:argument-payload="contentObject?.args"
:useLabels="false"
:labels="labels"
@onInsert="$emit('change', $event)"
@onCancel="$emit('cancel')" />
<b-alert v-else v-localize variant="info" show>
Expand All @@ -16,14 +16,16 @@
<script setup lang="ts">
import { computed, type Ref, ref, watch } from "vue";

import type { WorkflowLabel } from "@/components/Markdown/Editor/types";
import { getArgs } from "@/components/Markdown/parse";

import REQUIREMENTS from "./requirements";
import REQUIREMENTS from "./requirements.yml";

import MarkdownDialog from "@/components/Markdown/MarkdownDialog.vue";

const props = defineProps<{
content: string;
labels?: Array<WorkflowLabel>;
}>();

defineEmits<{
Expand All @@ -43,7 +45,7 @@ const requirement = computed(() => {
const name = contentObject.value?.name || "";
if (name) {
for (const [key, values] of Object.entries(REQUIREMENTS)) {
if (values.includes(name)) {
if (Array.isArray(values) && values.includes(name)) {
return key;
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
history_dataset_collection_id:
- history_dataset_collection_display
history_dataset_id:
- history_dataset_display
- history_dataset_info
- history_dataset_index
- history_dataset_type
- history_dataset_embedded
- history_dataset_as_table
- history_dataset_as_image
- history_dataset_link
- history_dataset_name
- history_dataset_peek
history_id:
- history_link
invocation_id:
- invocation_inputs
- invocation_outputs
- invocation_time
job_id:
- job_metrics
- job_parameters
- tool_stderr
- tool_stdout
workflow_id:
- workflow_display
- workflow_image
- workflow_license
11 changes: 0 additions & 11 deletions client/src/components/Markdown/Editor/Configurations/types.ts

This file was deleted.

Loading
Loading