diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f5d9cc..2e8238d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ # Unreleased +* Fixed bug with save/discard changes in workflow task (\#315). +* Fixed first-run redirects issue (\#315). + # 0.6.0 * Added fractal-web version to the footer (\#312). diff --git a/src/lib/components/common/jschema/ArrayProperty.svelte b/src/lib/components/common/jschema/ArrayProperty.svelte index f3b17d71..df67bd7f 100644 --- a/src/lib/components/common/jschema/ArrayProperty.svelte +++ b/src/lib/components/common/jschema/ArrayProperty.svelte @@ -3,14 +3,14 @@ import PropertyDiscriminator from '$lib/components/common/jschema/PropertyDiscriminator.svelte'; import PropertyDescription from '$lib/components/common/jschema/PropertyDescription.svelte'; - export let schemaProperty = undefined; + export let schemaProperty; let nestedProperties = []; let accordionParentKey = schemaProperty.key.replaceAll('#', ''); let collapseSymbol = accordionParentKey + '-collapse'; onMount(() => { - schemaProperty.value?.forEach((nestedValue, index) => { + schemaProperty.value?.forEach((/** @type {any} */ nestedValue, /** @type {number} */ index) => { schemaProperty.addNestedSchemaProperty(nestedValue, index); }); nestedProperties = schemaProperty.nestedProperties; @@ -21,60 +21,68 @@ nestedProperties = schemaProperty.nestedProperties; } - function removeNestedProperty(index) { + function removeNestedProperty(/** @type {number} */ index) { schemaProperty.removeNestedSchemaProperty(index); nestedProperties = schemaProperty.nestedProperties; } - -{#if schemaProperty } -
-
- { schemaProperty.title || "" } - -
-
- - -
-
-
- -
-
-
-
- -
-
- {#each nestedProperties as nestedProperty, index (nestedProperty.key)} -
-
- -
-
- -
-
- {/each} -
-
-
-
-
- - -
-
- +{#if schemaProperty} +
+
+ {schemaProperty.title || ''} + +
+
+
+
+
+ +
+
+
+
+ +
+
+ {#each nestedProperties as nestedProperty, index (nestedProperty.key)} +
+
+ +
+
+ +
+
+ {/each} +
+
+
+
+
+
+
{:else} - -
-

Unable to display array data

-
- - -{/if} \ No newline at end of file +
+

Unable to display array data

+
+{/if} diff --git a/src/lib/components/common/jschema/ObjectProperty.svelte b/src/lib/components/common/jschema/ObjectProperty.svelte index a3a3a79f..3817a12a 100644 --- a/src/lib/components/common/jschema/ObjectProperty.svelte +++ b/src/lib/components/common/jschema/ObjectProperty.svelte @@ -1,11 +1,12 @@ {#if objectSchema} - -
-
- { objectSchema.title } - -
-
-
-
-
- -
-
-
- {#if objectSchema.hasCustomKeyValues} -
-
-
- -
-
- -
-
-
- {#if objectSchema.properties} - {#key objectSchema.properties } - { - propertyKey = propertyKey.split(objectSchema.manager.keySeparator).pop(); - objectSchema.removeProperty(propertyKey); - objectSchema = objectSchema; - }} /> - {/key} - {/if} - {:else} - {#if objectSchema.properties} - {#key objectSchema.properties } - - {/key} - {/if} - {/if} -
-
-
- -
-
-
- +
+
+ {objectSchema.title} + +
+
+
+
+
+ +
+
+
+ {#if objectSchema.hasCustomKeyValues} +
+
+
+
+ + + {#if addNestedObjectError} +
{addNestedObjectError}
+ {/if} +
+
+
+
+ {#if objectSchema.properties} + {#key objectSchema.properties} + { + propertyKey = propertyKey.split(objectSchema.manager.keySeparator).pop(); + objectSchema.removeProperty(propertyKey); + objectSchema = objectSchema; + }} + /> + {/key} + {/if} + {:else if objectSchema.properties} + {#key objectSchema.properties} + + {/key} + {/if} +
+
+
+
+
+
{:else} - - - -
-

Object schema is undefined

-
-{/if} \ No newline at end of file +
+

Object schema is undefined

+
+{/if} diff --git a/src/lib/components/common/jschema/PropertiesBlock.svelte b/src/lib/components/common/jschema/PropertiesBlock.svelte index 5a470ac7..8f2583f1 100644 --- a/src/lib/components/common/jschema/PropertiesBlock.svelte +++ b/src/lib/components/common/jschema/PropertiesBlock.svelte @@ -19,17 +19,17 @@ blockProperties.push(schemaManager.addProperty(prop)); }); }); - -
- {#if parsedProperties} - {#each blockProperties as prop} - {#if removePropertyBlock } - - {/if} - - {/each} - {/if} -
\ No newline at end of file +
+ {#if parsedProperties} + {#each blockProperties as prop} + {#if removePropertyBlock} + + {/if} + + {/each} + {/if} +
diff --git a/src/routes/projects/[projectId]/workflows/[workflowId]/+page.svelte b/src/routes/projects/[projectId]/workflows/[workflowId]/+page.svelte index e894e38d..dbd69b0a 100644 --- a/src/routes/projects/[projectId]/workflows/[workflowId]/+page.svelte +++ b/src/routes/projects/[projectId]/workflows/[workflowId]/+page.svelte @@ -113,8 +113,7 @@ } ); const fileUrl = URL.createObjectURL(file); - /** @type {any} */ - const linkElement = document.getElementById('downloadWorkflowButton'); + const linkElement = /** @type {HTMLAnchorElement} */ (document.getElementById('downloadWorkflowButton')); linkElement.download = `workflow-export-${workflow.name}-${Date.now().toString()}.json`; linkElement.href = fileUrl; linkElement.click(); @@ -263,6 +262,9 @@ throw new AlertError(error); } + // Discard unsaved changes when workflow task is deleted + argumentsWithUnsavedChanges = false; + // Get updated workflow with deleted task const workflowResponse = await fetch(`/api/v1/project/${project.id}/workflow/${workflow.id}`, { method: 'GET', diff --git a/vite.config.js b/vite.config.js index a0b95047..75c3750c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -15,6 +15,10 @@ const config = { test: { globals: true, include: ['**/__tests__/**/*.?(c|m)[jt]s?(x)'] + }, + optimizeDeps: { + // The dependencies to be optimized are explicitly listed, to avoid the reloads triggered by their automatic detection + include: ['slim-select', 'marked', 'dompurify', 'semver', 'ajv', '@vincjo/datatables'] } };