-
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.
Merge pull request #18615 from ahmedhamidawan/invocation_view_improve…
…ments Workflow Invocation view improvements
- Loading branch information
Showing
40 changed files
with
1,070 additions
and
1,017 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,80 @@ | ||
import { faEye } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
import { type WorkflowInvocation } from "@/api/invocations"; | ||
import { getAppRoot } from "@/onload"; | ||
|
||
import { type FieldArray, type GridConfig } from "./types"; | ||
|
||
/** | ||
* Request and return invocations for the given workflow (and current user) from server | ||
*/ | ||
async function getData( | ||
offset: number, | ||
limit: number, | ||
search: string, | ||
sort_by: string, | ||
sort_desc: boolean, | ||
extraProps?: Record<string, unknown> | ||
) { | ||
// extra props will be Record<string, Invocation>; get array of invocations | ||
const data = Object.values(extraProps ?? {}) as WorkflowInvocation[]; | ||
const totalMatches = data.length; | ||
return [data, totalMatches]; | ||
} | ||
|
||
/** | ||
* Declare columns to be displayed | ||
*/ | ||
const fields: FieldArray = [ | ||
{ | ||
key: "expand", | ||
title: null, | ||
type: "expand", | ||
}, | ||
{ | ||
key: "view", | ||
title: "View", | ||
type: "button", | ||
icon: faEye, | ||
handler: (data) => { | ||
const url = `${getAppRoot()}workflows/invocations/${(data as WorkflowInvocation).id}`; | ||
window.open(url, "_blank"); | ||
}, | ||
converter: () => "", | ||
}, | ||
{ | ||
key: "history_id", | ||
title: "History", | ||
type: "history", | ||
}, | ||
{ | ||
key: "create_time", | ||
title: "Invoked", | ||
type: "date", | ||
}, | ||
{ | ||
key: "state", | ||
title: "State", | ||
type: "helptext", | ||
converter: (data) => { | ||
const invocation = data as WorkflowInvocation; | ||
return `galaxy.invocations.states.${invocation.state}`; | ||
}, | ||
}, | ||
]; | ||
|
||
/** | ||
* Grid configuration | ||
*/ | ||
const gridConfig: GridConfig = { | ||
id: "invocations-batch-grid", | ||
fields: fields, | ||
getData: getData, | ||
plural: "Workflow Invocations", | ||
sortBy: "create_time", | ||
sortDesc: true, | ||
sortKeys: [], | ||
title: "Workflow Invocations in Batch", | ||
}; | ||
|
||
export default gridConfig; |
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
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,7 @@ | ||
import { formatDuration, intervalToDuration } from "date-fns"; | ||
|
||
import type { JobBaseModel } from "@/api/jobs"; | ||
|
||
export function getJobDuration(job: JobBaseModel): string { | ||
return formatDuration(intervalToDuration({ start: new Date(job.create_time), end: new Date(job.update_time) })); | ||
} |
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 |
---|---|---|
@@ -1,22 +1,35 @@ | ||
<script setup lang="ts"> | ||
import { BAlert } from "bootstrap-vue"; | ||
import { storeToRefs } from "pinia"; | ||
import { ref } from "vue"; | ||
import { useUserStore } from "@/stores/userStore"; | ||
import InvocationScrollList from "../Workflow/Invocation/InvocationScrollList.vue"; | ||
import ActivityPanel from "./ActivityPanel.vue"; | ||
const { currentUser, toggledSideBar } = storeToRefs(useUserStore()); | ||
const shouldCollapse = ref(false); | ||
function collapseOnLeave() { | ||
if (shouldCollapse.value) { | ||
toggledSideBar.value = ""; | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events --> | ||
<ActivityPanel | ||
title="Workflow Invocations" | ||
go-to-all-title="Open Invocations List" | ||
href="/workflows/invocations" | ||
@goToAll="toggledSideBar = ''"> | ||
<InvocationScrollList v-if="currentUser && !currentUser?.isAnonymous" in-panel /> | ||
@goToAll="shouldCollapse = true" | ||
@mouseleave.native="collapseOnLeave"> | ||
<InvocationScrollList | ||
v-if="currentUser && !currentUser?.isAnonymous" | ||
in-panel | ||
@invocation-clicked="shouldCollapse = true" /> | ||
<BAlert v-else variant="info" class="mt-3" show>Please log in to view your Workflow Invocations.</BAlert> | ||
</ActivityPanel> | ||
</template> |
Oops, something went wrong.