From e814db4b1a1ef11b93a2a15c130c8803c6475ba2 Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Thu, 12 Oct 2023 12:11:08 +0200 Subject: [PATCH 1/7] Fixed glitch on workflow task deletion (discard changes modal) --- .../[projectId]/workflows/[workflowId]/+page.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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', From d660448fed035a48e433b42460a47140b6f01c7b Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Thu, 12 Oct 2023 12:11:47 +0200 Subject: [PATCH 2/7] Fixed first-run glitches --- vite.config.js | 4 ++++ 1 file changed, 4 insertions(+) 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'] } }; From e64923ad3430eafa8a69ea7203553fcb21bbec43 Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Thu, 12 Oct 2023 12:15:15 +0200 Subject: [PATCH 3/7] Updated CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f5d9cc..804889b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # Unreleased +* Fixed deleted workflow task pending changes bug and first-run redirects issue (\#315). + # 0.6.0 * Added fractal-web version to the footer (\#312). From 0dbf9e1d2110689907592dd351d69b285cb6a575 Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Thu, 12 Oct 2023 15:49:48 +0200 Subject: [PATCH 4/7] Added type="button" in jschema components to avoid automatic form submission --- src/lib/components/common/jschema/ArrayProperty.svelte | 4 ++-- src/lib/components/common/jschema/ObjectProperty.svelte | 2 +- src/lib/components/common/jschema/PropertiesBlock.svelte | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/common/jschema/ArrayProperty.svelte b/src/lib/components/common/jschema/ArrayProperty.svelte index f3b17d71..4c74e710 100644 --- a/src/lib/components/common/jschema/ArrayProperty.svelte +++ b/src/lib/components/common/jschema/ArrayProperty.svelte @@ -47,13 +47,13 @@
- +
{#each nestedProperties as nestedProperty, index (nestedProperty.key)}
- +
diff --git a/src/lib/components/common/jschema/ObjectProperty.svelte b/src/lib/components/common/jschema/ObjectProperty.svelte index a3a3a79f..c39364d3 100644 --- a/src/lib/components/common/jschema/ObjectProperty.svelte +++ b/src/lib/components/common/jschema/ObjectProperty.svelte @@ -58,7 +58,7 @@
- +
diff --git a/src/lib/components/common/jschema/PropertiesBlock.svelte b/src/lib/components/common/jschema/PropertiesBlock.svelte index 5a470ac7..80e1eb24 100644 --- a/src/lib/components/common/jschema/PropertiesBlock.svelte +++ b/src/lib/components/common/jschema/PropertiesBlock.svelte @@ -26,7 +26,7 @@ {#if parsedProperties} {#each blockProperties as prop} {#if removePropertyBlock } - {/if} From 88090295c4d00811ccfb455976608b5d7ea253b4 Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Thu, 12 Oct 2023 16:35:44 +0200 Subject: [PATCH 5/7] autoindent and minor improvements --- .../common/jschema/ArrayProperty.svelte | 114 ++++++++++-------- .../common/jschema/PropertiesBlock.svelte | 24 ++-- 2 files changed, 73 insertions(+), 65 deletions(-) diff --git a/src/lib/components/common/jschema/ArrayProperty.svelte b/src/lib/components/common/jschema/ArrayProperty.svelte index 4c74e710..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 } -
- -
- - -
-
-
- -
-
-
-
- -
-
- {#each nestedProperties as nestedProperty, index (nestedProperty.key)} -
-
- -
-
- -
-
- {/each} -
-
-
-
-
- - -
-
- +{#if schemaProperty} +
+ +
+
+
+
+ +
+
+
+
+ +
+
+ {#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/PropertiesBlock.svelte b/src/lib/components/common/jschema/PropertiesBlock.svelte index 80e1eb24..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} +
From 8b5c6428ffd61f3a4595d504603fdbf345125bc6 Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Thu, 12 Oct 2023 16:37:30 +0200 Subject: [PATCH 6/7] autoindent and displayed error for invalid argument properties --- .../common/jschema/ObjectProperty.svelte | 182 +++++++++--------- 1 file changed, 88 insertions(+), 94 deletions(-) diff --git a/src/lib/components/common/jschema/ObjectProperty.svelte b/src/lib/components/common/jschema/ObjectProperty.svelte index c39364d3..3817a12a 100644 --- a/src/lib/components/common/jschema/ObjectProperty.svelte +++ b/src/lib/components/common/jschema/ObjectProperty.svelte @@ -1,11 +1,12 @@ {#if objectSchema} - -
- -
-
-
-
- -
-
-
- {#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} -
-
-
- -
-
-
- +
+ +
+
+
+
+ +
+
+
+ {#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} From 968f50e79e5ad27629e8aa817e628c7011120288 Mon Sep 17 00:00:00 2001 From: Tommaso Comparin <3862206+tcompa@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:21:17 +0200 Subject: [PATCH 7/7] Improve CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 804889b8..2e8238d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ # Unreleased -* Fixed deleted workflow task pending changes bug and first-run redirects issue (\#315). +* Fixed bug with save/discard changes in workflow task (\#315). +* Fixed first-run redirects issue (\#315). # 0.6.0