Skip to content

Commit

Permalink
add force prop to WorkflowRunButton for routing
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Sep 20, 2024
1 parent f5ef84a commit 8e6449a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/components/Workflow/WorkflowRunButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ interface Props {
title?: string;
disabled?: boolean;
version?: number;
force?: boolean;
}
const props = defineProps<Props>();
const runPath = computed(
() => `/workflows/run?id=${props.id}${props.version !== undefined ? `&version=${props.version}` : ""}`
);
function forceRunPath() {
if (props.force) {
window.open(runPath.value);
}
}
</script>

<template>
Expand All @@ -31,7 +38,8 @@ const runPath = computed(
variant="primary"
size="sm"
:disabled="disabled"
:to="runPath">
:to="runPath"
@click="forceRunPath">
<FontAwesomeIcon :icon="faPlay" fixed-width />
<span v-if="full" v-localize>Run</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const jobStatesStr = computed(() => {
"
:disabled="workflow.deleted"
full
force
:version="workflow.version" />
</BButtonGroup>
</div>
Expand Down

0 comments on commit 8e6449a

Please sign in to comment.