windmill-components 1.58.1 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/components/AddUser.svelte +66 -0
  2. package/components/AddUser.svelte.d.ts +16 -0
  3. package/components/AppConnect.svelte +6 -5
  4. package/components/ArgInput.svelte +39 -14
  5. package/components/Dropdown.svelte +2 -1
  6. package/components/EditorBar.svelte +3 -2
  7. package/components/FlowStatusViewer.svelte +24 -4
  8. package/components/IconedResourceType.svelte +3 -3
  9. package/components/InviteUser.svelte +0 -1
  10. package/components/ItemPicker.svelte +5 -5
  11. package/components/ModulePreview.svelte +1 -1
  12. package/components/MoveDrawer.svelte +2 -2
  13. package/components/Path.svelte +5 -3
  14. package/components/Popover.svelte +22 -11
  15. package/components/Popover.svelte.d.ts +1 -0
  16. package/components/ResourcePicker.svelte +9 -2
  17. package/components/RunForm.svelte +4 -2
  18. package/components/RunForm.svelte.d.ts +1 -0
  19. package/components/SchemaForm.svelte +7 -5
  20. package/components/ScriptBuilder.svelte +0 -1
  21. package/components/Tooltip.svelte +2 -1
  22. package/components/Tooltip.svelte.d.ts +3 -1
  23. package/components/apps/components/DisplayComponent.svelte +1 -1
  24. package/components/apps/components/buttons/AppButton.svelte +2 -5
  25. package/components/apps/components/dataDisplay/AppBarChart.svelte +1 -1
  26. package/components/apps/components/dataDisplay/AppHtml.svelte +1 -1
  27. package/components/apps/components/dataDisplay/AppPieChart.svelte +1 -1
  28. package/components/apps/components/dataDisplay/AppScatterChart.svelte +1 -1
  29. package/components/apps/components/dataDisplay/AppText.svelte +32 -9
  30. package/components/apps/components/dataDisplay/AppTimeseries.svelte +1 -1
  31. package/components/apps/components/form/AppForm.svelte +39 -26
  32. package/components/apps/components/helpers/RunnableComponent.svelte +12 -7
  33. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +3 -0
  34. package/components/apps/components/helpers/RunnableWrapper.svelte +6 -0
  35. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +3 -0
  36. package/components/apps/components/numberInputs/AppSliderInputs.svelte +1 -1
  37. package/components/apps/components/table/AppTable.svelte +5 -5
  38. package/components/apps/editor/AppEditorHeader.svelte +19 -12
  39. package/components/apps/editor/GridEditor.svelte +0 -1
  40. package/components/apps/editor/GridEditor.svelte.d.ts +0 -2
  41. package/components/apps/editor/componentsPanel/data.js +7 -0
  42. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +7 -8
  43. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +1 -1
  44. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +4 -1
  45. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +1 -3
  46. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +52 -33
  47. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -4
  48. package/components/apps/editor/settingsPanel/TableActions.svelte +1 -1
  49. package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte +1 -1
  50. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +2 -1
  51. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +1 -0
  52. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
  53. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +4 -3
  54. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +1 -0
  55. package/components/apps/editorUtils.js +7 -2
  56. package/components/apps/inputType.d.ts +1 -1
  57. package/components/apps/types.d.ts +3 -2
  58. package/components/apps/utils.d.ts +1 -1
  59. package/components/apps/utils.js +6 -3
  60. package/components/common/button/Button.svelte +2 -2
  61. package/components/common/drawer/Drawer.svelte +1 -1
  62. package/components/common/table/AppRow.svelte +5 -0
  63. package/components/common/table/LanguageBadge.svelte +3 -1
  64. package/components/common/table/Row.svelte +5 -3
  65. package/components/flows/CreateActionsApp.svelte +1 -3
  66. package/components/flows/CreateActionsFlow.svelte +1 -1
  67. package/components/flows/content/CapturePayload.svelte +4 -4
  68. package/components/flows/content/FlowSettings.svelte +0 -1
  69. package/components/flows/utils.js +8 -6
  70. package/components/home/ItemsList.svelte +10 -4
  71. package/components/home/ListFilters.svelte +9 -1
  72. package/components/icons/AppwriteIcon.svelte +11 -13
  73. package/components/icons/AwsIcon.svelte +9 -0
  74. package/components/icons/AwsIcon.svelte.d.ts +17 -0
  75. package/components/icons/BcryptIcon.svelte +10 -0
  76. package/components/icons/BcryptIcon.svelte.d.ts +17 -0
  77. package/components/icons/{GItlabIcon.svelte → GitlabIcon.svelte} +0 -0
  78. package/components/icons/GitlabIcon.svelte.d.ts +17 -0
  79. package/components/icons/GoogleIcon.svelte +10 -0
  80. package/components/icons/GoogleIcon.svelte.d.ts +17 -0
  81. package/components/icons/HackernewsIcon.svelte +15 -0
  82. package/components/icons/HackernewsIcon.svelte.d.ts +17 -0
  83. package/components/icons/MongodbIcon.svelte +7 -0
  84. package/components/icons/MongodbIcon.svelte.d.ts +17 -0
  85. package/components/icons/RedditIcon.svelte +8 -0
  86. package/components/icons/RedditIcon.svelte.d.ts +17 -0
  87. package/components/icons/SupabaseIcon.svelte +19 -0
  88. package/components/icons/SupabaseIcon.svelte.d.ts +17 -0
  89. package/components/icons/WebdavIcon.svelte +7 -0
  90. package/components/icons/WebdavIcon.svelte.d.ts +17 -0
  91. package/components/icons/ZammadIcon.svelte +23 -0
  92. package/components/icons/ZammadIcon.svelte.d.ts +17 -0
  93. package/components/icons/index.d.ts +21 -3
  94. package/components/icons/index.js +22 -4
  95. package/components/preview/FlowPreviewStatus.svelte +1 -1
  96. package/components/scripts/CreateActionsScript.svelte +1 -1
  97. package/gen/core/OpenAPI.js +1 -1
  98. package/gen/services/AppService.js +2 -2
  99. package/gen/services/CaptureService.d.ts +8 -8
  100. package/gen/services/CaptureService.js +9 -9
  101. package/gen/services/FlowService.d.ts +8 -0
  102. package/gen/services/FlowService.js +14 -0
  103. package/gen/services/JobService.d.ts +9 -1
  104. package/gen/services/JobService.js +10 -8
  105. package/gen/services/ScriptService.d.ts +8 -0
  106. package/gen/services/ScriptService.js +14 -0
  107. package/gen/services/WorkspaceService.d.ts +17 -0
  108. package/gen/services/WorkspaceService.js +16 -0
  109. package/package.json +517 -508
  110. package/utils.d.ts +2 -1
  111. package/utils.js +9 -0
  112. 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 {
@@ -119,20 +119,24 @@ function testRegex(pattern, value) {
119
119
  $: {
120
120
  if (value == undefined || value == null) {
121
121
  value = defaultValue;
122
- if (defaultValue === undefined || defaultValue === null)
122
+ if (defaultValue === undefined || defaultValue === null) {
123
123
  if (inputCat === 'string') {
124
124
  value = '';
125
125
  }
126
126
  else if (inputCat == 'enum') {
127
127
  value = enum_?.[0];
128
128
  }
129
+ else if (inputCat == 'boolean') {
130
+ value = false;
131
+ }
132
+ }
129
133
  }
130
134
  }
131
135
  export let inputCat = 'string';
132
136
  $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncoding);
133
137
  </script>
134
138
 
135
- <div class="flex flex-col w-full">
139
+ <div class="flex flex-col w-full min-w-[250px]">
136
140
  <div>
137
141
  {#if displayHeader}
138
142
  <FieldHeader {label} {required} {type} {contentEncoding} {format} {itemsType} />
@@ -203,7 +207,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
203
207
  {:else}
204
208
  <input
205
209
  {autofocus}
206
- on:focus
210
+ on:focus={(e) => {
211
+ window.dispatchEvent(new Event('pointerup'))
212
+ dispatch('focus')
213
+ }}
207
214
  {disabled}
208
215
  type="number"
209
216
  class={valid
@@ -218,6 +225,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
218
225
  {/if}
219
226
  {:else if inputCat == 'boolean'}
220
227
  <Toggle
228
+ on:pointerdown={(e) => {
229
+ e?.stopPropagation()
230
+ window.dispatchEvent(new Event('pointerup'))
231
+ }}
221
232
  {disabled}
222
233
  class={valid
223
234
  ? ''
@@ -295,7 +306,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
295
306
  {:else}
296
307
  <textarea
297
308
  bind:this={el}
298
- on:focus
309
+ on:focus={(e) => {
310
+ window.dispatchEvent(new Event('pointerup'))
311
+ dispatch('focus')
312
+ }}
299
313
  {autofocus}
300
314
  {disabled}
301
315
  use:autosize
@@ -311,7 +325,15 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
311
325
  />
312
326
  {/if}
313
327
  {:else if inputCat == 'enum'}
314
- <select {disabled} class="px-6" bind:value>
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
+ >
315
337
  {#each enum_ ?? [] as e}
316
338
  <option>{e}</option>
317
339
  {/each}
@@ -321,7 +343,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
321
343
  {:else if inputCat == 'sql' || inputCat == 'yaml'}
322
344
  <div class="border my-1 mb-4 w-full border-gray-400">
323
345
  <SimpleEditor
324
- on:focus={() => dispatch('focus')}
346
+ on:focus={(e) => {
347
+ window.dispatchEvent(new Event('pointerup'))
348
+ dispatch('focus')
349
+ }}
325
350
  on:blur={() => dispatch('blur')}
326
351
  bind:this={editor}
327
352
  lang={inputCat}
@@ -357,7 +382,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
357
382
  {autofocus}
358
383
  rows="1"
359
384
  bind:this={el}
360
- on:focus={() => dispatch('focus')}
385
+ on:focus={(e) => {
386
+ window.dispatchEvent(new Event('pointerup'))
387
+ dispatch('focus')
388
+ }}
361
389
  on:blur={() => dispatch('blur')}
362
390
  use:autosize
363
391
  type="text"
@@ -373,16 +401,13 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
373
401
  />
374
402
  {#if itemPicker}
375
403
  <div class="ml-1 relative">
376
- <Button
377
- {disabled}
378
- variant="border"
379
- color="blue"
380
- size="sm"
381
- 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"
382
407
  on:click={() => {
383
408
  pickForField = label
384
409
  itemPicker?.openDrawer?.()
385
- }}><Icon data={faDollarSign} /></Button
410
+ }}><Icon data={faDollarSign} /></div
386
411
  >
387
412
  </div>
388
413
  {/if}
@@ -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
- Create a new variable
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].type === FlowStatusModule.type.WAITING_FOR_EVENTS}
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 for approval from the previous step</p>
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 job without the resume id since you are not an owner of {job.script_path}
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,16 +5,16 @@ export let after = false;
5
5
  export let height = '24px';
6
6
  export let width = '24px';
7
7
  export let center = false;
8
- $: name_prefix = name.split('_')[0];
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 APP_TO_ICON_COMPONENT[name_prefix]}
15
+ {#if iconComponent}
16
16
  <span class="text-gray-700 grayscale">
17
- <svelte:component this={APP_TO_ICON_COMPONENT[name_prefix]} {height} {width} />
17
+ <svelte:component this={iconComponent} {height} {width} />
18
18
  </span>
19
19
  {:else}
20
20
  <span style="width: {width}; height: {height}" class="bg-gray-100 rounded-full" />
@@ -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 a {itemName}" on:close={drawer.closeDrawer}>
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 inline-flex items-center p-4 gap-4 first-of-type:!border-t-0
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
 
@@ -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
- initialFolders.push(initialPath?.split('/')?.[1]);
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), 100);
36
+ timeout = setTimeout(() => (showTooltip = false), disapperTimoout);
36
37
  }
37
38
  </script>
38
39
 
39
- <button
40
- class:cursor-default={notClickable}
41
- use:popperRef
42
- on:mouseenter={open}
43
- on:mouseleave={close}
44
- on:click
45
- class={$$props.class}
46
- >
47
- <slot />
48
- </button>
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;
@@ -7,6 +7,7 @@ import { Button } from './common';
7
7
  import Select from 'svelte-select';
8
8
  import AppConnect from './AppConnect.svelte';
9
9
  import ResourceEditor from './ResourceEditor.svelte';
10
+ import { truncate } from '../utils';
10
11
  const dispatch = createEventDispatcher();
11
12
  let resources = [];
12
13
  export let initialValue = undefined;
@@ -25,7 +26,7 @@ $: {
25
26
  $: dispatch('change', value);
26
27
  $: collection = resources.map((x) => ({
27
28
  value: x.path,
28
- label: `${x.path}${x.description ? ' | ' + x.description : ''}`
29
+ label: x.path
29
30
  }));
30
31
  let appConnect;
31
32
  let resourceEditor;
@@ -44,12 +45,13 @@ let resourceEditor;
44
45
 
45
46
  <div class="flex flex-row gap-x-1 w-full">
46
47
  <Select
48
+ listAutoWidth={false}
47
49
  --height="34px"
48
50
  value={collection.find((x) => x.value == value)}
49
51
  bind:justValue={value}
50
52
  items={collection}
51
53
  class="text-clip grow min-w-0"
52
- placeholder="Pick a {resourceType} resource"
54
+ placeholder="{resourceType} resource"
53
55
  />
54
56
  {#if value && value != ''}
55
57
  <Button variant="border" size="xs" on:click={() => resourceEditor?.initEdit?.(value ?? '')}>
@@ -68,3 +70,8 @@ let resourceEditor;
68
70
  }}><Icon scale={0.8} data={faRotateRight} /></Button
69
71
  >
70
72
  </div>
73
+
74
+ <style>
75
+ :global(.svelte-select-list) {
76
+ font-size: small !important;
77
+ }</style>
@@ -15,6 +15,7 @@ export let schedulable = true;
15
15
  export let detailed = true;
16
16
  export let autofocus = false;
17
17
  export let topButton = false;
18
+ export let loading = false;
18
19
  export let args = decodeArgs($page.url.searchParams.get('args') ?? undefined);
19
20
  export function run() {
20
21
  runAction(scheduledForStr, args, invisible_to_owner);
@@ -133,17 +134,18 @@ let invisible_to_owner;
133
134
  <div class="flex items-center gap-1">
134
135
  <Toggle
135
136
  options={{
136
- right: `make run invisible to ${runnable?.path?.split('/').slice(0, 2).join('/')}`
137
+ right: `run only visible to you`
137
138
  }}
138
139
  bind:checked={invisible_to_owner}
139
140
  />
140
141
  <Tooltip
141
- >By default, runs are visible to the owner of the script or flow being triggered</Tooltip
142
+ >By default, runs are visible to the owner(s) of the script or flow being triggered</Tooltip
142
143
  >
143
144
  </div>
144
145
  {/if}
145
146
  <div class="flex-row-reverse flex grow">
146
147
  <Button
148
+ {loading}
147
149
  btnClasses="!px-6 !py-1"
148
150
  disabled={!isValid}
149
151
  on:click={() => runAction(scheduledForStr, args, invisible_to_owner)}
@@ -21,6 +21,7 @@ declare const __propDef: {
21
21
  detailed?: boolean | undefined;
22
22
  autofocus?: boolean | undefined;
23
23
  topButton?: boolean | undefined;
24
+ loading?: boolean | undefined;
24
25
  args?: Record<string, any> | undefined;
25
26
  run?: (() => void) | undefined;
26
27
  isValid?: boolean | undefined;
@@ -1,6 +1,7 @@
1
1
  <script>import { VariableService } from '../gen';
2
2
  import { workspaceStore } from '../stores';
3
3
  import { allTrue } from '../utils';
4
+ import { faPlus } from '@fortawesome/free-solid-svg-icons';
4
5
  import { slide } from 'svelte/transition';
5
6
  import ArgInput from './ArgInput.svelte';
6
7
  import { Button } from './common';
@@ -45,7 +46,7 @@ let itemPicker = undefined;
45
46
  let variableEditor = undefined;
46
47
  </script>
47
48
 
48
- <div class="w-full {clazz} {flexWrap ? 'flex flex-row flex-wrap gap-x-4' : ''}">
49
+ <div class="w-full {clazz} {flexWrap ? 'flex flex-row flex-wrap gap-x-6 gap-y-2' : ''}">
49
50
  {#if Object.keys(schema?.properties ?? {}).length > 0}
50
51
  {#each Object.keys(schema?.properties ?? {}) as argName, i (argName)}
51
52
  {#if !filter || filter.includes(argName)}
@@ -112,7 +113,7 @@ let variableEditor = undefined;
112
113
  }
113
114
  }}
114
115
  itemName="Variable"
115
- extraField="name"
116
+ extraField="path"
116
117
  loadItems={async () =>
117
118
  (await VariableService.listVariable({ workspace: $workspaceStore ?? '' })).map((x) => ({
118
119
  name: x.path,
@@ -121,20 +122,21 @@ let variableEditor = undefined;
121
122
  >
122
123
  <div
123
124
  slot="submission"
124
- class="flex flex-row-reverse w-full p-5 bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"
125
+ class="flex flex-row-reverse w-full bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"
125
126
  >
126
127
  <Button
127
128
  variant="border"
128
129
  color="blue"
129
130
  size="sm"
131
+ startIcon={{ icon: faPlus }}
130
132
  on:click={() => {
131
133
  variableEditor?.initNew?.()
132
134
  }}
133
135
  >
134
- Create a new variable
136
+ New variable
135
137
  </Button>
136
138
  </div>
137
139
  </ItemPicker>
138
140
 
139
- <VariableEditor bind:this={variableEditor} on:create={itemPicker.openDrawer} />
141
+ <VariableEditor bind:this={variableEditor} />
140
142
  {/if}
@@ -174,7 +174,6 @@ $: kind = script.kind;
174
174
  bind:this={summaryC}
175
175
  bind:value={script.summary}
176
176
  placeholder="A short summary of the script displayed when the script is listed"
177
- rows="1"
178
177
  />
179
178
  <h2 class="border-b pb-1 mt-8 mb-6">Language</h2>
180
179
  <div class="flex flex-row gap-2 flex-wrap">