windmill-components 1.35.42 → 1.36.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/AppConnect.svelte +85 -59
- package/components/ArgInput.svelte +50 -33
- package/components/ArgInput.svelte.d.ts +1 -1
- package/components/Button.svelte +15 -48
- package/components/Button.svelte.d.ts +1 -1
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +75 -67
- package/components/Dropdown.svelte +9 -7
- package/components/Editor.svelte +187 -178
- package/components/Editor.svelte.d.ts +4 -2
- package/components/EditorBar.svelte +135 -98
- package/components/EditorBar.svelte.d.ts +2 -1
- package/components/FlowBuilder.svelte +115 -134
- package/components/FlowJobResult.svelte +4 -5
- package/components/FlowModulesViewer.svelte +89 -7
- package/components/FlowModulesViewer.svelte.d.ts +1 -0
- package/components/FlowPreviewContent.svelte +88 -27
- package/components/FlowPreviewContent.svelte.d.ts +1 -1
- package/components/FlowStatusViewer.svelte +39 -24
- package/components/FlowStatusViewer.svelte.d.ts +0 -1
- package/components/FlowViewer.svelte +17 -11
- package/components/GroupModal.svelte +10 -1
- package/components/HighlightCode.svelte +22 -0
- package/components/HighlightCode.svelte.d.ts +17 -0
- package/components/IconedPath.svelte +9 -7
- package/components/InputTransformForm.svelte +97 -115
- package/components/InputTransformForm.svelte.d.ts +0 -1
- package/components/InputTransformsViewer.svelte +1 -1
- package/components/InviteGlobalUser.svelte +8 -8
- package/components/InviteUser.svelte +9 -9
- package/components/ItemPicker.svelte +37 -30
- package/components/ItemPicker.svelte.d.ts +2 -1
- package/components/JobStatus.svelte +2 -1
- package/components/LogViewer.svelte +23 -0
- package/components/LogViewer.svelte.d.ts +19 -0
- package/components/ModulePreview.svelte +107 -0
- package/components/ModulePreview.svelte.d.ts +24 -0
- package/components/Path.svelte +1 -1
- package/components/RadioButton.svelte +3 -2
- package/components/ResourceEditor.svelte +22 -34
- package/components/ResourceTypePicker.svelte +23 -34
- package/components/RunForm.svelte +34 -31
- package/components/RunForm.svelte.d.ts +6 -2
- package/components/SchemaEditor.svelte +19 -11
- package/components/SchemaForm.svelte +3 -3
- package/components/SchemaForm.svelte.d.ts +1 -1
- package/components/SchemaModal.svelte +18 -7
- package/components/ScriptBuilder.svelte +99 -83
- package/components/ScriptBuilder.svelte.d.ts +2 -4
- package/components/ScriptEditor.svelte +71 -143
- package/components/ScriptEditor.svelte.d.ts +0 -5
- package/components/ScriptPicker.svelte +24 -14
- package/components/ScriptPicker.svelte.d.ts +2 -1
- package/components/ScriptSchema.svelte +8 -11
- package/components/ScriptSchema.svelte.d.ts +0 -1
- package/components/ShareModal.svelte +6 -6
- package/components/SharedBadge.svelte +5 -13
- package/components/SimpleEditor.svelte +14 -10
- package/components/StringTypeNarrowing.svelte +24 -30
- package/components/TestJobLoader.svelte +106 -0
- package/components/TestJobLoader.svelte.d.ts +26 -0
- package/components/Tooltip.svelte +3 -2
- package/components/VariableEditor.svelte +15 -24
- package/components/common/actionRow/ActionRow.svelte +31 -0
- package/components/common/actionRow/ActionRow.svelte.d.ts +22 -0
- package/components/common/alert/Alert.svelte +53 -0
- package/components/common/alert/Alert.svelte.d.ts +20 -0
- package/components/common/alert/model.d.ts +1 -0
- package/components/common/alert/model.js +1 -0
- package/components/common/badge/Badge.svelte +76 -0
- package/components/common/badge/Badge.svelte.d.ts +28 -0
- package/components/common/badge/model.d.ts +8 -0
- package/components/common/badge/model.js +1 -0
- package/components/common/button/Button.svelte +110 -0
- package/components/common/button/Button.svelte.d.ts +39 -0
- package/components/common/button/model.d.ts +6 -0
- package/components/common/button/model.js +1 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte +72 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +23 -0
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +41 -0
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +14 -0
- package/components/common/confirmationModal/dirtyStore.d.ts +1 -0
- package/components/common/confirmationModal/dirtyStore.js +2 -0
- package/components/common/drawer/Drawer.svelte +3 -0
- package/components/common/drawer/Drawer.svelte.d.ts +2 -0
- package/components/common/index.d.ts +14 -0
- package/components/common/index.js +14 -0
- package/components/common/tabs/TabContent.svelte +3 -2
- package/components/common/tabs/TabContent.svelte.d.ts +1 -0
- package/components/common/tabs/Tabs.svelte +8 -1
- package/components/common/tabs/Tabs.svelte.d.ts +2 -0
- package/components/common/toggleButton/ToggleButton.svelte +20 -0
- package/components/common/toggleButton/ToggleButton.svelte.d.ts +19 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte +33 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +24 -0
- package/components/flows/FlowEditor.svelte +30 -0
- package/components/{FlowEditor.svelte.d.ts → flows/FlowEditor.svelte.d.ts} +1 -6
- package/components/flows/common/FlowCard.svelte +9 -0
- package/components/flows/common/FlowCard.svelte.d.ts +21 -0
- package/components/flows/common/FlowCardHeader.svelte +39 -0
- package/components/flows/common/FlowCardHeader.svelte.d.ts +20 -0
- package/components/flows/content/CopyFirstStepSchema.svelte +13 -0
- package/components/flows/{CopyFirstStepSchema.svelte.d.ts → content/CopyFirstStepSchema.svelte.d.ts} +0 -0
- package/components/flows/{DynamicInputHelpBox.svelte → content/DynamicInputHelpBox.svelte} +0 -0
- package/components/flows/{DynamicInputHelpBox.svelte.d.ts → content/DynamicInputHelpBox.svelte.d.ts} +0 -0
- package/components/flows/content/FlowEditorPanel.svelte +25 -0
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +16 -0
- package/components/flows/content/FlowFailureModule.svelte +15 -0
- package/components/flows/content/FlowFailureModule.svelte.d.ts +14 -0
- package/components/flows/content/FlowInput.svelte +26 -0
- package/components/flows/{FlowInput.svelte.d.ts → content/FlowInput.svelte.d.ts} +0 -0
- package/components/flows/content/FlowInputs.svelte +91 -0
- package/components/flows/{FlowInputs.svelte.d.ts → content/FlowInputs.svelte.d.ts} +1 -0
- package/components/flows/content/FlowLoop.svelte +168 -0
- package/components/flows/content/FlowLoop.svelte.d.ts +18 -0
- package/components/flows/content/FlowLoopWrapper.svelte +9 -0
- package/components/flows/content/FlowLoopWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowModule.svelte +211 -0
- package/components/flows/content/FlowModule.svelte.d.ts +29 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte +76 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleHeader.svelte +157 -0
- package/components/flows/{FlowModuleHeader.svelte.d.ts → content/FlowModuleHeader.svelte.d.ts} +5 -3
- package/components/flows/content/FlowModuleScript.svelte +21 -0
- package/components/flows/content/FlowModuleScript.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleSuspend.svelte +27 -0
- package/components/flows/content/FlowModuleSuspend.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleWrapper.svelte +45 -0
- package/components/flows/content/FlowModuleWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowRetries.svelte +80 -0
- package/components/flows/content/FlowRetries.svelte.d.ts +17 -0
- package/components/flows/content/FlowSchedules.svelte +18 -0
- package/components/flows/content/FlowSchedules.svelte.d.ts +14 -0
- package/components/flows/content/FlowSettings.svelte +78 -0
- package/components/flows/{FlowSettings.svelte.d.ts → content/FlowSettings.svelte.d.ts} +2 -6
- package/components/flows/content/RemoveStepConfirmationModal.svelte +32 -0
- package/components/flows/content/RemoveStepConfirmationModal.svelte.d.ts +19 -0
- package/components/flows/flowState.d.ts +8 -7
- package/components/flows/flowState.js +25 -46
- package/components/flows/flowStateUtils.d.ts +16 -14
- package/components/flows/flowStateUtils.js +81 -73
- package/components/flows/flowStore.js +7 -4
- package/components/flows/header/FlowImportExportMenu.svelte +55 -0
- package/components/flows/header/FlowImportExportMenu.svelte.d.ts +14 -0
- package/components/flows/header/FlowPreviewButtons.svelte +57 -0
- package/components/flows/header/FlowPreviewButtons.svelte.d.ts +14 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte +60 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +80 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +32 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte +241 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubScript.svelte +5 -3
- package/components/flows/pickers/PickHubScript.svelte.d.ts +2 -1
- package/components/flows/pickers/PickScript.svelte +4 -12
- package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte +44 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +33 -0
- package/components/flows/scheduleUtils.d.ts +0 -1
- package/components/flows/scheduleUtils.js +0 -1
- package/components/flows/types.d.ts +8 -0
- package/components/flows/types.js +1 -0
- package/components/flows/utils.d.ts +3 -1
- package/components/flows/utils.js +26 -10
- package/components/icons/AirtableIcon.svelte +1 -1
- package/components/icons/DiscordIcon.svelte +1 -1
- package/components/icons/GCloudIcon.svelte +1 -1
- package/components/icons/GItlabIcon.svelte +1 -1
- package/components/icons/GSheetsIcon.svelte +1 -1
- package/components/icons/GcalIcon.svelte +1 -1
- package/components/icons/GdriveIcon.svelte +1 -1
- package/components/icons/GithubIcon.svelte +1 -1
- package/components/icons/GmailIcon.svelte +1 -1
- package/components/icons/HatIcon.svelte +19 -0
- package/components/icons/HatIcon.svelte.d.ts +16 -0
- package/components/icons/MastodonIcon.svelte +1 -1
- package/components/icons/MatrixIcon.svelte +1 -1
- package/components/icons/PostgresIcon.svelte +1 -1
- package/components/icons/S3Icon.svelte +1 -1
- package/components/icons/Slack.svelte +1 -1
- package/components/icons/TogglIcon.svelte +8 -46
- package/components/jobs/JobDetail.svelte +1 -1
- package/components/landing/FlowGettingStarted.svelte +22 -68
- package/components/landing/FlowLandingBox.svelte +1 -1
- package/components/landing/RessourceGettingStarted.svelte +7 -37
- package/components/landing/ScriptBox.svelte +33 -60
- package/components/landing/ScriptGettingStarted.svelte +23 -69
- package/components/propertyPicker/ObjectViewer.svelte +18 -12
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/PropPicker.svelte +108 -11
- package/components/propertyPicker/WarningMessage.svelte +2 -15
- package/components/script_editor/LogPanel.svelte +108 -119
- package/components/script_editor/LogPanel.svelte.d.ts +2 -0
- package/components/sidebar/SidebarContent.svelte +2 -2
- package/editorUtils.d.ts +3 -0
- package/editorUtils.js +1 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +1 -0
- package/gen/models/CompletedJob.d.ts +2 -1
- package/gen/models/CompletedJob.js +1 -0
- package/gen/models/FlowModule.d.ts +3 -0
- package/gen/models/FlowStatus.d.ts +3 -0
- package/gen/models/FlowStatusModule.d.ts +1 -1
- package/gen/models/Preview.d.ts +2 -1
- package/gen/models/Preview.js +1 -0
- package/gen/models/QueuedJob.d.ts +2 -1
- package/gen/models/QueuedJob.js +1 -0
- package/gen/models/RawScript.d.ts +2 -1
- package/gen/models/RawScript.js +1 -0
- package/gen/models/Retry.d.ts +11 -0
- package/gen/models/Retry.js +4 -0
- package/gen/models/Script.d.ts +9 -2
- package/gen/models/Script.js +8 -0
- package/gen/services/JobService.d.ts +40 -0
- package/gen/services/JobService.js +70 -0
- package/gen/services/ScriptService.d.ts +14 -3
- package/gen/services/ScriptService.js +13 -0
- package/infer.d.ts +1 -1
- package/infer.js +6 -1
- package/package.json +71 -38
- package/script_helpers.d.ts +8 -2
- package/script_helpers.js +88 -16
- package/stores.d.ts +1 -1
- package/utils.d.ts +8 -6
- package/utils.js +57 -21
- package/components/FlowEditor.svelte +0 -55
- package/components/FlowPreview.svelte +0 -107
- package/components/FlowPreview.svelte.d.ts +0 -23
- package/components/ModuleStep.svelte +0 -131
- package/components/ModuleStep.svelte.d.ts +0 -25
- package/components/flows/CopyFirstStepSchema.svelte +0 -13
- package/components/flows/FlowBox.svelte +0 -16
- package/components/flows/FlowBox.svelte.d.ts +0 -23
- package/components/flows/FlowBoxHeader.svelte +0 -16
- package/components/flows/FlowBoxHeader.svelte.d.ts +0 -21
- package/components/flows/FlowInput.svelte +0 -22
- package/components/flows/FlowInputs.svelte +0 -65
- package/components/flows/FlowModuleHeader.svelte +0 -109
- package/components/flows/FlowSettings.svelte +0 -165
- package/components/flows/FlowTimeline.svelte +0 -169
- package/components/flows/FlowTimeline.svelte.d.ts +0 -21
- package/components/flows/stepOpenedStore.d.ts +0 -1
- package/components/flows/stepOpenedStore.js +0 -6
- package/components/propertyPicker/OverlayPropertyPicker.svelte +0 -69
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +0 -24
|
@@ -11,8 +11,9 @@ const dispatch = createEventDispatcher();
|
|
|
11
11
|
<div class="flex flex-row flex-wrap gap-2 items-center mb-2 w-full">
|
|
12
12
|
{#each options as [label, val]}
|
|
13
13
|
<label
|
|
14
|
-
class
|
|
15
|
-
|
|
14
|
+
class="text-center text-sm border border-gray-300 h-full rounded-sm cursor-pointer p-2
|
|
15
|
+
grow whitespace-nowrap hover:border-gray-600 hover:bg-gray-100
|
|
16
|
+
{val === value ? '!bg-blue-50 !border-blue-500' : ''}"
|
|
16
17
|
>
|
|
17
18
|
<input
|
|
18
19
|
type="radio"
|
|
@@ -8,6 +8,7 @@ import AutosizedTextarea from './AutosizedTextarea.svelte';
|
|
|
8
8
|
import ItemPicker from './ItemPicker.svelte';
|
|
9
9
|
import VariableEditor from './VariableEditor.svelte';
|
|
10
10
|
import Required from './Required.svelte';
|
|
11
|
+
import { Button } from './common';
|
|
11
12
|
import { workspaceStore } from '../stores';
|
|
12
13
|
import ResourceTypePicker from './ResourceTypePicker.svelte';
|
|
13
14
|
let path = '';
|
|
@@ -92,6 +93,9 @@ async function loadResourceType() {
|
|
|
92
93
|
sendUserToast(`ResourceType cannot be undefined.`, true);
|
|
93
94
|
}
|
|
94
95
|
}
|
|
96
|
+
function resourceAction() {
|
|
97
|
+
return resourceToEdit ? editResource() : createResource();
|
|
98
|
+
}
|
|
95
99
|
let inputCheck = {};
|
|
96
100
|
$: isValid = allTrue(inputCheck) ?? false;
|
|
97
101
|
</script>
|
|
@@ -108,7 +112,7 @@ $: isValid = allTrue(inputCheck) ?? false;
|
|
|
108
112
|
{#if step === 1}
|
|
109
113
|
<div class="flex flex-col gap-3 px-6 py-3 bg-gray-50 text-gray-700">
|
|
110
114
|
<div>
|
|
111
|
-
<span class="text-
|
|
115
|
+
<span class="text-red-600 text-2xs grow">{error ?? ''}</span>
|
|
112
116
|
<span class="mb-1 font-semibold text-gray-700">Path</span>
|
|
113
117
|
<Path
|
|
114
118
|
bind:error={pathError}
|
|
@@ -167,13 +171,16 @@ $: isValid = allTrue(inputCheck) ?? false;
|
|
|
167
171
|
properties={resourceSchema.properties[fieldName]?.properties}
|
|
168
172
|
format={resourceSchema.properties[fieldName]?.format}
|
|
169
173
|
/>
|
|
170
|
-
<div class="pb-
|
|
171
|
-
<
|
|
172
|
-
|
|
174
|
+
<div class="pb-6 ml-2 relative">
|
|
175
|
+
<Button
|
|
176
|
+
variant="border"
|
|
177
|
+
color="blue"
|
|
178
|
+
size="sm"
|
|
179
|
+
btnClasses="min-w-min items-center leading-4 py-0"
|
|
173
180
|
on:click={() => {
|
|
174
181
|
pickForField = fieldName
|
|
175
182
|
itemPicker.openModal()
|
|
176
|
-
}}>
|
|
183
|
+
}}>Insert variable</Button
|
|
177
184
|
>
|
|
178
185
|
</div>
|
|
179
186
|
</div>
|
|
@@ -184,10 +191,9 @@ $: isValid = allTrue(inputCheck) ?? false;
|
|
|
184
191
|
</div>
|
|
185
192
|
{/if}
|
|
186
193
|
</div>
|
|
187
|
-
<span slot="submission">
|
|
194
|
+
<span slot="submission" class="flex gap-4">
|
|
188
195
|
{#if step === 1}
|
|
189
|
-
<
|
|
190
|
-
class="default-button px-4 py-2 font-semibold"
|
|
196
|
+
<Button
|
|
191
197
|
on:click={async () => {
|
|
192
198
|
await loadResourceType()
|
|
193
199
|
step = 2
|
|
@@ -195,29 +201,10 @@ $: isValid = allTrue(inputCheck) ?? false;
|
|
|
195
201
|
disabled={selectedResourceType == undefined || pathError != ''}
|
|
196
202
|
>
|
|
197
203
|
Next
|
|
198
|
-
</
|
|
204
|
+
</Button>
|
|
199
205
|
{:else}
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
on:click={() => {
|
|
203
|
-
step = 1
|
|
204
|
-
}}
|
|
205
|
-
>
|
|
206
|
-
Back
|
|
207
|
-
</button>
|
|
208
|
-
<button
|
|
209
|
-
disabled={!isValid}
|
|
210
|
-
class="default-button px-4 py-2 font-semibold"
|
|
211
|
-
on:click={() => {
|
|
212
|
-
if (resourceToEdit) {
|
|
213
|
-
editResource()
|
|
214
|
-
} else {
|
|
215
|
-
createResource()
|
|
216
|
-
}
|
|
217
|
-
}}
|
|
218
|
-
>
|
|
219
|
-
Save
|
|
220
|
-
</button>
|
|
206
|
+
<Button variant="border" on:click={() => (step = 1)}>Back</Button>
|
|
207
|
+
<Button on:click={resourceAction} disabled={!isValid}>Save</Button>
|
|
221
208
|
{/if}
|
|
222
209
|
</span>
|
|
223
210
|
</Modal>
|
|
@@ -241,15 +228,16 @@ $: isValid = allTrue(inputCheck) ?? false;
|
|
|
241
228
|
slot="submission"
|
|
242
229
|
class="flex flex-row-reverse w-full p-5 bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"
|
|
243
230
|
>
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
231
|
+
<Button
|
|
232
|
+
variant="border"
|
|
233
|
+
color="blue"
|
|
234
|
+
size="sm"
|
|
247
235
|
on:click={() => {
|
|
248
236
|
variableEditor.initNew()
|
|
249
237
|
}}
|
|
250
238
|
>
|
|
251
239
|
Create a new variable
|
|
252
|
-
</
|
|
240
|
+
</Button>
|
|
253
241
|
<div class="text-xs mr-2 align-middle">
|
|
254
242
|
The variable you were looking for does not exist yet?
|
|
255
243
|
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ResourceService } from '../gen';
|
|
3
3
|
import { workspaceStore } from '../stores';
|
|
4
4
|
import IconedResourceType from './IconedResourceType.svelte';
|
|
5
|
+
import { Button } from './common';
|
|
5
6
|
let resources = [];
|
|
6
7
|
export let value;
|
|
7
8
|
export let notPickable = false;
|
|
@@ -10,50 +11,38 @@ async function loadResources() {
|
|
|
10
11
|
resources = await ResourceService.listResourceTypeNames({ workspace: $workspaceStore });
|
|
11
12
|
}
|
|
12
13
|
const dispatch = createEventDispatcher();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function onClick(resource) {
|
|
15
|
+
value = resource;
|
|
16
|
+
dispatch('click');
|
|
17
|
+
}
|
|
18
|
+
$: if ($workspaceStore) {
|
|
19
|
+
loadResources();
|
|
17
20
|
}
|
|
18
21
|
</script>
|
|
19
22
|
|
|
20
23
|
<div class="grid sm:grid-cols-2 md:grid-cols-3 gap-x-2 gap-y-1 items-center mb-2">
|
|
21
24
|
{#if nonePickable}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
on:click={() =>
|
|
29
|
-
value = undefined
|
|
30
|
-
dispatch('click')
|
|
31
|
-
}}
|
|
25
|
+
{@const isPicked = value === undefined}
|
|
26
|
+
<Button
|
|
27
|
+
variant="border"
|
|
28
|
+
color={isPicked ? 'blue' : 'dark'}
|
|
29
|
+
btnClasses={isPicked ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
30
|
+
disabled={notPickable}
|
|
31
|
+
on:click={() => onClick(undefined)}
|
|
32
32
|
>
|
|
33
33
|
None
|
|
34
|
-
</
|
|
34
|
+
</Button>
|
|
35
35
|
{/if}
|
|
36
36
|
{#each resources as r}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
on:click={() =>
|
|
44
|
-
value = r
|
|
45
|
-
dispatch('click')
|
|
46
|
-
}}
|
|
37
|
+
{@const isPicked = value === r}
|
|
38
|
+
<Button
|
|
39
|
+
variant="border"
|
|
40
|
+
color={isPicked ? 'blue' : 'dark'}
|
|
41
|
+
btnClasses={isPicked ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
42
|
+
disabled={notPickable}
|
|
43
|
+
on:click={() => onClick(r)}
|
|
47
44
|
>
|
|
48
45
|
<IconedResourceType name={r} after={true} />
|
|
49
|
-
</
|
|
46
|
+
</Button>
|
|
50
47
|
{/each}
|
|
51
48
|
</div>
|
|
52
|
-
|
|
53
|
-
<style>
|
|
54
|
-
.selected:hover {
|
|
55
|
-
border-radius: 0.375rem;
|
|
56
|
-
border-width: 1px;
|
|
57
|
-
border-color: rgb(156 163 175 / var(--tw-border-opacity));
|
|
58
|
-
--tw-border-opacity: 0.5
|
|
59
|
-
}</style>
|
|
@@ -6,6 +6,7 @@ import Icon from 'svelte-awesome';
|
|
|
6
6
|
import SvelteMarkdown from 'svelte-markdown';
|
|
7
7
|
import SchemaForm from './SchemaForm.svelte';
|
|
8
8
|
import Tooltip from './Tooltip.svelte';
|
|
9
|
+
import { Button } from './common';
|
|
9
10
|
export let runnable;
|
|
10
11
|
export let runAction;
|
|
11
12
|
export let buttonText = 'Run';
|
|
@@ -28,7 +29,7 @@ let viewOptions = false;
|
|
|
28
29
|
let scheduledForStr;
|
|
29
30
|
</script>
|
|
30
31
|
|
|
31
|
-
<div class="max-w-
|
|
32
|
+
<div class="max-w-6xl">
|
|
32
33
|
{#if detailed}
|
|
33
34
|
<div class="grid grid-cols-3 gap-2">
|
|
34
35
|
<div>
|
|
@@ -61,9 +62,7 @@ let scheduledForStr;
|
|
|
61
62
|
{#if !runnable.schema.properties || Object.keys(runnable.schema.properties).length === 0}
|
|
62
63
|
<div class="text-sm p-4">No arguments</div>
|
|
63
64
|
{:else}
|
|
64
|
-
<
|
|
65
|
-
<SchemaForm schema={runnable.schema} bind:isValid bind:args />
|
|
66
|
-
</div>
|
|
65
|
+
<SchemaForm schema={runnable.schema} bind:isValid bind:args />
|
|
67
66
|
{/if}
|
|
68
67
|
{:else}
|
|
69
68
|
<div class="text-sm">No schema</div>
|
|
@@ -84,42 +83,46 @@ let scheduledForStr;
|
|
|
84
83
|
min={getToday().toISOString().slice(0, 16)}
|
|
85
84
|
/>
|
|
86
85
|
</div>
|
|
87
|
-
<
|
|
88
|
-
|
|
86
|
+
<Button
|
|
87
|
+
variant="border"
|
|
88
|
+
color="blue"
|
|
89
|
+
size="sm"
|
|
90
|
+
btnClasses="mx-2 mb-1"
|
|
89
91
|
on:click={() => {
|
|
90
92
|
scheduledForStr = undefined
|
|
91
93
|
}}
|
|
92
94
|
>
|
|
93
95
|
Clear
|
|
94
|
-
</
|
|
96
|
+
</Button>
|
|
95
97
|
</div>
|
|
96
98
|
</div>
|
|
97
99
|
</div>
|
|
98
100
|
{/if}
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
viewOptions
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
101
|
+
{#if schedulable}
|
|
102
|
+
<div class="flex justify-between mt-2 md:mt-6 mb-6">
|
|
103
|
+
<Button
|
|
104
|
+
color="light"
|
|
105
|
+
size="sm"
|
|
106
|
+
endIcon={{ icon: viewOptions ? faChevronUp : faChevronDown }}
|
|
107
|
+
on:click={() => (viewOptions = !viewOptions)}
|
|
108
|
+
>
|
|
109
|
+
Schedule to run later
|
|
110
|
+
</Button>
|
|
111
|
+
<Button
|
|
112
|
+
btnClasses="!px-6 !py-1"
|
|
113
|
+
disabled={!isValid}
|
|
114
|
+
on:click={() => runAction(scheduledForStr, args)}
|
|
115
|
+
>
|
|
116
|
+
{scheduledForStr ? 'Schedule run to a later time' : buttonText}
|
|
117
|
+
</Button>
|
|
118
|
+
</div>
|
|
119
|
+
{:else}
|
|
120
|
+
<Button
|
|
121
|
+
btnClasses="!px-6 !py-1 w-full"
|
|
116
122
|
disabled={!isValid}
|
|
117
|
-
|
|
118
|
-
on:click={() => {
|
|
119
|
-
runAction(scheduledForStr, args)
|
|
120
|
-
}}
|
|
123
|
+
on:click={() => runAction(undefined, args)}
|
|
121
124
|
>
|
|
122
|
-
{
|
|
123
|
-
</
|
|
124
|
-
|
|
125
|
+
{buttonText}
|
|
126
|
+
</Button>
|
|
127
|
+
{/if}
|
|
125
128
|
</div>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Schema } from '../common';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
runnable:
|
|
5
|
+
runnable: {
|
|
6
|
+
summary?: string;
|
|
7
|
+
schema?: Schema;
|
|
8
|
+
description?: string;
|
|
9
|
+
} | undefined;
|
|
6
10
|
runAction: (scheduledForStr: string | undefined, args: Record<string, any>) => void;
|
|
7
11
|
buttonText?: string | undefined;
|
|
8
12
|
schedulable?: boolean | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script>import { emptySchema, sendUserToast } from '../utils';
|
|
2
2
|
import { faPen, faPlus, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
import { Button } from '
|
|
3
|
+
import { Button } from './common';
|
|
4
4
|
import { createEventDispatcher } from 'svelte';
|
|
5
|
-
import Icon from 'svelte-awesome';
|
|
6
5
|
import SchemaEditorProperty from './SchemaEditorProperty.svelte';
|
|
7
6
|
import SchemaModal, { DEFAULT_PROPERTY, schemaToModal } from './SchemaModal.svelte';
|
|
8
7
|
import SimpleEditor from './SimpleEditor.svelte';
|
|
@@ -59,7 +58,9 @@ function handleAddOrEditArgument() {
|
|
|
59
58
|
else {
|
|
60
59
|
schema.properties[modalProperty.name] = modalToSchema(modalProperty);
|
|
61
60
|
if (modalProperty.required) {
|
|
62
|
-
schema.required
|
|
61
|
+
if (!schema.required.includes(modalProperty.name)) {
|
|
62
|
+
schema.required.push(modalProperty.name);
|
|
63
|
+
}
|
|
63
64
|
}
|
|
64
65
|
else if (schema.required.includes(modalProperty.name)) {
|
|
65
66
|
const index = schema.required.indexOf(modalProperty.name, 0);
|
|
@@ -128,13 +129,15 @@ function switchTab() {
|
|
|
128
129
|
<div class="flex flex-col">
|
|
129
130
|
<div class="flex justify-between gap-x-2">
|
|
130
131
|
<Button
|
|
132
|
+
variant="contained"
|
|
133
|
+
color="blue"
|
|
134
|
+
size="md"
|
|
135
|
+
startIcon={{ icon: faPlus }}
|
|
131
136
|
on:click={() => {
|
|
132
137
|
modalProperty = Object.assign({}, DEFAULT_PROPERTY)
|
|
133
138
|
schemaModal.openModal()
|
|
134
139
|
}}
|
|
135
|
-
class="blue-button"
|
|
136
140
|
>
|
|
137
|
-
<Icon data={faPlus} class="mr-1" />
|
|
138
141
|
Add argument
|
|
139
142
|
</Button>
|
|
140
143
|
|
|
@@ -185,16 +188,21 @@ function switchTab() {
|
|
|
185
188
|
<td class="justify-end flex">
|
|
186
189
|
<Button
|
|
187
190
|
color="red"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
size="
|
|
191
|
+
variant="border"
|
|
192
|
+
btnClasses="mr-2"
|
|
193
|
+
size="sm"
|
|
194
|
+
startIcon={{ icon: faTrash }}
|
|
191
195
|
on:click={() => handleDeleteArgument(name)}
|
|
192
196
|
>
|
|
193
|
-
<Icon data={faTrash} class="mr-2" scale={0.8} />
|
|
194
197
|
Delete
|
|
195
198
|
</Button>
|
|
196
|
-
<Button
|
|
197
|
-
|
|
199
|
+
<Button
|
|
200
|
+
color="light"
|
|
201
|
+
variant="border"
|
|
202
|
+
size="sm"
|
|
203
|
+
startIcon={{ icon: faPen }}
|
|
204
|
+
on:click={() => startEditArgument(name)}
|
|
205
|
+
>
|
|
198
206
|
Edit
|
|
199
207
|
</Button>
|
|
200
208
|
</td>
|
|
@@ -6,9 +6,10 @@ export let schema;
|
|
|
6
6
|
export let args = {};
|
|
7
7
|
export let editableSchema = false;
|
|
8
8
|
export let isValid = true;
|
|
9
|
-
export let pickableProperties = undefined;
|
|
10
9
|
export let extraLib = 'missing extraLib';
|
|
11
10
|
export let importPath = undefined;
|
|
11
|
+
let clazz = '';
|
|
12
|
+
export { clazz as class };
|
|
12
13
|
let inputCheck = {};
|
|
13
14
|
$: isValid = allTrue(inputCheck) ?? false;
|
|
14
15
|
$: if (args == undefined) {
|
|
@@ -25,7 +26,7 @@ function removeExtraKey() {
|
|
|
25
26
|
$: schema?.properties && removeExtraKey();
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
|
-
<div class="w-full">
|
|
29
|
+
<div class="w-full {clazz}">
|
|
29
30
|
{#if Object.keys(schema?.properties ?? {}).length > 0}
|
|
30
31
|
{#each Object.keys(schema?.properties ?? {}) as argName}
|
|
31
32
|
{#if inputTransform}
|
|
@@ -34,7 +35,6 @@ $: schema?.properties && removeExtraKey();
|
|
|
34
35
|
bind:schema
|
|
35
36
|
bind:argName
|
|
36
37
|
bind:inputCheck
|
|
37
|
-
bind:pickableProperties
|
|
38
38
|
bind:extraLib
|
|
39
39
|
bind:importPath
|
|
40
40
|
/>
|
|
@@ -7,9 +7,9 @@ declare const __propDef: {
|
|
|
7
7
|
args?: Record<string, any> | undefined;
|
|
8
8
|
editableSchema?: boolean | undefined;
|
|
9
9
|
isValid?: boolean | undefined;
|
|
10
|
-
pickableProperties?: Object | undefined;
|
|
11
10
|
extraLib?: string | undefined;
|
|
12
11
|
importPath?: string | undefined;
|
|
12
|
+
class?: string | undefined;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
@@ -26,6 +26,7 @@ import ArgInput from './ArgInput.svelte';
|
|
|
26
26
|
import StringTypeNarrowing from './StringTypeNarrowing.svelte';
|
|
27
27
|
import Required from './Required.svelte';
|
|
28
28
|
import ObjectTypeNarrowing from './ObjectTypeNarrowing.svelte';
|
|
29
|
+
import { Button } from './common';
|
|
29
30
|
export let property = DEFAULT_PROPERTY;
|
|
30
31
|
export let error = '';
|
|
31
32
|
export let editing = false;
|
|
@@ -80,7 +81,7 @@ else {
|
|
|
80
81
|
: 'border border-red-700 bg-red-100 border-opacity-30 focus:border-red-700 focus:border-opacity-30 focus-visible:ring-red-700 focus-visible:ring-opacity-25 focus-visible:border-red-700'}
|
|
81
82
|
/>
|
|
82
83
|
</label>
|
|
83
|
-
<div class="mb-2 text-
|
|
84
|
+
<div class="mb-2 text-red-600 text-2xs">{error}</div>
|
|
84
85
|
|
|
85
86
|
<label class="mb-2 font-semibold text-gray-700">
|
|
86
87
|
Description
|
|
@@ -95,22 +96,32 @@ else {
|
|
|
95
96
|
<h3 class="font-semibold text-gray-700">Type<Required required={true} /></h3>
|
|
96
97
|
<div class="grid sm:grid-cols-3 md:grid-cols-4 gap-x-2 gap-y-1 items-center mb-2 w-full">
|
|
97
98
|
{#each ARG_TYPES as argType}
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
{@const isSelected = argType == property.selectedType}
|
|
100
|
+
<Button
|
|
101
|
+
variant="border"
|
|
102
|
+
color={isSelected ? 'blue' : 'dark'}
|
|
103
|
+
btnClasses={isSelected ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
100
104
|
on:click={() => {
|
|
101
105
|
property.selectedType = argType
|
|
102
106
|
property.format = undefined
|
|
103
107
|
property.contentEncoding = undefined
|
|
104
108
|
property.enum_ = undefined
|
|
105
109
|
property.pattern = undefined
|
|
106
|
-
}}
|
|
110
|
+
}}
|
|
107
111
|
>
|
|
112
|
+
{argType}
|
|
113
|
+
</Button>
|
|
108
114
|
{/each}
|
|
109
|
-
<
|
|
110
|
-
|
|
115
|
+
<Button
|
|
116
|
+
variant="border"
|
|
117
|
+
color={!property.selectedType ? 'blue' : 'dark'}
|
|
118
|
+
btnClasses={!property.selectedType ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
111
119
|
on:click={() => {
|
|
112
120
|
property.selectedType = undefined
|
|
113
|
-
}}
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
Any
|
|
124
|
+
</Button>
|
|
114
125
|
>
|
|
115
126
|
</div>
|
|
116
127
|
<Switch
|