@prefecthq/prefect-ui-library 3.11.55 → 3.12.0

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.
@@ -10,7 +10,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
10
10
  jobVariables: Record<string, unknown> | undefined;
11
11
  deploymentParameters: SchemaValuesV2;
12
12
  scheduleParameters?: SchemaValuesV2 | null;
13
- parameterOpenApiSchema: SchemaV2;
13
+ parameterOpenApiSchema?: SchemaV2 | null;
14
14
  deployment?: Deployment;
15
15
  deploymentScheduleId?: string;
16
16
  }, {
@@ -24,7 +24,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
24
24
  jobVariables: Record<string, unknown> | undefined;
25
25
  deploymentParameters: SchemaValuesV2;
26
26
  scheduleParameters?: SchemaValuesV2 | null;
27
- parameterOpenApiSchema: SchemaV2;
27
+ parameterOpenApiSchema?: SchemaV2 | null;
28
28
  deployment?: Deployment;
29
29
  deploymentScheduleId?: string;
30
30
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prefecthq/prefect-ui-library",
3
- "version": "3.11.55",
3
+ "version": "3.12.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,9 +21,9 @@
21
21
 
22
22
 
23
23
  <script lang="ts" setup>
24
+ import { computed } from 'vue'
24
25
  import { DeploymentScheduleMenu, DeploymentScheduleToggle } from '@/components'
25
26
  import { Deployment, DeploymentSchedule } from '@/models'
26
- import { computed } from 'vue'
27
27
 
28
28
  const props = defineProps<{
29
29
  deployment: Deployment,
@@ -50,6 +50,7 @@
50
50
  py-2
51
51
  flex
52
52
  flex-row
53
+ gap-2
53
54
  text-sm
54
55
  w-full
55
56
  justify-between
@@ -44,7 +44,7 @@
44
44
  const updateSchedule = async (value: boolean): Promise<void> => {
45
45
  loading.value = true
46
46
  try {
47
- await api.deploymentSchedules.updateDeploymentSchedule(props.deployment.id, props.schedule.id, { active: value })
47
+ await api.deploymentSchedules.updateDeploymentSchedule(props.deployment.id, props.schedule.id, { slug: props.schedule.slug, active: value })
48
48
  showToast(value ? localization.success.activateDeploymentSchedule : localization.success.pauseDeploymentSchedule, 'success')
49
49
  emit('update', value)
50
50
  } catch (error) {
@@ -30,9 +30,9 @@
30
30
 
31
31
  <FlowRunJobVariableOverridesLabeledInput v-if="can.access.deploymentScheduleFlowRunInfraOverrides" v-model="internalJobVariables" />
32
32
 
33
- <p-divider />
34
-
35
33
  <template v-if="schemaHasParameters">
34
+ <p-divider />
35
+
36
36
  <SchemaInputV2 v-model:values="internalParameters" :schema="internalSchema" :errors="errors" :kinds="['none', 'json']">
37
37
  <template #default="{ kind, setKind }">
38
38
  <div class="schedule-form-modal__parameters-container">
@@ -58,10 +58,18 @@
58
58
  </template>
59
59
 
60
60
  <script lang="ts" setup>
61
+ import { ButtonGroupOption } from '@prefecthq/prefect-design'
62
+ import {
63
+ ValidationRule,
64
+ useValidation,
65
+ useValidationObserver
66
+ } from '@prefecthq/vue-compositions'
67
+ import merge from 'lodash.merge'
68
+ import { computed, ref, watch } from 'vue'
61
69
  import CronScheduleForm from '@/components/CronScheduleForm.vue'
62
70
  import FlowRunJobVariableOverridesLabeledInput from '@/components/FlowRunJobVariableOverridesLabeledInput.vue'
63
71
  import IntervalScheduleForm from '@/components/IntervalScheduleForm.vue'
64
- import { useCan, useShowModal, useWorkspaceApi } from '@/compositions'
72
+ import { useCan, useShowModal } from '@/compositions'
65
73
  import { localization } from '@/localization'
66
74
  import {
67
75
  CronSchedule,
@@ -77,14 +85,6 @@
77
85
  import { SchemaInputV2, SchemaV2, SchemaValuesV2 } from '@/schemas'
78
86
  import { useSchemaValidation } from '@/schemas/compositions/useSchemaValidation'
79
87
  import { isEmptyObject, isEmptyString, isNull, isSlug, omit, stringify, timeout } from '@/utilities'
80
- import { ButtonGroupOption } from '@prefecthq/prefect-design'
81
- import {
82
- ValidationRule,
83
- useValidation,
84
- useValidationObserver
85
- } from '@prefecthq/vue-compositions'
86
- import merge from 'lodash.merge'
87
- import { computed, ref, watch } from 'vue'
88
88
 
89
89
  defineOptions({
90
90
  inheritAttrs: false,
@@ -105,7 +105,7 @@
105
105
  jobVariables: Record<string, unknown> | undefined,
106
106
  deploymentParameters: SchemaValuesV2,
107
107
  scheduleParameters?: SchemaValuesV2 | null,
108
- parameterOpenApiSchema: SchemaV2,
108
+ parameterOpenApiSchema?: SchemaV2 | null,
109
109
  deployment?: Deployment,
110
110
  deploymentScheduleId?: string,
111
111
  }>()
@@ -152,7 +152,7 @@
152
152
  const internalParameters = ref<SchemaValuesV2>(props.scheduleParameters ?? {})
153
153
  const selectedProperties = ref<string[]>(Object.keys(internalParameters.value))
154
154
  const properties = computed(
155
- () => props.parameterOpenApiSchema.properties ?? {},
155
+ () => props.parameterOpenApiSchema?.properties ?? {},
156
156
  )
157
157
  const propertyNames = computed(() => Object.keys(properties.value))
158
158
  const propertiesToOmit = computed(() => propertyNames.value.filter(
@@ -187,7 +187,7 @@
187
187
  })
188
188
 
189
189
  const schemaHasParameters = computed(
190
- () => !isEmptyObject(props.parameterOpenApiSchema.properties),
190
+ () => !isEmptyObject(props.parameterOpenApiSchema?.properties ?? {}),
191
191
  )
192
192
 
193
193
  const { errors, validate: validateParameters } = useSchemaValidation(