windmill-components 1.57.4 → 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 +69 -26
- package/components/ArgInput.svelte.d.ts +1 -0
- package/components/Dropdown.svelte +2 -1
- package/components/EditorBar.svelte +3 -2
- package/components/FlowStatusViewer.svelte +24 -4
- package/components/IconedResourceType.svelte +4 -4
- 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/NumberTypeNarrowing.svelte +19 -0
- package/components/NumberTypeNarrowing.svelte.d.ts +17 -0
- package/components/Path.svelte +5 -3
- package/components/Popover.svelte +22 -11
- package/components/Popover.svelte.d.ts +1 -0
- package/components/Range.svelte +304 -0
- package/components/Range.svelte.d.ts +37 -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 +8 -5
- package/components/ScriptBuilder.svelte +0 -1
- package/components/Tooltip.svelte +3 -2
- 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 +37 -0
- package/components/apps/components/numberInputs/AppSliderInputs.svelte.d.ts +21 -0
- package/components/apps/components/table/AppTable.svelte +5 -5
- package/components/apps/editor/AppEditorHeader.svelte +77 -36
- package/components/apps/editor/AppExportButton.svelte +4 -7
- package/components/apps/editor/AppExportButton.svelte.d.ts +2 -0
- package/components/apps/editor/ComponentEditor.svelte +3 -0
- 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 +29 -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 +5 -3
- package/components/apps/utils.d.ts +1 -1
- package/components/apps/utils.js +11 -4
- package/components/common/button/Button.svelte +2 -2
- package/components/common/drawer/Drawer.svelte +1 -1
- package/components/common/table/AppRow.svelte +18 -1
- 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 +16 -0
- package/components/icons/AppwriteIcon.svelte.d.ts +17 -0
- 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/LinkdingIcon.svelte +13 -0
- package/components/icons/LinkdingIcon.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 +25 -3
- package/components/icons/index.js +25 -3
- 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.d.ts +1 -5
- 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 +34 -1
- package/gen/services/WorkspaceService.js +46 -2
- package/package.json +517 -501
- package/utils.d.ts +3 -1
- package/utils.js +14 -0
- package/components/apps/editor/AppPublishButton.svelte +0 -46
- package/components/apps/editor/AppPublishButton.svelte.d.ts +0 -19
- package/components/icons/GItlabIcon.svelte.d.ts +0 -17
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script>import { sendUserToast } from '../utils';
|
|
2
|
+
import { createEventDispatcher } from 'svelte';
|
|
3
|
+
import { workspaceStore } from '../stores';
|
|
4
|
+
import { WorkspaceService } from '../gen';
|
|
5
|
+
import { Button, ToggleButton, ToggleButtonGroup } from './common';
|
|
6
|
+
import Tooltip from './Tooltip.svelte';
|
|
7
|
+
const dispatch = createEventDispatcher();
|
|
8
|
+
let email;
|
|
9
|
+
let username;
|
|
10
|
+
function handleKeyUp(event) {
|
|
11
|
+
const key = event.key;
|
|
12
|
+
if (key === 'Enter') {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
addUser();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function addUser() {
|
|
18
|
+
await WorkspaceService.addUser({
|
|
19
|
+
workspace: $workspaceStore,
|
|
20
|
+
requestBody: {
|
|
21
|
+
email,
|
|
22
|
+
username,
|
|
23
|
+
is_admin: selected == 'admin',
|
|
24
|
+
operator: selected == 'operator'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
sendUserToast(`Added ${email}`);
|
|
28
|
+
dispatch('new');
|
|
29
|
+
}
|
|
30
|
+
let selected = 'author';
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div class="flex flex-row">
|
|
34
|
+
<input type="email" on:keyup={handleKeyUp} placeholder="email" bind:value={email} class="mr-4" />
|
|
35
|
+
<input
|
|
36
|
+
type="text"
|
|
37
|
+
on:keyup={handleKeyUp}
|
|
38
|
+
placeholder="username"
|
|
39
|
+
bind:value={username}
|
|
40
|
+
class="mr-4"
|
|
41
|
+
/>
|
|
42
|
+
<ToggleButtonGroup bind:selected>
|
|
43
|
+
<ToggleButton position="left" value="operator" size="sm"
|
|
44
|
+
>Operator <Tooltip
|
|
45
|
+
>An operator can only execute and view scripts/flows/apps from your workspace, and only
|
|
46
|
+
those that he has visibility on</Tooltip
|
|
47
|
+
></ToggleButton
|
|
48
|
+
>
|
|
49
|
+
<ToggleButton position="center" value="author" size="sm"
|
|
50
|
+
>Author <Tooltip
|
|
51
|
+
>An Author can execute and view scripts/flows/apps, but he can also create new ones</Tooltip
|
|
52
|
+
></ToggleButton
|
|
53
|
+
>
|
|
54
|
+
<ToggleButton position="right" value="admin" size="sm">Admin</ToggleButton>
|
|
55
|
+
</ToggleButtonGroup>
|
|
56
|
+
<Button
|
|
57
|
+
variant="contained"
|
|
58
|
+
color="blue"
|
|
59
|
+
size="sm"
|
|
60
|
+
btnClasses="!ml-8"
|
|
61
|
+
on:click={addUser}
|
|
62
|
+
disabled={email === undefined}
|
|
63
|
+
>
|
|
64
|
+
Add
|
|
65
|
+
</Button>
|
|
66
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
new: CustomEvent<any>;
|
|
6
|
+
} & {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type AddUserProps = typeof __propDef.props;
|
|
12
|
+
export type AddUserEvents = typeof __propDef.events;
|
|
13
|
+
export type AddUserSlots = typeof __propDef.slots;
|
|
14
|
+
export default class AddUser extends SvelteComponentTyped<AddUserProps, AddUserEvents, AddUserSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<script context="module">"use strict";
|
|
2
2
|
const apiTokenApps = {
|
|
3
3
|
airtable: {
|
|
4
|
-
img: 'airtable_connect.png',
|
|
4
|
+
img: '/airtable_connect.png',
|
|
5
5
|
instructions: ['Click on the top-right avatar', 'Click on Account', 'Find "Api"']
|
|
6
6
|
},
|
|
7
7
|
discord_webhook: {
|
|
8
|
-
img: 'discord_webhook.png',
|
|
8
|
+
img: '/discord_webhook.png',
|
|
9
9
|
instructions: ['Click on Server Settings', 'Click on Integration', 'Find "Webhooks"'],
|
|
10
10
|
key: 'webhook_url'
|
|
11
11
|
},
|
|
12
12
|
toggl: {
|
|
13
|
-
img: 'toggl_connect.png',
|
|
13
|
+
img: '/toggl_connect.png',
|
|
14
14
|
instructions: [
|
|
15
15
|
'Go to <a href="https://track.toggl.com/profile" target="_blank" rel=”noopener noreferrer”>https://track.toggl.com/profile</a>',
|
|
16
16
|
'Find "API Token"'
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
mailchimp: {
|
|
20
|
-
img: 'mailchimp_connect.png',
|
|
20
|
+
img: '/mailchimp_connect.png',
|
|
21
21
|
instructions: [
|
|
22
22
|
'Go to <a href="https://admin.mailchimp.com/account/api" target="_blank" rel=”noopener noreferrer”>https://admin.mailchimp.com/account/api</a>',
|
|
23
23
|
'Find "Your API Keys"'
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
sendgrid: {
|
|
27
|
-
img: 'sendgrid_connect.png',
|
|
27
|
+
img: '/sendgrid_connect.png',
|
|
28
28
|
instructions: [
|
|
29
29
|
'Go to <a href="https://app.sendgrid.com/settings/api_keys" target="_blank" rel=”noopener noreferrer”>https://app.sendgrid.com/settings/api_keys</a>',
|
|
30
30
|
'Create an API key',
|
|
@@ -134,6 +134,7 @@ async function next() {
|
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
136
136
|
window.open(url.toString(), '_blank');
|
|
137
|
+
drawer.closeDrawer();
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { faChevronDown, faChevronUp, faDollarSign, faMinus, faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
2
2
|
import { setInputCat as computeInputCat } from '../utils';
|
|
3
|
-
import { Button } from './common';
|
|
3
|
+
import { Badge, Button } from './common';
|
|
4
4
|
import { createEventDispatcher } from 'svelte';
|
|
5
5
|
import Icon from 'svelte-awesome';
|
|
6
6
|
import FieldHeader from './FieldHeader.svelte';
|
|
@@ -13,6 +13,8 @@ import SimpleEditor from './SimpleEditor.svelte';
|
|
|
13
13
|
import autosize from 'svelte-autosize';
|
|
14
14
|
import Toggle from './Toggle.svelte';
|
|
15
15
|
import Password from './Password.svelte';
|
|
16
|
+
import NumberTypeNarrowing from './NumberTypeNarrowing.svelte';
|
|
17
|
+
import Range from './Range.svelte';
|
|
16
18
|
export let label = '';
|
|
17
19
|
export let value;
|
|
18
20
|
export let defaultValue = undefined;
|
|
@@ -37,6 +39,7 @@ export let pickForField = undefined;
|
|
|
37
39
|
export let variableEditor = undefined;
|
|
38
40
|
export let itemPicker = undefined;
|
|
39
41
|
export let noMargin = false;
|
|
42
|
+
export let extra = {};
|
|
40
43
|
let seeEditable = enum_ != undefined || pattern != undefined;
|
|
41
44
|
const dispatch = createEventDispatcher();
|
|
42
45
|
$: maxHeight = maxRows ? `${1 + maxRows * 1.2}em` : `auto`;
|
|
@@ -116,20 +119,24 @@ function testRegex(pattern, value) {
|
|
|
116
119
|
$: {
|
|
117
120
|
if (value == undefined || value == null) {
|
|
118
121
|
value = defaultValue;
|
|
119
|
-
if (defaultValue === undefined || defaultValue === null)
|
|
122
|
+
if (defaultValue === undefined || defaultValue === null) {
|
|
120
123
|
if (inputCat === 'string') {
|
|
121
124
|
value = '';
|
|
122
125
|
}
|
|
123
126
|
else if (inputCat == 'enum') {
|
|
124
127
|
value = enum_?.[0];
|
|
125
128
|
}
|
|
129
|
+
else if (inputCat == 'boolean') {
|
|
130
|
+
value = false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
126
133
|
}
|
|
127
134
|
}
|
|
128
135
|
export let inputCat = 'string';
|
|
129
136
|
$: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncoding);
|
|
130
137
|
</script>
|
|
131
138
|
|
|
132
|
-
<div class="flex flex-col w-full">
|
|
139
|
+
<div class="flex flex-col w-full min-w-[250px]">
|
|
133
140
|
<div>
|
|
134
141
|
{#if displayHeader}
|
|
135
142
|
<FieldHeader {label} {required} {type} {contentEncoding} {format} {itemsType} />
|
|
@@ -159,6 +166,8 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
159
166
|
/>
|
|
160
167
|
{#if type == 'string' && format != 'date-time'}
|
|
161
168
|
<StringTypeNarrowing bind:format bind:pattern bind:enum_ bind:contentEncoding />
|
|
169
|
+
{:else if type == 'number'}
|
|
170
|
+
<NumberTypeNarrowing bind:min={extra['min']} bind:max={extra['max']} />
|
|
162
171
|
{:else if type == 'object'}
|
|
163
172
|
<ObjectTypeNarrowing bind:format />
|
|
164
173
|
{:else if type == 'array'}
|
|
@@ -186,20 +195,40 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
186
195
|
|
|
187
196
|
<div class="flex space-x-1">
|
|
188
197
|
{#if inputCat == 'number'}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
{#if extra['min'] != undefined && extra['max'] != undefined}
|
|
199
|
+
<div class="flex w-full gap-1">
|
|
200
|
+
<span>{extra['min']}</span>
|
|
201
|
+
<div class="grow">
|
|
202
|
+
<Range bind:value min={extra['min']} max={extra['max']} />
|
|
203
|
+
</div>
|
|
204
|
+
<span>{extra['max']}</span>
|
|
205
|
+
<span class="mx-2"><Badge large color="blue">{value}</Badge></span>
|
|
206
|
+
</div>
|
|
207
|
+
{:else}
|
|
208
|
+
<input
|
|
209
|
+
{autofocus}
|
|
210
|
+
on:focus={(e) => {
|
|
211
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
212
|
+
dispatch('focus')
|
|
213
|
+
}}
|
|
214
|
+
{disabled}
|
|
215
|
+
type="number"
|
|
216
|
+
class={valid
|
|
217
|
+
? ''
|
|
218
|
+
: 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}
|
|
219
|
+
placeholder={defaultValue ?? ''}
|
|
220
|
+
bind:value
|
|
221
|
+
min={extra['min']}
|
|
222
|
+
max={extra['max']}
|
|
223
|
+
on:input={() => dispatch('input', { value, isRaw: true })}
|
|
224
|
+
/>
|
|
225
|
+
{/if}
|
|
201
226
|
{:else if inputCat == 'boolean'}
|
|
202
227
|
<Toggle
|
|
228
|
+
on:pointerdown={(e) => {
|
|
229
|
+
e?.stopPropagation()
|
|
230
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
231
|
+
}}
|
|
203
232
|
{disabled}
|
|
204
233
|
class={valid
|
|
205
234
|
? ''
|
|
@@ -277,7 +306,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
277
306
|
{:else}
|
|
278
307
|
<textarea
|
|
279
308
|
bind:this={el}
|
|
280
|
-
on:focus
|
|
309
|
+
on:focus={(e) => {
|
|
310
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
311
|
+
dispatch('focus')
|
|
312
|
+
}}
|
|
281
313
|
{autofocus}
|
|
282
314
|
{disabled}
|
|
283
315
|
use:autosize
|
|
@@ -293,7 +325,15 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
293
325
|
/>
|
|
294
326
|
{/if}
|
|
295
327
|
{:else if inputCat == 'enum'}
|
|
296
|
-
<select
|
|
328
|
+
<select
|
|
329
|
+
on:focus={(e) => {
|
|
330
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
331
|
+
dispatch('focus')
|
|
332
|
+
}}
|
|
333
|
+
{disabled}
|
|
334
|
+
class="px-6"
|
|
335
|
+
bind:value
|
|
336
|
+
>
|
|
297
337
|
{#each enum_ ?? [] as e}
|
|
298
338
|
<option>{e}</option>
|
|
299
339
|
{/each}
|
|
@@ -303,7 +343,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
303
343
|
{:else if inputCat == 'sql' || inputCat == 'yaml'}
|
|
304
344
|
<div class="border my-1 mb-4 w-full border-gray-400">
|
|
305
345
|
<SimpleEditor
|
|
306
|
-
on:focus={() =>
|
|
346
|
+
on:focus={(e) => {
|
|
347
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
348
|
+
dispatch('focus')
|
|
349
|
+
}}
|
|
307
350
|
on:blur={() => dispatch('blur')}
|
|
308
351
|
bind:this={editor}
|
|
309
352
|
lang={inputCat}
|
|
@@ -339,7 +382,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
339
382
|
{autofocus}
|
|
340
383
|
rows="1"
|
|
341
384
|
bind:this={el}
|
|
342
|
-
on:focus={() =>
|
|
385
|
+
on:focus={(e) => {
|
|
386
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
387
|
+
dispatch('focus')
|
|
388
|
+
}}
|
|
343
389
|
on:blur={() => dispatch('blur')}
|
|
344
390
|
use:autosize
|
|
345
391
|
type="text"
|
|
@@ -355,16 +401,13 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
355
401
|
/>
|
|
356
402
|
{#if itemPicker}
|
|
357
403
|
<div class="ml-1 relative">
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
color="blue"
|
|
362
|
-
size="sm"
|
|
363
|
-
btnClasses="min-w-min min-h-[34px] items-center leading-4 py-0"
|
|
404
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
405
|
+
<div
|
|
406
|
+
class="min-w-min min-h-[34px] items-center leading-4 px-3 text-blue-500 cursor-pointer border border-blue-500 rounded center-center"
|
|
364
407
|
on:click={() => {
|
|
365
408
|
pickForField = label
|
|
366
409
|
itemPicker?.openDrawer?.()
|
|
367
|
-
}}><Icon data={faDollarSign} /></
|
|
410
|
+
}}><Icon data={faDollarSign} /></div
|
|
368
411
|
>
|
|
369
412
|
</div>
|
|
370
413
|
{/if}
|
|
@@ -35,6 +35,7 @@ declare const __propDef: {
|
|
|
35
35
|
variableEditor?: VariableEditor | undefined;
|
|
36
36
|
itemPicker?: ItemPicker | undefined;
|
|
37
37
|
noMargin?: boolean | undefined;
|
|
38
|
+
extra?: Record<string, any> | undefined;
|
|
38
39
|
editor?: SimpleEditor | undefined;
|
|
39
40
|
evalValueToRaw?: (() => void) | undefined;
|
|
40
41
|
focus?: (() => void) | undefined;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Icon from 'svelte-awesome';
|
|
3
3
|
import { MoreHorizontal } from 'lucide-svelte';
|
|
4
4
|
import { Button, Menu } from './common';
|
|
5
|
+
import { goto } from '$app/navigation';
|
|
5
6
|
export let dropdownItems;
|
|
6
7
|
export let name = undefined;
|
|
7
8
|
export let placement = 'bottom-start';
|
|
@@ -52,7 +53,7 @@ const dispatch = createEventDispatcher();
|
|
|
52
53
|
{:else if item.href && !item.disabled}
|
|
53
54
|
<a
|
|
54
55
|
href={item.href}
|
|
55
|
-
on:click|stopPropagation
|
|
56
|
+
on:click|stopPropagation|preventDefault={() => goto(item.href ?? '')}
|
|
56
57
|
class="block w-full px-4 font-semibold text-left py-2 text-sm text-gray-700 hover:drop-shadow-sm hover:bg-gray-50 hover:bg-opacity-30
|
|
57
58
|
{item.disabled ? 'bg-gray-200' : ''}"
|
|
58
59
|
role="menuitem"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<script>import { ResourceService, VariableService } from '../gen';
|
|
5
5
|
import { getScriptByPath, sendUserToast } from '../utils';
|
|
6
|
-
import { faBroom, faCube, faDollarSign, faEye, faRotate, faRotateLeft } from '@fortawesome/free-solid-svg-icons';
|
|
6
|
+
import { faBroom, faCube, faDollarSign, faEye, faPlus, faRotate, faRotateLeft } from '@fortawesome/free-solid-svg-icons';
|
|
7
7
|
import { workspaceStore } from '../stores';
|
|
8
8
|
import ItemPicker from './ItemPicker.svelte';
|
|
9
9
|
import ResourceEditor from './ResourceEditor.svelte';
|
|
@@ -142,11 +142,12 @@ async function onScriptPick(e) {
|
|
|
142
142
|
variant="border"
|
|
143
143
|
color="blue"
|
|
144
144
|
size="sm"
|
|
145
|
+
startIcon={{ icon: faPlus }}
|
|
145
146
|
on:click={() => {
|
|
146
147
|
variableEditor.initNew()
|
|
147
148
|
}}
|
|
148
149
|
>
|
|
149
|
-
|
|
150
|
+
New variable
|
|
150
151
|
</Button>
|
|
151
152
|
</div>
|
|
152
153
|
</ItemPicker>
|
|
@@ -6,7 +6,7 @@ import Icon from 'svelte-awesome';
|
|
|
6
6
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
7
7
|
import { createEventDispatcher } from 'svelte';
|
|
8
8
|
import { onDestroy } from 'svelte';
|
|
9
|
-
import { Button, Tab } from './common';
|
|
9
|
+
import { Badge, Button, Tab } from './common';
|
|
10
10
|
import DisplayResult from './DisplayResult.svelte';
|
|
11
11
|
import Tabs from './common/tabs/Tabs.svelte';
|
|
12
12
|
import { FlowGraph } from './graph';
|
|
@@ -15,6 +15,7 @@ import { displayDate, isOwner, pluralize, truncateRev } from '../utils';
|
|
|
15
15
|
import JobArgs from './JobArgs.svelte';
|
|
16
16
|
import Tooltip from './Tooltip.svelte';
|
|
17
17
|
import SimpleEditor from './SimpleEditor.svelte';
|
|
18
|
+
import { Loader2 } from 'lucide-svelte';
|
|
18
19
|
const dispatch = createEventDispatcher();
|
|
19
20
|
export let jobId;
|
|
20
21
|
export let flowState = undefined;
|
|
@@ -144,9 +145,9 @@ let payload = '"a test payload in json"';
|
|
|
144
145
|
<div class="w-full h-full">
|
|
145
146
|
<FlowJobResult result={job.result} logs={job.logs ?? ''} />
|
|
146
147
|
</div>
|
|
147
|
-
{:else if job.flow_status?.modules?.[job?.flow_status?.step]
|
|
148
|
+
{:else if job.flow_status?.modules?.[job?.flow_status?.step]?.type === FlowStatusModule.type.WAITING_FOR_EVENTS}
|
|
148
149
|
<div class="w-full h-full mt-2 text-sm text-gray-600">
|
|
149
|
-
<p>Waiting
|
|
150
|
+
<p>Waiting to be resumed</p>
|
|
150
151
|
<div>
|
|
151
152
|
{#if is_owner}
|
|
152
153
|
<div class="flex flex-row gap-2 mt-2">
|
|
@@ -175,7 +176,8 @@ let payload = '"a test payload in json"';
|
|
|
175
176
|
>
|
|
176
177
|
</div>
|
|
177
178
|
{:else}
|
|
178
|
-
You cannot resume the
|
|
179
|
+
You cannot resume the flow yourself without receiving the resume secret since you
|
|
180
|
+
are not an owner of {job.script_path}
|
|
179
181
|
{/if}
|
|
180
182
|
</div>
|
|
181
183
|
</div>
|
|
@@ -183,6 +185,24 @@ let payload = '"a test payload in json"';
|
|
|
183
185
|
<div class="text-xs p-4 bg-gray-50 overflow-auto max-h-80 border">
|
|
184
186
|
<pre class="w-full">{job.logs}</pre>
|
|
185
187
|
</div>
|
|
188
|
+
{:else if innerModules?.length > 0}
|
|
189
|
+
<div class="flex flex-col gap-1">
|
|
190
|
+
{#each innerModules as mod, i (mod.id)}
|
|
191
|
+
{#if mod.type == FlowStatusModule.type.IN_PROGRESS}
|
|
192
|
+
<div
|
|
193
|
+
><span class="inline-flex gap-1"
|
|
194
|
+
><Badge color="indigo">{mod.id}</Badge>
|
|
195
|
+
{#if job.raw_flow?.modules[i]?.summary}
|
|
196
|
+
<span class="font-medium text-gray-900">
|
|
197
|
+
{job.raw_flow?.modules[i]?.summary ?? ''}
|
|
198
|
+
</span>
|
|
199
|
+
{/if}
|
|
200
|
+
<Loader2 class="animate-spin" /></span
|
|
201
|
+
></div
|
|
202
|
+
>
|
|
203
|
+
{/if}
|
|
204
|
+
{/each}
|
|
205
|
+
</div>
|
|
186
206
|
{/if}
|
|
187
207
|
</div>
|
|
188
208
|
{/if}
|
|
@@ -5,19 +5,19 @@ export let after = false;
|
|
|
5
5
|
export let height = '24px';
|
|
6
6
|
export let width = '24px';
|
|
7
7
|
export let center = false;
|
|
8
|
-
$:
|
|
8
|
+
$: iconComponent = APP_TO_ICON_COMPONENT[name] || APP_TO_ICON_COMPONENT[name.split('_')[0]];
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<div class="truncate flex flex-row gap-2 {center ? 'justify-center items-center' : ''} -pl-2">
|
|
12
12
|
{#if !silent && !after}
|
|
13
13
|
{name}
|
|
14
14
|
{/if}
|
|
15
|
-
{#if
|
|
15
|
+
{#if iconComponent}
|
|
16
16
|
<span class="text-gray-700 grayscale">
|
|
17
|
-
<svelte:component this={
|
|
17
|
+
<svelte:component this={iconComponent} {height} {width} />
|
|
18
18
|
</span>
|
|
19
19
|
{:else}
|
|
20
|
-
<span style="width: {width}" class="bg-gray-100 rounded-full" />
|
|
20
|
+
<span style="width: {width}; height: {height}" class="bg-gray-100 rounded-full" />
|
|
21
21
|
{/if}
|
|
22
22
|
{#if !silent && after}
|
|
23
23
|
{name}
|
|
@@ -6,7 +6,6 @@ import { Button, ToggleButton, ToggleButtonGroup } from './common';
|
|
|
6
6
|
import Tooltip from './Tooltip.svelte';
|
|
7
7
|
const dispatch = createEventDispatcher();
|
|
8
8
|
let email;
|
|
9
|
-
let is_admin = false;
|
|
10
9
|
function handleKeyUp(event) {
|
|
11
10
|
const key = event.key;
|
|
12
11
|
if (key === 'Enter') {
|
|
@@ -42,12 +42,12 @@ let drawer;
|
|
|
42
42
|
/>
|
|
43
43
|
|
|
44
44
|
<Drawer bind:this={drawer} size="600px">
|
|
45
|
-
<DrawerContent title="Search
|
|
46
|
-
<div class="w-full">
|
|
45
|
+
<DrawerContent overflow_y={false} title="Search {itemName}s" on:close={drawer.closeDrawer}>
|
|
46
|
+
<div class="w-full h-full flex flex-col">
|
|
47
47
|
<div class="w-12/12 pb-4">
|
|
48
48
|
<input
|
|
49
49
|
type="text"
|
|
50
|
-
placeholder="Search {itemName}"
|
|
50
|
+
placeholder="Search {itemName}s"
|
|
51
51
|
bind:value={filter}
|
|
52
52
|
class="search-item"
|
|
53
53
|
/>
|
|
@@ -61,10 +61,10 @@ let drawer;
|
|
|
61
61
|
{@html noItemMessage}
|
|
62
62
|
</div>
|
|
63
63
|
{:else if filteredItems?.length}
|
|
64
|
-
<div class="border rounded-md divide-y divide-gray-200 w-full">
|
|
64
|
+
<div class="border rounded-md divide-y divide-gray-200 w-full overflow-auto pb-12 grow">
|
|
65
65
|
{#each filteredItems as obj}
|
|
66
66
|
<div
|
|
67
|
-
class="hover:bg-gray-50 w-full
|
|
67
|
+
class="hover:bg-gray-50 w-full flex items-center p-4 gap-4 first-of-type:!border-t-0
|
|
68
68
|
first-of-type:rounded-t-md last-of-type:rounded-b-md"
|
|
69
69
|
>
|
|
70
70
|
<div class="inline-flex items-center grow">
|
|
@@ -35,7 +35,6 @@ export async function runTest(args) {
|
|
|
35
35
|
else {
|
|
36
36
|
throw Error('not testable module type');
|
|
37
37
|
}
|
|
38
|
-
sendUserToast(`started test ${truncateRev(jobId ?? '', 10)}`);
|
|
39
38
|
}
|
|
40
39
|
function jobDone() {
|
|
41
40
|
if (testJob && !testJob.canceled && testJob.type == 'CompletedJob' && `result` in testJob) {
|
|
@@ -61,6 +60,7 @@ function jobDone() {
|
|
|
61
60
|
{/if}
|
|
62
61
|
|
|
63
62
|
<RunForm
|
|
63
|
+
loading={testIsLoading}
|
|
64
64
|
runnable={{ summary: mod.summary ?? '', schema, description: '' }}
|
|
65
65
|
runAction={(_, args) => runTest(args)}
|
|
66
66
|
schedulable={false}
|
|
@@ -35,7 +35,8 @@ async function updatePath() {
|
|
|
35
35
|
path: path ?? '',
|
|
36
36
|
summary: summary ?? '',
|
|
37
37
|
description: flow.description,
|
|
38
|
-
value: flow.value
|
|
38
|
+
value: flow.value,
|
|
39
|
+
schema: flow.schema
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
}
|
|
@@ -85,7 +86,6 @@ async function updatePath() {
|
|
|
85
86
|
type="text"
|
|
86
87
|
bind:value={summary}
|
|
87
88
|
placeholder="A short summary displayed when it is listed"
|
|
88
|
-
rows="1"
|
|
89
89
|
disabled={!own}
|
|
90
90
|
/>
|
|
91
91
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import Toggle from './Toggle.svelte';
|
|
2
|
+
export let min;
|
|
3
|
+
export let max;
|
|
4
|
+
let minChecked = min != undefined;
|
|
5
|
+
let maxChecked = max != undefined;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class="my-2" />
|
|
9
|
+
|
|
10
|
+
<div class="flex flex-col gap-2">
|
|
11
|
+
<div class="flex gap-2">
|
|
12
|
+
<Toggle bind:checked={minChecked} options={{ right: 'min' }} />
|
|
13
|
+
<input type="number" bind:value={min} disabled={!minChecked} />
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex gap-2">
|
|
16
|
+
<Toggle bind:checked={maxChecked} options={{ right: 'max' }} />
|
|
17
|
+
<input type="number" bind:value={max} disabled={!maxChecked} />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
min: number | undefined;
|
|
5
|
+
max: number | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export type NumberTypeNarrowingProps = typeof __propDef.props;
|
|
13
|
+
export type NumberTypeNarrowingEvents = typeof __propDef.events;
|
|
14
|
+
export type NumberTypeNarrowingSlots = typeof __propDef.slots;
|
|
15
|
+
export default class NumberTypeNarrowing extends SvelteComponentTyped<NumberTypeNarrowingProps, NumberTypeNarrowingEvents, NumberTypeNarrowingSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/components/Path.svelte
CHANGED
|
@@ -60,12 +60,14 @@ export async function reset() {
|
|
|
60
60
|
}
|
|
61
61
|
async function loadFolders() {
|
|
62
62
|
let initialFolders = [];
|
|
63
|
+
let initialFolder = '';
|
|
63
64
|
if (initialPath?.split('/')?.[0] == 'f') {
|
|
64
|
-
|
|
65
|
+
initialFolder = initialPath?.split('/')?.[1];
|
|
66
|
+
initialFolders.push(initialFolder);
|
|
65
67
|
}
|
|
66
|
-
folders = initialFolders.concat(await FolderService.listFolderNames({
|
|
68
|
+
folders = initialFolders.concat((await FolderService.listFolderNames({
|
|
67
69
|
workspace: $workspaceStore
|
|
68
|
-
}));
|
|
70
|
+
})).filter((x) => x != initialFolder));
|
|
69
71
|
}
|
|
70
72
|
async function loadGroups() {
|
|
71
73
|
let initialGroups = [];
|
|
@@ -4,6 +4,7 @@ const ALIGN = ['start', 'end'];
|
|
|
4
4
|
export let placement = 'auto';
|
|
5
5
|
export let notClickable = false;
|
|
6
6
|
export let popupClass = '';
|
|
7
|
+
export let disapperTimoout = 100;
|
|
7
8
|
const [popperRef, popperContent] = createPopperActions({ placement });
|
|
8
9
|
const betterPreventOverflow = (options) => ({
|
|
9
10
|
name: 'preventOverflow',
|
|
@@ -32,20 +33,30 @@ function open() {
|
|
|
32
33
|
showTooltip = true;
|
|
33
34
|
}
|
|
34
35
|
function close() {
|
|
35
|
-
timeout = setTimeout(() => (showTooltip = false),
|
|
36
|
+
timeout = setTimeout(() => (showTooltip = false), disapperTimoout);
|
|
36
37
|
}
|
|
37
38
|
</script>
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
{#if notClickable}
|
|
41
|
+
<span
|
|
42
|
+
use:popperRef
|
|
43
|
+
on:mouseenter={open}
|
|
44
|
+
on:mouseleave={close}
|
|
45
|
+
class={$$props.class}
|
|
46
|
+
>
|
|
47
|
+
<slot />
|
|
48
|
+
</span>
|
|
49
|
+
{:else}
|
|
50
|
+
<button
|
|
51
|
+
use:popperRef
|
|
52
|
+
on:mouseenter={open}
|
|
53
|
+
on:mouseleave={close}
|
|
54
|
+
on:click
|
|
55
|
+
class={$$props.class}
|
|
56
|
+
>
|
|
57
|
+
<slot />
|
|
58
|
+
</button>
|
|
59
|
+
{/if}
|
|
49
60
|
{#if showTooltip}
|
|
50
61
|
<div
|
|
51
62
|
use:popperContent={extraOpts}
|
|
@@ -5,6 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
placement?: "left" | "right" | "auto" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "auto-start" | "auto-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
|
|
6
6
|
notClickable?: boolean | undefined;
|
|
7
7
|
popupClass?: string | undefined;
|
|
8
|
+
disapperTimoout?: number | undefined;
|
|
8
9
|
};
|
|
9
10
|
events: {
|
|
10
11
|
click: MouseEvent;
|