Skip to content

Commit

Permalink
Merge pull request #18762 from hujambo-dunia/enhance-workflow-detail
Browse files Browse the repository at this point in the history
Add Workflow Title and Annotation sections
  • Loading branch information
dannon authored Nov 15, 2024
2 parents bf5e8cb + aca94f4 commit f67dc5c
Show file tree
Hide file tree
Showing 21 changed files with 858 additions and 541 deletions.
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

0 comments on commit f67dc5c

Please sign in to comment.