@prefecthq/prefect-ui-library 3.0.11 → 3.0.12
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-B4o1U_0i.mjs → RunsPageWithDefaultFilter-baZISani.mjs} +2 -2
- package/dist/{RunsPageWithDefaultFilter-B4o1U_0i.mjs.map → RunsPageWithDefaultFilter-baZISani.mjs.map} +1 -1
- package/dist/{index-C_g-RXTK.mjs → index-ohfdy0jM.mjs} +1346 -1347
- package/dist/{index-C_g-RXTK.mjs.map → index-ohfdy0jM.mjs.map} +1 -1
- package/dist/prefect-ui-library.mjs +1 -1
- package/dist/prefect-ui-library.umd.js +37 -37
- package/dist/prefect-ui-library.umd.js.map +1 -1
- package/dist/types/src/maps/index.d.ts +2 -2
- package/dist/types/src/models/Variable.d.ts +2 -2
- package/dist/types/src/models/VariableCreate.d.ts +1 -1
- package/dist/types/src/models/VariableEdit.d.ts +1 -1
- package/dist/types/src/models/api/VariableRequest.d.ts +2 -2
- package/dist/types/src/models/api/VariableResponse.d.ts +1 -1
- package/dist/types/src/services/Mapper.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/VariableDisplayPreview.vue +3 -9
- package/src/components/VariableEditModal.vue +1 -3
- package/src/components/VariableMenu.vue +2 -8
- package/src/components/VariablesTable.vue +1 -1
- package/src/maps/variable.ts +2 -3
- package/src/models/Variable.ts +3 -2
- package/src/models/VariableCreate.ts +1 -1
- package/src/models/VariableEdit.ts +1 -1
- package/src/models/api/VariableRequest.ts +2 -2
- package/src/models/api/VariableResponse.ts +1 -1
|
@@ -431,14 +431,14 @@ export declare const maps: {
|
|
|
431
431
|
VariableCreate: {
|
|
432
432
|
VariableCreateRequest: import("..").MapFunction<import("..").VariableCreate, Partial<{
|
|
433
433
|
name: string | null;
|
|
434
|
-
value:
|
|
434
|
+
value: string | null;
|
|
435
435
|
tags: string[] | null;
|
|
436
436
|
}>>;
|
|
437
437
|
};
|
|
438
438
|
VariableEdit: {
|
|
439
439
|
VariableEditRequest: import("..").MapFunction<import("..").VariableEdit, Partial<{
|
|
440
440
|
name: string | null;
|
|
441
|
-
value:
|
|
441
|
+
value: string | null;
|
|
442
442
|
tags: string[] | null;
|
|
443
443
|
}>>;
|
|
444
444
|
};
|
|
@@ -3,7 +3,7 @@ export interface IVariable {
|
|
|
3
3
|
created: Date;
|
|
4
4
|
updated: Date;
|
|
5
5
|
name: string;
|
|
6
|
-
value:
|
|
6
|
+
value: string;
|
|
7
7
|
tags: string[];
|
|
8
8
|
}
|
|
9
9
|
export declare const MAX_VARIABLE_NAME_LENGTH: 255;
|
|
@@ -13,7 +13,7 @@ export declare class Variable implements IVariable {
|
|
|
13
13
|
readonly created: Date;
|
|
14
14
|
readonly updated: Date;
|
|
15
15
|
name: string;
|
|
16
|
-
value:
|
|
16
|
+
value: string;
|
|
17
17
|
tags: string[];
|
|
18
18
|
constructor(variable: IVariable);
|
|
19
19
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type VariableCreateRequest = Partial<{
|
|
2
2
|
name: string | null;
|
|
3
|
-
value:
|
|
3
|
+
value: string | null;
|
|
4
4
|
tags: string[] | null;
|
|
5
5
|
}>;
|
|
6
6
|
export type VariableEditRequest = Partial<{
|
|
7
7
|
name: string | null;
|
|
8
|
-
value:
|
|
8
|
+
value: string | null;
|
|
9
9
|
tags: string[] | null;
|
|
10
10
|
}>;
|
|
@@ -455,14 +455,14 @@ export declare const mapper: Mapper<{
|
|
|
455
455
|
VariableCreate: {
|
|
456
456
|
VariableCreateRequest: MapFunction<import("..").VariableCreate, Partial<{
|
|
457
457
|
name: string | null;
|
|
458
|
-
value:
|
|
458
|
+
value: string | null;
|
|
459
459
|
tags: string[] | null;
|
|
460
460
|
}>>;
|
|
461
461
|
};
|
|
462
462
|
VariableEdit: {
|
|
463
463
|
VariableEditRequest: MapFunction<import("..").VariableEdit, Partial<{
|
|
464
464
|
name: string | null;
|
|
465
|
-
value:
|
|
465
|
+
value: string | null;
|
|
466
466
|
tags: string[] | null;
|
|
467
467
|
}>>;
|
|
468
468
|
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="variable-link" />
|
|
3
|
-
<p-button v-if="
|
|
3
|
+
<p-button v-if="variable.value.length > 64" size="sm" @click="openEditModal">
|
|
4
4
|
{{ valueOverflowText }}
|
|
5
5
|
</p-button>
|
|
6
|
-
<p-code-highlight v-else :text="value
|
|
6
|
+
<p-code-highlight v-else :text="variable.value" lang="json" inline />
|
|
7
7
|
<VariableEditModal v-model:showModal="showEditModal" :variable="variable" @update="handleUpdate" />
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<script lang="ts" setup>
|
|
12
|
-
import { computed } from 'vue'
|
|
13
|
-
import { stringifyUnknownJson } from '..'
|
|
14
12
|
import VariableEditModal from '@/components/VariableEditModal.vue'
|
|
15
13
|
import { useShowModal } from '@/compositions/useShowModal'
|
|
16
14
|
import { Variable } from '@/models/Variable'
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
defineProps<{
|
|
19
17
|
variable: Variable,
|
|
20
18
|
valueOverflowText?: string,
|
|
21
19
|
}>()
|
|
@@ -29,9 +27,5 @@
|
|
|
29
27
|
const handleUpdate = (variable: Variable): void => {
|
|
30
28
|
emit('update', variable)
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
const value = computed(() => {
|
|
34
|
-
return stringifyUnknownJson(props.variable.value)
|
|
35
|
-
})
|
|
36
30
|
</script>
|
|
37
31
|
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
import { useValidation, useValidationObserver, ValidationRule } from '@prefecthq/vue-compositions'
|
|
30
30
|
import { isNull } from 'lodash'
|
|
31
31
|
import { computed, ref } from 'vue'
|
|
32
|
-
import { stringifyUnknownJson } from '..'
|
|
33
32
|
import { JsonInput } from '@/components'
|
|
34
33
|
import { useWorkspaceApi } from '@/compositions'
|
|
35
34
|
import { localization } from '@/localization'
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
import { isSnakeCase, isRequired, isString, isLessThanOrEqual, isJson } from '@/utilities'
|
|
38
37
|
import { getApiErrorMessage } from '@/utilities/errors'
|
|
39
38
|
|
|
40
|
-
|
|
41
39
|
const props = defineProps<{
|
|
42
40
|
variable: Variable,
|
|
43
41
|
showModal: boolean,
|
|
@@ -92,7 +90,7 @@
|
|
|
92
90
|
|
|
93
91
|
const { validate, pending } = useValidationObserver()
|
|
94
92
|
const name = ref<string>(props.variable.name)
|
|
95
|
-
const value = ref<string>(
|
|
93
|
+
const value = ref<string>(props.variable.value)
|
|
96
94
|
const tags = ref<string[]>(props.variable.tags)
|
|
97
95
|
|
|
98
96
|
const rules: Record<string, ValidationRule<string | undefined>[]> = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<p-icon-button-menu v-bind="$attrs">
|
|
3
3
|
<copy-overflow-menu-item :label="localization.info.copyId" :item="variable.id" />
|
|
4
4
|
<copy-overflow-menu-item :label="localization.info.copyName" :item="variable.name" />
|
|
5
|
-
<copy-overflow-menu-item :label="localization.info.copyValue" :item="value
|
|
5
|
+
<copy-overflow-menu-item :label="localization.info.copyValue" :item="variable.value" />
|
|
6
6
|
<p-overflow-menu-item v-if="can.update.variable" :label="localization.info.edit" @click="openEditModal" />
|
|
7
7
|
<p-overflow-menu-item v-if="can.delete.variable" :label="localization.info.delete" @click="openDeleteModal" />
|
|
8
8
|
</p-icon-button-menu>
|
|
@@ -27,15 +27,13 @@
|
|
|
27
27
|
|
|
28
28
|
<script lang="ts" setup>
|
|
29
29
|
import { showToast } from '@prefecthq/prefect-design'
|
|
30
|
-
import { computed, ref } from 'vue'
|
|
31
|
-
import { stringifyUnknownJson } from '..'
|
|
32
30
|
import { ConfirmDeleteModal, CopyOverflowMenuItem, VariableEditModal } from '@/components'
|
|
33
31
|
import { useWorkspaceApi, useCan, useShowModal } from '@/compositions'
|
|
34
32
|
import { localization } from '@/localization'
|
|
35
33
|
import { Variable } from '@/models'
|
|
36
34
|
import { getApiErrorMessage } from '@/utilities/errors'
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
defineProps<{
|
|
39
37
|
variable: Variable,
|
|
40
38
|
}>()
|
|
41
39
|
|
|
@@ -68,8 +66,4 @@
|
|
|
68
66
|
const handleUpdate = (variable: Variable): void => {
|
|
69
67
|
emit('update', variable)
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
const value = computed(() => {
|
|
73
|
-
return stringifyUnknownJson(props.variable.value)
|
|
74
|
-
})
|
|
75
69
|
</script>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
import { useDebouncedRef, useLocalStorage, useSubscription } from '@prefecthq/vue-compositions'
|
|
91
91
|
import merge from 'lodash.merge'
|
|
92
92
|
import { computed, ref } from 'vue'
|
|
93
|
-
import { VariablesDeleteButton, VariableMenu, ResultsCount, SearchInput, SelectedCount, VariableTagsInput } from '@/components'
|
|
93
|
+
import { VariablesDeleteButton, VariableMenu, ResultsCount, SearchInput, SelectedCount, VariableTagsInput, VariableEditModal } from '@/components'
|
|
94
94
|
import VariableDisplayPreview from '@/components/VariableDisplayPreview.vue'
|
|
95
95
|
import { useCan, useVariablesFilter, useWorkspaceApi } from '@/compositions'
|
|
96
96
|
import { localization } from '@/localization'
|
package/src/maps/variable.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Variable, VariableCreate, VariableEdit } from '..'
|
|
|
3
3
|
import { VariableCreateRequest, VariableEditRequest } from '@/models/api/VariableRequest'
|
|
4
4
|
import { VariableResponse } from '@/models/api/VariableResponse'
|
|
5
5
|
import { MapFunction } from '@/services/Mapper'
|
|
6
|
-
import { parseUnknownJson } from '@/utilities/parseUnknownJson'
|
|
7
6
|
|
|
8
7
|
export const mapVariableResponseToVariable: MapFunction<VariableResponse, Variable> = function(source) {
|
|
9
8
|
return new Variable({
|
|
@@ -19,7 +18,7 @@ export const mapVariableResponseToVariable: MapFunction<VariableResponse, Variab
|
|
|
19
18
|
export const mapVariableEditToVariableEditRequest: MapFunction<VariableEdit, VariableEditRequest> = function(source) {
|
|
20
19
|
return {
|
|
21
20
|
name: source.name,
|
|
22
|
-
value:
|
|
21
|
+
value: source.value,
|
|
23
22
|
tags: source.tags,
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -27,7 +26,7 @@ export const mapVariableEditToVariableEditRequest: MapFunction<VariableEdit, Var
|
|
|
27
26
|
export const mapVariableCreateToVariableCreateRequest: MapFunction<VariableCreate, VariableCreateRequest> = function(source) {
|
|
28
27
|
return {
|
|
29
28
|
name: source.name,
|
|
30
|
-
value:
|
|
29
|
+
value: source.value,
|
|
31
30
|
tags: source.tags,
|
|
32
31
|
}
|
|
33
32
|
}
|
package/src/models/Variable.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
|
|
1
2
|
export interface IVariable {
|
|
2
3
|
id: string,
|
|
3
4
|
created: Date,
|
|
4
5
|
updated: Date,
|
|
5
6
|
name: string,
|
|
6
|
-
value:
|
|
7
|
+
value: string,
|
|
7
8
|
tags: string[],
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -15,7 +16,7 @@ export class Variable implements IVariable {
|
|
|
15
16
|
public readonly created: Date
|
|
16
17
|
public readonly updated: Date
|
|
17
18
|
public name: string
|
|
18
|
-
public value:
|
|
19
|
+
public value: string
|
|
19
20
|
public tags: string[]
|
|
20
21
|
|
|
21
22
|
public constructor(
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type VariableCreateRequest = Partial<{
|
|
2
2
|
name: string | null,
|
|
3
|
-
value:
|
|
3
|
+
value: string | null,
|
|
4
4
|
tags: string[] | null,
|
|
5
5
|
}>
|
|
6
6
|
|
|
7
7
|
export type VariableEditRequest = Partial<{
|
|
8
8
|
name: string | null,
|
|
9
|
-
value:
|
|
9
|
+
value: string | null,
|
|
10
10
|
tags: string[] | null,
|
|
11
11
|
}>
|