windmill-components 1.472.3 → 1.472.5
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script>import { DraftService, ScriptService, ScheduleService, PostgresTriggerService } from '../gen';
|
|
2
2
|
import { inferArgs } from '../infer';
|
|
3
3
|
import { initialCode } from '../script_helpers';
|
|
4
|
-
import { page } from '$app/stores';
|
|
5
4
|
import { defaultScripts, enterpriseLicense, userStore, workspaceStore } from '../stores';
|
|
6
5
|
import { cleanValueProperties, emptySchema, emptyString, encodeState, formatCron, orderedJsonStringify, replaceFalseWithUndefined } from '../utils';
|
|
7
6
|
import Path from './Path.svelte';
|
|
@@ -175,16 +174,17 @@ if (script.content == '') {
|
|
|
175
174
|
initContent(script.language, script.kind, template);
|
|
176
175
|
}
|
|
177
176
|
async function isTemplateScript() {
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
const params = new URLSearchParams(window.location.search);
|
|
178
|
+
const templateId = params.get('id');
|
|
179
|
+
if (templateId === null) {
|
|
180
180
|
return undefined;
|
|
181
181
|
}
|
|
182
182
|
try {
|
|
183
|
-
|
|
183
|
+
const templateScript = await PostgresTriggerService.getTemplateScript({
|
|
184
184
|
workspace: $workspaceStore,
|
|
185
|
-
id:
|
|
185
|
+
id: templateId
|
|
186
186
|
});
|
|
187
|
-
return
|
|
187
|
+
return templateScript;
|
|
188
188
|
}
|
|
189
189
|
catch (error) {
|
|
190
190
|
sendUserToast('An error occured when trying to load your template script, please try again later', true);
|
|
@@ -62,6 +62,9 @@ $: containerHeight = Math.min(
|
|
|
62
62
|
maxHeight($app.subgrids?.[`${id}-0`] ?? [], 0, $breakpoint) * (ROW_HEIGHT + ROW_GAP_Y) + 16,
|
|
63
63
|
// 32px (2rem) of top and bottom margin
|
|
64
64
|
wrapperHeight - headerHeight - 64);
|
|
65
|
+
async function getMenuElements() {
|
|
66
|
+
return Array.from(document.querySelectorAll('[data-menu]'));
|
|
67
|
+
}
|
|
65
68
|
</script>
|
|
66
69
|
|
|
67
70
|
<InitializeComponent {id} />
|
|
@@ -148,7 +151,11 @@ wrapperHeight - headerHeight - 64);
|
|
|
148
151
|
<div
|
|
149
152
|
style={css?.popup?.style}
|
|
150
153
|
class={twMerge('mx-24 mt-8 bg-surface rounded-lg relative', css?.popup?.class)}
|
|
151
|
-
use:clickOutside={
|
|
154
|
+
use:clickOutside={{
|
|
155
|
+
capture: false,
|
|
156
|
+
stopPropagation: false,
|
|
157
|
+
exclude: getMenuElements
|
|
158
|
+
}}
|
|
152
159
|
on:click_outside={(e) => {
|
|
153
160
|
if ($mode !== 'dnd' && !unclickableOutside) {
|
|
154
161
|
handleClickAway(e)
|
|
@@ -13,7 +13,6 @@ import { Loader2, Save, X } from 'lucide-svelte';
|
|
|
13
13
|
import Label from '../../Label.svelte';
|
|
14
14
|
import Toggle from '../../Toggle.svelte';
|
|
15
15
|
import ResourcePicker from '../../ResourcePicker.svelte';
|
|
16
|
-
import { base } from '$app/paths';
|
|
17
16
|
import Tooltip from '../../Tooltip.svelte';
|
|
18
17
|
import ToggleButton from '../../common/toggleButton-v2/ToggleButton.svelte';
|
|
19
18
|
import ToggleButtonGroup from '../../common/toggleButton-v2/ToggleButtonGroup.svelte';
|
|
@@ -26,6 +25,7 @@ import Tab from '../../common/tabs/Tab.svelte';
|
|
|
26
25
|
import RelationPicker from './RelationPicker.svelte';
|
|
27
26
|
import { invalidRelations } from './utils';
|
|
28
27
|
import CheckPostgresRequirement from './CheckPostgresRequirement.svelte';
|
|
28
|
+
import { base } from '../../../base';
|
|
29
29
|
let drawer;
|
|
30
30
|
let is_flow = false;
|
|
31
31
|
let initialPath = '';
|