@prefecthq/prefect-ui-library 3.9.4 → 3.10.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.
@@ -1,11 +1,13 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
2
  modelValue: string | null | undefined;
3
3
  blockTypeSlug: string;
4
+ required?: boolean;
4
5
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
6
  "update:modelValue": (value: string | null | undefined) => void;
6
7
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
7
8
  modelValue: string | null | undefined;
8
9
  blockTypeSlug: string;
10
+ required?: boolean;
9
11
  }>>> & {
10
12
  "onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
11
13
  }, {}, {}>;
@@ -1,4 +1,10 @@
1
1
  import { ConcurrencyV2Limit } from '../models/ConcurrencyV2Limit';
2
+ declare let __VLS_typeProps: {
3
+ concurrencyLimit: ConcurrencyV2Limit;
4
+ };
5
+ type __VLS_PublicProps = {
6
+ 'showModal': boolean;
7
+ } & typeof __VLS_typeProps;
2
8
  declare function __VLS_template(): {
3
9
  slots: {
4
10
  actions?(_: {}): any;
@@ -7,16 +13,10 @@ declare function __VLS_template(): {
7
13
  attrs: Partial<{}>;
8
14
  };
9
15
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
- declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
11
- showModal: boolean;
12
- concurrencyLimit: ConcurrencyV2Limit;
13
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
- "update:showModal": (value: boolean) => void;
15
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
16
- showModal: boolean;
17
- concurrencyLimit: ConcurrencyV2Limit;
18
- }>>> & {
19
- "onUpdate:showModal"?: ((value: boolean) => any) | undefined;
16
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_PublicProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:showModal": (showModal: boolean) => void;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
19
+ "onUpdate:showModal"?: ((showModal: boolean) => any) | undefined;
20
20
  }, {}, {}>;
21
21
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
22
22
  export default _default;
@@ -1,12 +1,22 @@
1
1
  export interface IEmpiricalPolicy {
2
2
  retries: number | null;
3
3
  retryDelay: number | null;
4
+ retryJitterFactor: number | null;
5
+ /**
6
+ * @deprecated
7
+ * Use `retries` instead
8
+ */
4
9
  maxRetries: number | null;
10
+ /**
11
+ * @deprecated
12
+ * Use `retryDelay` instead
13
+ */
5
14
  retryDelaySeconds: number | null;
6
15
  }
7
16
  export declare class EmpiricalPolicy implements IEmpiricalPolicy {
8
17
  retries: number | null;
9
18
  retryDelay: number | null;
19
+ retryJitterFactor: number | null;
10
20
  maxRetries: number | null;
11
21
  retryDelaySeconds: number | null;
12
22
  constructor(empiricalPolicy: IEmpiricalPolicy);
@@ -3,4 +3,5 @@ export type EmpiricalPolicyResponse = {
3
3
  retry_delay: number | null;
4
4
  max_retries: number | null;
5
5
  retry_delay_seconds: number | null;
6
+ retry_jitter_factor: number | null;
6
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prefecthq/prefect-ui-library",
3
- "version": "3.9.4",
3
+ "version": "3.10.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,21 +57,21 @@
57
57
  "@types/lodash.debounce": "4.0.9",
58
58
  "@types/lodash.isequal": "^4.5.8",
59
59
  "@types/lodash.merge": "4.6.9",
60
- "@types/node": "^22.5.4",
60
+ "@types/node": "^22.5.5",
61
61
  "@types/prismjs": "^1.26.4",
62
62
  "@vitejs/plugin-vue": "5.1.3",
63
- "auto-changelog": "^2.4.0",
63
+ "auto-changelog": "^2.5.0",
64
64
  "autoprefixer": "10.4.20",
65
- "eslint": "8.57.0",
65
+ "eslint": "8.57.1",
66
66
  "lodash.camelcase": "4.3.0",
67
67
  "lodash.debounce": "4.0.8",
68
68
  "postcss": "8.4.45",
69
69
  "tailwindcss": "3.4.10",
70
70
  "tsc-alias": "1.8.10",
71
71
  "typescript": "5.6.2",
72
- "vite": "5.4.4",
72
+ "vite": "5.4.6",
73
73
  "vite-svg-loader": "^5.1.0",
74
- "vitest": "^2.0.5",
74
+ "vitest": "^2.1.1",
75
75
  "vue-tsc": "^2.1.6"
76
76
  },
77
77
  "peerDependencies": {
@@ -3,7 +3,7 @@
3
3
  <LogoImage v-if="blockType" :url="blockType.logoUrl" />
4
4
 
5
5
  <template v-if="blockDocuments.length">
6
- <BlockDocumentCombobox v-model:selected="model" v-bind="{ blockDocuments }" class="block-document-input__select" />
6
+ <BlockDocumentCombobox v-model:selected="model" :required="required" v-bind="{ blockDocuments }" class="block-document-input__select" />
7
7
  </template>
8
8
  <p-button v-if="blockTypeSlug" icon-append="PlusIcon" @click="open">
9
9
  Add
@@ -25,6 +25,7 @@
25
25
  const props = defineProps<{
26
26
  modelValue: string | null | undefined,
27
27
  blockTypeSlug: string,
28
+ required?: boolean,
28
29
  }>()
29
30
 
30
31
  const emit = defineEmits<{
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <p-modal v-model:showModal="internalShowModal" class="concurrency-limits-v2-update-modal" :title="updateLimitTitle">
2
+ <p-modal v-model:showModal="showModal" class="concurrency-limits-v2-update-modal" :title="updateLimitTitle">
3
3
  <p-form class="concurrency-limits-v2-update-form" @submit="submit">
4
4
  <p-content>
5
5
  <p-label label="Name" :message="nameErrorMessage" :state="nameState">
@@ -37,7 +37,7 @@
37
37
  <script lang="ts" setup>
38
38
  import { PLabel, PNumberInput, PForm, showToast } from '@prefecthq/prefect-design'
39
39
  import { useSubscription, useValidation, useValidationObserver } from '@prefecthq/vue-compositions'
40
- import { computed, ref } from 'vue'
40
+ import { computed, ref, watch } from 'vue'
41
41
  import { useWorkspaceApi } from '@/compositions'
42
42
  import { localization } from '@/localization'
43
43
  import { ConcurrencyV2Limit } from '@/models/ConcurrencyV2Limit'
@@ -45,12 +45,9 @@
45
45
  import { isRequired, isGreaterThanZeroOrNull } from '@/utilities/formValidation'
46
46
 
47
47
  const props = defineProps<{
48
- showModal: boolean,
49
48
  concurrencyLimit: ConcurrencyV2Limit,
50
49
  }>()
51
- const emit = defineEmits<{
52
- (event: 'update:showModal', value: boolean): void,
53
- }>()
50
+ const showModal = defineModel<boolean>('showModal', { required: true })
54
51
 
55
52
  const updateLimitTitle = computed(() => `Update ${props.concurrencyLimit.name}`)
56
53
 
@@ -63,22 +60,9 @@
63
60
  isGreaterThanZeroOrNull,
64
61
  ])
65
62
 
66
- const active = ref(true)
67
-
68
- const activeSlots = ref(props.concurrencyLimit.activeSlots)
69
-
70
-
71
- const decay = ref(props.concurrencyLimit.slotDecayPerSecond)
72
-
73
-
74
- const internalShowModal = computed({
75
- get() {
76
- return props.showModal
77
- },
78
- set(value: boolean) {
79
- emit('update:showModal', value)
80
- },
81
- })
63
+ const active = ref(props.concurrencyLimit.active ?? true)
64
+ const activeSlots = ref(props.concurrencyLimit.activeSlots ?? 0)
65
+ const decay = ref(props.concurrencyLimit.slotDecayPerSecond ?? 0)
82
66
 
83
67
  const api = useWorkspaceApi()
84
68
  const concurrencyLimitSubscription = useSubscription(api.concurrencyV2Limits.getConcurrencyV2Limits)
@@ -86,11 +70,13 @@
86
70
  const reset = (): void => {
87
71
  name.value = props.concurrencyLimit.name
88
72
  limit.value = props.concurrencyLimit.limit
89
- decay.value = props.concurrencyLimit.slotDecayPerSecond ?? 0
90
73
  active.value = props.concurrencyLimit.active ?? true
91
74
  activeSlots.value = props.concurrencyLimit.activeSlots ?? 0
75
+ decay.value = props.concurrencyLimit.slotDecayPerSecond ?? 0
92
76
  }
93
77
 
78
+ watch(() => props.concurrencyLimit, reset)
79
+
94
80
  const { valid, pending, validate } = useValidationObserver()
95
81
  const submit = async (): Promise<void> => {
96
82
  await validate()
@@ -100,8 +86,8 @@
100
86
  name: name.value,
101
87
  limit: limit.value,
102
88
  active: active.value,
103
- slotDecayPerSecond: decay.value,
104
89
  activeSlots: activeSlots.value,
90
+ slotDecayPerSecond: decay.value,
105
91
  }
106
92
  await api.concurrencyV2Limits.updateConcurrencyV2Limit(props.concurrencyLimit.id, updatedLimit)
107
93
  concurrencyLimitSubscription.refresh()
@@ -111,8 +97,7 @@
111
97
  const message = getApiErrorMessage(error, localization.error.updateConcurrencyLimit)
112
98
  showToast(message, 'error')
113
99
  } finally {
114
- reset()
115
- internalShowModal.value = false
100
+ showModal.value = false
116
101
  }
117
102
  }
118
103
  }
@@ -163,6 +163,7 @@
163
163
  retryDelay: retryDelay.value,
164
164
  maxRetries: null,
165
165
  retryDelaySeconds: null,
166
+ retryJitterFactor: null,
166
167
  },
167
168
  name: name.value,
168
169
  parameters: parameters.value,
@@ -60,16 +60,9 @@
60
60
 
61
61
  <p-key-value label="Version" :value="taskRun.taskVersion" :alternate="alternate" />
62
62
 
63
- <div v-if="taskRun.empiricalPolicy?.maxRetries">
64
- <p-key-value label="Max Retries" :value="taskRun.empiricalPolicy?.maxRetries" :alternate="alternate" />
65
-
66
- <p-key-value label="Retry Delay" :value="secondsToApproximateString(taskRun.empiricalPolicy?.retryDelaySeconds ?? 0)" :alternate="alternate" />
67
- </div>
68
- <div v-else>
69
- <p-key-value label="Retries" :value="taskRun.empiricalPolicy?.retries" :alternate="alternate" />
70
-
71
- <p-key-value label="Retry Delay" :value="secondsToApproximateString(taskRun.empiricalPolicy?.retryDelay ?? 0)" :alternate="alternate" />
72
- </div>
63
+ <p-key-value label="Retries" :value="taskRun.empiricalPolicy?.retries" :alternate="alternate" />
64
+ <p-key-value label="Retry Delay" :value="secondsToApproximateString(taskRun.empiricalPolicy?.retryDelay ?? 0)" :alternate="alternate" />
65
+ <p-key-value label="Retry Jitter Factor" :value="taskRun.empiricalPolicy?.retryJitterFactor" :alternate="alternate" />
73
66
 
74
67
  <p-key-value label="Tags" :alternate="alternate">
75
68
  <template v-if="taskRun.tags?.length" #value>
@@ -8,6 +8,7 @@ export const mapEmpiricalPolicyResponseToEmpiricalPolicy: MapFunction<EmpiricalP
8
8
  retries: source.retries,
9
9
  retryDelay: source.retry_delay,
10
10
  maxRetries: source.max_retries,
11
+ retryJitterFactor: source.retry_jitter_factor,
11
12
  retryDelaySeconds: source.retry_delay_seconds,
12
13
  })
13
14
  }
@@ -17,6 +18,7 @@ export const mapEmpiricalPolicyToEmpiricalPolicyResponse: MapFunction<EmpiricalP
17
18
  retries: source.retries,
18
19
  retry_delay: source.retryDelay,
19
20
  max_retries: source.maxRetries,
21
+ retry_jitter_factor: source.retryJitterFactor,
20
22
  retry_delay_seconds: source.retryDelaySeconds,
21
23
  }
22
24
  }
@@ -1,19 +1,30 @@
1
1
  export interface IEmpiricalPolicy {
2
2
  retries: number | null,
3
3
  retryDelay: number | null,
4
+ retryJitterFactor: number | null,
5
+ /**
6
+ * @deprecated
7
+ * Use `retries` instead
8
+ */
4
9
  maxRetries: number | null,
10
+ /**
11
+ * @deprecated
12
+ * Use `retryDelay` instead
13
+ */
5
14
  retryDelaySeconds: number | null,
6
15
  }
7
16
 
8
17
  export class EmpiricalPolicy implements IEmpiricalPolicy {
9
18
  public retries: number | null
10
19
  public retryDelay: number | null
20
+ public retryJitterFactor: number | null
11
21
  public maxRetries: number | null
12
22
  public retryDelaySeconds: number | null
13
23
 
14
24
  public constructor(empiricalPolicy: IEmpiricalPolicy) {
15
25
  this.retries = empiricalPolicy.retries
16
26
  this.retryDelay = empiricalPolicy.retryDelay
27
+ this.retryJitterFactor = empiricalPolicy.retryJitterFactor
17
28
  this.maxRetries = empiricalPolicy.maxRetries
18
29
  this.retryDelaySeconds = empiricalPolicy.retryDelaySeconds
19
30
  }
@@ -3,4 +3,5 @@ export type EmpiricalPolicyResponse = {
3
3
  retry_delay: number | null,
4
4
  max_retries: number | null,
5
5
  retry_delay_seconds: number | null,
6
+ retry_jitter_factor: number | null,
6
7
  }