File tree 1 file changed +17
-5
lines changed
frontend/src/lib/components
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 6
6
import { ToggleButton , ToggleButtonGroup } from ' ./common'
7
7
import ResourcePicker from ' ./ResourcePicker.svelte'
8
8
import SchemaForm from ' ./SchemaForm.svelte'
9
+ import SimpleEditor from ' ./SimpleEditor.svelte'
9
10
10
11
export let format: string
11
12
export let value: any
28
29
29
30
async function loadSchema(format : string ) {
30
31
resourceTypeName = format .substring (' resource-' .length )
31
- schema = (
32
- await ResourceService .getResourceType ({ workspace: $workspaceStore ! , path: resourceTypeName })
33
- ).schema
32
+ try {
33
+ schema = (
34
+ await ResourceService .getResourceType ({
35
+ workspace: $workspaceStore ! ,
36
+ path: resourceTypeName
37
+ })
38
+ ).schema
39
+ } catch (e ) {
40
+ schema = undefined
41
+ }
34
42
}
35
43
36
44
function argToValue() {
91
99
/>
92
100
{:else }
93
101
<div class =" border rounded p-2 w-full" >
94
- {#if ! isString (args )}
95
- <SchemaForm {compact } {schema } bind:isValid bind:args />
102
+ {#if schema != undefined }
103
+ {#if ! isString (args )}
104
+ <SchemaForm {compact } {schema } bind:isValid bind:args />
105
+ {/if }
106
+ {:else }
107
+ <SimpleEditor autoHeight lang ="json" bind:value ={args } />
96
108
{/if }
97
109
</div >
98
110
{/if }
You can’t perform that action at this time.
0 commit comments