mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 00:00:46 +00:00
fix: multiselect + jsoneditor nits
This commit is contained in:
@@ -284,7 +284,7 @@
|
||||
function checkArrayValueType() {
|
||||
try {
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
const firstItem = value?.[0]
|
||||
let firstItem = value?.[0]
|
||||
const type = itemsType?.type
|
||||
|
||||
switch (type) {
|
||||
@@ -499,6 +499,7 @@
|
||||
$effect.pre(() => {
|
||||
!isListJson &&
|
||||
inputCat === 'list' &&
|
||||
enum_ == undefined &&
|
||||
value != lastValue &&
|
||||
itemsType?.type &&
|
||||
!hasIsListJsonChanged &&
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
}
|
||||
items={[
|
||||
{ value: 'string', label: 'Items are strings' },
|
||||
{ value: 'string', label: "Items are strings or objects with a 'label/value' field" },
|
||||
{ value: 'enum', label: 'Items are strings from an enum' },
|
||||
...(originalType != 'string[]'
|
||||
? [
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import '@codingame/monaco-vscode-standalone-json-language-features'
|
||||
|
||||
import SimpleEditor from '$lib/components/SimpleEditor.svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { createEventDispatcher, untrack } from 'svelte'
|
||||
import { createDispatcherIfMounted } from '$lib/createDispatcherIfMounted'
|
||||
import Button from './common/button/Button.svelte'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
@@ -55,8 +55,8 @@
|
||||
error = e.message
|
||||
}
|
||||
}
|
||||
run(() => {
|
||||
code != undefined && parseJson()
|
||||
$effect(() => {
|
||||
code != undefined && untrack(() => parseJson())
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ export function safeSelectItems<T>(
|
||||
list: (T | { value: T; label?: string } | undefined | null)[] | undefined | null
|
||||
): { value: T; label?: string }[] {
|
||||
if (!list) return []
|
||||
if (!Array.isArray(list)) return []
|
||||
return list
|
||||
.filter((item) => item !== undefined && item !== null)
|
||||
.map((item) => {
|
||||
|
||||
Reference in New Issue
Block a user