windmill-components 1.56.5 → 1.57.2
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/assets/app.css +5 -1
- package/components/ArgInput.svelte +6 -6
- package/components/DisplayResult.svelte +1 -1
- package/components/Dropdown.svelte +1 -1
- package/components/Dropdown.svelte.d.ts +1 -0
- package/components/Editor.svelte +5 -3
- package/components/Editor.svelte.d.ts +2 -0
- package/components/EditorBar.svelte +15 -1
- package/components/FlowBuilder.svelte +18 -10
- package/components/GroupEditor.svelte +1 -0
- package/components/IconedResourceType.svelte +2 -2
- package/components/InputTransformForm.svelte +7 -5
- package/components/ItemPicker.svelte +63 -57
- package/components/ItemPicker.svelte.d.ts +1 -2
- package/components/LogViewer.svelte +7 -9
- package/components/ModulePreview.svelte +4 -13
- package/components/MoveDrawer.svelte +40 -16
- package/components/MoveDrawer.svelte.d.ts +2 -2
- package/components/PageHeader.svelte +1 -1
- package/components/Path.svelte +5 -2
- package/components/Popover.svelte +6 -4
- package/components/Popover.svelte.d.ts +2 -0
- package/components/ResourcePicker.svelte +1 -0
- package/components/RunChart.svelte +0 -1
- package/components/SchemaForm.svelte +2 -1
- package/components/SchemaForm.svelte.d.ts +1 -0
- package/components/ScriptBuilder.svelte +2 -1
- package/components/ScriptEditor.svelte +86 -80
- package/components/ShareModal.svelte.d.ts +2 -2
- package/components/SimpleEditor.svelte +17 -0
- package/components/StringTypeNarrowing.svelte +30 -8
- package/components/TemplateEditor.svelte +18 -2
- package/components/TestJobLoader.svelte +83 -74
- package/components/Tooltip.svelte +1 -1
- package/components/VariableEditor.svelte +4 -3
- package/components/VariableEditor.svelte.d.ts +2 -2
- package/components/apps/components/buttons/AppButton.svelte +3 -7
- package/components/apps/components/dataDisplay/AppBarChart.svelte +10 -6
- package/components/apps/components/dataDisplay/AppHtml.svelte +23 -0
- package/components/apps/components/dataDisplay/AppHtml.svelte.d.ts +23 -0
- package/components/apps/components/dataDisplay/AppPieChart.svelte +10 -6
- package/components/apps/components/dataDisplay/AppScatterChart.svelte +46 -0
- package/components/apps/components/dataDisplay/AppScatterChart.svelte.d.ts +21 -0
- package/components/apps/components/dataDisplay/AppText.svelte +48 -7
- package/components/apps/components/dataDisplay/AppText.svelte.d.ts +1 -0
- package/components/apps/components/dataDisplay/AppTimeseries.svelte +57 -0
- package/components/apps/components/dataDisplay/AppTimeseries.svelte.d.ts +22 -0
- package/components/apps/components/form/AppForm.svelte +33 -28
- package/components/apps/components/helpers/InputValue.svelte +10 -16
- package/components/apps/components/helpers/InputValue.svelte.d.ts +2 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte +4 -6
- package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +1 -1
- package/components/apps/components/helpers/RefreshButton.svelte +1 -1
- package/components/apps/components/helpers/RunnableComponent.svelte +120 -119
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte +11 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/components/apps/components/selectInputs/AppSelect.svelte +2 -0
- package/components/apps/components/table/AppTable.svelte +22 -17
- package/components/apps/components/table/AppTableFooter.svelte +2 -1
- package/components/apps/components/table/tableOptions.d.ts +2 -9
- package/components/apps/components/table/tableOptions.js +5 -2
- package/components/apps/components/textInputs/AppTextInput.svelte +0 -1
- package/components/apps/editor/AppEditor.svelte +133 -102
- package/components/apps/editor/AppEditor.svelte.d.ts +1 -0
- package/components/apps/editor/AppEditorHeader.svelte +355 -50
- package/components/apps/editor/AppEditorHeader.svelte.d.ts +2 -4
- package/components/apps/editor/AppExportButton.svelte +34 -0
- package/components/apps/editor/AppExportButton.svelte.d.ts +17 -0
- package/components/apps/editor/AppPreview.svelte +19 -6
- package/components/apps/editor/AppPreview.svelte.d.ts +5 -0
- package/components/apps/editor/AppPublishButton.svelte +46 -0
- package/components/apps/editor/AppPublishButton.svelte.d.ts +19 -0
- package/components/apps/editor/ComponentEditor.svelte +35 -3
- package/components/apps/editor/ComponentHeader.svelte +23 -16
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -0
- package/components/apps/editor/GridEditor.svelte +71 -48
- package/components/apps/editor/RecomputeAllComponents.svelte +80 -13
- package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -28
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +2 -1
- package/components/apps/editor/componentsPanel/componentStaticValues.js +3 -2
- package/components/apps/editor/componentsPanel/data.js +191 -77
- package/components/apps/editor/contextPanel/ContextPanel.svelte +60 -41
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +6 -2
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +47 -10
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +11 -4
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +29 -21
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +10 -6
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +38 -33
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +3 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +1 -10
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +27 -9
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +8 -6
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +6 -16
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +46 -21
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +3 -1
- package/components/apps/editor/settingsPanel/PickInlineScript.svelte +0 -1
- package/components/apps/editor/settingsPanel/Recompute.svelte +1 -1
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +8 -7
- package/components/apps/editor/settingsPanel/TableActions.svelte +10 -10
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -0
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +55 -49
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +24 -0
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +8 -11
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +35 -7
- package/components/apps/editorUtils.d.ts +1 -0
- package/components/apps/editorUtils.js +11 -0
- package/components/apps/gridUtils.js +1 -1
- package/components/apps/inputType.d.ts +5 -4
- package/components/apps/rx.d.ts +1 -1
- package/components/apps/rx.js +6 -2
- package/components/apps/store.d.ts +2 -0
- package/components/apps/store.js +2 -0
- package/components/apps/types.d.ts +19 -3
- package/components/apps/utils.d.ts +2 -2
- package/components/apps/utils.js +22 -8
- package/components/common/button/Button.svelte +6 -8
- package/components/common/button/Button.svelte.d.ts +1 -0
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +4 -1
- package/components/common/popup/Popup.svelte +1 -1
- package/components/common/table/AppRow.svelte +26 -3
- package/components/common/table/AppRow.svelte.d.ts +4 -0
- package/components/common/table/FlowRow.svelte +4 -4
- package/components/common/table/RowIcon.svelte +1 -1
- package/components/common/table/ScriptRow.svelte +2 -2
- package/components/common/tabs/Tabs.svelte +1 -1
- package/components/common/toggleButton/ToggleButton.svelte +2 -0
- package/components/common/toggleButton/ToggleButton.svelte.d.ts +1 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte +3 -3
- package/components/flows/CreateActionsApp.svelte +43 -0
- package/components/flows/CreateActionsApp.svelte.d.ts +14 -0
- package/components/flows/CreateActionsFlow.svelte +6 -1
- package/components/flows/content/DynamicInputHelpBox.svelte +1 -1
- package/components/flows/content/FlowConstants.svelte +23 -9
- package/components/flows/content/FlowInputs.svelte +2 -2
- package/components/flows/content/FlowModuleHeader.svelte +6 -5
- package/components/flows/content/FlowSettings.svelte +1 -1
- package/components/flows/header/FlowImportExportMenu.svelte +1 -1
- package/components/flows/map/FlowConstantsItem.svelte +5 -7
- package/components/flows/map/FlowModuleSchemaMap.svelte +1 -5
- package/components/flows/map/FlowSettingsItem.svelte +5 -7
- package/components/flows/pickers/PickHubApp.svelte +73 -0
- package/components/flows/pickers/PickHubApp.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubFlow.svelte +3 -1
- package/components/flows/pickers/PickHubScript.svelte +1 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte +42 -31
- package/components/home/ItemsList.svelte +6 -4
- package/components/icons/ClickhouseIcon.svelte +22 -0
- package/components/icons/ClickhouseIcon.svelte.d.ts +17 -0
- package/components/icons/FaunadbIcon.svelte +19 -0
- package/components/icons/FaunadbIcon.svelte.d.ts +17 -0
- package/components/icons/OpenaiIcon.svelte +18 -0
- package/components/icons/OpenaiIcon.svelte.d.ts +17 -0
- package/components/icons/index.d.ts +7 -1
- package/components/icons/index.js +8 -2
- package/components/propertyPicker/ObjectViewer.svelte +11 -4
- package/components/propertyPicker/PropPicker.svelte +1 -1
- package/components/scriptEditor/LogPanel.svelte +26 -22
- package/components/sidebar/WorkspaceMenu.svelte +2 -3
- package/components/splitPanes/SplitPanesWrapper.svelte +1 -5
- package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +0 -1
- package/editorUtils.js +2 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/models/Policy.d.ts +1 -0
- package/gen/services/AppService.d.ts +50 -0
- package/gen/services/AppService.js +55 -0
- package/gen/services/GranularAclService.d.ts +3 -3
- package/gen/services/ResourceService.d.ts +15 -0
- package/gen/services/ResourceService.js +17 -0
- package/infer.js +4 -0
- package/package.json +18 -9
- package/stores.d.ts +1 -0
- package/stores.js +13 -5
- package/utils.d.ts +9 -1
- package/utils.js +28 -11
- package/components/apps/CreateApp.svelte +0 -68
- package/components/apps/CreateApp.svelte.d.ts +0 -14
- package/components/apps/editor/settingsPanel/SectionPanel.svelte +0 -70
- package/components/apps/editor/settingsPanel/SectionPanel.svelte.d.ts +0 -19
- package/components/apps/editor/settingsPanel/UserInputEditor.svelte +0 -2
- package/components/apps/editor/settingsPanel/UserInputEditor.svelte.d.ts +0 -14
package/assets/app.css
CHANGED
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
whitespace: normal !important;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
pre code.hljs {
|
|
31
|
+
overflow: visible !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
svelte-virtual-list-row {
|
|
31
35
|
overflow: visible !important;
|
|
32
36
|
}
|
|
@@ -40,7 +44,7 @@
|
|
|
40
44
|
box-shadow: none !important;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
.
|
|
47
|
+
.Template-editor span.mtk20 {
|
|
44
48
|
color: black !important;
|
|
45
49
|
}
|
|
46
50
|
}
|
|
@@ -157,7 +157,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
157
157
|
bind:value={description}
|
|
158
158
|
placeholder="Field description"
|
|
159
159
|
/>
|
|
160
|
-
{#if type == 'string' &&
|
|
160
|
+
{#if type == 'string' && format != 'date-time'}
|
|
161
161
|
<StringTypeNarrowing bind:format bind:pattern bind:enum_ bind:contentEncoding />
|
|
162
162
|
{:else if type == 'object'}
|
|
163
163
|
<ObjectTypeNarrowing bind:format />
|
|
@@ -300,18 +300,18 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
300
300
|
</select>
|
|
301
301
|
{:else if inputCat == 'date'}
|
|
302
302
|
<input {autofocus} class="inline-block" type="datetime-local" bind:value />
|
|
303
|
-
{:else if inputCat == 'sql'}
|
|
304
|
-
<div class="border
|
|
303
|
+
{:else if inputCat == 'sql' || inputCat == 'yaml'}
|
|
304
|
+
<div class="border my-1 mb-4 w-full border-gray-400">
|
|
305
305
|
<SimpleEditor
|
|
306
306
|
on:focus={() => dispatch('focus')}
|
|
307
307
|
on:blur={() => dispatch('blur')}
|
|
308
308
|
bind:this={editor}
|
|
309
|
-
lang=
|
|
309
|
+
lang={inputCat}
|
|
310
310
|
bind:code={value}
|
|
311
|
-
class="few-lines-editor"
|
|
312
311
|
on:change={async () => {
|
|
313
312
|
dispatch('input', { rawValue: value, isRaw: false })
|
|
314
313
|
}}
|
|
314
|
+
autoHeight
|
|
315
315
|
/>
|
|
316
316
|
</div>
|
|
317
317
|
{:else if inputCat == 'base64'}
|
|
@@ -360,7 +360,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
360
360
|
variant="border"
|
|
361
361
|
color="blue"
|
|
362
362
|
size="sm"
|
|
363
|
-
btnClasses="min-w-min items-center leading-4 py-0"
|
|
363
|
+
btnClasses="min-w-min min-h-[34px] items-center leading-4 py-0"
|
|
364
364
|
on:click={() => {
|
|
365
365
|
pickForField = label
|
|
366
366
|
itemPicker?.openDrawer?.()
|
|
@@ -73,7 +73,7 @@ let payload = '';
|
|
|
73
73
|
class="grid grid-flow-col-dense border border-gray-200 rounded-md "
|
|
74
74
|
>
|
|
75
75
|
{#each Object.keys(result) as col}
|
|
76
|
-
<div class="flex flex-col max-h-40 min-w-full
|
|
76
|
+
<div class="flex flex-col max-h-40 min-w-full">
|
|
77
77
|
<div
|
|
78
78
|
class="px-12 text-left uppercase border-b bg-gray-50 overflow-hidden rounded-t-md "
|
|
79
79
|
>
|
|
@@ -10,7 +10,7 @@ const dispatch = createEventDispatcher();
|
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<Menu {placement} let:close>
|
|
13
|
-
<Button nonCaptureEvent color="light" size="xs" {btnClasses} slot="trigger">
|
|
13
|
+
<Button nonCaptureEvent color="light" size="xs" {btnClasses} {...$$restProps} slot="trigger">
|
|
14
14
|
{#if !$$slots.default}
|
|
15
15
|
<MoreHorizontal size={20} />
|
|
16
16
|
{:else}
|
|
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { DropdownItem } from '../utils';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
+
[x: string]: any;
|
|
5
6
|
dropdownItems: DropdownItem[];
|
|
6
7
|
name?: string | undefined;
|
|
7
8
|
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | undefined;
|
package/components/Editor.svelte
CHANGED
|
@@ -28,6 +28,7 @@ languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
|
28
28
|
noSuggestionDiagnostics: true,
|
|
29
29
|
noSyntaxValidation: true
|
|
30
30
|
});
|
|
31
|
+
languages.typescript.typescriptDefaults.setExtraLibs([]);
|
|
31
32
|
meditor.defineTheme('myTheme', {
|
|
32
33
|
base: 'vs',
|
|
33
34
|
inherit: true,
|
|
@@ -105,7 +106,7 @@ export function setCode(ncode) {
|
|
|
105
106
|
editor.setValue(ncode);
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
|
-
function format() {
|
|
109
|
+
export function format() {
|
|
109
110
|
if (editor) {
|
|
110
111
|
code = getCode();
|
|
111
112
|
editor.getAction('editor.action.formatDocument').run();
|
|
@@ -156,7 +157,6 @@ export async function reloadWebsocket() {
|
|
|
156
157
|
markdown: {
|
|
157
158
|
isTrusted: true
|
|
158
159
|
},
|
|
159
|
-
// workspaceFolder: { uri: Uri.parse(`/tmp/${name}`), name: 'tmp', index: 0 },
|
|
160
160
|
initializationOptions,
|
|
161
161
|
middleware: {
|
|
162
162
|
workspace: {
|
|
@@ -354,7 +354,9 @@ async function closeWebsockets() {
|
|
|
354
354
|
async function loadMonaco() {
|
|
355
355
|
const model = meditor.createModel(code, lang, mUri.parse(uri));
|
|
356
356
|
model.updateOptions(updateOptions);
|
|
357
|
-
editor = meditor.create(divEl,
|
|
357
|
+
editor = meditor.create(divEl, {
|
|
358
|
+
...editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets)
|
|
359
|
+
});
|
|
358
360
|
let timeoutModel = undefined;
|
|
359
361
|
editor.onDidChangeModelContent((event) => {
|
|
360
362
|
$dirtyStore = true;
|
|
@@ -22,6 +22,7 @@ declare const __propDef: {
|
|
|
22
22
|
insertAtBeginning?: ((code: string) => void) | undefined;
|
|
23
23
|
insertAtLine?: ((code: string, line: number) => void) | undefined;
|
|
24
24
|
setCode?: ((ncode: string) => void) | undefined;
|
|
25
|
+
format?: (() => void) | undefined;
|
|
25
26
|
clearContent?: (() => Promise<void>) | undefined;
|
|
26
27
|
reloadWebsocket?: (() => Promise<void>) | undefined;
|
|
27
28
|
addAction?: ((id: string, label: string, callback: (editor: meditor.IStandaloneCodeEditor) => void, keybindings?: number[]) => void) | undefined;
|
|
@@ -44,6 +45,7 @@ export default class Editor extends SvelteComponentTyped<EditorProps, EditorEven
|
|
|
44
45
|
get insertAtBeginning(): (code: string) => void;
|
|
45
46
|
get insertAtLine(): (code: string, line: number) => void;
|
|
46
47
|
get setCode(): (ncode: string) => void;
|
|
48
|
+
get format(): () => void;
|
|
47
49
|
get clearContent(): () => Promise<void>;
|
|
48
50
|
get reloadWebsocket(): () => Promise<void>;
|
|
49
51
|
get addAction(): (id: string, label: string, callback: (editor: meditor.IStandaloneCodeEditor) => void, keybindings?: number[]) => void;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<script>import { ResourceService, VariableService } from '../gen';
|
|
5
5
|
import { getScriptByPath, sendUserToast } from '../utils';
|
|
6
|
-
import { faCube, faDollarSign, faEye, faRotate, faRotateLeft } from '@fortawesome/free-solid-svg-icons';
|
|
6
|
+
import { faBroom, faCube, faDollarSign, faEye, 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';
|
|
@@ -286,6 +286,20 @@ async function onScriptPick(e) {
|
|
|
286
286
|
</span>
|
|
287
287
|
</Button></div
|
|
288
288
|
>
|
|
289
|
+
<div>
|
|
290
|
+
<Button
|
|
291
|
+
btnClasses="!font-medium"
|
|
292
|
+
size="xs"
|
|
293
|
+
spacingSize="md"
|
|
294
|
+
color="light"
|
|
295
|
+
on:click={editor.format}
|
|
296
|
+
startIcon={{ icon: faBroom }}
|
|
297
|
+
>
|
|
298
|
+
{#if !iconOnly}
|
|
299
|
+
Format (Ctrl+S)
|
|
300
|
+
{/if}
|
|
301
|
+
</Button></div
|
|
302
|
+
>
|
|
289
303
|
</div>
|
|
290
304
|
<div class="py-1">
|
|
291
305
|
<div>
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { page } from '$app/stores';
|
|
3
3
|
import { FlowService, ScheduleService } from '../gen';
|
|
4
4
|
import { userStore, workspaceStore } from '../stores';
|
|
5
|
-
import { encodeState, formatCron, loadHubScripts, sendUserToast
|
|
5
|
+
import { encodeState, formatCron, loadHubScripts, sendUserToast } from '../utils';
|
|
6
6
|
import { faCalendarAlt, faEye, faPen, faSave } from '@fortawesome/free-solid-svg-icons';
|
|
7
7
|
import { setContext } from 'svelte';
|
|
8
|
-
import { Icon } from 'svelte-awesome';
|
|
9
8
|
import { writable } from 'svelte/store';
|
|
10
9
|
import CenteredPage from './CenteredPage.svelte';
|
|
11
|
-
import {
|
|
10
|
+
import { Button, Drawer, DrawerContent } from './common';
|
|
12
11
|
import { dirtyStore } from './common/confirmationModal/dirtyStore';
|
|
13
12
|
import UnsavedConfirmationModal from './common/confirmationModal/UnsavedConfirmationModal.svelte';
|
|
14
13
|
import { OFFSET } from './CronInput.svelte';
|
|
@@ -50,6 +49,7 @@ async function saveFlow() {
|
|
|
50
49
|
const { cron, args, enabled } = $scheduleStore;
|
|
51
50
|
$dirtyStore = false;
|
|
52
51
|
if (initialPath === '') {
|
|
52
|
+
localStorage.removeItem('flow');
|
|
53
53
|
await FlowService.createFlow({
|
|
54
54
|
workspace: $workspaceStore,
|
|
55
55
|
requestBody: {
|
|
@@ -65,6 +65,7 @@ async function saveFlow() {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
+
localStorage.removeItem(`flow-${initialPath}`);
|
|
68
69
|
await FlowService.updateFlow({
|
|
69
70
|
workspace: $workspaceStore,
|
|
70
71
|
path: initialPath,
|
|
@@ -112,16 +113,23 @@ async function saveFlow() {
|
|
|
112
113
|
}
|
|
113
114
|
let timeout = undefined;
|
|
114
115
|
$: {
|
|
115
|
-
if ($flowStore
|
|
116
|
-
|
|
116
|
+
if ($flowStore || $selectedIdStore) {
|
|
117
|
+
saveDraft();
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function saveDraft() {
|
|
120
121
|
timeout && clearTimeout(timeout);
|
|
121
|
-
timeout = setTimeout(() =>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
timeout = setTimeout(() => {
|
|
123
|
+
try {
|
|
124
|
+
localStorage.setItem(initialPath ? `flow-${initialPath}` : 'flow', encodeState({
|
|
125
|
+
flow: $flowStore,
|
|
126
|
+
selectedId: $selectedIdStore
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
console.error(err);
|
|
131
|
+
}
|
|
132
|
+
}, 500);
|
|
125
133
|
}
|
|
126
134
|
const selectedIdStore = writable(selectedId);
|
|
127
135
|
const scheduleStore = writable({ args: {}, cron: '', enabled: false });
|
|
@@ -8,12 +8,12 @@ export let center = false;
|
|
|
8
8
|
$: name_prefix = name.split('_')[0];
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
<div class="
|
|
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
15
|
{#if APP_TO_ICON_COMPONENT[name_prefix]}
|
|
16
|
-
<span class="text-gray-700">
|
|
16
|
+
<span class="text-gray-700 grayscale">
|
|
17
17
|
<svelte:component this={APP_TO_ICON_COMPONENT[name_prefix]} {height} {width} />
|
|
18
18
|
</span>
|
|
19
19
|
{:else}
|
|
@@ -54,7 +54,7 @@ function setPropertyType(rawValue) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
function isStaticTemplate(inputCat) {
|
|
57
|
-
return inputCat === 'string' || inputCat === 'sql';
|
|
57
|
+
return inputCat === 'string' || inputCat === 'sql' || inputCat == 'yaml';
|
|
58
58
|
}
|
|
59
59
|
function connectProperty(rawValue) {
|
|
60
60
|
if (isStaticTemplate(inputCat)) {
|
|
@@ -94,10 +94,13 @@ const { focusProp, propPickerConfig } = getContext('PropPickerWrapper');
|
|
|
94
94
|
$: isStaticTemplate(inputCat) && propertyType == 'static' && setPropertyType(arg?.value);
|
|
95
95
|
const openBracket = '${';
|
|
96
96
|
const closeBracket = '}';
|
|
97
|
+
$: schema.properties[argName].default &&
|
|
98
|
+
!arg?.value &&
|
|
99
|
+
monacoTemplate?.setCode(schema.properties[argName].default);
|
|
97
100
|
</script>
|
|
98
101
|
|
|
99
102
|
{#if arg != undefined}
|
|
100
|
-
<div class="flex flex-row justify-between gap-1
|
|
103
|
+
<div class="flex flex-row justify-between gap-1 pb-1">
|
|
101
104
|
<div class="flex items-center flex-wrap grow">
|
|
102
105
|
<FieldHeader
|
|
103
106
|
label={argName}
|
|
@@ -161,7 +164,7 @@ const closeBracket = '}';
|
|
|
161
164
|
>
|
|
162
165
|
{#if isStaticTemplate(inputCat)}
|
|
163
166
|
<ToggleButton light position="left" value="static" size="xs">
|
|
164
|
-
{'${} '}
|
|
167
|
+
{'${} '}Template <Tooltip
|
|
165
168
|
>Write javascript expressions between "{openBracket}" and "{closeBracket}". You may
|
|
166
169
|
refer to contextual objects like 'flow_input', or 'result' or functions like
|
|
167
170
|
'resource' and 'variable'
|
|
@@ -199,7 +202,7 @@ const closeBracket = '}';
|
|
|
199
202
|
<div class="max-w-xs" />
|
|
200
203
|
|
|
201
204
|
<div
|
|
202
|
-
class="relative {$propPickerConfig?.propName == argName
|
|
205
|
+
class="relative mb-6 {$propPickerConfig?.propName == argName
|
|
203
206
|
? 'outline outline-offset-0 outline-2 outline-blue-500 rounded-md'
|
|
204
207
|
: ''}"
|
|
205
208
|
>
|
|
@@ -271,7 +274,6 @@ const closeBracket = '}';
|
|
|
271
274
|
Not recognized input type {argName}
|
|
272
275
|
{/if}
|
|
273
276
|
</div>
|
|
274
|
-
<div class="mb-6" />
|
|
275
277
|
{:else}
|
|
276
278
|
<p class="text-sm text-gray-700">Argument at {argName} is undefined</p>
|
|
277
279
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<script>import { Drawer, Skeleton } from './common';
|
|
1
|
+
<script>import { Button, Drawer, Skeleton } from './common';
|
|
2
2
|
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
3
|
+
import NoItemFound from './home/NoItemFound.svelte';
|
|
3
4
|
import IconedResourceType from './IconedResourceType.svelte';
|
|
4
5
|
import SearchItems from './SearchItems.svelte';
|
|
5
6
|
export let pickCallback;
|
|
@@ -11,7 +12,6 @@ export let closeOnClick = true;
|
|
|
11
12
|
/** Displayed if the load function returns no items. */
|
|
12
13
|
export let noItemMessage = 'There are no items in the list';
|
|
13
14
|
/** Displayed if the search returns no items. */
|
|
14
|
-
export let emptySearchMessage = 'No items found';
|
|
15
15
|
export let buttons = {};
|
|
16
16
|
let loading = false;
|
|
17
17
|
let items = [];
|
|
@@ -43,7 +43,7 @@ let drawer;
|
|
|
43
43
|
|
|
44
44
|
<Drawer bind:this={drawer} size="600px">
|
|
45
45
|
<DrawerContent title="Search a {itemName}" on:close={drawer.closeDrawer}>
|
|
46
|
-
<div>
|
|
46
|
+
<div class="w-full">
|
|
47
47
|
<div class="w-12/12 pb-4">
|
|
48
48
|
<input
|
|
49
49
|
type="text"
|
|
@@ -61,72 +61,78 @@ let drawer;
|
|
|
61
61
|
{@html noItemMessage}
|
|
62
62
|
</div>
|
|
63
63
|
{:else if filteredItems?.length}
|
|
64
|
-
<
|
|
64
|
+
<div class="border rounded-md divide-y divide-gray-200 w-full">
|
|
65
65
|
{#each filteredItems as obj}
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<div class="text-sm font-semibold">
|
|
90
|
-
{@html obj.marked}
|
|
66
|
+
<div
|
|
67
|
+
class="hover:bg-gray-50 w-full inline-flex items-center p-4 gap-4 first-of-type:!border-t-0
|
|
68
|
+
first-of-type:rounded-t-md last-of-type:rounded-b-md"
|
|
69
|
+
>
|
|
70
|
+
<div class="inline-flex items-center grow">
|
|
71
|
+
<button
|
|
72
|
+
class="py-2 px-1 gap-1 flex grow border-gray-300 border-opacity-0
|
|
73
|
+
text-black"
|
|
74
|
+
on:click={() => {
|
|
75
|
+
if (closeOnClick) {
|
|
76
|
+
drawer.closeDrawer()
|
|
77
|
+
}
|
|
78
|
+
pickCallback(obj['path'], obj[extraField])
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{#if `app` in obj}
|
|
82
|
+
<div class="mr-2 text-sm text-left center-center w-30">
|
|
83
|
+
<IconedResourceType after={true} silent={false} name={obj['app']} />
|
|
84
|
+
</div>
|
|
85
|
+
{/if}
|
|
86
|
+
{#if `resource_type` in obj}
|
|
87
|
+
<div class="mr-2 text-left w-30 center-center text-sm">
|
|
88
|
+
<IconedResourceType after={true} name={obj['resource_type']} />
|
|
91
89
|
</div>
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
{/if}
|
|
91
|
+
<div class="flex grow flex-col break-all overflow-hidden">
|
|
92
|
+
{#if obj.marked}
|
|
93
|
+
<div class="text-sm font-semibold text-left">
|
|
94
|
+
{@html obj.marked}
|
|
95
|
+
</div>
|
|
96
|
+
{:else}
|
|
97
|
+
<div class="text-sm font-semibold flex flex-col">
|
|
98
|
+
<span class="mr-2 text-left">{obj[extraField] ?? ''}</span>
|
|
99
|
+
{#if extraField != 'path'}
|
|
100
|
+
<span class="font-normal text-xs text-left italic"
|
|
101
|
+
>{obj['path'] ?? ''}</span
|
|
102
|
+
>
|
|
103
|
+
{/if}
|
|
104
|
+
</div>
|
|
105
|
+
{#if extraField != 'description'}
|
|
106
|
+
<div class="text-xs font-light italic text-left"
|
|
107
|
+
>{obj['description'] ?? ''}</div
|
|
98
108
|
>
|
|
99
109
|
{/if}
|
|
100
|
-
</div>
|
|
101
|
-
{#if extraField != 'description'}
|
|
102
|
-
<div class="text-xs font-light italic text-left"
|
|
103
|
-
>{obj['description'] ?? ''}</div
|
|
104
|
-
>
|
|
105
110
|
{/if}
|
|
106
|
-
|
|
107
|
-
</
|
|
108
|
-
</
|
|
111
|
+
</div>
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
109
114
|
{#if buttons}
|
|
110
|
-
<div class="flex flex-row">
|
|
115
|
+
<div class="flex flex-row items-center">
|
|
111
116
|
{#each Object.entries(buttons) as [name, button]}
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
<div>
|
|
118
|
+
<Button
|
|
119
|
+
size="sm"
|
|
120
|
+
variant="border"
|
|
121
|
+
on:click={() => {
|
|
122
|
+
button(obj['path'] ?? '')
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
{name}
|
|
126
|
+
</Button>
|
|
127
|
+
</div>
|
|
120
128
|
{/each}
|
|
121
129
|
</div>
|
|
122
130
|
{/if}
|
|
123
|
-
</
|
|
131
|
+
</div>
|
|
124
132
|
{/each}
|
|
125
|
-
</ul>
|
|
126
|
-
{:else}
|
|
127
|
-
<div class="text-center text-sm text-gray-600 mt-2">
|
|
128
|
-
{@html emptySearchMessage}
|
|
129
133
|
</div>
|
|
134
|
+
{:else}
|
|
135
|
+
<NoItemFound />
|
|
130
136
|
{/if}
|
|
131
137
|
</div>
|
|
132
138
|
<svelte:fragment slot="actions">
|
|
@@ -8,8 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
itemName: string;
|
|
9
9
|
closeOnClick?: boolean | undefined;
|
|
10
10
|
/** Displayed if the load function returns no items. */ noItemMessage?: string | undefined;
|
|
11
|
-
/** Displayed if the search returns no items. */
|
|
12
|
-
buttons?: Record<string, (x: string) => void> | undefined;
|
|
11
|
+
/** Displayed if the search returns no items. */ buttons?: Record<string, (x: string) => void> | undefined;
|
|
13
12
|
openDrawer?: (() => void) | undefined;
|
|
14
13
|
};
|
|
15
14
|
events: {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { Icon } from 'svelte-awesome';
|
|
3
|
-
import { fade } from 'svelte/transition';
|
|
1
|
+
<script>import { Loader2 } from 'lucide-svelte';
|
|
4
2
|
import { Drawer, DrawerContent } from './common';
|
|
5
3
|
export let content;
|
|
6
4
|
export let isLoading;
|
|
@@ -40,15 +38,15 @@ let logViewer;
|
|
|
40
38
|
</div>
|
|
41
39
|
</div>
|
|
42
40
|
</div>
|
|
43
|
-
{#if
|
|
41
|
+
{#if isLoading}
|
|
42
|
+
<Loader2 class="animate-spin absolute top-2 left-2" />
|
|
43
|
+
{:else if duration}
|
|
44
44
|
<span class="absolute text-xs text-gray-500 top-2 left-2">took {duration}ms</span>
|
|
45
45
|
{/if}
|
|
46
|
-
|
|
47
46
|
<pre class="whitespace-pre-wrap break-words bg-gray-50 text-xs w-full p-2"
|
|
48
|
-
>{#if content}<span>{content}</span>{:else if isLoading}<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/>{:else}<span class="text-gray-600">No logs are available yet</span>{/if}</pre
|
|
47
|
+
>{#if content}<span>{content}</span>{:else if !isLoading}<span class="text-gray-600"
|
|
48
|
+
>No logs are available yet</span
|
|
49
|
+
>{/if}</pre
|
|
52
50
|
>
|
|
53
51
|
</div>
|
|
54
52
|
</div>
|
|
@@ -6,11 +6,10 @@ import TestJobLoader from './TestJobLoader.svelte';
|
|
|
6
6
|
import LogViewer from './LogViewer.svelte';
|
|
7
7
|
import DisplayResult from './DisplayResult.svelte';
|
|
8
8
|
import Button from './common/button/Button.svelte';
|
|
9
|
-
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
|
|
10
9
|
import { flowStateStore } from './flows/flowState';
|
|
11
10
|
import { flowStore } from './flows/flowStore';
|
|
12
11
|
import { workspaceStore } from '../stores';
|
|
13
|
-
import {
|
|
12
|
+
import { Loader2 } from 'lucide-svelte';
|
|
14
13
|
export let mod;
|
|
15
14
|
export let schema;
|
|
16
15
|
// Test
|
|
@@ -71,16 +70,8 @@ function jobDone() {
|
|
|
71
70
|
bind:args={stepArgs}
|
|
72
71
|
/>
|
|
73
72
|
{#if testIsLoading}
|
|
74
|
-
<Button
|
|
75
|
-
|
|
76
|
-
btnClasses="w-full mt-4"
|
|
77
|
-
color="red"
|
|
78
|
-
size="sm"
|
|
79
|
-
startIcon={{
|
|
80
|
-
icon: faSpinner,
|
|
81
|
-
classes: 'animate-spin'
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
73
|
+
<Button on:click={testJobLoader?.cancelJob} btnClasses="w-full mt-4" color="red" size="sm">
|
|
74
|
+
<Loader2 class="animate-spin mr-1" />
|
|
84
75
|
Cancel
|
|
85
76
|
</Button>
|
|
86
77
|
{/if}
|
|
@@ -98,7 +89,7 @@ function jobDone() {
|
|
|
98
89
|
{:else}
|
|
99
90
|
<div class="p-2">
|
|
100
91
|
{#if testIsLoading}
|
|
101
|
-
<
|
|
92
|
+
<Loader2 class="animate-spin" />
|
|
102
93
|
{:else}
|
|
103
94
|
Test to see the result here
|
|
104
95
|
{/if}
|
|
@@ -4,21 +4,23 @@ import { userStore, workspaceStore } from '../stores';
|
|
|
4
4
|
import { Alert, Button, Drawer } from './common';
|
|
5
5
|
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
6
6
|
import Path from './Path.svelte';
|
|
7
|
-
import { FlowService, ScriptService } from '../gen';
|
|
7
|
+
import { AppService, FlowService, ScriptService } from '../gen';
|
|
8
8
|
const dispatch = createEventDispatcher();
|
|
9
9
|
let kind;
|
|
10
10
|
let initialPath = '';
|
|
11
|
-
let path =
|
|
11
|
+
let path = undefined;
|
|
12
|
+
let summary = undefined;
|
|
12
13
|
let drawer;
|
|
13
14
|
let own = false;
|
|
14
|
-
export async function openDrawer(initialPath_l, kind_l) {
|
|
15
|
+
export async function openDrawer(initialPath_l, summary_l, kind_l) {
|
|
15
16
|
kind = kind_l;
|
|
16
17
|
initialPath = initialPath_l;
|
|
18
|
+
summary = summary_l;
|
|
17
19
|
await loadOwner();
|
|
18
20
|
drawer.openDrawer();
|
|
19
21
|
}
|
|
20
22
|
async function loadOwner() {
|
|
21
|
-
own = await isOwner(
|
|
23
|
+
own = await isOwner(initialPath, $userStore, $workspaceStore);
|
|
22
24
|
}
|
|
23
25
|
async function updatePath() {
|
|
24
26
|
if (kind == 'flow') {
|
|
@@ -30,8 +32,8 @@ async function updatePath() {
|
|
|
30
32
|
workspace: $workspaceStore,
|
|
31
33
|
path: initialPath,
|
|
32
34
|
requestBody: {
|
|
33
|
-
path,
|
|
34
|
-
summary:
|
|
35
|
+
path: path ?? '',
|
|
36
|
+
summary: summary ?? '',
|
|
35
37
|
description: flow.description,
|
|
36
38
|
value: flow.value
|
|
37
39
|
}
|
|
@@ -42,6 +44,7 @@ async function updatePath() {
|
|
|
42
44
|
workspace: $workspaceStore,
|
|
43
45
|
path: initialPath
|
|
44
46
|
});
|
|
47
|
+
script.summary = summary ?? '';
|
|
45
48
|
await ScriptService.createScript({
|
|
46
49
|
workspace: $workspaceStore,
|
|
47
50
|
requestBody: {
|
|
@@ -49,7 +52,17 @@ async function updatePath() {
|
|
|
49
52
|
description: script.description ?? '',
|
|
50
53
|
lock: script.lock?.split('\n'),
|
|
51
54
|
parent_hash: script.hash,
|
|
52
|
-
path
|
|
55
|
+
path: path ?? ''
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else if (kind == 'app') {
|
|
60
|
+
await AppService.updateApp({
|
|
61
|
+
workspace: $workspaceStore,
|
|
62
|
+
path: initialPath,
|
|
63
|
+
requestBody: {
|
|
64
|
+
path: path != initialPath ? path : undefined,
|
|
65
|
+
summary
|
|
53
66
|
}
|
|
54
67
|
});
|
|
55
68
|
}
|
|
@@ -59,16 +72,27 @@ async function updatePath() {
|
|
|
59
72
|
</script>
|
|
60
73
|
|
|
61
74
|
<Drawer bind:this={drawer}>
|
|
62
|
-
<DrawerContent title="Move {initialPath}" on:close={drawer.closeDrawer}>
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
<DrawerContent title="Move/Rename {initialPath}" on:close={drawer.closeDrawer}>
|
|
76
|
+
<h1 class="mb-2">Move/Rename {initialPath}</h1>
|
|
77
|
+
|
|
78
|
+
{#if !own}
|
|
79
|
+
<Alert type="warning" title="Not owner"
|
|
80
|
+
>Since you do not own this item, you cannot move this item (you can however fork it)</Alert
|
|
81
|
+
>
|
|
82
|
+
{/if}
|
|
83
|
+
<h2 class="border-b pb-1 mt-8 mb-4">Summary</h2>
|
|
84
|
+
<input
|
|
85
|
+
type="text"
|
|
86
|
+
bind:value={summary}
|
|
87
|
+
placeholder="A short summary displayed when it is listed"
|
|
88
|
+
rows="1"
|
|
89
|
+
disabled={!own}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<h2 class="border-b pb-1 mt-8 mb-4">Path</h2>
|
|
93
|
+
<div class="flex flex-col mb-2 gap-6">
|
|
70
94
|
<Path disabled={!own} {kind} {initialPath} bind:path />
|
|
71
|
-
<Button disabled={!own} on:click={updatePath}>Move</Button>
|
|
95
|
+
<Button disabled={!own} on:click={updatePath}>Move/Rename</Button>
|
|
72
96
|
<div />
|
|
73
97
|
</div>
|
|
74
98
|
</DrawerContent>
|