-
Notifications
You must be signed in to change notification settings - Fork 19
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 #1135 from PrefectHQ/feature/flow-run-timeline-opt…
…ions add layout and hide edges options to timeline
- Loading branch information
Showing
5 changed files
with
164 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,84 @@ | ||
<template> | ||
<p-pop-over | ||
class="flow-run-timeline-options" | ||
auto-close | ||
:placement="placement" | ||
> | ||
<template #target="{ toggle }"> | ||
<p-button | ||
aria-label="Flow Run Timeline Options" | ||
icon="CogIcon" | ||
flat | ||
@click="toggle" | ||
/> | ||
</template> | ||
<div class="flow-run-timeline-options__popover"> | ||
<p-overflow-menu> | ||
<div class="flow-run-timeline-options__popover-option-set"> | ||
<p-radio-group v-model="layoutModel" :options="layoutOptions"> | ||
<template #label="{ option }"> | ||
{{ option.label }} | ||
</template> | ||
</p-radio-group> | ||
</div> | ||
<div class="flow-run-timeline-options__popover-option-set"> | ||
<p-checkbox v-model="hideDependencyArrowsModel" label="Hide Dependency Arrows" /> | ||
</div> | ||
</p-overflow-menu> | ||
</div> | ||
</p-pop-over> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { TimelineNodesLayoutOptions } from '@prefecthq/graphs' | ||
import { PButton, positions, PPopOver } from '@prefecthq/prefect-design' | ||
import { computed } from 'vue' | ||
const props = defineProps<{ | ||
layout: TimelineNodesLayoutOptions, | ||
hideEdges: boolean, | ||
}>() | ||
const emit = defineEmits<{ | ||
(event: 'update:layout', value: TimelineNodesLayoutOptions): void, | ||
(event: 'update:hideEdges', value: boolean): void, | ||
}>() | ||
const placement = [positions.topRight, positions.bottomRight, positions.topLeft, positions.bottomLeft] | ||
const layoutOptions: { | ||
value: TimelineNodesLayoutOptions, | ||
label: string, | ||
}[] = [ | ||
{ | ||
value: 'nearestParent', | ||
label: 'Nearest Parent Layout', | ||
}, { | ||
value: 'waterfall', | ||
label: 'Waterfall Layout (fast)', | ||
}, | ||
] | ||
const layoutModel = computed({ | ||
get: () => props.layout, | ||
set: (layout) => emit('update:layout', layout), | ||
}) | ||
const hideDependencyArrowsModel = computed({ | ||
get: () => props.hideEdges, | ||
set: () => emit('update:hideEdges', !props.hideEdges), | ||
}) | ||
</script> | ||
|
||
<style> | ||
.flow-run-timeline-options { @apply | ||
inline-block | ||
} | ||
.flow-run-timeline-options__popover { @apply | ||
py-1 | ||
} | ||
.flow-run-timeline-options__popover-option-set { @apply | ||
p-3 | ||
} | ||
</style> |
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