@prefecthq/prefect-ui-library 3.9.0 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RunsPageWithDefaultFilter-BW_RCryM.mjs → RunsPageWithDefaultFilter-Dr_frEsA.mjs} +2 -2
- package/dist/{RunsPageWithDefaultFilter-BW_RCryM.mjs.map → RunsPageWithDefaultFilter-Dr_frEsA.mjs.map} +1 -1
- package/dist/{WorkQueueToWorkPoolQueueRedirect-CF3WoI-i.mjs → WorkQueueToWorkPoolQueueRedirect-S9gTIj4p.mjs} +2 -2
- package/dist/{WorkQueueToWorkPoolQueueRedirect-CF3WoI-i.mjs.map → WorkQueueToWorkPoolQueueRedirect-S9gTIj4p.mjs.map} +1 -1
- package/dist/{index-L2npLPSH.mjs → index-BfIxla2D.mjs} +2354 -2375
- package/dist/{index-L2npLPSH.mjs.map → index-BfIxla2D.mjs.map} +1 -1
- package/dist/prefect-ui-library.mjs +1 -1
- package/dist/prefect-ui-library.umd.js +34 -34
- package/dist/prefect-ui-library.umd.js.map +1 -1
- package/dist/types/src/components/FlowRunMenu.vue.d.ts +6 -3
- package/dist/types/src/schemas/compositions/useSchemaPropertyInput.d.ts +1 -3
- package/package.json +1 -1
- package/src/components/FlowRunMenu.vue +25 -27
- package/src/components/PageHeadingFlowRun.vue +6 -6
- package/src/schemas/components/SchemaFormPropertyUnknown.vue +1 -1
- package/src/schemas/compositions/useSchemaPropertyInput.ts +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { FlowRun } from '../models';
|
|
1
2
|
declare function __VLS_template(): {
|
|
2
3
|
slots: {
|
|
3
4
|
default?(_: {
|
|
4
|
-
flowRun:
|
|
5
|
+
flowRun: FlowRun;
|
|
5
6
|
}): any;
|
|
6
7
|
};
|
|
7
8
|
refs: {};
|
|
@@ -9,15 +10,17 @@ declare function __VLS_template(): {
|
|
|
9
10
|
};
|
|
10
11
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
12
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
12
|
-
|
|
13
|
+
flowRun: FlowRun;
|
|
13
14
|
showAll?: boolean;
|
|
14
15
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
16
|
delete: (...args: any[]) => void;
|
|
17
|
+
update: (...args: any[]) => void;
|
|
16
18
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
17
|
-
|
|
19
|
+
flowRun: FlowRun;
|
|
18
20
|
showAll?: boolean;
|
|
19
21
|
}>>> & {
|
|
20
22
|
onDelete?: ((...args: any[]) => any) | undefined;
|
|
23
|
+
onUpdate?: ((...args: any[]) => any) | undefined;
|
|
21
24
|
}, {}, {}>;
|
|
22
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
26
|
export default _default;
|
|
@@ -203,9 +203,7 @@ export declare function useSchemaPropertyInput(schemaProperty: MaybeRefOrGetter<
|
|
|
203
203
|
"onUpdate:value"?: ((args_0: import("../../schemas/types/schemaValues").PrefectKindWorkspaceVariable) => any) | undefined;
|
|
204
204
|
}, never>, ""> & Record<string, unknown>;
|
|
205
205
|
} | {
|
|
206
|
-
component: () =>
|
|
207
|
-
template: string;
|
|
208
|
-
};
|
|
206
|
+
component: () => string;
|
|
209
207
|
props?: (Omit<unknown, ""> & Record<string, unknown>) | undefined;
|
|
210
208
|
}>;
|
|
211
209
|
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<p-overflow-menu-item v-if="canSuspend && showAll" label="Pause" @click="openSuspendModal" />
|
|
8
8
|
<p-overflow-menu-item v-if="canCancel && showAll" label="Cancel" @click="openCancelModal" />
|
|
9
9
|
<p-overflow-menu-item v-if="canChangeState" label="Change state" @click="openChangeStateModal" />
|
|
10
|
-
<copy-overflow-menu-item label="Copy ID" :item="
|
|
10
|
+
<copy-overflow-menu-item label="Copy ID" :item="flowRun.id" />
|
|
11
11
|
<p-overflow-menu-item v-if="can.delete.flow_run" label="Delete" @click="openDeleteModal" />
|
|
12
12
|
|
|
13
13
|
<slot v-bind="{ flowRun }" />
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
:flow-run="flowRun"
|
|
22
22
|
/>
|
|
23
23
|
|
|
24
|
-
<FlowRunResumeModal v-model:showModal="showResumeModal" :flow-run-id="
|
|
24
|
+
<FlowRunResumeModal v-model:showModal="showResumeModal" :flow-run-id="flowRun.id" />
|
|
25
25
|
|
|
26
26
|
<FlowRunCancelModal
|
|
27
27
|
v-model:showModal="showCancelModal"
|
|
28
|
-
:flow-run-id="
|
|
28
|
+
:flow-run-id="flowRun.id"
|
|
29
29
|
@change="showCancelModal"
|
|
30
30
|
/>
|
|
31
31
|
<FlowRunSuspendModal
|
|
32
32
|
v-model:showModal="showSuspendModal"
|
|
33
|
-
:flow-run-id="
|
|
33
|
+
:flow-run-id="flowRun.id"
|
|
34
34
|
@change="showSuspendModal"
|
|
35
35
|
/>
|
|
36
36
|
<ConfirmStateChangeModal
|
|
@@ -45,30 +45,29 @@
|
|
|
45
45
|
v-model:showModal="showDeleteModal"
|
|
46
46
|
label="Flow Run"
|
|
47
47
|
:name="flowRun.name!"
|
|
48
|
-
@delete="deleteFlowRun(
|
|
48
|
+
@delete="deleteFlowRun(flowRun.id)"
|
|
49
49
|
/>
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script lang="ts" setup>
|
|
53
53
|
import { showToast } from '@prefecthq/prefect-design'
|
|
54
|
-
import { computed, ref
|
|
54
|
+
import { computed, ref } from 'vue'
|
|
55
55
|
import { FlowRunRetryModal, FlowRunCancelModal, FlowRunSuspendModal, ConfirmStateChangeModal, ConfirmDeleteModal, CopyOverflowMenuItem } from '@/components'
|
|
56
56
|
import FlowRunResumeModal from '@/components/FlowRunResumeModal.vue'
|
|
57
|
-
import { useCan, useWorkspaceApi, useShowModal, useWorkspaceRoutes, useFlowRuns,
|
|
57
|
+
import { useCan, useWorkspaceApi, useShowModal, useWorkspaceRoutes, useFlowRuns, useDeployment } from '@/compositions'
|
|
58
58
|
import { localization } from '@/localization'
|
|
59
|
-
import { FlowRunsFilter, isPausedStateType, isRunningStateType, isStuckStateType, isTerminalStateType, StateUpdateDetails } from '@/models'
|
|
59
|
+
import { FlowRun, FlowRunsFilter, isPausedStateType, isRunningStateType, isStuckStateType, isTerminalStateType, StateUpdateDetails } from '@/models'
|
|
60
60
|
import { deleteItem } from '@/utilities'
|
|
61
61
|
import { getApiErrorMessage } from '@/utilities/errors'
|
|
62
62
|
|
|
63
63
|
const props = defineProps<{
|
|
64
|
-
|
|
64
|
+
flowRun: FlowRun,
|
|
65
65
|
showAll?: boolean,
|
|
66
66
|
}>()
|
|
67
67
|
|
|
68
68
|
const can = useCan()
|
|
69
69
|
const api = useWorkspaceApi()
|
|
70
70
|
const routes = useWorkspaceRoutes()
|
|
71
|
-
const { flowRunId } = toRefs(props)
|
|
72
71
|
|
|
73
72
|
const { showModal: showRetryModal, open: openRetryModal } = useShowModal()
|
|
74
73
|
const { showModal: showResumeModal, open: openResumeModal } = useShowModal()
|
|
@@ -79,32 +78,31 @@
|
|
|
79
78
|
|
|
80
79
|
const retryingRun = ref(false)
|
|
81
80
|
|
|
82
|
-
const {
|
|
83
|
-
const { deployment } = useDeployment(() => flowRun.value?.deploymentId)
|
|
81
|
+
const { deployment } = useDeployment(() => props.flowRun.deploymentId)
|
|
84
82
|
|
|
85
83
|
const canRetry = computed(() => {
|
|
86
|
-
if (!can.update.flow_run || !flowRun.
|
|
84
|
+
if (!can.update.flow_run || !props.flowRun.stateType || !props.flowRun.deploymentId) {
|
|
87
85
|
return false
|
|
88
86
|
}
|
|
89
|
-
return isTerminalStateType(flowRun.
|
|
87
|
+
return isTerminalStateType(props.flowRun.stateType)
|
|
90
88
|
})
|
|
91
89
|
|
|
92
90
|
const canResume = computed(() => {
|
|
93
|
-
if (!can.update.flow_run || !flowRun.
|
|
91
|
+
if (!can.update.flow_run || !props.flowRun.stateType) {
|
|
94
92
|
return false
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
return isPausedStateType(flowRun.
|
|
95
|
+
return isPausedStateType(props.flowRun.stateType)
|
|
98
96
|
})
|
|
99
97
|
|
|
100
98
|
const flowRunFilter = (): FlowRunsFilter | null => {
|
|
101
|
-
if (!flowRun.
|
|
99
|
+
if (!props.flowRun.parentTaskRunId) {
|
|
102
100
|
return null
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
return {
|
|
106
104
|
taskRuns: {
|
|
107
|
-
id: [flowRun.
|
|
105
|
+
id: [props.flowRun.parentTaskRunId],
|
|
108
106
|
},
|
|
109
107
|
}
|
|
110
108
|
}
|
|
@@ -117,31 +115,31 @@
|
|
|
117
115
|
return value.id
|
|
118
116
|
})
|
|
119
117
|
const canCancel = computed(() => {
|
|
120
|
-
if (!can.update.flow_run || !flowRun.
|
|
118
|
+
if (!can.update.flow_run || !props.flowRun.stateType || parentFlowRunId.value) {
|
|
121
119
|
return false
|
|
122
120
|
}
|
|
123
|
-
return isStuckStateType(flowRun.
|
|
121
|
+
return isStuckStateType(props.flowRun.stateType)
|
|
124
122
|
})
|
|
125
123
|
|
|
126
124
|
const canSuspend = computed(() => {
|
|
127
|
-
if (!can.update.flow_run || !flowRun.
|
|
125
|
+
if (!can.update.flow_run || !props.flowRun.stateType || !props.flowRun.deploymentId) {
|
|
128
126
|
return false
|
|
129
127
|
}
|
|
130
128
|
|
|
131
|
-
return isRunningStateType(flowRun.
|
|
129
|
+
return isRunningStateType(props.flowRun.stateType)
|
|
132
130
|
})
|
|
133
131
|
|
|
134
132
|
const canChangeState = computed(() => {
|
|
135
|
-
if (!can.update.flow_run || !flowRun.
|
|
133
|
+
if (!can.update.flow_run || !props.flowRun.stateType) {
|
|
136
134
|
return false
|
|
137
135
|
}
|
|
138
|
-
return isTerminalStateType(flowRun.
|
|
136
|
+
return isTerminalStateType(props.flowRun.stateType)
|
|
139
137
|
})
|
|
140
138
|
|
|
141
139
|
const changeFlowRunState = async (values: StateUpdateDetails): Promise<void> => {
|
|
142
140
|
try {
|
|
143
|
-
await api.flowRuns.setFlowRunState(props.
|
|
144
|
-
|
|
141
|
+
await api.flowRuns.setFlowRunState(props.flowRun.id, { state: values })
|
|
142
|
+
emit('update')
|
|
145
143
|
showToast(localization.success.changeFlowRunState, 'success')
|
|
146
144
|
} catch (error) {
|
|
147
145
|
console.error(error)
|
|
@@ -150,7 +148,7 @@
|
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
150
|
|
|
153
|
-
const emit = defineEmits(['delete'])
|
|
151
|
+
const emit = defineEmits(['delete', 'update'])
|
|
154
152
|
|
|
155
153
|
const deleteFlowRun = async (id: string): Promise<void> => {
|
|
156
154
|
await deleteItem(id, api.flowRuns.deleteFlowRun, 'Flow run')
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
<template #actions>
|
|
34
34
|
<template v-if="flowRun">
|
|
35
35
|
<template v-if="media.sm">
|
|
36
|
-
<FlowRunSuspendButton :flow-run
|
|
37
|
-
<FlowRunResumeButton :flow-run
|
|
38
|
-
<FlowRunRetryButton :flow-run
|
|
39
|
-
<FlowRunCancelButton :flow-run
|
|
36
|
+
<FlowRunSuspendButton :flow-run />
|
|
37
|
+
<FlowRunResumeButton :flow-run />
|
|
38
|
+
<FlowRunRetryButton :flow-run />
|
|
39
|
+
<FlowRunCancelButton :flow-run />
|
|
40
40
|
</template>
|
|
41
|
-
<FlowRunMenu :flow-run
|
|
41
|
+
<FlowRunMenu :flow-run :show-all="!media.sm" @delete="emit('delete')" />
|
|
42
42
|
</template>
|
|
43
43
|
</template>
|
|
44
44
|
</page-heading>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
{ text: flowRun.value?.name ?? '' },
|
|
87
87
|
])
|
|
88
88
|
|
|
89
|
-
const { flowRun } = useFlowRun(() => props.flowRunId, { interval:
|
|
89
|
+
const { flowRun } = useFlowRun(() => props.flowRunId, { interval: 30_000 })
|
|
90
90
|
|
|
91
91
|
const isPending = computed(() => flowRun.value?.stateType ? isPendingStateType(flowRun.value.stateType) : true)
|
|
92
92
|
|
|
@@ -66,7 +66,7 @@ export function useSchemaPropertyInput(schemaProperty: MaybeRefOrGetter<SchemaPr
|
|
|
66
66
|
const exhaustive: never = propertyValue.value
|
|
67
67
|
console.error(new Error(`SchemaFormProperty input is not exhaustive: ${JSON.stringify(exhaustive)}`))
|
|
68
68
|
|
|
69
|
-
return withProps(() =>
|
|
69
|
+
return withProps(() => '')
|
|
70
70
|
})
|
|
71
71
|
|
|
72
72
|
return { input }
|