windmill-components 1.58.1 → 1.60.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.
- package/components/AddUser.svelte +66 -0
- package/components/AddUser.svelte.d.ts +16 -0
- package/components/AppConnect.svelte +6 -5
- package/components/ArgInput.svelte +39 -14
- package/components/Dropdown.svelte +2 -1
- package/components/EditorBar.svelte +3 -2
- package/components/FlowStatusViewer.svelte +24 -4
- package/components/IconedResourceType.svelte +3 -3
- package/components/InviteUser.svelte +0 -1
- package/components/ItemPicker.svelte +5 -5
- package/components/ModulePreview.svelte +1 -1
- package/components/MoveDrawer.svelte +2 -2
- package/components/Path.svelte +5 -3
- package/components/Popover.svelte +22 -11
- package/components/Popover.svelte.d.ts +1 -0
- package/components/ResourcePicker.svelte +9 -2
- package/components/RunForm.svelte +4 -2
- package/components/RunForm.svelte.d.ts +1 -0
- package/components/SchemaForm.svelte +7 -5
- package/components/ScriptBuilder.svelte +0 -1
- package/components/Tooltip.svelte +2 -1
- package/components/Tooltip.svelte.d.ts +3 -1
- package/components/apps/components/DisplayComponent.svelte +1 -1
- package/components/apps/components/buttons/AppButton.svelte +2 -5
- package/components/apps/components/dataDisplay/AppBarChart.svelte +1 -1
- package/components/apps/components/dataDisplay/AppHtml.svelte +1 -1
- package/components/apps/components/dataDisplay/AppPieChart.svelte +1 -1
- package/components/apps/components/dataDisplay/AppScatterChart.svelte +1 -1
- package/components/apps/components/dataDisplay/AppText.svelte +32 -9
- package/components/apps/components/dataDisplay/AppTimeseries.svelte +1 -1
- package/components/apps/components/form/AppForm.svelte +39 -26
- package/components/apps/components/helpers/RunnableComponent.svelte +12 -7
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +3 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte +6 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +3 -0
- package/components/apps/components/numberInputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/table/AppTable.svelte +5 -5
- package/components/apps/editor/AppEditorHeader.svelte +19 -12
- package/components/apps/editor/GridEditor.svelte +0 -1
- package/components/apps/editor/GridEditor.svelte.d.ts +0 -2
- package/components/apps/editor/componentsPanel/data.js +7 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +7 -8
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +1 -1
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +4 -1
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +1 -3
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +52 -33
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -4
- package/components/apps/editor/settingsPanel/TableActions.svelte +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +2 -1
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +4 -3
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +1 -0
- package/components/apps/editorUtils.js +7 -2
- package/components/apps/inputType.d.ts +1 -1
- package/components/apps/types.d.ts +3 -2
- package/components/apps/utils.d.ts +1 -1
- package/components/apps/utils.js +6 -3
- package/components/common/button/Button.svelte +2 -2
- package/components/common/drawer/Drawer.svelte +1 -1
- package/components/common/table/AppRow.svelte +5 -0
- package/components/common/table/LanguageBadge.svelte +3 -1
- package/components/common/table/Row.svelte +5 -3
- package/components/flows/CreateActionsApp.svelte +1 -3
- package/components/flows/CreateActionsFlow.svelte +1 -1
- package/components/flows/content/CapturePayload.svelte +4 -4
- package/components/flows/content/FlowSettings.svelte +0 -1
- package/components/flows/utils.js +8 -6
- package/components/home/ItemsList.svelte +10 -4
- package/components/home/ListFilters.svelte +9 -1
- package/components/icons/AppwriteIcon.svelte +11 -13
- package/components/icons/AwsIcon.svelte +9 -0
- package/components/icons/AwsIcon.svelte.d.ts +17 -0
- package/components/icons/BcryptIcon.svelte +10 -0
- package/components/icons/BcryptIcon.svelte.d.ts +17 -0
- package/components/icons/{GItlabIcon.svelte → GitlabIcon.svelte} +0 -0
- package/components/icons/GitlabIcon.svelte.d.ts +17 -0
- package/components/icons/GoogleIcon.svelte +10 -0
- package/components/icons/GoogleIcon.svelte.d.ts +17 -0
- package/components/icons/HackernewsIcon.svelte +15 -0
- package/components/icons/HackernewsIcon.svelte.d.ts +17 -0
- package/components/icons/MongodbIcon.svelte +7 -0
- package/components/icons/MongodbIcon.svelte.d.ts +17 -0
- package/components/icons/RedditIcon.svelte +8 -0
- package/components/icons/RedditIcon.svelte.d.ts +17 -0
- package/components/icons/SupabaseIcon.svelte +19 -0
- package/components/icons/SupabaseIcon.svelte.d.ts +17 -0
- package/components/icons/WebdavIcon.svelte +7 -0
- package/components/icons/WebdavIcon.svelte.d.ts +17 -0
- package/components/icons/ZammadIcon.svelte +23 -0
- package/components/icons/ZammadIcon.svelte.d.ts +17 -0
- package/components/icons/index.d.ts +21 -3
- package/components/icons/index.js +22 -4
- package/components/preview/FlowPreviewStatus.svelte +1 -1
- package/components/scripts/CreateActionsScript.svelte +1 -1
- package/gen/core/OpenAPI.js +1 -1
- package/gen/services/AppService.js +2 -2
- package/gen/services/CaptureService.d.ts +8 -8
- package/gen/services/CaptureService.js +9 -9
- package/gen/services/FlowService.d.ts +8 -0
- package/gen/services/FlowService.js +14 -0
- package/gen/services/JobService.d.ts +9 -1
- package/gen/services/JobService.js +10 -8
- package/gen/services/ScriptService.d.ts +8 -0
- package/gen/services/ScriptService.js +14 -0
- package/gen/services/WorkspaceService.d.ts +17 -0
- package/gen/services/WorkspaceService.js +16 -0
- package/package.json +517 -508
- package/utils.d.ts +2 -1
- package/utils.js +9 -0
- package/components/icons/GItlabIcon.svelte.d.ts +0 -17
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script>import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
|
|
2
2
|
import Icon from 'svelte-awesome';
|
|
3
3
|
import Popover from './Popover.svelte';
|
|
4
|
+
export let light = false;
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<Popover notClickable>
|
|
7
8
|
<Icon
|
|
8
|
-
class="text-gray-500 font-thin inline-block align-middle w-4"
|
|
9
|
+
class="{light ? 'text-gray-300' : ' text-gray-500'} font-thin inline-block align-middle w-4"
|
|
9
10
|
data={faInfoCircle}
|
|
10
11
|
scale={0.8}
|
|
11
12
|
/>
|
|
@@ -6,7 +6,7 @@ let result = undefined;
|
|
|
6
6
|
export const staticOutputs = ['result', 'loading'];
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<RunnableWrapper bind:result bind:componentInput {id}>
|
|
9
|
+
<RunnableWrapper flexWrap bind:result bind:componentInput {id}>
|
|
10
10
|
<div class="w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm">
|
|
11
11
|
Results
|
|
12
12
|
</div>
|
|
@@ -40,6 +40,7 @@ $: loading = isLoading && ownClick;
|
|
|
40
40
|
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
41
41
|
|
|
42
42
|
<RunnableWrapper
|
|
43
|
+
flexWrap
|
|
43
44
|
bind:runnableComponent
|
|
44
45
|
bind:componentInput
|
|
45
46
|
{id}
|
|
@@ -66,13 +67,9 @@ $: loading = isLoading && ownClick;
|
|
|
66
67
|
}}
|
|
67
68
|
{size}
|
|
68
69
|
{color}
|
|
70
|
+
{loading}
|
|
69
71
|
>
|
|
70
72
|
{labelValue}
|
|
71
|
-
{#if !loading}
|
|
72
|
-
<span class="w-5" />
|
|
73
|
-
{:else}
|
|
74
|
-
<Loader2 class="animate-spin ml-1" size={14} />
|
|
75
|
-
{/if}
|
|
76
73
|
</Button>
|
|
77
74
|
</AlignWrapper>
|
|
78
75
|
</RunnableWrapper>
|
|
@@ -41,7 +41,7 @@ $: data = {
|
|
|
41
41
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
42
42
|
<InputValue {id} input={configuration.line} bind:value={lineChart} />
|
|
43
43
|
|
|
44
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
44
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
45
45
|
{#if result}
|
|
46
46
|
{#if lineChart}
|
|
47
47
|
<Line {data} {options} />
|
|
@@ -9,7 +9,7 @@ export const staticOutputs = ['result', 'loading'];
|
|
|
9
9
|
let result = undefined;
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
-
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
12
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
13
13
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
14
14
|
<div
|
|
15
15
|
on:pointerdown={(e) => {
|
|
@@ -36,7 +36,7 @@ $: data = {
|
|
|
36
36
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
37
37
|
<InputValue {id} input={configuration.doughnutStyle} bind:value={doughnut} />
|
|
38
38
|
|
|
39
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
39
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
40
40
|
{#if result}
|
|
41
41
|
{#if doughnut}
|
|
42
42
|
<Doughnut {data} {options} />
|
|
@@ -39,7 +39,7 @@ $: data = {
|
|
|
39
39
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
40
40
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
41
41
|
|
|
42
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
42
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
43
43
|
{#if result}
|
|
44
44
|
<Scatter {data} {options} />
|
|
45
45
|
{/if}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import { Clipboard } from 'lucide-svelte';
|
|
2
|
+
import { copyToClipboard } from '../../../../utils';
|
|
3
|
+
import Button from '../../../common/button/Button.svelte';
|
|
4
|
+
import Popover from '../../../Popover.svelte';
|
|
5
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
2
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
3
7
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
4
8
|
export let id;
|
|
@@ -10,6 +14,7 @@ export const staticOutputs = ['result', 'loading'];
|
|
|
10
14
|
let extraStyle = undefined;
|
|
11
15
|
let result = undefined;
|
|
12
16
|
let style = undefined;
|
|
17
|
+
let copyButton;
|
|
13
18
|
function getComponent() {
|
|
14
19
|
switch (style) {
|
|
15
20
|
case 'Title':
|
|
@@ -44,20 +49,38 @@ $: style && (classes = getClasses());
|
|
|
44
49
|
|
|
45
50
|
<InputValue {id} input={configuration.extraStyle} bind:value={extraStyle} />
|
|
46
51
|
<InputValue {id} input={configuration.style} bind:value={style} />
|
|
52
|
+
<InputValue {id} input={configuration.copyButton} bind:value={copyButton} />
|
|
47
53
|
|
|
48
|
-
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
54
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
49
55
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
50
56
|
{#if !result || result === ''}
|
|
51
57
|
<div class="text-gray-400 bg-gray-100 flex justify-center items-center h-full w-full">
|
|
52
58
|
No text
|
|
53
59
|
</div>
|
|
54
|
-
{:else}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
{:else}
|
|
61
|
+
<div class="flex flex-wrap gap-2">
|
|
62
|
+
<svelte:element
|
|
63
|
+
this={component}
|
|
64
|
+
class="whitespace-pre-wrap {classes}"
|
|
65
|
+
style={extraStyle}
|
|
66
|
+
>
|
|
67
|
+
{String(result)}
|
|
68
|
+
</svelte:element>
|
|
69
|
+
{#if copyButton && result}
|
|
70
|
+
<Popover notClickable>
|
|
71
|
+
<Button
|
|
72
|
+
size="xs"
|
|
73
|
+
btnClasses="!px-2"
|
|
74
|
+
on:click={() => copyToClipboard(result)}
|
|
75
|
+
>
|
|
76
|
+
<Clipboard size={14} strokeWidth={2} />
|
|
77
|
+
</Button>
|
|
78
|
+
<svelte:fragment slot="text">
|
|
79
|
+
Copy to clipboard
|
|
80
|
+
</svelte:fragment>
|
|
81
|
+
</Popover>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
61
84
|
{/if}
|
|
62
85
|
</AlignWrapper>
|
|
63
86
|
</RunnableWrapper>
|
|
@@ -50,7 +50,7 @@ $: data = {
|
|
|
50
50
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
51
51
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
52
52
|
|
|
53
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
53
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
54
54
|
{#if result}
|
|
55
55
|
<Scatter {data} {options} />
|
|
56
56
|
{/if}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>import { Button } from '../../../common';
|
|
2
|
+
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
|
2
3
|
import { getContext } from 'svelte';
|
|
4
|
+
import { Icon } from 'svelte-awesome';
|
|
3
5
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
4
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
5
7
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
@@ -16,6 +18,8 @@ let color;
|
|
|
16
18
|
let size;
|
|
17
19
|
let runnableComponent;
|
|
18
20
|
let isLoading = false;
|
|
21
|
+
$: noInputs =
|
|
22
|
+
componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0;
|
|
19
23
|
$: outputs = $worldStore?.outputsById[id];
|
|
20
24
|
$: if (outputs?.loading != undefined) {
|
|
21
25
|
outputs.loading.set(false, true);
|
|
@@ -32,6 +36,7 @@ $: outputs?.loading.subscribe({
|
|
|
32
36
|
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
33
37
|
|
|
34
38
|
<RunnableWrapper
|
|
39
|
+
defaultUserInput
|
|
35
40
|
noMinH
|
|
36
41
|
bind:runnableComponent
|
|
37
42
|
bind:componentInput
|
|
@@ -39,39 +44,47 @@ $: outputs?.loading.subscribe({
|
|
|
39
44
|
{extraQueryParams}
|
|
40
45
|
autoRefresh={false}
|
|
41
46
|
forceSchemaDisplay={true}
|
|
47
|
+
runnableClass="!block"
|
|
42
48
|
>
|
|
43
49
|
<AlignWrapper {horizontalAlignment}>
|
|
44
|
-
<div class="flex flex-col gap-2 px-4 w-full
|
|
50
|
+
<div class="flex flex-col gap-2 px-4 w-full">
|
|
45
51
|
<div>
|
|
46
|
-
{#if
|
|
47
|
-
<
|
|
48
|
-
Run forms are
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
{#if noInputs}
|
|
53
|
+
<div class="text-gray-600 italic text-sm my-4">
|
|
54
|
+
Run forms are associated with a runnable that has user inputs.
|
|
55
|
+
<br />
|
|
56
|
+
Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
|
|
57
|
+
<strong>
|
|
58
|
+
User Input
|
|
59
|
+
<Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
|
|
60
|
+
</strong>
|
|
61
|
+
</div>
|
|
51
62
|
{/if}
|
|
52
63
|
</div>
|
|
53
64
|
<div class="flex justify-end">
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
e
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
{#if !noInputs}
|
|
66
|
+
<Button
|
|
67
|
+
loading={isLoading}
|
|
68
|
+
btnClasses="my-1"
|
|
69
|
+
on:pointerdown={(e) => {
|
|
70
|
+
e?.stopPropagation()
|
|
71
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
72
|
+
}}
|
|
73
|
+
on:click={() => {
|
|
74
|
+
runnableComponent?.runComponent()
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
if (recomputeIds) {
|
|
77
|
+
recomputeIds.forEach((id) => {
|
|
78
|
+
$runnableComponents[id]?.()
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
}}
|
|
82
|
+
{size}
|
|
83
|
+
{color}
|
|
84
|
+
>
|
|
85
|
+
{labelValue}
|
|
86
|
+
</Button>
|
|
87
|
+
{/if}
|
|
75
88
|
</div>
|
|
76
89
|
</div>
|
|
77
90
|
</AlignWrapper>
|
|
@@ -16,6 +16,9 @@ export let autoRefresh = true;
|
|
|
16
16
|
export let result = undefined;
|
|
17
17
|
export let forceSchemaDisplay = false;
|
|
18
18
|
export let noMinH = false;
|
|
19
|
+
export let defaultUserInput = false;
|
|
20
|
+
export let flexWrap = false;
|
|
21
|
+
export let wrapperClass = '';
|
|
19
22
|
const { worldStore, runnableComponents, workspace, appPath, isEditor, jobs, noBackend } = getContext('AppEditorContext');
|
|
20
23
|
onMount(() => {
|
|
21
24
|
if (autoRefresh) {
|
|
@@ -87,7 +90,7 @@ async function loadSchemaAndInputsByName() {
|
|
|
87
90
|
function reloadInputs(schema) {
|
|
88
91
|
let schemaCopy = JSON.parse(JSON.stringify(schema));
|
|
89
92
|
const result = {};
|
|
90
|
-
const newInputs = schemaToInputsSpec(schemaCopy);
|
|
93
|
+
const newInputs = schemaToInputsSpec(schemaCopy, defaultUserInput);
|
|
91
94
|
if (!fields) {
|
|
92
95
|
return newInputs;
|
|
93
96
|
}
|
|
@@ -99,7 +102,9 @@ function reloadInputs(schema) {
|
|
|
99
102
|
result[key] = newInput;
|
|
100
103
|
}
|
|
101
104
|
else {
|
|
102
|
-
if (fieldTypeToTsType(newInput.fieldType) !== fieldTypeToTsType(oldInput.fieldType)
|
|
105
|
+
if (fieldTypeToTsType(newInput.fieldType) !== fieldTypeToTsType(oldInput.fieldType) ||
|
|
106
|
+
newInput.format !== oldInput.format ||
|
|
107
|
+
newInput.subFieldType !== oldInput.subFieldType) {
|
|
103
108
|
result[key] = newInput;
|
|
104
109
|
}
|
|
105
110
|
else {
|
|
@@ -188,7 +193,7 @@ async function executeComponent(noToast = false) {
|
|
|
188
193
|
});
|
|
189
194
|
});
|
|
190
195
|
if (njob) {
|
|
191
|
-
$jobs = [
|
|
196
|
+
$jobs = [{ job: njob, component: id }, ...$jobs];
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
199
|
export async function runComponent() {
|
|
@@ -225,7 +230,7 @@ let lastStartedAt = Date.now();
|
|
|
225
230
|
bind:this={testJobLoader}
|
|
226
231
|
/>
|
|
227
232
|
|
|
228
|
-
<div class="h-full flex relative flex-row flex-wrap">
|
|
233
|
+
<div class="h-full flex relative flex-row flex-wrap {wrapperClass}">
|
|
229
234
|
{#if autoRefresh === true}
|
|
230
235
|
<div class="flex absolute top-1 right-1">
|
|
231
236
|
<RefreshButton componentId={id} />
|
|
@@ -234,8 +239,7 @@ let lastStartedAt = Date.now();
|
|
|
234
239
|
{#if schemaStripped && Object.keys(schemaStripped?.properties ?? {}).length > 0 && (autoRefresh || forceSchemaDisplay)}
|
|
235
240
|
<div class="px-2 h-fit min-h-0">
|
|
236
241
|
<SchemaForm
|
|
237
|
-
|
|
238
|
-
flexWrap
|
|
242
|
+
{flexWrap}
|
|
239
243
|
schema={schemaStripped}
|
|
240
244
|
bind:args
|
|
241
245
|
{disabledArgs}
|
|
@@ -252,7 +256,8 @@ let lastStartedAt = Date.now();
|
|
|
252
256
|
{:else if result?.error}
|
|
253
257
|
<div class="p-2">
|
|
254
258
|
<Alert type="error" title="Error during execution">
|
|
255
|
-
|
|
259
|
+
See "Debug Runs" on the top right for more details
|
|
260
|
+
<pre title={result.error} class=" mt-2 text-2xs whitespace-pre-wrap">{result.error}</pre>
|
|
256
261
|
</Alert>
|
|
257
262
|
<slot />
|
|
258
263
|
</div>
|
|
@@ -10,6 +10,9 @@ declare const __propDef: {
|
|
|
10
10
|
result?: any;
|
|
11
11
|
forceSchemaDisplay?: boolean | undefined;
|
|
12
12
|
noMinH?: boolean | undefined;
|
|
13
|
+
defaultUserInput?: boolean | undefined;
|
|
14
|
+
flexWrap?: boolean | undefined;
|
|
15
|
+
wrapperClass?: string | undefined;
|
|
13
16
|
runComponent?: (() => Promise<void>) | undefined;
|
|
14
17
|
};
|
|
15
18
|
events: {
|
|
@@ -10,6 +10,9 @@ export let extraQueryParams = {};
|
|
|
10
10
|
export let autoRefresh = true;
|
|
11
11
|
export let runnableComponent = undefined;
|
|
12
12
|
export let forceSchemaDisplay = false;
|
|
13
|
+
export let defaultUserInput = false;
|
|
14
|
+
export let flexWrap = false;
|
|
15
|
+
export let runnableClass = '';
|
|
13
16
|
const { staticExporter, noBackend } = getContext('AppEditorContext');
|
|
14
17
|
if (noBackend && componentInput?.type == 'runnable') {
|
|
15
18
|
result = componentInput?.['value'];
|
|
@@ -26,6 +29,8 @@ function isRunnableDefined() {
|
|
|
26
29
|
<slot />
|
|
27
30
|
{:else if componentInput.type === 'runnable' && isRunnableDefined()}
|
|
28
31
|
<RunnableComponent
|
|
32
|
+
{flexWrap}
|
|
33
|
+
{defaultUserInput}
|
|
29
34
|
bind:this={runnableComponent}
|
|
30
35
|
bind:fields={componentInput.fields}
|
|
31
36
|
bind:result
|
|
@@ -35,6 +40,7 @@ function isRunnableDefined() {
|
|
|
35
40
|
{extraQueryParams}
|
|
36
41
|
{forceSchemaDisplay}
|
|
37
42
|
{noMinH}
|
|
43
|
+
wrapperClass={runnableClass}
|
|
38
44
|
>
|
|
39
45
|
<slot />
|
|
40
46
|
</RunnableComponent>
|
|
@@ -11,6 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
autoRefresh?: boolean | undefined;
|
|
12
12
|
runnableComponent?: RunnableComponent | undefined;
|
|
13
13
|
forceSchemaDisplay?: boolean | undefined;
|
|
14
|
+
defaultUserInput?: boolean | undefined;
|
|
15
|
+
flexWrap?: boolean | undefined;
|
|
16
|
+
runnableClass?: string | undefined;
|
|
14
17
|
};
|
|
15
18
|
events: {
|
|
16
19
|
[evt: string]: CustomEvent<any>;
|
|
@@ -14,7 +14,7 @@ export let componentInput;
|
|
|
14
14
|
export let configuration;
|
|
15
15
|
export let actionButtons;
|
|
16
16
|
export const staticOutputs = ['selectedRow', 'loading', 'result', 'search'];
|
|
17
|
-
|
|
17
|
+
let result = undefined;
|
|
18
18
|
let search = undefined;
|
|
19
19
|
let searchValue = '';
|
|
20
20
|
let pagination = true;
|
|
@@ -75,8 +75,8 @@ function cellIsObject(x, props) {
|
|
|
75
75
|
}
|
|
76
76
|
let filteredResult = [];
|
|
77
77
|
$: filteredResult && setOptions(filteredResult);
|
|
78
|
-
$: search === 'By Component' && (filteredResult = searchInResult(result, searchValue));
|
|
79
|
-
$: (search === 'By Runnable' || search === 'Disabled') && (filteredResult = result);
|
|
78
|
+
$: search === 'By Component' && (filteredResult = searchInResult(result ?? [], searchValue));
|
|
79
|
+
$: (search === 'By Runnable' || search === 'Disabled') && (filteredResult = result ?? []);
|
|
80
80
|
$: outputs = $worldStore?.outputsById[id];
|
|
81
81
|
function rerender() {
|
|
82
82
|
table = createSvelteTable(options);
|
|
@@ -86,7 +86,7 @@ $: result && rerender();
|
|
|
86
86
|
|
|
87
87
|
<InputValue {id} input={configuration.search} bind:value={search} />
|
|
88
88
|
|
|
89
|
-
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
89
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
90
90
|
{#if Array.isArray(result) && result.every(isObject)}
|
|
91
91
|
<div class="border border-gray-300 shadow-sm divide-y divide-gray-300 flex flex-col h-full">
|
|
92
92
|
{#if search !== 'Disabled'}
|
|
@@ -180,7 +180,7 @@ $: result && rerender();
|
|
|
180
180
|
|
|
181
181
|
<AppTableFooter paginationEnabled={pagination} {result} {table} />
|
|
182
182
|
</div>
|
|
183
|
-
{:else}
|
|
183
|
+
{:else if result != undefined}
|
|
184
184
|
<Alert title="Parsing issues" type="error" size="xs">
|
|
185
185
|
The result should be an array of objects
|
|
186
186
|
</Alert>
|
|
@@ -59,23 +59,29 @@ function toStatic() {
|
|
|
59
59
|
return { app: newApp, summary: $summary };
|
|
60
60
|
}
|
|
61
61
|
async function computeTriggerables() {
|
|
62
|
-
const allTriggers = await Promise.all($app.grid
|
|
62
|
+
const allTriggers = await Promise.all($app.grid
|
|
63
|
+
.flatMap((x) => {
|
|
63
64
|
let c = x.data;
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
let r = [c.componentInput];
|
|
66
|
+
if (c.type === 'tablecomponent') {
|
|
67
|
+
r.push(...c.actionButtons.map((x) => x.componentInput));
|
|
68
|
+
}
|
|
69
|
+
return r.filter((x) => x);
|
|
70
|
+
})
|
|
71
|
+
.map(async (input) => {
|
|
72
|
+
if (input?.type == 'runnable') {
|
|
73
|
+
const staticInputs = Object.fromEntries(Object.entries(input.fields ?? {})
|
|
66
74
|
.filter(([k, v]) => v.type == 'static')
|
|
67
75
|
.map(([k, v]) => {
|
|
68
76
|
return [k, v['value']];
|
|
69
77
|
}));
|
|
70
|
-
if (
|
|
71
|
-
let hex = await hash(
|
|
78
|
+
if (input.runnable?.type == 'runnableByName') {
|
|
79
|
+
let hex = await hash(input.runnable.inlineScript?.content);
|
|
72
80
|
return [`rawscript/${hex}`, staticInputs];
|
|
73
81
|
}
|
|
74
|
-
else if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
staticInputs
|
|
78
|
-
];
|
|
82
|
+
else if (input.runnable?.type == 'runnableByPath') {
|
|
83
|
+
let prefix = input.runnable.runType !== 'hubscript' ? input.runnable.runType : 'script';
|
|
84
|
+
return [`${prefix}/${input.runnable.path}`, staticInputs];
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
return [];
|
|
@@ -96,6 +102,7 @@ async function createApp(path) {
|
|
|
96
102
|
policy
|
|
97
103
|
}
|
|
98
104
|
});
|
|
105
|
+
closeSaveDrawer();
|
|
99
106
|
goto(`/apps/edit/${appId}`);
|
|
100
107
|
}
|
|
101
108
|
catch (e) {
|
|
@@ -353,9 +360,9 @@ $: selectedJobId && testJobLoader?.watchJob(selectedJobId);
|
|
|
353
360
|
<div class="hidden lg:block">
|
|
354
361
|
<ToggleButtonGroup bind:selected={$app.fullscreen}>
|
|
355
362
|
<ToggleButton position="left" value={false} size="xs">
|
|
356
|
-
<div class="flex gap-1 justify-start">
|
|
363
|
+
<div class="flex gap-1 justify-start items-center">
|
|
357
364
|
<AlignHorizontalSpaceAround size={14} />
|
|
358
|
-
<Tooltip>
|
|
365
|
+
<Tooltip light>
|
|
359
366
|
The max width is 1168px and the content stay centered instead of taking the full page
|
|
360
367
|
width
|
|
361
368
|
</Tooltip>
|
|
@@ -125,7 +125,6 @@ const onpointerup = () => {
|
|
|
125
125
|
'h-full w-full flex justify-center align-center items-center',
|
|
126
126
|
gridComponent.data.card ? 'border border-gray-100' : ''
|
|
127
127
|
)}
|
|
128
|
-
on:click|preventDefault|capture|once|stopPropagation
|
|
129
128
|
>
|
|
130
129
|
<ComponentEditor
|
|
131
130
|
{pointerdown}
|
|
@@ -251,6 +251,13 @@ const display = {
|
|
|
251
251
|
type: 'static',
|
|
252
252
|
fieldType: 'text',
|
|
253
253
|
value: '',
|
|
254
|
+
tooltip: 'CSS rules like "color: blue;"',
|
|
255
|
+
},
|
|
256
|
+
copyButton: {
|
|
257
|
+
type: 'static',
|
|
258
|
+
value: false,
|
|
259
|
+
fieldType: 'boolean',
|
|
260
|
+
onlyStatic: true,
|
|
254
261
|
},
|
|
255
262
|
},
|
|
256
263
|
card: false
|
|
@@ -7,7 +7,7 @@ import { inferArgs } from '../../../../infer';
|
|
|
7
7
|
import Badge from '../../../common/badge/Badge.svelte';
|
|
8
8
|
import { fly } from 'svelte/transition';
|
|
9
9
|
import Editor from '../../../Editor.svelte';
|
|
10
|
-
import { scriptLangToEditorLang } from '../../../../utils';
|
|
10
|
+
import { emptySchema, scriptLangToEditorLang } from '../../../../utils';
|
|
11
11
|
import Tooltip from '../../../Tooltip.svelte';
|
|
12
12
|
let inlineScriptEditorDrawer;
|
|
13
13
|
export let inlineScript;
|
|
@@ -15,7 +15,7 @@ export let name = undefined;
|
|
|
15
15
|
export let id;
|
|
16
16
|
const { runnableComponents } = getContext('AppEditorContext');
|
|
17
17
|
let editor;
|
|
18
|
-
let validCode =
|
|
18
|
+
let validCode = true;
|
|
19
19
|
async function inferInlineScriptSchema(language, content, schema) {
|
|
20
20
|
try {
|
|
21
21
|
await inferArgs(language, content, schema);
|
|
@@ -28,8 +28,8 @@ async function inferInlineScriptSchema(language, content, schema) {
|
|
|
28
28
|
return schema;
|
|
29
29
|
}
|
|
30
30
|
onMount(async () => {
|
|
31
|
-
if (inlineScript) {
|
|
32
|
-
inlineScript.schema = await inferInlineScriptSchema(inlineScript?.language, inlineScript?.content,
|
|
31
|
+
if (inlineScript && !inlineScript.schema) {
|
|
32
|
+
inlineScript.schema = await inferInlineScriptSchema(inlineScript?.language, inlineScript?.content, emptySchema());
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
const dispatch = createEventDispatcher();
|
|
@@ -73,7 +73,7 @@ let runLoading = false;
|
|
|
73
73
|
startIcon={{ icon: faTrash }}
|
|
74
74
|
on:click={() => dispatch('delete')}
|
|
75
75
|
/>
|
|
76
|
-
{:else}
|
|
76
|
+
{:else if $runnableComponents[id] != undefined}
|
|
77
77
|
<Button
|
|
78
78
|
loading={runLoading}
|
|
79
79
|
size="xs"
|
|
@@ -84,9 +84,8 @@ let runLoading = false;
|
|
|
84
84
|
runLoading = false
|
|
85
85
|
}}
|
|
86
86
|
>
|
|
87
|
-
Run 
|
|
88
|
-
|
|
89
|
-
>
|
|
87
|
+
Run
|
|
88
|
+
<Tooltip light>Ctrl+Enter</Tooltip>
|
|
90
89
|
</Button>
|
|
91
90
|
{/if}
|
|
92
91
|
|
|
@@ -13,7 +13,7 @@ export let id;
|
|
|
13
13
|
async function fork(path) {
|
|
14
14
|
let { content, language, schema } = await getScriptByPath(path);
|
|
15
15
|
if (componentInput && componentInput.type == 'runnable') {
|
|
16
|
-
if (!schema || Object.keys(schema).length == 0) {
|
|
16
|
+
if (!schema || typeof schema == 'string' || Object.keys(schema).length == 0) {
|
|
17
17
|
schema = emptySchema();
|
|
18
18
|
await inferArgs(language, content, schema);
|
|
19
19
|
}
|
|
@@ -109,7 +109,10 @@ $: extraLib =
|
|
|
109
109
|
{:else if component.componentInput.type === 'connected' && component.componentInput !== undefined}
|
|
110
110
|
<ConnectedInputEditor bind:componentInput={component.componentInput} />
|
|
111
111
|
{:else if component.componentInput?.type === 'runnable' && component.componentInput !== undefined}
|
|
112
|
-
<RunnableInputEditor
|
|
112
|
+
<RunnableInputEditor
|
|
113
|
+
bind:appInput={component.componentInput}
|
|
114
|
+
defaultUserInput={component.type == 'formcomponent'}
|
|
115
|
+
/>
|
|
113
116
|
{/if}
|
|
114
117
|
</div>
|
|
115
118
|
{#if component.componentInput?.type === 'runnable' && Object.keys(component.componentInput.fields ?? {}).length > 0}
|
|
@@ -12,7 +12,5 @@ export let componentInput;
|
|
|
12
12
|
{:else if componentInput.type === 'static'}
|
|
13
13
|
<StaticInputEditor bind:componentInput />
|
|
14
14
|
{:else if componentInput.type === 'user'}
|
|
15
|
-
<span class="text-2xs italic text-gray-6f00"
|
|
16
|
-
>Field's value is set by the user in the visible field</span
|
|
17
|
-
>
|
|
15
|
+
<span class="text-2xs italic text-gray-6f00">Field's value is set by the user</span>
|
|
18
16
|
{/if}
|