Skip to content
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

Add Workflow Title and Annotation sections #18762

Merged
merged 26 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
88c6639
New component for Title and Annotation detail
hujambo-dunia Sep 3, 2024
122b1cc
Added expand/collapse for Annotation detail
hujambo-dunia Sep 3, 2024
829258b
Component upgrade, minor styling changes, code cleanup
hujambo-dunia Sep 10, 2024
87b7415
Cleaner error handling
hujambo-dunia Sep 10, 2024
0a11bec
Added Workflow header 'gray bar' for consistency with Tool Form page …
hujambo-dunia Sep 10, 2024
701a35a
Linting prettier
hujambo-dunia Sep 11, 2024
3eb9699
Update client/src/components/Workflow/Run/WorkflowRunName.vue
hujambo-dunia Sep 12, 2024
5ac81a4
Reverted changes to client/src/components/Workflow/Run/WorkflowRunFor…
hujambo-dunia Sep 12, 2024
f712553
Replaced with Workflow-Card component for design consistency with Wor…
hujambo-dunia Sep 19, 2024
a1ddc7f
Backend code formatting
hujambo-dunia Sep 24, 2024
ecb1fd1
Update lib/galaxy/managers/workflows.py
hujambo-dunia Oct 25, 2024
51f5de6
Update lib/galaxy/managers/workflows.py
hujambo-dunia Oct 25, 2024
625f5e3
Coding convention update
hujambo-dunia Oct 25, 2024
ab5bc43
Added reusability & consistency for Workflow headers on: Workflow Inv…
hujambo-dunia Nov 4, 2024
1715e96
Added reusability & consistency for Workflow headers on: Workflow Inv…
hujambo-dunia Nov 4, 2024
09346e6
update workflow annotation header with the following changes:
ahmedhamidawan Nov 4, 2024
b2625b3
adjust `WorkflowRunButton` jest for router push
ahmedhamidawan Nov 4, 2024
8947533
remove unused imports and props
ahmedhamidawan Nov 8, 2024
632955a
in fact do show the history in run form view; just say "Input History"
ahmedhamidawan Nov 8, 2024
fa9aa73
add a jest each for `WorkflowAnnotation` and `WorkflowNavigationTitle`
ahmedhamidawan Nov 9, 2024
baa3e55
include workflow error in `WorkflowNavigationTitle`
ahmedhamidawan Nov 9, 2024
9f1522b
prevent users from importing workflow over and over
ahmedhamidawan Nov 9, 2024
32c8c7c
add space below individual invocation id in `GridInvocation`
ahmedhamidawan Nov 12, 2024
3bd965b
add alert for no metrics, lint
ahmedhamidawan Nov 12, 2024
377c5cf
add badge for workflow run resulting in a new history
ahmedhamidawan Nov 13, 2024
aca94f4
fix jests for workflow header and job metrics
ahmedhamidawan Nov 13, 2024
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
4 changes: 4 additions & 0 deletions client/src/components/Common/ButtonSpinner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ interface Props {
wait?: boolean;
tooltip?: string;
disabled?: boolean;
size?: string;
}

withDefaults(defineProps<Props>(), {
wait: false,
tooltip: undefined,
disabled: false,
size: "md",
});
</script>

Expand All @@ -25,6 +27,7 @@ withDefaults(defineProps<Props>(), {
v-if="wait"
v-b-tooltip.hover.bottom
disabled
:size="size"
variant="info"
title="Please Wait..."
class="d-flex flex-nowrap align-items-center text-nowrap">
Expand All @@ -38,6 +41,7 @@ withDefaults(defineProps<Props>(), {
class="d-flex flex-nowrap align-items-center text-nowrap"
:title="tooltip"
:disabled="disabled"
:size="size"
@click="$emit('onClick')">
<FontAwesomeIcon :icon="faPlay" class="mr-2" />
{{ title }}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Grid/GridInvocation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function refreshTable() {
:extra-props="extraProps"
:embedded="forStoredWorkflow || forHistory || forBatch">
<template v-slot:expanded="{ rowData }">
<span class="position-absolute ml-4" :data-invocation-id="rowData.id">
<span class="mb-2" :data-invocation-id="rowData.id">
<small>
<b>Last updated: <UtcDate :date="rowData.update_time" mode="elapsed" />; Invocation ID:</b>
</small>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/History/SwitchToHistoryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function viewHistoryInNewTab(history: HistorySummary) {
<template>
<div>
<LoadingSpan v-if="!history" />
<div v-else class="history-link">
<div v-else class="history-link" data-description="switch to history link">
<BLink
v-b-tooltip.hover.top.noninteractive.html
data-description="switch to history link"
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/JobMetrics/JobMetrics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { getLocalVue } from "tests/jest/helpers";

import JobMetrics from "./JobMetrics";

const NO_METRICS_MESSAGE = "No metrics available for this job.";

// Ignore all axios calls, data is mocked locally -- just say "OKAY!"
jest.mock("axios", () => ({
get: async () => {
Expand All @@ -26,7 +28,8 @@ describe("JobMetrics/JobMetrics.vue", () => {
});

await wrapper.vm.$nextTick();
expect(wrapper.find("div").exists()).toBe(false);
const alert = wrapper.find(".alert-info");
expect(alert.text()).toBe(NO_METRICS_MESSAGE);
});

it("should group plugins by type", async () => {
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/JobMetrics/JobMetrics.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { BAlert } from "bootstrap-vue";
import { computed, ref, unref, watch } from "vue";

import { useJobMetricsStore } from "@/stores/jobMetricsStore";
Expand Down Expand Up @@ -217,4 +218,5 @@ const estimatedServerInstance = computed(() => {
:cores-allocated="coresAllocated"
:memory-allocated-in-mebibyte="memoryAllocatedInMebibyte" />
</div>
<BAlert v-else variant="info" show> No metrics available for this job. </BAlert>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ const route = useRoute();
const router = useRouter();

function cardClicked(invocation: WorkflowInvocation) {
let path = `/workflows/invocations/${invocation.id}`;
if (props.inPanel) {
path += "?from_panel=true";
emit("invocation-clicked");
}
router.push(path);
router.push(`/workflows/invocations/${invocation.id}`);
}

function scrollToTop() {
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/Workflow/List/WorkflowIndicators.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ library.add(faFileImport, faGlobe, faShieldAlt, faUsers, faUser);
interface Props {
workflow: any;
publishedView: boolean;
noEditTime?: boolean;
}

const props = defineProps<Props>();
Expand Down Expand Up @@ -118,7 +119,7 @@ function onViewUserPublished() {
<FontAwesomeIcon :icon="faFileImport" fixed-width @click="onCopyLink" />
</BButton>

<span class="mr-1">
<span v-if="!noEditTime" class="mr-1">
<small>
edited
<UtcDate :date="workflow.update_time" mode="elapsed" />
Expand All @@ -136,8 +137,9 @@ function onViewUserPublished() {
</BBadge>

<BBadge
v-if="publishedView"
v-if="publishedView && workflow.published"
v-b-tooltip.noninteractive.hover
data-description="published owner badge"
class="outline-badge cursor-pointer mx-1"
:title="publishedTitle"
@click="onViewUserPublished">
Expand Down
96 changes: 51 additions & 45 deletions client/src/components/Workflow/Run/WorkflowRunFormSimple.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
<template>
<div>
<div v-if="isConfigLoaded" class="h4 clearfix mb-3">
<div v-if="isConfigLoaded">
<BAlert v-if="!canRunOnHistory" variant="warning" show>
<span v-localize>
The workflow cannot run because the current history is immutable. Please select a different history
or send the results to a new one using the run settings ⚙️
</span>
</BAlert>
<b>Workflow: {{ model.name }}</b> <i>(version: {{ model.runData.version + 1 }})</i>
<ButtonSpinner
id="run-workflow"
:wait="waitingForRequest"
:disabled="hasValidationErrors || !canRunOnHistory"
class="float-right"
title="Run Workflow"
@onClick="onExecute" />
<b-dropdown
v-if="showRuntimeSettings(currentUser)"
id="dropdown-form"
ref="dropdown"
class="workflow-run-settings float-right"
style="margin-right: 10px"
title="Workflow Run Settings"
no-caret>
<template v-slot:button-content>
<span class="fa fa-cog" />
<WorkflowNavigationTitle
:workflow-id="model.runData.workflow_id"
:run-disabled="hasValidationErrors || !canRunOnHistory"
:run-waiting="waitingForRequest"
@on-execute="onExecute">
<template v-slot:workflow-run-actions>
<b-dropdown
v-if="showRuntimeSettings(currentUser)"
id="dropdown-form"
ref="dropdown"
class="workflow-run-settings"
title="Workflow Run Settings"
size="sm"
variant="link"
no-caret>
<template v-slot:button-content>
<span class="fa fa-cog" />
</template>
<b-dropdown-form>
<b-form-checkbox v-model="sendToNewHistory" class="workflow-run-settings-target">
Send results to a new history
</b-form-checkbox>
<b-form-checkbox
v-if="reuseAllowed(currentUser)"
v-model="useCachedJobs"
title="This may skip executing jobs that you have already run.">
Attempt to re-use jobs with identical parameters?
</b-form-checkbox>
<b-form-checkbox
v-if="isConfigLoaded && config.object_store_allows_id_selection"
v-model="splitObjectStore">
Send outputs and intermediate to different storage locations?
</b-form-checkbox>
<WorkflowStorageConfiguration
v-if="isConfigLoaded && config.object_store_allows_id_selection"
:split-object-store="splitObjectStore"
:invocation-preferred-object-store-id="preferredObjectStoreId"
:invocation-intermediate-preferred-object-store-id="preferredIntermediateObjectStoreId"
@updated="onStorageUpdate">
</WorkflowStorageConfiguration>
</b-dropdown-form>
</b-dropdown>
</template>
<b-dropdown-form>
<b-form-checkbox v-model="sendToNewHistory" class="workflow-run-settings-target">
Send results to a new history
</b-form-checkbox>
<b-form-checkbox
v-if="reuseAllowed(currentUser)"
v-model="useCachedJobs"
title="This may skip executing jobs that you have already run.">
Attempt to re-use jobs with identical parameters?
</b-form-checkbox>
<b-form-checkbox
v-if="isConfigLoaded && config.object_store_allows_id_selection"
v-model="splitObjectStore">
Send outputs and intermediate to different storage locations?
</b-form-checkbox>
<WorkflowStorageConfiguration
v-if="isConfigLoaded && config.object_store_allows_id_selection"
:split-object-store="splitObjectStore"
:invocation-preferred-object-store-id="preferredObjectStoreId"
:invocation-intermediate-preferred-object-store-id="preferredIntermediateObjectStoreId"
@updated="onStorageUpdate">
</WorkflowStorageConfiguration>
</b-dropdown-form>
</b-dropdown>
</WorkflowNavigationTitle>
</div>

<WorkflowAnnotation :workflow-id="model.runData.workflow_id" :history-id="model.historyId" show-details />
<FormDisplay
:inputs="formInputs"
:allow-empty-value-on-required-input="true"
Expand All @@ -62,7 +65,6 @@
</template>

<script>
import ButtonSpinner from "components/Common/ButtonSpinner";
import FormDisplay from "components/Form/FormDisplay";
import { allowCachedJobs } from "components/Tool/utilities";
import { isWorkflowInput } from "components/Workflow/constants";
Expand All @@ -76,10 +78,14 @@ import { useUserStore } from "@/stores/userStore";
import { invokeWorkflow } from "./services";
import WorkflowStorageConfiguration from "./WorkflowStorageConfiguration";

import WorkflowAnnotation from "../../Workflow/WorkflowAnnotation.vue";
import WorkflowNavigationTitle from "../WorkflowNavigationTitle.vue";

export default {
components: {
ButtonSpinner,
FormDisplay,
WorkflowAnnotation,
WorkflowNavigationTitle,
WorkflowStorageConfiguration,
},
props: {
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Workflow/Run/WorkflowRunSuccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const targetHistories = props.invocations.reduce((histories, invocation) => {
}, [] as string[]);
const wasNewHistoryTarget =
props.invocations.length > 0 &&
props.invocations[0]?.history_id &&
!!props.invocations[0]?.history_id &&
historyStore.currentHistoryId !== props.invocations[0].history_id;
</script>

Expand All @@ -51,7 +51,7 @@ const wasNewHistoryTarget =
<WorkflowInvocationState
v-else-if="props.invocations.length === 1 && props.invocations[0]"
:invocation-id="props.invocations[0].id"
:new-history-target="wasNewHistoryTarget ? props.invocations[0].history_id : undefined"
:new-history-target="wasNewHistoryTarget"
is-full-page
success />
<div id="webhook-view"></div>
Expand Down
Loading
Loading