Skip to content

Commit

Permalink
Merge pull request #1087 from PrefectHQ/issue-548
Browse files Browse the repository at this point in the history
Disable start run button for late flow runs
  • Loading branch information
zhen0 authored Oct 19, 2021
2 parents 96490c5 + ef7dada commit 37013f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Bugfixes

- Disable start run button for late flow runs -[#1087](https://github.com/PrefectHQ/ui/pull/1087)
- Filter by scheduled runs in the Flow runs table - [#1079](https://github.com/PrefectHQ/ui/pull/1079)

- When editing a schedule, update the action button to "Save" - [#1083](https://github.com/PrefectHQ/ui/pull/1083)
Expand Down
9 changes: 8 additions & 1 deletion src/pages/FlowRun/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export default {
this.failedTaskRuns?.length > 0 ||
this.eligibleStates.includes(this.flowRun.state)
)
},
isLateRun() {
return new Date() - new Date(this.flowRun.scheduled_start_time) > 20000
}
},
watch: {
Expand Down Expand Up @@ -144,7 +147,8 @@ export default {
depressed
:loading="runFlowNowLoading"
:disabled="
runFlowNowLoading ||
isLateRun ||
runFlowNowLoading ||
runFlowNowClicked ||
!hasPermission('create', 'run')
"
Expand All @@ -162,6 +166,9 @@ export default {
<span v-else-if="runFlowNowClicked">
This flow run has been scheduled to start as soon as possible.
</span>
<span v-else-if="isLateRun">
Flow run already scheduled to start.
</span>
<span v-else>
Start this flow run immediately
</span>
Expand Down

0 comments on commit 37013f4

Please sign in to comment.