From c5f349efc0bce2695ea75013fc12cc2db5bfbe13 Mon Sep 17 00:00:00 2001 From: Mario Frank Date: Mon, 23 Feb 2026 12:14:09 +0100 Subject: [PATCH 1/4] Extend the frontend to support snakemake export introduced in RestAPE PR 95 --- src/components/explore/GenerationResults.tsx | 41 ++++++++++++++++++++ src/stores/WorkflowTypes.ts | 1 + 2 files changed, 42 insertions(+) diff --git a/src/components/explore/GenerationResults.tsx b/src/components/explore/GenerationResults.tsx index 66be3202..ca69701f 100644 --- a/src/components/explore/GenerationResults.tsx +++ b/src/components/explore/GenerationResults.tsx @@ -68,6 +68,36 @@ const GenerationResults: React.FC = observer((props) => { }); }; + const downloadSnakeFile = (run_id: string, snakemake_name: string) => { + const request = { + run_id: run_id, + file_name: snakemake_name, + }; + fetch("/ape/snakemake", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(request), + }) + .then((response) => response.text()) + .then((data) => { + const blob = new Blob([data], { type: "text/plain" }); + const url = URL.createObjectURL(blob); + const link = document.createElement("a"); + link.href = url; + link.download = snakemake_name; + link.click(); + URL.revokeObjectURL(url); + }) + .catch((error) => { + console.error( + "There has been a problem with accessing a snakemake file from the REST APE service:", + error + ); + }); + }; + const downloadInputFile = (run_id: string) => { fetch(`/ape/cwl_input?run_id=${run_id}`) .then((response) => response.text()) @@ -233,6 +263,17 @@ const GenerationResults: React.FC = observer((props) => { > CWL + ) diff --git a/src/stores/WorkflowTypes.ts b/src/stores/WorkflowTypes.ts index 72c2d325..484484ae 100644 --- a/src/stores/WorkflowTypes.ts +++ b/src/stores/WorkflowTypes.ts @@ -36,6 +36,7 @@ export type WorkflowSolution = { descriptive_name: string, description: string, cwl_name: string, + snakemake_name: string, figure_name: string, benchmark_file: string, isSelected: boolean, From 57e36bb375f2e1af003e2931d6273c80ebbc21d5 Mon Sep 17 00:00:00 2001 From: Mario Frank Date: Wed, 29 Jul 2026 17:14:58 +0200 Subject: [PATCH 2/4] Support dropping non-executable workflows and visualise non-executability by deactivating and striking the download button. This implementation relies on RestAPE PR 104. --- src/components/explore/GenerationConfig.tsx | 9 +++++++++ src/components/explore/GenerationResults.tsx | 10 ++++++++++ src/stores/DomainStore.ts | 1 + src/stores/ExploreDataStore.ts | 2 ++ src/stores/WorkflowTypes.ts | 1 + 5 files changed, 23 insertions(+) diff --git a/src/components/explore/GenerationConfig.tsx b/src/components/explore/GenerationConfig.tsx index de0b33a7..dd397375 100644 --- a/src/components/explore/GenerationConfig.tsx +++ b/src/components/explore/GenerationConfig.tsx @@ -69,6 +69,15 @@ const GenerationConfig: React.FC = observer((props) => { onChange={(event) => (workflowConfig.solutionCount = parseInt(event.target.value))} /> +
+ + (workflowConfig.createPartialScripts = !workflowConfig.createPartialScripts)} + /> +
diff --git a/src/components/explore/GenerationResults.tsx b/src/components/explore/GenerationResults.tsx index ca69701f..fd71fa11 100644 --- a/src/components/explore/GenerationResults.tsx +++ b/src/components/explore/GenerationResults.tsx @@ -260,6 +260,11 @@ const GenerationResults: React.FC = observer((props) => { workflow.cwl_name ) } + style={{ + textDecoration: workflow.cwl_name === '' ? 'line-through' : 'none', + cursor: workflow.cwl_name === '' ? 'not-allowed' : 'pointer', + }} + disabled={workflow.cwl_name === ''} > CWL @@ -271,6 +276,11 @@ const GenerationResults: React.FC = observer((props) => { workflow.snakemake_name ) } + disabled={workflow.snakemake_name === ''} + style={{ + textDecoration: workflow.snakemake_name === '' ? 'line-through' : 'none', + cursor: workflow.snakemake_name === '' ? 'not-allowed' : 'pointer', + }} > SMK diff --git a/src/stores/DomainStore.ts b/src/stores/DomainStore.ts index 8cdc9412..3e7883ee 100644 --- a/src/stores/DomainStore.ts +++ b/src/stores/DomainStore.ts @@ -41,6 +41,7 @@ export interface DomainConfig { max: number; }; solutions: number; + create_partial_scripts: boolean; number_of_execution_scripts: number; number_of_generated_graphs: number; diff --git a/src/stores/ExploreDataStore.ts b/src/stores/ExploreDataStore.ts index d4309aa5..6ee2a6ab 100644 --- a/src/stores/ExploreDataStore.ts +++ b/src/stores/ExploreDataStore.ts @@ -16,6 +16,7 @@ const emptyUserConfig = (): UserParams => { maxSteps: 5, timeout: 120, solutionCount: 10, + createPartialScripts: true, }; }; @@ -122,6 +123,7 @@ export class ExploreDataStore { min: config.minSteps, max: config.maxSteps, }, + create_partial_scripts: config.createPartialScripts, solutions: config.solutionCount, number_of_execution_scripts: config.solutionCount, number_of_generated_graphs: config.solutionCount, diff --git a/src/stores/WorkflowTypes.ts b/src/stores/WorkflowTypes.ts index 484484ae..6b2038a6 100644 --- a/src/stores/WorkflowTypes.ts +++ b/src/stores/WorkflowTypes.ts @@ -27,6 +27,7 @@ export type UserParams = { maxSteps: number timeout: number solutionCount: number + createPartialScripts: boolean } export type WorkflowSolution = { From 5289ffe8952a56cccc1d13182f4dda28e28ca328 Mon Sep 17 00:00:00 2001 From: Mario Frank Date: Tue, 8 Sep 2026 14:21:33 +0200 Subject: [PATCH 3/4] Apply suggestion from @vedran-kasalica Co-authored-by: Vedran Kasalica --- src/components/explore/GenerationConfig.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/explore/GenerationConfig.tsx b/src/components/explore/GenerationConfig.tsx index dd397375..e68640df 100644 --- a/src/components/explore/GenerationConfig.tsx +++ b/src/components/explore/GenerationConfig.tsx @@ -75,7 +75,7 @@ const GenerationConfig: React.FC = observer((props) => { (workflowConfig.createPartialScripts = !workflowConfig.createPartialScripts)} + onChange={(event) => { workflowConfig.createPartialScripts = event.target.checked }} /> From c142a707f6f1dc78532f0051d53354ffebb9e519 Mon Sep 17 00:00:00 2001 From: Mario Frank Date: Tue, 8 Sep 2026 15:55:47 +0200 Subject: [PATCH 4/4] Update src/components/explore/GenerationConfig.tsx Co-authored-by: Vedran Kasalica --- src/components/explore/GenerationConfig.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/explore/GenerationConfig.tsx b/src/components/explore/GenerationConfig.tsx index e68640df..fd013f2f 100644 --- a/src/components/explore/GenerationConfig.tsx +++ b/src/components/explore/GenerationConfig.tsx @@ -73,7 +73,7 @@ const GenerationConfig: React.FC = observer((props) => { data-tip="Specifies whether potentially non-executable workflow descriptions shall be generated."> { workflowConfig.createPartialScripts = event.target.checked }} />