windmill-components 1.35.43 → 1.36.1
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 +31 -14
- package/components/Button.svelte +15 -48
- package/components/Button.svelte.d.ts +1 -1
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +31 -29
- package/components/Dropdown.svelte +9 -7
- package/components/Editor.svelte +10 -14
- package/components/EditorBar.svelte +115 -91
- package/components/FlowBuilder.svelte +63 -74
- package/components/FlowPreviewContent.svelte +44 -24
- package/components/FlowStatusViewer.svelte +2 -5
- package/components/FlowViewer.svelte +12 -10
- package/components/GroupModal.svelte +10 -1
- package/components/HighlightCode.svelte +4 -3
- package/components/InputTransformForm.svelte +15 -14
- package/components/InputTransformsViewer.svelte +1 -1
- package/components/InviteGlobalUser.svelte +8 -8
- package/components/InviteUser.svelte +9 -9
- package/components/ItemPicker.svelte +36 -29
- package/components/ItemPicker.svelte.d.ts +2 -1
- package/components/JobStatus.svelte +2 -1
- package/components/ModulePreview.svelte +7 -8
- 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 +23 -31
- package/components/SchemaEditor.svelte +16 -10
- package/components/SchemaForm.svelte +3 -1
- package/components/SchemaForm.svelte.d.ts +1 -0
- package/components/SchemaModal.svelte +18 -7
- package/components/ScriptBuilder.svelte +22 -17
- package/components/ScriptEditor.svelte +2 -1
- package/components/ScriptPicker.svelte +21 -11
- package/components/ScriptSchema.svelte +8 -11
- package/components/ScriptSchema.svelte.d.ts +0 -1
- package/components/ShareModal.svelte +6 -6
- package/components/SimpleEditor.svelte +10 -10
- package/components/StringTypeNarrowing.svelte +24 -30
- package/components/TestJobLoader.svelte +15 -7
- package/components/Tooltip.svelte +1 -1
- package/components/VariableEditor.svelte +15 -24
- package/components/common/actionRow/ActionRow.svelte +11 -6
- package/components/common/actionRow/ActionRow.svelte.d.ts +1 -0
- package/components/common/badge/Badge.svelte +2 -8
- package/components/common/badge/model.d.ts +1 -1
- package/components/common/button/Button.svelte +45 -79
- package/components/common/button/Button.svelte.d.ts +14 -15
- package/components/common/button/ButtonPopup.svelte +67 -0
- package/components/common/button/ButtonPopup.svelte.d.ts +33 -0
- package/components/common/button/ButtonPopupItem.svelte +47 -0
- package/components/common/button/ButtonPopupItem.svelte.d.ts +27 -0
- package/components/common/button/model.d.ts +14 -1
- package/components/common/button/model.js +26 -1
- package/components/common/confirmationModal/ConfirmationModal.svelte +19 -2
- 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 +1 -0
- package/components/common/drawer/Drawer.svelte.d.ts +2 -0
- package/components/common/drawer/DrawerContent.svelte +1 -1
- package/components/common/index.d.ts +4 -0
- package/components/common/index.js +4 -0
- package/components/common/kbd/Kbd.svelte +7 -0
- package/components/common/kbd/Kbd.svelte.d.ts +27 -0
- package/components/common/popup/Popup.svelte +147 -0
- package/components/common/popup/Popup.svelte.d.ts +46 -0
- package/components/flows/FlowEditor.svelte +7 -7
- package/components/flows/FlowEditor.svelte.d.ts +3 -1
- package/components/flows/common/FlowCardHeader.svelte +1 -1
- package/components/flows/content/FlowEditorPanel.svelte +5 -6
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +3 -1
- package/components/flows/content/FlowFailureModule.svelte +2 -4
- package/components/flows/content/FlowInput.svelte +5 -1
- package/components/flows/content/FlowInputs.svelte +27 -12
- package/components/flows/content/FlowInputs.svelte.d.ts +1 -0
- package/components/flows/content/FlowLoop.svelte +159 -29
- package/components/flows/content/FlowLoop.svelte.d.ts +5 -1
- package/components/flows/content/FlowLoopWrapper.svelte +9 -0
- package/components/flows/content/FlowLoopWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowModule.svelte +31 -10
- package/components/flows/content/FlowModule.svelte.d.ts +1 -1
- package/components/flows/content/FlowModuleEarlyStop.svelte +76 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleHeader.svelte +92 -3
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +3 -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 +4 -6
- package/components/flows/content/FlowRetries.svelte +18 -18
- package/components/flows/content/FlowRetries.svelte.d.ts +4 -1
- package/components/flows/content/FlowSettings.svelte +51 -11
- package/components/flows/content/FlowSettings.svelte.d.ts +1 -0
- package/components/flows/content/RemoveStepConfirmationModal.svelte +1 -1
- package/components/flows/flowStateUtils.d.ts +1 -1
- package/components/flows/flowStateUtils.js +2 -2
- package/components/flows/header/FlowImportExportMenu.svelte +4 -5
- package/components/flows/header/FlowPreviewButtons.svelte +24 -16
- package/components/flows/map/FlowErrorHandlerItem.svelte +14 -8
- package/components/flows/map/FlowModuleSchemaItem.svelte +41 -19
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +6 -1
- package/components/flows/map/FlowModuleSchemaMap.svelte +86 -6
- package/components/flows/pickers/PickHubScript.svelte +1 -0
- package/components/flows/pickers/model.d.ts +5 -0
- package/components/flows/pickers/model.js +1 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte +3 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +2 -0
- package/components/flows/types.d.ts +0 -1
- package/components/flows/utils.d.ts +2 -0
- package/components/flows/utils.js +19 -0
- 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/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/propertyPicker/ObjectViewer.svelte +9 -12
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/PropPicker.svelte +85 -14
- package/components/script_editor/LogPanel.svelte +1 -1
- package/components/scripts/CreateActions.svelte +114 -0
- package/components/scripts/CreateActions.svelte.d.ts +14 -0
- 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/FlowModule.d.ts +2 -0
- package/gen/models/FlowValue.d.ts +1 -11
- package/gen/models/Retry.d.ts +11 -0
- package/gen/models/Retry.js +4 -0
- package/package.json +25 -15
- package/script_helpers.d.ts +4 -1
- package/script_helpers.js +48 -4
- package/stateMachine.d.ts +30 -0
- package/stateMachine.js +41 -0
- package/utils.d.ts +5 -3
- package/utils.js +32 -20
- package/components/flows/content/FlowModuleAdvancedSettings.svelte +0 -64
- package/components/flows/content/FlowModuleAdvancedSettings.svelte.d.ts +0 -17
- package/components/flows/header/FlowEditorHeader.svelte +0 -23
- package/components/flows/header/FlowEditorHeader.svelte.d.ts +0 -14
- package/components/flows/header/FlowStatus.svelte +0 -36
- package/components/flows/header/FlowStatus.svelte.d.ts +0 -14
|
@@ -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';
|
|
@@ -130,13 +129,15 @@ function switchTab() {
|
|
|
130
129
|
<div class="flex flex-col">
|
|
131
130
|
<div class="flex justify-between gap-x-2">
|
|
132
131
|
<Button
|
|
132
|
+
variant="contained"
|
|
133
|
+
color="blue"
|
|
134
|
+
size="md"
|
|
135
|
+
startIcon={{ icon: faPlus }}
|
|
133
136
|
on:click={() => {
|
|
134
137
|
modalProperty = Object.assign({}, DEFAULT_PROPERTY)
|
|
135
138
|
schemaModal.openModal()
|
|
136
139
|
}}
|
|
137
|
-
class="blue-button"
|
|
138
140
|
>
|
|
139
|
-
<Icon data={faPlus} class="mr-1" />
|
|
140
141
|
Add argument
|
|
141
142
|
</Button>
|
|
142
143
|
|
|
@@ -187,16 +188,21 @@ function switchTab() {
|
|
|
187
188
|
<td class="justify-end flex">
|
|
188
189
|
<Button
|
|
189
190
|
color="red"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
size="
|
|
191
|
+
variant="border"
|
|
192
|
+
btnClasses="mr-2"
|
|
193
|
+
size="sm"
|
|
194
|
+
startIcon={{ icon: faTrash }}
|
|
193
195
|
on:click={() => handleDeleteArgument(name)}
|
|
194
196
|
>
|
|
195
|
-
<Icon data={faTrash} class="mr-2" scale={0.8} />
|
|
196
197
|
Delete
|
|
197
198
|
</Button>
|
|
198
|
-
<Button
|
|
199
|
-
|
|
199
|
+
<Button
|
|
200
|
+
color="light"
|
|
201
|
+
variant="border"
|
|
202
|
+
size="sm"
|
|
203
|
+
startIcon={{ icon: faPen }}
|
|
204
|
+
on:click={() => startEditArgument(name)}
|
|
205
|
+
>
|
|
200
206
|
Edit
|
|
201
207
|
</Button>
|
|
202
208
|
</td>
|
|
@@ -8,6 +8,8 @@ export let editableSchema = false;
|
|
|
8
8
|
export let isValid = true;
|
|
9
9
|
export let extraLib = 'missing extraLib';
|
|
10
10
|
export let importPath = undefined;
|
|
11
|
+
let clazz = '';
|
|
12
|
+
export { clazz as class };
|
|
11
13
|
let inputCheck = {};
|
|
12
14
|
$: isValid = allTrue(inputCheck) ?? false;
|
|
13
15
|
$: if (args == undefined) {
|
|
@@ -24,7 +26,7 @@ function removeExtraKey() {
|
|
|
24
26
|
$: schema?.properties && removeExtraKey();
|
|
25
27
|
</script>
|
|
26
28
|
|
|
27
|
-
<div class="w-full">
|
|
29
|
+
<div class="w-full {clazz}">
|
|
28
30
|
{#if Object.keys(schema?.properties ?? {}).length > 0}
|
|
29
31
|
{#each Object.keys(schema?.properties ?? {}) as argName}
|
|
30
32
|
{#if inputTransform}
|
|
@@ -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
|
|
@@ -14,6 +14,9 @@ import ScriptEditor from './ScriptEditor.svelte';
|
|
|
14
14
|
import ScriptSchema from './ScriptSchema.svelte';
|
|
15
15
|
import CenteredPage from './CenteredPage.svelte';
|
|
16
16
|
import Tooltip from './Tooltip.svelte';
|
|
17
|
+
import UnsavedConfirmationModal from './common/confirmationModal/UnsavedConfirmationModal.svelte';
|
|
18
|
+
import { dirtyStore } from './common/confirmationModal/dirtyStore';
|
|
19
|
+
import { Button } from './common';
|
|
17
20
|
export let script;
|
|
18
21
|
export let initialPath = '';
|
|
19
22
|
export let template = 'script';
|
|
@@ -28,6 +31,7 @@ function initContent(language, kind, template) {
|
|
|
28
31
|
}
|
|
29
32
|
async function editScript() {
|
|
30
33
|
try {
|
|
34
|
+
$dirtyStore = false;
|
|
31
35
|
if (!script.schema) {
|
|
32
36
|
await inferArgs(script.language, script.content, script.schema);
|
|
33
37
|
}
|
|
@@ -60,6 +64,7 @@ async function changeStep(step) {
|
|
|
60
64
|
}
|
|
61
65
|
</script>
|
|
62
66
|
|
|
67
|
+
<UnsavedConfirmationModal />
|
|
63
68
|
<div class="flex flex-col h-screen">
|
|
64
69
|
<!-- Nav between steps-->
|
|
65
70
|
<div class="flex flex-col w-full px-4 py-2 border-b shadow-sm">
|
|
@@ -93,37 +98,37 @@ async function changeStep(step) {
|
|
|
93
98
|
</div>
|
|
94
99
|
<div class="flex flex-row-reverse ml-2">
|
|
95
100
|
{#if step != 3}
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
on:click={() =>
|
|
100
|
-
changeStep(step + 1)
|
|
101
|
-
}}
|
|
101
|
+
<Button
|
|
102
|
+
size="sm"
|
|
103
|
+
disabled={step === 1 && pathError !== ''}
|
|
104
|
+
on:click={() => changeStep(step + 1)}
|
|
102
105
|
>
|
|
103
106
|
Next
|
|
104
|
-
</
|
|
107
|
+
</Button>
|
|
105
108
|
{:else}
|
|
106
|
-
<
|
|
109
|
+
<Button size="sm" on:click={editScript}>Save</Button>
|
|
107
110
|
{/if}
|
|
108
111
|
{#if step > 1}
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
112
|
+
<Button
|
|
113
|
+
variant="border"
|
|
114
|
+
size="sm"
|
|
115
|
+
btnClasses="mr-2"
|
|
116
|
+
on:click={() => changeStep(step - 1)}
|
|
114
117
|
>
|
|
115
118
|
Back
|
|
116
|
-
</
|
|
119
|
+
</Button>
|
|
117
120
|
{/if}
|
|
118
121
|
{#if step == 2}
|
|
119
|
-
<
|
|
120
|
-
|
|
122
|
+
<Button
|
|
123
|
+
variant="border"
|
|
124
|
+
size="sm"
|
|
125
|
+
btnClasses="mr-2"
|
|
121
126
|
on:click={async () => {
|
|
122
127
|
editScript()
|
|
123
128
|
}}
|
|
124
129
|
>
|
|
125
130
|
Save (commit)
|
|
126
|
-
</
|
|
131
|
+
</Button>
|
|
127
132
|
{/if}
|
|
128
133
|
</div>
|
|
129
134
|
</div>
|
|
@@ -13,6 +13,7 @@ import EditorBar from './EditorBar.svelte';
|
|
|
13
13
|
import Button from './common/button/Button.svelte';
|
|
14
14
|
import TestJobLoader from './TestJobLoader.svelte';
|
|
15
15
|
import { onMount } from 'svelte';
|
|
16
|
+
import UnsavedConfirmationModal from './common/confirmationModal/UnsavedConfirmationModal.svelte';
|
|
16
17
|
// Exported
|
|
17
18
|
export let schema = emptySchema();
|
|
18
19
|
export let code;
|
|
@@ -133,7 +134,7 @@ onMount(() => {
|
|
|
133
134
|
</left>
|
|
134
135
|
<right slot="right">
|
|
135
136
|
<div class="h-full">
|
|
136
|
-
<VSplitPane topPanelSize="
|
|
137
|
+
<VSplitPane topPanelSize="30%" downPanelSize="70%">
|
|
137
138
|
<top slot="top">
|
|
138
139
|
<div class="h-full overflow-auto">
|
|
139
140
|
<div class="p-4">
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import { ScriptService, FlowService, Script } from '../gen';
|
|
2
|
-
import Icon from 'svelte-awesome';
|
|
3
2
|
import { faSearch } from '@fortawesome/free-solid-svg-icons';
|
|
4
3
|
import { hubScripts, workspaceStore } from '../stores';
|
|
5
4
|
import { createEventDispatcher } from 'svelte';
|
|
@@ -10,6 +9,7 @@ import typescript from 'svelte-highlight/languages/typescript';
|
|
|
10
9
|
import python from 'svelte-highlight/languages/python';
|
|
11
10
|
import { getScriptByPath } from '../utils';
|
|
12
11
|
import RadioButton from './RadioButton.svelte';
|
|
12
|
+
import { Button } from './common';
|
|
13
13
|
export let scriptPath = undefined;
|
|
14
14
|
export let allowFlow = false;
|
|
15
15
|
export let allowHub = false;
|
|
@@ -56,27 +56,37 @@ $: {
|
|
|
56
56
|
}}
|
|
57
57
|
/>
|
|
58
58
|
|
|
59
|
-
<div class="flex flex-row items-center
|
|
60
|
-
<div class="w-80">
|
|
59
|
+
<div class="flex flex-row flex-wrap items-center gap-4">
|
|
60
|
+
<div class="w-80 -mb-2">
|
|
61
61
|
{#if options.length > 1}
|
|
62
62
|
<RadioButton bind:value={itemKind} {options} />
|
|
63
63
|
{/if}
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
<div class="flex items-center grow gap-4">
|
|
67
|
+
<input type="text" value={scriptPath ?? 'No path chosen yet'} disabled />
|
|
68
|
+
<Button
|
|
69
|
+
size="sm"
|
|
70
|
+
endIcon={{ icon: faSearch }}
|
|
71
|
+
btnClasses="mx-auto whitespace-nowrap"
|
|
72
|
+
on:click={() => itemPicker.openModal()}
|
|
73
|
+
>
|
|
74
|
+
Pick a {itemKind} path
|
|
75
|
+
</Button>
|
|
76
|
+
</div>
|
|
77
|
+
{#if scriptPath !== undefined && scriptPath !== ''}
|
|
78
|
+
<Button
|
|
79
|
+
color="light"
|
|
80
|
+
size="xs"
|
|
73
81
|
on:click={async () => {
|
|
74
82
|
const { language, content } = await getScriptByPath(scriptPath ?? '')
|
|
75
83
|
code = content
|
|
76
84
|
lang = language
|
|
77
85
|
modalViewer.openModal()
|
|
78
|
-
}}
|
|
86
|
+
}}
|
|
79
87
|
>
|
|
88
|
+
Show code
|
|
89
|
+
</Button>
|
|
80
90
|
{/if}
|
|
81
91
|
</div>
|
|
82
92
|
|
|
@@ -9,7 +9,6 @@ import SvelteMarkdown from 'svelte-markdown';
|
|
|
9
9
|
export let schema;
|
|
10
10
|
export let summary;
|
|
11
11
|
export let description;
|
|
12
|
-
export let synchronizedHeader = true;
|
|
13
12
|
export function setSchema(newSchema) {
|
|
14
13
|
schema = newSchema;
|
|
15
14
|
}
|
|
@@ -47,16 +46,14 @@ export function setSchema(newSchema) {
|
|
|
47
46
|
</div>
|
|
48
47
|
</div>
|
|
49
48
|
</div>
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</div>
|
|
59
|
-
{/if}
|
|
49
|
+
<div class="bg-blue-100 border-l-4 border-blue-600 text-blue-700 p-4 m-4" role="alert">
|
|
50
|
+
<p class="font-bold">Synchronized with main signature</p>
|
|
51
|
+
<p>
|
|
52
|
+
Argument names, being required or not, and default values are derived from the main
|
|
53
|
+
signature of step 2 and cannot be edited directly. Change the main signature to edit
|
|
54
|
+
them.
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
60
57
|
<SchemaForm {schema} editableSchema={true} />
|
|
61
58
|
</TabContent>
|
|
62
59
|
<TabContent value="jsonschema">
|
|
@@ -6,6 +6,7 @@ import { GroupService, UserService } from '../gen';
|
|
|
6
6
|
import { createEventDispatcher } from 'svelte';
|
|
7
7
|
import AutoComplete from 'simple-svelte-autocomplete';
|
|
8
8
|
import { workspaceStore } from '../stores';
|
|
9
|
+
import { Button } from './common';
|
|
9
10
|
const dispatch = createEventDispatcher();
|
|
10
11
|
export let kind;
|
|
11
12
|
export let path = '';
|
|
@@ -101,10 +102,9 @@ async function addAcl(owner, write) {
|
|
|
101
102
|
<span class="text-sm text-gray-700">Editor</span>
|
|
102
103
|
<input class="block mt-4" type="checkbox" bind:checked={write} />
|
|
103
104
|
</label>
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
>
|
|
105
|
+
<Button size="sm" btnClasses="ml-2" on:click={() => addAcl(newOwner, write)}>
|
|
106
|
+
Add permission
|
|
107
|
+
</Button>
|
|
108
108
|
</div>
|
|
109
109
|
<TableCustom>
|
|
110
110
|
<tr slot="header-row">
|
|
@@ -118,8 +118,8 @@ async function addAcl(owner, write) {
|
|
|
118
118
|
<td>{owner}</td>
|
|
119
119
|
<td>{write}</td>
|
|
120
120
|
<td
|
|
121
|
-
><
|
|
122
|
-
>Delete</
|
|
121
|
+
><Button variant="border" color="blue" size="sm" on:click={() => deleteAcl(owner)}
|
|
122
|
+
>Delete</Button
|
|
123
123
|
></td
|
|
124
124
|
>
|
|
125
125
|
</tr>
|
|
@@ -73,6 +73,7 @@ function format() {
|
|
|
73
73
|
editor.getAction('editor.action.formatDocument').run();
|
|
74
74
|
if (formatAction) {
|
|
75
75
|
formatAction();
|
|
76
|
+
code = getCode();
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
}
|
|
@@ -80,16 +81,6 @@ async function loadMonaco() {
|
|
|
80
81
|
const model = monaco.editor.createModel(code, lang, monaco.Uri.parse(uri));
|
|
81
82
|
model.updateOptions(updateOptions);
|
|
82
83
|
editor = monaco.editor.create(divEl, editorConfig(model, code, lang, automaticLayout));
|
|
83
|
-
if (shouldBindKey) {
|
|
84
|
-
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function () {
|
|
85
|
-
format();
|
|
86
|
-
});
|
|
87
|
-
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, function () {
|
|
88
|
-
if (cmdEnterAction) {
|
|
89
|
-
cmdEnterAction();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
84
|
let timeoutModel = undefined;
|
|
94
85
|
editor.onDidChangeModelContent((event) => {
|
|
95
86
|
timeoutModel && clearTimeout(timeoutModel);
|
|
@@ -99,9 +90,18 @@ async function loadMonaco() {
|
|
|
99
90
|
dispatch('change');
|
|
100
91
|
});
|
|
101
92
|
editor.onDidFocusEditorText(() => {
|
|
93
|
+
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function () {
|
|
94
|
+
code = getCode();
|
|
95
|
+
shouldBindKey && format && format();
|
|
96
|
+
});
|
|
97
|
+
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, function () {
|
|
98
|
+
code = getCode();
|
|
99
|
+
shouldBindKey && cmdEnterAction && cmdEnterAction();
|
|
100
|
+
});
|
|
102
101
|
dispatch('focus');
|
|
103
102
|
});
|
|
104
103
|
editor.onDidBlurEditorText(() => {
|
|
104
|
+
code = getCode();
|
|
105
105
|
dispatch('blur');
|
|
106
106
|
});
|
|
107
107
|
if (lang == 'javascript' && extraLib != '' && extraLibPath != '') {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import RadioButton from './RadioButton.svelte';
|
|
2
2
|
import ResourceTypePicker from './ResourceTypePicker.svelte';
|
|
3
|
+
import { Button } from './common';
|
|
3
4
|
export let pattern;
|
|
4
5
|
export let enum_;
|
|
5
6
|
export let format;
|
|
@@ -23,6 +24,15 @@ $: format =
|
|
|
23
24
|
kind == 'resource' ? (resource != undefined ? `resource-${resource}` : 'resource') : undefined;
|
|
24
25
|
$: pattern = patternStr == '' ? undefined : patternStr;
|
|
25
26
|
$: contentEncoding = kind == 'base64' ? 'base64' : undefined;
|
|
27
|
+
function add() {
|
|
28
|
+
enum_ = enum_ ? enum_.concat('') : [''];
|
|
29
|
+
}
|
|
30
|
+
function remove(item) {
|
|
31
|
+
enum_ = (enum_ || []).filter((el) => el !== item);
|
|
32
|
+
if (enum_.length == 0) {
|
|
33
|
+
enum_ = undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
26
36
|
</script>
|
|
27
37
|
|
|
28
38
|
<RadioButton
|
|
@@ -49,47 +59,31 @@ $: contentEncoding = kind == 'base64' ? 'base64' : undefined;
|
|
|
49
59
|
placeholder="^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
|
|
50
60
|
bind:value={patternStr}
|
|
51
61
|
/>
|
|
52
|
-
<
|
|
53
|
-
|
|
62
|
+
<Button
|
|
63
|
+
variant="border"
|
|
64
|
+
color="blue"
|
|
65
|
+
size="sm"
|
|
66
|
+
btnClasses="mx-2 mb-1"
|
|
54
67
|
on:click={() => {
|
|
55
68
|
patternStr = ''
|
|
56
|
-
}}>clear</
|
|
69
|
+
}}>clear</Button
|
|
57
70
|
>
|
|
58
71
|
</div>
|
|
59
72
|
</label>
|
|
60
73
|
{:else if kind == 'enum'}
|
|
61
|
-
<label for="input" class="mb-2 text-gray-700 text-xs"
|
|
62
|
-
|
|
63
|
-
{#each enum_
|
|
74
|
+
<label for="input" class="mb-2 text-gray-700 text-xs">
|
|
75
|
+
Enums
|
|
76
|
+
{#each enum_ || [] as e}
|
|
64
77
|
<div class="flex flex-row max-w-md">
|
|
65
78
|
<input id="input" type="text" bind:value={e} />
|
|
66
|
-
<
|
|
67
|
-
class="default-button mx-6"
|
|
68
|
-
on:click={() => {
|
|
69
|
-
enum_ = (enum_ ?? []).filter((el) => el != e)
|
|
70
|
-
if (enum_.length == 0) {
|
|
71
|
-
enum_ = undefined
|
|
72
|
-
}
|
|
73
|
-
}}>-</button
|
|
74
|
-
>
|
|
79
|
+
<Button size="sm" btnClasses="ml-6" on:click={() => remove(e)}>-</Button>
|
|
75
80
|
</div>
|
|
76
81
|
{/each}
|
|
77
82
|
<div class="flex flex-row my-1">
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
enum_ = []
|
|
83
|
-
}
|
|
84
|
-
enum_ = enum_.concat('')
|
|
85
|
-
}}>+</button
|
|
86
|
-
>
|
|
87
|
-
<button
|
|
88
|
-
class="default-button-secondary ml-2"
|
|
89
|
-
on:click={() => {
|
|
90
|
-
enum_ = undefined
|
|
91
|
-
}}>clear</button
|
|
92
|
-
>
|
|
83
|
+
<Button size="sm" on:click={add}>+</Button>
|
|
84
|
+
<Button variant="border" size="sm" btnClasses="ml-2" on:click={() => (enum_ = undefined)}>
|
|
85
|
+
Clear
|
|
86
|
+
</Button>
|
|
93
87
|
</div>
|
|
94
88
|
</label>
|
|
95
89
|
{:else if kind == 'resource'}
|
|
@@ -48,13 +48,17 @@ export async function cancelJob() {
|
|
|
48
48
|
export async function watchJob(testId) {
|
|
49
49
|
console.log('watch jobs');
|
|
50
50
|
job = undefined;
|
|
51
|
-
await loadTestJob(testId);
|
|
52
51
|
syncIteration = 0;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
const isCompleted = await loadTestJob(testId);
|
|
53
|
+
if (!isCompleted) {
|
|
54
|
+
isLoading = true;
|
|
55
|
+
intervalId = setInterval(() => {
|
|
56
|
+
syncer(testId);
|
|
57
|
+
}, 500);
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
async function loadTestJob(id) {
|
|
61
|
+
let isCompleted = false;
|
|
58
62
|
try {
|
|
59
63
|
if (job && `running` in job) {
|
|
60
64
|
let previewJobUpdates = await JobService.getJobUpdates({
|
|
@@ -73,16 +77,20 @@ async function loadTestJob(id) {
|
|
|
73
77
|
else {
|
|
74
78
|
job = await JobService.getJob({ workspace: $workspaceStore, id });
|
|
75
79
|
}
|
|
76
|
-
if (job?.type === 'CompletedJob'
|
|
80
|
+
if (job?.type === 'CompletedJob') {
|
|
77
81
|
//only CompletedJob has success property
|
|
78
|
-
|
|
82
|
+
isCompleted = true;
|
|
79
83
|
clearInterval(intervalId);
|
|
80
|
-
isLoading
|
|
84
|
+
if (isLoading) {
|
|
85
|
+
dispatch('done', job);
|
|
86
|
+
isLoading = false;
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
catch (err) {
|
|
84
91
|
console.error(err);
|
|
85
92
|
}
|
|
93
|
+
return isCompleted;
|
|
86
94
|
}
|
|
87
95
|
function syncer(id) {
|
|
88
96
|
if (syncIteration == ITERATIONS_BEFORE_SLOW_REFRESH) {
|
|
@@ -58,7 +58,7 @@ function close() {
|
|
|
58
58
|
white-space: normal;
|
|
59
59
|
border-radius: 0.75rem;
|
|
60
60
|
--tw-bg-opacity: 1;
|
|
61
|
-
background-color: rgb(
|
|
61
|
+
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
|
|
62
62
|
padding: 1rem;
|
|
63
63
|
font-size: 1rem;
|
|
64
64
|
line-height: 1.5rem;
|
|
@@ -8,6 +8,7 @@ import { createEventDispatcher } from 'svelte';
|
|
|
8
8
|
import { workspaceStore } from '../stores';
|
|
9
9
|
import Required from './Required.svelte';
|
|
10
10
|
import Tooltip from './Tooltip.svelte';
|
|
11
|
+
import { Button } from './common';
|
|
11
12
|
const dispatch = createEventDispatcher();
|
|
12
13
|
let path = '';
|
|
13
14
|
let variable = {
|
|
@@ -47,7 +48,7 @@ export async function editVariable(path) {
|
|
|
47
48
|
modal.openModal();
|
|
48
49
|
}
|
|
49
50
|
const MAX_VARIABLE_LENGTH = 3000;
|
|
50
|
-
$: valid = variable.value.length
|
|
51
|
+
$: valid = variable.value.length <= MAX_VARIABLE_LENGTH;
|
|
51
52
|
async function createVariable() {
|
|
52
53
|
await VariableService.createVariable({
|
|
53
54
|
workspace: $workspaceStore,
|
|
@@ -101,7 +102,8 @@ async function updateVariable() {
|
|
|
101
102
|
<div slot="content">
|
|
102
103
|
<div class="text-gray-700 text-2xs mb-6">
|
|
103
104
|
Variables have a globally unique name represented by their path. When passed to scripts, <pre
|
|
104
|
-
class="inline text-red-700 bg-gray-50 rounded round-sm">/</pre
|
|
105
|
+
class="inline text-red-700 bg-gray-50 rounded round-sm">/</pre
|
|
106
|
+
>
|
|
105
107
|
are converted to
|
|
106
108
|
<pre class="inline text-red-700 bg-gray-50 rounded round-sm">_</pre>
|
|
107
109
|
</div>
|
|
@@ -139,12 +141,12 @@ async function updateVariable() {
|
|
|
139
141
|
<Password
|
|
140
142
|
bind:password={variable.value}
|
|
141
143
|
placeholder={'******** (only fill to update value)'}
|
|
142
|
-
label={
|
|
144
|
+
label={`Secret value (${variable.value.length}/3000 characters)`}
|
|
143
145
|
/>
|
|
144
146
|
</div>
|
|
145
147
|
{:else}
|
|
146
148
|
<div>
|
|
147
|
-
<span>Variable (
|
|
149
|
+
<span>Variable value ({variable.value.length}/3000 characters)</span>
|
|
148
150
|
<AutosizedTextarea bind:value={variable.value} minRows={5} />
|
|
149
151
|
</div>
|
|
150
152
|
{/if}
|
|
@@ -155,24 +157,13 @@ async function updateVariable() {
|
|
|
155
157
|
</div>
|
|
156
158
|
</div>
|
|
157
159
|
</div>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
createVariable()
|
|
168
|
-
}
|
|
169
|
-
}}
|
|
170
|
-
disabled={!valid || pathError != ''}
|
|
171
|
-
>
|
|
172
|
-
{#if edit}
|
|
173
|
-
Save
|
|
174
|
-
{:else}
|
|
175
|
-
Add a variable
|
|
176
|
-
{/if}
|
|
177
|
-
</button>
|
|
160
|
+
<div slot="submission">
|
|
161
|
+
<Button
|
|
162
|
+
size="sm"
|
|
163
|
+
on:click={() => (edit ? updateVariable() : createVariable())}
|
|
164
|
+
disabled={!valid || pathError != ''}
|
|
165
|
+
>
|
|
166
|
+
{edit ? 'Save' : 'Add a variable'}
|
|
167
|
+
</Button>
|
|
168
|
+
</div>
|
|
178
169
|
</Modal>
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
<script>export let applyPageWidth = false;
|
|
2
|
-
let
|
|
2
|
+
export let stickToTop = false;
|
|
3
|
+
$: wide = applyPageWidth ? 'max-w-6xl mx-auto px-4 sm:px-6 md:px-8 ' : '';
|
|
4
|
+
let scrollY;
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<svelte:window bind:scrollY />
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
class={'bg-white py-3 ' +
|
|
11
|
+
(stickToTop ? 'sticky top-0 ' + (scrollY >= 30 ? 'border-b ' : '') : '') +
|
|
12
|
+
$$props.class}
|
|
13
|
+
>
|
|
14
|
+
<div class={'w-full flex flex-wrap justify-between items-center gap-4 ' + wide}>
|
|
10
15
|
<div class="flex flex-wrap items-center gap-2">
|
|
11
16
|
{#if $$slots.left}
|
|
12
17
|
<slot name="left" />
|