diff --git a/.env b/.env
index b88c588c..4c147163 100644
--- a/.env
+++ b/.env
@@ -18,6 +18,5 @@ LOG_FILE=/tmp/fractal-web.log
LOG_LEVEL_FILE=info
LOG_LEVEL_CONSOLE=warn
-FRACTAL_API_V1_MODE=include
FRACTAL_RUNNER_BACKEND=local
#WARNING_BANNER_PATH=/path/to/banner.txt
diff --git a/.env.development b/.env.development
index b9e10841..7ba94f6a 100644
--- a/.env.development
+++ b/.env.development
@@ -17,6 +17,5 @@ LOG_FILE=./fractal-web.log
LOG_LEVEL_FILE=debug
LOG_LEVEL_CONSOLE=info
-FRACTAL_API_V1_MODE=include
FRACTAL_RUNNER_BACKEND=local
#WARNING_BANNER_PATH=/path/to/banner.txt
diff --git a/__tests__/selected_api_version.test.js b/__tests__/selected_api_version.test.js
deleted file mode 100644
index 0c50c5fc..00000000
--- a/__tests__/selected_api_version.test.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import { it, expect, vi, beforeEach } from 'vitest';
-import { reloadVersionedPage } from '../src/lib/common/selected_api_version';
-
-vi.mock('$app/navigation', () => {
- return { goto: vi.fn() };
-});
-
-import { goto } from '$app/navigation';
-
-beforeEach(() => {
- vi.resetAllMocks();
-});
-
-it('should reload versioned page (v1 -> v2)', async () => {
- await reloadVersionedPage('/v1/projects', 'v2');
- expect(goto).toHaveBeenCalledWith('/v2/projects');
-});
-
-it('should reload versioned page (v2 -> v1)', async () => {
- await reloadVersionedPage('/v2/projects', 'v1');
- expect(goto).toHaveBeenCalledWith('/v1/projects');
-});
-
-it('should ignore page without version', async () => {
- await reloadVersionedPage('/admin', 'v2');
- expect(goto).not.toHaveBeenCalled();
-});
diff --git a/docs/environment-variables.md b/docs/environment-variables.md
index 504729bc..75a944a7 100644
--- a/docs/environment-variables.md
+++ b/docs/environment-variables.md
@@ -16,7 +16,6 @@ The following environment variables can be used to configure fractal-web.
* `LOG_FILE`: the path of the file where logs will be written; by default is unset and no file will be created;
* `LOG_LEVEL_FILE`: the log level of logs that will be written to the file; the default value is `info`;
* `LOG_LEVEL_CONSOLE`: the log level of logs that will be written to the console; the default value is `warn`;
-* `FRACTAL_API_V1_MODE`: include/exclude V1 pages and version switcher; supported values are: `include`, `include_read_only`, `exclude`; the default value is `include`;
* `FRACTAL_RUNNER_BACKEND`: specifies which runner backend is used; supported values are: `local`, `local_experimental`, `slurm`, `slurm_ssh`; setting this variable is mandatory;
* `PUBLIC_FRACTAL_VIZARR_VIEWER_URL`: URL to [fractal-vizarr-viewer](https://github.com/fractal-analytics-platform/fractal-vizarr-viewer) service (e.g. http://localhost:3000/vizarr for testing);
* `WARNING_BANNER_PATH`: specifies the path to a text file containing the warning banner message displayed on the site; the banner is used to inform users about important issues, such as external resources downtime or maintenance alerts; if the variable is empty or unset no banner is displayed.
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 90a82b3b..ffa47609 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -55,7 +55,6 @@ export LOG_FILE=fractal-web.log
# export LOG_LEVEL_FILE=info
# export LOG_LEVEL_CONSOLE=warn
-export FRACTAL_API_V1_MODE=include
export FRACTAL_RUNNER_BACKEND=local
#export PUBLIC_FRACTAL_VIZARR_VIEWER_URL=
diff --git a/src/hooks.server.js b/src/hooks.server.js
index 221ee5fb..13d6e21f 100644
--- a/src/hooks.server.js
+++ b/src/hooks.server.js
@@ -85,7 +85,7 @@ export async function handle({ event, resolve }) {
}
// Admin area check
- if (event.url.pathname.startsWith('/v1/admin') || event.url.pathname.startsWith('/v2/admin')) {
+ if (event.url.pathname.startsWith('/v2/admin')) {
if (!(/** @type {import('$lib/types').User} */ (userInfo).is_superuser)) {
error(403, `Only superusers can access the admin area`);
}
diff --git a/src/lib/common/selected_api_version.js b/src/lib/common/selected_api_version.js
deleted file mode 100644
index 4f4a11fc..00000000
--- a/src/lib/common/selected_api_version.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import { goto } from "$app/navigation";
-
-/**
- * Save the selected API version in the cookie and reload the page.
- * This function is called from the Svelte frontend.
- * @param {string} path
- * @param {string} version
- */
-export async function reloadVersionedPage(path, version) {
- if ((version === 'v2' && path.startsWith('/v1')) || (version === 'v1' && path.startsWith('/v2'))) {
- const newPath = path.replace(/^(\/v(1|2)\/)(.*)/, `/${version}/$3`);
- await goto(newPath);
- }
-}
diff --git a/src/lib/components/v1/jobs/JobInfoModal.svelte b/src/lib/components/v1/jobs/JobInfoModal.svelte
deleted file mode 100644
index e1e6436a..00000000
--- a/src/lib/components/v1/jobs/JobInfoModal.svelte
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
- Workflow Job #{job?.id}
- {#if job && job.user_email === $page.data.userInfo.email && job.project_id !== null}
-
-
-
- {/if}
-
-
-
-
-
-
Workflow job properties
- {#if job}
-
- Id
- {job.id}
- Workflow
- {job.workflow_dump.name}
- Project
- {job.project_dump.name}
- Input dataset
- {job.input_dataset_dump.name}
- Output dataset
- {job.output_dataset_dump.name}
- Status
- {#key job.status}
-
- {/key}
- Working directory
- {job.working_dir}
- User Working directory
- {job.working_dir_user}
- SLURM account
- {job.slurm_account || '-'}
-
- {/if}
-
-
-
-
-
diff --git a/src/lib/components/v1/jobs/JobLogsModal.svelte b/src/lib/components/v1/jobs/JobLogsModal.svelte
deleted file mode 100644
index 8d10787f..00000000
--- a/src/lib/components/v1/jobs/JobLogsModal.svelte
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
-
Workflow Job logs
-
-
-
-
- {#if loading}
-
- Loading...
-
- Loading...
- {:else}
-
-
- {#if logParts.length > 1}
-
-{#each logParts as part}{#if part.highlight}{part.text}
-
{:else if showDetails}{part.text}
{:else}... (details hidden, click here to expand) {/if}{/each}
- {:else}
-
{logParts
- .map((p) => p.text)
- .join('\n')}
- {/if}
-
- {/if}
-
-
-
-
diff --git a/src/lib/components/v1/jobs/JobsList.svelte b/src/lib/components/v1/jobs/JobsList.svelte
deleted file mode 100644
index 11d3729d..00000000
--- a/src/lib/components/v1/jobs/JobsList.svelte
+++ /dev/null
@@ -1,518 +0,0 @@
-
-
-
-
-{#if tableHandler}
-
-
- {#if !admin}
-
-
- Clear filters
-
- {/if}
-
-
-
-
-
-
- {#if !columnsToHide.includes('id')}
-
- {/if}
-
-
-
-
- {#if !columnsToHide.includes('project')}
-
- {/if}
- {#if !columnsToHide.includes('workflow')}
-
- {/if}
-
-
- {#if !columnsToHide.includes('user_email')}
-
- {/if}
-
-
-
- {#if !columnsToHide.includes('id')}
-
- {/if}
-
- Options
-
-
- {#if !columnsToHide.includes('project')}
-
- {/if}
- {#if !columnsToHide.includes('workflow')}
-
- {/if}
-
-
- {#if !columnsToHide.includes('user_email')}
-
- {/if}
-
- {#if !admin}
-
- {#if !columnsToHide.includes('id')}
-
- {/if}
-
-
-
-
-
-
- {#if !columnsToHide.includes('project')}
-
- {#if projects}
-
- {/if}
-
- {/if}
- {#if !columnsToHide.includes('workflow')}
-
- {#if workflows}
-
- {/if}
-
- {/if}
-
-
-
-
-
-
- {#if !columnsToHide.includes('user_email')}
-
- {/if}
-
- {/if}
-
-
-
- {#if rows}
- {#each $rows as row}
-
- {#if !columnsToHide.includes('id')}
- {row.id}
- {/if}
-
-
-
- {#if admin}
-
- {/if}
-
-
-
- jobInfoModal.show(row)}>
-
- Info
-
- jobLogsModal.show(row, admin)}
- >
-
- Logs
-
- {#if (admin && row.id) || (row.project_id !== null && row.user_email === $page.data.userInfo.email)}
-
-
-
- {/if}
- {#if row.status === 'submitted'}
- handleJobCancel(row)}
- disabled={cancellingJobs.includes(row.id)}
- >
- {#if cancellingJobs.includes(row.id)}
-
- {:else}
-
- {/if}
- Cancel
-
- {/if}
-
-
-
-
-
-
-
- {#if !columnsToHide.includes('project')}
-
- {#if projects && row.project_id !== null && row.user_email === $page.data.userInfo.email}
-
- {projects.find((project) => project.id === row.project_id)?.name}
-
- {:else}
- {projects.find((project) => project.id === row.project_id)?.name || '-'}
- {/if}
-
- {/if}
- {#if !columnsToHide.includes('workflow')}
-
- {#if workflows && row.workflow_id !== null && row.user_email === $page.data.userInfo.email}
-
- {row.workflow_dump.name}
-
- {:else}
- {row.workflow_dump.name}
- {/if}
-
- {/if}
-
- {#if inputDatasets && row.input_dataset_id !== null && row.user_email === $page.data.userInfo.email}
-
- {row.input_dataset_dump.name}
-
- {:else}
- {row.input_dataset_dump.name}
- {/if}
-
-
- {#if outputDatasets && row.output_dataset_id !== null && row.user_email === $page.data.userInfo.email}
-
- {row.output_dataset_dump.name}
-
- {:else}
- {row.output_dataset_dump.name}
- {/if}
-
- {#if !columnsToHide.includes('user_email')}
- {row.user_email}
- {/if}
-
- {/each}
- {/if}
-
-
-{/if}
-
-
-
-
-
diff --git a/src/lib/components/v1/projects/CreateUpdateDatasetModal.svelte b/src/lib/components/v1/projects/CreateUpdateDatasetModal.svelte
deleted file mode 100644
index 51f46523..00000000
--- a/src/lib/components/v1/projects/CreateUpdateDatasetModal.svelte
+++ /dev/null
@@ -1,585 +0,0 @@
-
-
-
-
-
- {datasetId === null ? 'Create new dataset' : 'Edit dataset ' + datasetName}
-
-
-
- {#if creatingDataset && resources.filter((r) => r.error !== '').length > 0}
-
-
-
- Warning : Dataset has been created but the creation of some of its
- resources failed.
-
-
-
- {/if}
-
-
-
-
-
- {#if saving}
-
- {/if}
- Save
-
- Cancel
-
-
diff --git a/src/lib/components/v1/projects/CreateWorkflowModal.svelte b/src/lib/components/v1/projects/CreateWorkflowModal.svelte
deleted file mode 100644
index 2eebaad6..00000000
--- a/src/lib/components/v1/projects/CreateWorkflowModal.svelte
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-
-
- Create new workflow
-
-
-
-
- {#if importSuccess}
- Workflow imported successfully
- {/if}
-
-
diff --git a/src/lib/components/v1/projects/ProjectDatasetsList.svelte b/src/lib/components/v1/projects/ProjectDatasetsList.svelte
deleted file mode 100644
index abb5edf3..00000000
--- a/src/lib/components/v1/projects/ProjectDatasetsList.svelte
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
-
Datasets
-
-
-
-
-
- createUpdateDatasetModal.openForCreate()}
- >
- Create new dataset
-
-
-
-
-
-
-
-
-
- Name
- Type
- Options
-
-
-
- {#key datasets}
- {#each filteredDatasets as dataset}
-
- {dataset.name}
- {dataset.type || 'Unknown'}
-
-
- Open
-
- createUpdateDatasetModal.openForEdit(dataset)}
- >
- Edit
-
- handleDatasetDelete(dataset.project_id, dataset.id)}
- />
-
-
- {/each}
- {/key}
-
-
-
-
-
diff --git a/src/lib/components/v1/projects/ProjectInfoModal.svelte b/src/lib/components/v1/projects/ProjectInfoModal.svelte
deleted file mode 100644
index f2c205f0..00000000
--- a/src/lib/components/v1/projects/ProjectInfoModal.svelte
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
- {#if project}
- Project {project.name}
-
- Open
-
- {/if}
-
-
- {#if project}
-
-
-
Project properties
-
- Name
- {project.name}
- Read only
- {project.read_only ? 'Yes' : 'No'}
-
-
-
-
-
- {#if loadingDatasets}
- Loading...
- {/if}
-
- {#if datasets}
-
Datasets
-
-
-
- Name
- Readonly
- # Resources
- Type
-
-
-
- {#each datasets as { name, read_only, resource_list, type }}
-
- {name}
- {read_only ? 'Yes' : 'No'}
- {resource_list.length}
- {type == '' ? 'Unknown' : type}
-
- {/each}
-
-
- {/if}
-
-
- {/if}
-
-
diff --git a/src/lib/components/v1/projects/ProjectsList.svelte b/src/lib/components/v1/projects/ProjectsList.svelte
deleted file mode 100644
index d50eb607..00000000
--- a/src/lib/components/v1/projects/ProjectsList.svelte
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-
-
-
-
-
-
- newProjectModal.show()}>
- Create new project
-
-
-
-
-
-
-
-
-
- Name
- Options
-
-
-
- {#key projects}
- {#each filteredProjects as { id, name }}
-
- {name}
-
- setProjectInfoModal(id)}
- >
- Info
-
-
- Open
-
- handleDeleteProject(id)}
- />
-
-
- {/each}
- {/key}
-
-
-
-
-
-
-
- Create new project
-
-
-
-
-
-
- Cancel
-
- {#if creating}
-
- {/if}
- Create
-
-
-
diff --git a/src/lib/components/v1/projects/WorkflowsList.svelte b/src/lib/components/v1/projects/WorkflowsList.svelte
deleted file mode 100644
index 4ea8831c..00000000
--- a/src/lib/components/v1/projects/WorkflowsList.svelte
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
Workflows
-
-
-
-
-
- createWorkflowModal.show()}
- >
- Create new workflow
-
-
-
-
-
-
-
-
- Id
- Name
- Options
-
-
-
- {#key workflows}
- {#each filteredWorkflows as { id, name }}
-
- {id}
- {name}
-
-
-
- Open
-
-
- List jobs
-
- handleDeleteWorkflow(id)}
- />
-
-
- {/each}
- {/key}
-
-
-
diff --git a/src/lib/components/v1/tasks/AddSingleTask.svelte b/src/lib/components/v1/tasks/AddSingleTask.svelte
deleted file mode 100644
index 5fda366d..00000000
--- a/src/lib/components/v1/tasks/AddSingleTask.svelte
+++ /dev/null
@@ -1,451 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/lib/components/v1/tasks/TaskCollection.svelte b/src/lib/components/v1/tasks/TaskCollection.svelte
deleted file mode 100644
index fbdcf640..00000000
--- a/src/lib/components/v1/tasks/TaskCollection.svelte
+++ /dev/null
@@ -1,531 +0,0 @@
-
-
-
-
-
- {#if taskCollectionAlreadyPresent}
-
-
{taskCollectionAlreadyPresent.package}
-
{taskCollectionAlreadyPresent.info}
-
- {/if}
-
-
-
-
-
- {#if packageType === 'pypi'}
- The name of a package published on PyPI
- {:else}
- The full path to a wheel file
- {/if}
-
-
- {#if packageType === 'pypi'}
-
- {/if}
-
-
-
- Optional arguments
-
-
-
-
-
-
Python version to install and run the package tasks
-
-
-
-
- Package extras to include in the pip install
command
-
-
-
- {#if pinnedPackageVersions.length > 0}
- Pinned packages versions:
- {/if}
- {#each pinnedPackageVersions as ppv, i}
-
- {/each}
-
-
-
- Add pinned package version
-
-
-
-
-
-
-
- {#if taskCollectionInProgress}
-
- Collecting...
-
- {/if}
- Collect
-
-
-
-
- {#if taskCollections.length > 0}
-
-
-
-
-
Task collections
-
-
-
-
-
-
-
- Timestamp
- Package
- Version
- Status
- Options
-
-
-
- {#key taskCollections}
- {#each taskCollections as { timestamp, status, package_version, pkg, id, logs }}
-
- {new Date(timestamp).toLocaleString()}
- {pkg}
-
- {package_version ? package_version : 'Unspecified'}
-
- {status}
-
- removeTaskCollection(id)}
- />
- {#if status == 'fail' || (status == 'OK' && logs !== '')}
-
-
-
- {/if}
-
-
- {/each}
- {/key}
-
-
-
- {/if}
-
diff --git a/src/lib/components/v1/tasks/TaskCollectionLogsModal.svelte b/src/lib/components/v1/tasks/TaskCollectionLogsModal.svelte
deleted file mode 100644
index ed66de48..00000000
--- a/src/lib/components/v1/tasks/TaskCollectionLogsModal.svelte
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
- Task collection logs
-
-
-
- {logs}
-
-
diff --git a/src/lib/components/v1/tasks/TaskEditModal.svelte b/src/lib/components/v1/tasks/TaskEditModal.svelte
deleted file mode 100644
index d7bd9682..00000000
--- a/src/lib/components/v1/tasks/TaskEditModal.svelte
+++ /dev/null
@@ -1,280 +0,0 @@
-
-
-
-
- {#if task}
- Task {task.name}
- {/if}
-
-
- {#if loading}
-
- Loading...
-
- {:else if task}
-
-
-
Task properties
-
-
-
-
-
Name
-
-
- {#if !task.name}
-
Required field
- {/if}
-
-
-
-
-
-
-
-
-
Command
-
-
- {#if !task.command}
-
Required field
- {/if}
-
-
-
-
-
-
-
Input Type
-
-
- {#if !task.input_type}
-
Required field
- {/if}
-
-
-
-
-
Output Type
-
-
- {#if !task.output_type}
-
Required field
- {/if}
-
-
-
-
-
Args Schema Version
-
-
-
-
-
-
-
-
-
-
-
-
- {/if}
-
-
- {#if task}
-
- {#if saving}
-
- {/if}
- Update
-
- Close
- {/if}
-
-
diff --git a/src/lib/components/v1/tasks/TaskInfoModal.svelte b/src/lib/components/v1/tasks/TaskInfoModal.svelte
deleted file mode 100644
index f12b60c4..00000000
--- a/src/lib/components/v1/tasks/TaskInfoModal.svelte
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
- {#if task}
- Task {task.name}
- {/if}
-
-
-
- {#if task}
-
-
-
Task properties
-
- Name
- {task.name}
- Version
- {task.version || '-'}
- Owner
- {task.owner || '-'}
- Command
- {task.command}
- Source
- {task.source}
- Input Type
-
- {task.input_type}
-
- Output Type
-
- {task.output_type}
-
- Args Schema Version
- {task.args_schema_version || '-'}
- Args Schema
-
- {#if loading}
-
- Loading...
-
- {:else if task.args_schema}
-
- {JSON.stringify(task.args_schema, null, 2)}
-
- {:else}
- -
- {/if}
-
- Docs Link
-
- {#if task.docs_link}
- {task?.docs_link}
- {:else}
- -
- {/if}
-
- Docs Info
-
- {#if task.docs_info}
-
- {@html formatMarkdown(task.docs_info)}
- {:else}
- -
- {/if}
-
-
-
-
- {/if}
-
-
- Close
-
-
diff --git a/src/lib/components/v1/workflow/ArgumentForm.svelte b/src/lib/components/v1/workflow/ArgumentForm.svelte
deleted file mode 100644
index 4aab0ffe..00000000
--- a/src/lib/components/v1/workflow/ArgumentForm.svelte
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- handleEntryUpdate(json)}
- exportDisabled={false}
- />
-
-
-
-
diff --git a/src/lib/components/v1/workflow/ArgumentsSchema.svelte b/src/lib/components/v1/workflow/ArgumentsSchema.svelte
deleted file mode 100644
index c8a7a768..00000000
--- a/src/lib/components/v1/workflow/ArgumentsSchema.svelte
+++ /dev/null
@@ -1,183 +0,0 @@
-
-
-
-
-
-
-
-
-
handleImport(json)}
- exportDisabled={unsavedChanges || savingChanges}
- />
-
-
- Discard changes
-
-
-
-
- {#if savingChanges}
-
- {/if}
- Save changes
-
-
-
-
-
-
diff --git a/src/lib/components/v1/workflow/FormBaseEntry.svelte b/src/lib/components/v1/workflow/FormBaseEntry.svelte
deleted file mode 100644
index bfff0ef8..00000000
--- a/src/lib/components/v1/workflow/FormBaseEntry.svelte
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
- {#if !editingEntry}
-
- {#if !isListEntry}
-
-
-
- {entryName}
-
-
-
- {entryValue}
-
-
- {:else}
-
- {entryValue}
-
- {/if}
-
- (editingEntry = true)}
- >
-
-
- {:else}
-
- {/if}
-
diff --git a/src/lib/components/v1/workflow/FormBuilder.svelte b/src/lib/components/v1/workflow/FormBuilder.svelte
deleted file mode 100644
index 7ef806a6..00000000
--- a/src/lib/components/v1/workflow/FormBuilder.svelte
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
diff --git a/src/lib/components/v1/workflow/FormStructure.svelte b/src/lib/components/v1/workflow/FormStructure.svelte
deleted file mode 100644
index 5995acc8..00000000
--- a/src/lib/components/v1/workflow/FormStructure.svelte
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
- {#if entryType === 'object' && !isArray}
-
-
- {#if entryName}
-
-
-
-
-
- {#each Object.entries(entry) as [key, value]}
-
- {/each}
-
-
-
-
-
- {:else}
-
- {#if entry}
- {#each Object.entries(entry) as [key, value]}
-
- {/each}
- {/if}
- {/if}
- {/if}
-
- {#if isArray}
-
-
- {#if entryName}
-
-
-
-
-
- {#each entry as listItem, index}
-
- {/each}
-
-
-
-
-
- {/if}
- {/if}
-
- {#if entryType !== 'object'}
-
- {#if entryName}
-
- {/if}
- {/if}
-
diff --git a/src/lib/components/v1/workflow/ImportExportArgs.svelte b/src/lib/components/v1/workflow/ImportExportArgs.svelte
deleted file mode 100644
index 87da50ef..00000000
--- a/src/lib/components/v1/workflow/ImportExportArgs.svelte
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
- importArgsModal.show()}>
-
- Import
-
-
-
- Export
-
-
-
-
-
- Import arguments
-
-
-
-
- Select arguments file
-
- {importArgsError}
-
-
JSON containing workflow task arguments
-
-
-
-
-
- The current arguments will be completely overwritten, disregarding any pending changes.
-
-
-
-
-
-
- Cancel
-
- Confirm
-
-
-
diff --git a/src/lib/components/v1/workflow/MetaPropertiesForm.svelte b/src/lib/components/v1/workflow/MetaPropertiesForm.svelte
deleted file mode 100644
index 225bcd23..00000000
--- a/src/lib/components/v1/workflow/MetaPropertiesForm.svelte
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
diff --git a/src/lib/components/v1/workflow/NewEntryProperty.svelte b/src/lib/components/v1/workflow/NewEntryProperty.svelte
deleted file mode 100644
index fe66d6df..00000000
--- a/src/lib/components/v1/workflow/NewEntryProperty.svelte
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-{#if activateInput}
-
-{/if}
-
-
- (activateInput = true)}
- >Add property
-
diff --git a/src/lib/components/v1/workflow/TaskInfoTab.svelte b/src/lib/components/v1/workflow/TaskInfoTab.svelte
deleted file mode 100644
index 7ed2979d..00000000
--- a/src/lib/components/v1/workflow/TaskInfoTab.svelte
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- Name
- {task.name}
- Version
- {task.version || '–'}
- Docs Link
-
- {#if task.docs_link}
- {task.docs_link}
- {:else}
- -
- {/if}
-
- Docs Info
-
- {#if task.docs_info}
-
- {@html formatMarkdown(task.docs_info)}
- {:else}
- -
- {/if}
-
- Owner
- {task.owner || '–'}
- Command
-
- {task.command}
-
- Source
-
- {task.source}
-
- Input Type
-
- {task.input_type}
-
- Output Type
-
- {task.output_type}
-
- Args Schema Version
-
- {task.args_schema_version || '–'}
-
- Args Schema
-
- {#if task.args_schema}
-
- {JSON.stringify(task.args_schema, null, 2)}
-
- {:else}
- -
- {/if}
-
-
diff --git a/src/lib/components/v1/workflow/TasksOrderModal.svelte b/src/lib/components/v1/workflow/TasksOrderModal.svelte
deleted file mode 100644
index 7a7c358e..00000000
--- a/src/lib/components/v1/workflow/TasksOrderModal.svelte
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
- Edit workflow tasks order
-
-
-
- {#if workflow !== undefined && editableTasksList.length == 0}
- No workflow tasks yet, add one.
- {:else if workflow !== undefined}
- {#key editableTasksList}
-
- {#each editableTasksList as workflowTask, i}
-
-
-
- {workflowTask.name} #{workflowTask.id}
-
-
- {#if i !== 0}
- moveWorkflowTask(i, 'up')}
- >
-
-
- {/if}
- {#if i !== editableTasksList.length - 1}
- moveWorkflowTask(i, 'down')}
- >
-
-
- {/if}
-
-
-
- {/each}
-
- {/key}
- {/if}
-
-
-
- {#if workflowTaskSorting}
-
- {/if}
- Save
-
-
-
diff --git a/src/lib/components/v1/workflow/VersionUpdate.svelte b/src/lib/components/v1/workflow/VersionUpdate.svelte
deleted file mode 100644
index f367dcb9..00000000
--- a/src/lib/components/v1/workflow/VersionUpdate.svelte
+++ /dev/null
@@ -1,292 +0,0 @@
-
-
-
-
- {#if task.args_schema && task.version}
- {#if updateCandidates.length > 0}
-
New versions of this task exist:
-
- Select...
- {#each updateCandidates as update}
- {update.version}
- {/each}
-
- {#if selectedUpdateVersion}
-
- You are updating version from {task.version} to {selectedUpdateVersion}
- {#if getSelectedUpdateCandidate()?.docs_link}
- Information on different version may be found on
-
- task documentation
-
- {/if}
-
- {/if}
- {#if validationErrors}
-
-
Following errors must be fixed before performing the update:
-
- {#each validationErrors as error, index}
-
- {#if error.instancePath !== ''}
- {error.instancePath}:
- {/if}
- {#if error.keyword === 'additionalProperties'}
- must NOT have additional property '{error.params.additionalProperty}'
- {:else}
- {error.message}
- {/if}
-
- more
-
-
-
-
{JSON.stringify(error, null, 2)}
-
-
-
- {/each}
-
-
- {/if}
- {#if originalArgs}
- {#if !validationErrors}
-
The arguments are valid
- {/if}
- {#if needChanges}
-
Fix the arguments:
-
- {#if !argsToBeFixedValidJson}
-
Invalid JSON
- {/if}
-
Check
-
-
- Cancel
-
-
- {/if}
- {/if}
-
- Update
-
- {:else}
-
No new versions available
- {/if}
- {:else if !task.version}
-
- It is not possible to check for new versions because task version is not set.
-
- {:else if !task.args_schema}
-
- It is not possible to check for new versions because task has no args_schema.
-
- {/if}
-
diff --git a/src/lib/components/v1/workflow/WorkflowTaskSelection.svelte b/src/lib/components/v1/workflow/WorkflowTaskSelection.svelte
deleted file mode 100644
index 0e6dea2e..00000000
--- a/src/lib/components/v1/workflow/WorkflowTaskSelection.svelte
+++ /dev/null
@@ -1,278 +0,0 @@
-
-
-{#if tasks}
-
-
-
-
-
- Select task
- {#if loadingTasks}
-
-
- {/if}
-
- {#if selectedTypeOfTask}
-
- {/if}
-
- {#if selectedMapKey && selectedMapTaskVersions}
- {#if selectedMapTaskVersions.length > 0}
- Select task version
-
- {#each selectedMapTaskVersions as task}
- {task.version ? 'v' + task.version : task.source}
- {/each}
-
- {/if}
- {/if}
-
-
-
-{/if}
diff --git a/src/lib/components/v1/workflow/task_form_utils.js b/src/lib/components/v1/workflow/task_form_utils.js
deleted file mode 100644
index f2c50ee0..00000000
--- a/src/lib/components/v1/workflow/task_form_utils.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { AlertError } from "$lib/common/errors";
-
-/**
- * Updates the workflow task properties.
- * @param {string} projectId
- * @param {number} workflowId
- * @param {number} workflowTaskId
- * @param {any} updatingWorkflowTaskProperties
- * @param {string} groupName
- * @returns
- */
-export async function updateFormEntry(
- projectId,
- workflowId,
- workflowTaskId,
- updatingWorkflowTaskProperties,
- groupName
-) {
- const requestData = {};
- requestData[groupName] = updatingWorkflowTaskProperties;
-
- const updateArgs = requestData.args;
- const updateMeta = requestData.meta;
-
- console.log(`In updateFormEntry, requestData is ${JSON.stringify(requestData)}`);
-
- if (updateArgs) {
- return await updateWorkflowTaskArguments(
- projectId,
- workflowId,
- workflowTaskId,
- updateArgs
- );
- } else if (updateMeta) {
- return await updateWorkflowTaskMetadata(
- projectId,
- workflowId,
- workflowTaskId,
- updateMeta
- );
- }
- throw new AlertError('Invalid request data: args or meta are required');
-}
-
-/**
- * Updates a project's workflow task in the server
- * @param {string} projectId
- * @param {number} workflowId
- * @param {number} workflowTaskId
- * @param {any} args
- * @returns {Promise<*>}
- */
-async function updateWorkflowTaskArguments(
- projectId,
- workflowId,
- workflowTaskId,
- args
-) {
- const requestBody = {
- args: args
- };
-
- const headers = new Headers();
- headers.set('Content-Type', 'application/json');
-
- const response = await fetch(
- `/api/v1/project/${projectId}/workflow/${workflowId}/wftask/${workflowTaskId}`,
- {
- method: 'PATCH',
- credentials: 'include',
- headers,
- body: JSON.stringify(requestBody)
- }
- );
-
- const result = await response.json();
- if (response.ok) {
- console.log('workflow task arguments updated successfully', result);
- return result
- }
-
- throw new AlertError(result);
-}
-
-/**
- * Updates a project's workflow task in the server
- * @param {string} projectId
- * @param {number} workflowId
- * @param {number} workflowTaskId
- * @param {any} meta
- * @returns {Promise<*>}
- */
-async function updateWorkflowTaskMetadata(
- projectId,
- workflowId,
- workflowTaskId,
- meta
-) {
- const requestBody = {
- meta: meta
- };
-
- const headers = new Headers();
- headers.set('Content-Type', 'application/json');
-
- const response = await fetch(
- `/api/v1/project/${projectId}/workflow/${workflowId}/wftask/${workflowTaskId}`,
- {
- method: 'PATCH',
- credentials: 'include',
- headers,
- body: JSON.stringify(requestBody)
- }
- );
-
- const result = await response.json();
- if (response.ok) {
- console.log('workflow task metadata updated successfully', result);
- return result
- }
-
- throw new AlertError(result);
-}
\ No newline at end of file
diff --git a/src/lib/components/v1/workflow/version-checker.js b/src/lib/components/v1/workflow/version-checker.js
deleted file mode 100644
index 579df5ec..00000000
--- a/src/lib/components/v1/workflow/version-checker.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { greatestVersionAsc, greatestVersionDesc } from '$lib/common/component_utilities';
-import { AlertError } from '$lib/common/errors';
-
-/**
- * @param {import('$lib/types').Task} task
- * @returns {Promise} the list of update candidates for the given task
- */
-export async function getNewVersions(task) {
- const updateCandidates = await getAllNewVersions([task]);
- return updateCandidates[task.id];
-}
-
-/**
- * @param {import('$lib/types').Task[]} tasks
- * @returns {Promise<{ [id: string]: import('$lib/types').Task[] }>} the list of update candidates, for each task received as input
- */
-export async function getAllNewVersions(tasks) {
- const response = await fetch(`/api/v1/task`);
-
- if (!response.ok) {
- throw new AlertError(await response.json());
- }
-
- /** @type {import('$lib/types').Task[]} */
- const result = await response.json();
-
- return tasks.reduce(function (map, task) {
- map[task.id] = result
- .filter((t) => {
- return (
- task.args_schema !== null &&
- task.version !== null &&
- t.name === task.name &&
- t.owner === task.owner &&
- t.version &&
- t.args_schema &&
- greatestVersionAsc(t.version, task.version) === 1
- );
- })
- .sort((t1, t2) => greatestVersionDesc(t1.version, t2.version));
- return map;
- }, {});
-}
diff --git a/src/lib/server/api/v1/admin_api.js b/src/lib/server/api/v1/admin_api.js
deleted file mode 100644
index 8ae1e5ce..00000000
--- a/src/lib/server/api/v1/admin_api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import { env } from '$env/dynamic/private';
-import { responseError } from '$lib/common/errors';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('admin API [v1]');
-
-/**
- * Fetches the list of projects from the server
- * @param {typeof fetch} fetch
- * @returns {Promise}
- */
-export async function listProjects(fetch) {
- logger.debug('Fetching the list of projects');
- const response = await fetch(env.FRACTAL_SERVER_HOST + '/admin/v1/project/', {
- method: 'GET',
- credentials: 'include'
- });
-
- if (!response.ok) {
- logger.error('Unable to fetch the list of projects');
- await responseError(response);
- }
-
- return await response.json();
-}
diff --git a/src/lib/server/api/v1/project_api.js b/src/lib/server/api/v1/project_api.js
deleted file mode 100644
index 148545b1..00000000
--- a/src/lib/server/api/v1/project_api.js
+++ /dev/null
@@ -1,124 +0,0 @@
-import { env } from '$env/dynamic/private';
-import { responseError } from '$lib/common/errors';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('projects API [v1]');
-
-// PROJECT ENDPOINTS
-
-/**
- * Fetches the list of projects from the server
- * @param {typeof fetch} fetch
- * @returns {Promise>}
- */
-export async function listProjects(fetch) {
- logger.debug('Fetching the list of projects');
- const response = await fetch(env.FRACTAL_SERVER_HOST + '/api/v1/project/', {
- method: 'GET',
- credentials: 'include'
- });
-
- if (!response.ok) {
- logger.error('Unable to fetch projects list');
- await responseError(response);
- }
-
- return await response.json();
-}
-
-/**
- * Fetches a project from the server
- * @param {typeof fetch} fetch
- * @param {string} projectId
- * @returns {Promise}
- */
-export async function getProject(fetch, projectId) {
- logger.debug('Fetching project [project_id=%d]', projectId);
- const response = await fetch(env.FRACTAL_SERVER_HOST + `/api/v1/project/${projectId}/`, {
- method: 'GET',
- credentials: 'include'
- });
-
- if (!response.ok) {
- logger.error('Unable to fetch project [project_id=%d]', projectId);
- await responseError(response);
- }
-
- return await response.json();
-}
-
-// DATASET ENDPOINTS
-
-/**
- * Fetches all the project's datasets from the server
- * @param {typeof fetch} fetch
- * @param {number|string} projectId
- * @returns {Promise>}
- */
-export async function getProjectDatasets(fetch, projectId) {
- logger.debug('Retrieving project datasets [project_id=%d]', projectId);
- const response = await fetch(
- env.FRACTAL_SERVER_HOST + `/api/v1/project/${projectId}/dataset/?history=false`,
- {
- method: 'GET',
- credentials: 'include'
- }
- );
-
- if (!response.ok) {
- logger.error('Unable to fetch project datasets [project_id=%d]', projectId);
- await responseError(response);
- }
-
- /** @type {import('$lib/types').Dataset[]} */
- const datasets = await response.json();
- datasets.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
- return datasets;
-}
-
-/**
- * Fetches a project's dataset from the server
- * @param {typeof fetch} fetch
- * @param {number|string} projectId
- * @param {number|string} datasetId
- * @returns {Promise}
- */
-export async function getDataset(fetch, projectId, datasetId) {
- logger.debug('Fetching dataset [dataset_id=%d] [project_id=%d]', datasetId, projectId);
- const response = await fetch(
- env.FRACTAL_SERVER_HOST + `/api/v1/project/${projectId}/dataset/${datasetId}/`,
- {
- method: 'GET',
- credentials: 'include'
- }
- );
-
- if (!response.ok) {
- logger.error('Unable to fetch dataset [dataset_id=%d] [project_id=%d]', datasetId, projectId);
- await responseError(response);
- }
-
- return await response.json();
-}
-
-// JOB ENDPOINTS
-
-/**
- * Fetches the list of all the jobs belonging to the current user
- * @param {typeof fetch} fetch
- * @returns {Promise>}
- */
-export async function getUserJobs(fetch) {
- logger.debug('Fetching user jobs');
- const response = await fetch(env.FRACTAL_SERVER_HOST + `/api/v1/job/?log=false`, {
- method: 'GET',
- credentials: 'include'
- });
-
- if (!response.ok) {
- logger.error('Unable to fetch user jobs');
- await responseError(response);
- }
-
- return await response.json();
-}
diff --git a/src/lib/server/api/v1/task_api.js b/src/lib/server/api/v1/task_api.js
deleted file mode 100644
index adebcf86..00000000
--- a/src/lib/server/api/v1/task_api.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { env } from '$env/dynamic/private';
-import { responseError } from '$lib/common/errors.js';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('task API [v1]');
-
-/**
- * Fetches a list of tasks from the server
- * @param {typeof fetch} fetch
- * @returns {Promise>}
- */
-export async function listTasks(fetch) {
- logger.debug('Fetching tasks');
-
- // Compose request
- const response = await fetch(env.FRACTAL_SERVER_HOST + '/api/v1/task/?args_schema=false', {
- method: 'GET',
- credentials: 'include',
- mode: 'cors'
- });
-
- if (!response.ok) {
- logger.error('Unable to fetch tasks');
- await responseError(response);
- }
-
- return await response.json();
-}
diff --git a/src/lib/server/api/v1/workflow_api.js b/src/lib/server/api/v1/workflow_api.js
deleted file mode 100644
index 684adaea..00000000
--- a/src/lib/server/api/v1/workflow_api.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import { env } from '$env/dynamic/private';
-import { responseError } from '$lib/common/errors';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('workflow API [v1]');
-
-/**
- * Fetches the list of workflows of a project from the server
- * @param {typeof fetch} fetch
- * @param {number|string} projectId
- * @returns {Promise>}
- */
-export async function getWorkflows(fetch, projectId) {
- logger.debug('Fetching project workflows [project_id=%d]', projectId);
- const response = await fetch(env.FRACTAL_SERVER_HOST + `/api/v1/project/${projectId}/workflow/`, {
- method: 'GET',
- credentials: 'include'
- });
-
- if (!response.ok) {
- logger.error('Unable to fetch project workflows [project_id=%d]', projectId);
- await responseError(response);
- }
-
- return await response.json();
-}
-
-/**
- * Fetches a project's workflow from the server
- * @param {typeof fetch} fetch
- * @param {string} projectId
- * @param {string} workflowId
- * @returns {Promise}
- */
-export async function getWorkflow(fetch, projectId, workflowId) {
- logger.debug('Fetching workflow [workflow_id=%d] [project_id=%d]', workflowId, projectId);
- const response = await fetch(
- env.FRACTAL_SERVER_HOST + `/api/v1/project/${projectId}/workflow/${workflowId}/`,
- {
- method: 'GET',
- credentials: 'include'
- }
- );
-
- if (!response.ok) {
- logger.error(
- 'Unable to fetch workflow [workflow_id=%d] [project_id=%d]',
- workflowId,
- projectId
- );
- await responseError(response);
- }
-
- return await response.json();
-}
-
-/**
- * Fetches the jobs of a given workflow from the server
- * @param {typeof fetch} fetch
- * @param {number|string} projectId
- * @param {number|string} workflowId
- * @returns {Promise>}
- */
-export async function getWorkflowJobs(fetch, projectId, workflowId) {
- logger.debug('Fetching workflow jobs [workflow_id=%d] [project_id=%d]', workflowId, projectId);
- const response = await fetch(
- env.FRACTAL_SERVER_HOST + `/api/v1/project/${projectId}/workflow/${workflowId}/job/`,
- {
- method: 'GET',
- credentials: 'include'
- }
- );
-
- if (!response.ok) {
- logger.error(
- 'Unable to fetch workflow jobs [workflow_id=%d] [project_id=%d]',
- workflowId,
- projectId
- );
- await responseError(response);
- }
-
- return await response.json();
-}
diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js
index f87e6558..7a2390b5 100644
--- a/src/routes/+layout.server.js
+++ b/src/routes/+layout.server.js
@@ -22,7 +22,6 @@ export async function load({ locals, request, url }) {
return {
...pageInfo,
warningBanner,
- apiV1Mode: env.FRACTAL_API_V1_MODE,
runnerBackend: env.FRACTAL_RUNNER_BACKEND
};
}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index e0132847..237e4531 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -5,43 +5,16 @@
import { page } from '$app/stores';
import { navigating } from '$app/stores';
import { env } from '$env/dynamic/public';
- import { reloadVersionedPage } from '$lib/common/selected_api_version';
import { onMount } from 'svelte';
$: userLoggedIn = !!$page.data.userInfo;
$: isAdmin = userLoggedIn && $page.data.userInfo.is_superuser;
$: server = $page.data.serverInfo || {};
- /** @type {'v1'|'v2'} */
- $: apiVersion = $page.url.pathname.startsWith('/v1') ? 'v1' : 'v2';
$: warningBanner = $page.data.warningBanner;
// @ts-ignore
// eslint-disable-next-line no-undef
let clientVersion = __APP_VERSION__;
- $: displayVersionSelector =
- $page.data.apiV1Mode !== 'exclude' &&
- (!isSubPage($page.url.pathname, apiVersion) ||
- $page.url.pathname === '/v2/admin/jobs' ||
- $page.url.pathname === '/v1/admin/jobs') &&
- selectedSection !== 'home';
-
- /**
- * Returns true if the URL indicates a subpage.
- * Values need to be passed to trigger the reactivity.
- * @param {string} pathname
- * @param {string} version
- * @returns {boolean}
- */
- function isSubPage(pathname, version) {
- if (!pathname.startsWith(`/${version}/`)) {
- return false;
- }
- if (pathname.endsWith('/')) {
- pathname = pathname.substring(0, pathname.length - 1);
- }
- return pathname.substring(4).includes('/');
- }
-
// Detects page change
$: if ($navigating) cleanupModalBackdrop();
@@ -79,27 +52,14 @@
return 'home';
}
for (const section of ['projects', 'tasks', 'jobs', 'admin', 'auth']) {
- if (pathname.startsWith(`/${section}`) || pathname.startsWith(`/${apiVersion}/${section}`)) {
+ if (pathname.startsWith(`/${section}`) || pathname.startsWith(`/$v2/${section}`)) {
return section;
}
}
}
- /**
- * @param {'v1'|'v2'} version
- */
- function setSelecteApiVersion(version) {
- reloadVersionedPage($page.url.pathname, version);
- }
-
let loading = true;
- $: {
- if (selectedSection === 'home') {
- setSelecteApiVersion('v2');
- }
- }
-
onMount(() => {
loading = false;
if (sessionStorage && userLoggedIn) {
@@ -115,7 +75,7 @@
-
+
{#if userLoggedIn}
- {#if displayVersionSelector}
-
- {#if apiVersion === 'v1'}
- setSelecteApiVersion('v2')}
- >
- Switch to Fractal V2
-
- {:else}
- setSelecteApiVersion('v1')}
- >
- Switch to legacy Fractal
-
- {/if}
-
- {:else if apiVersion === 'v1'}
-
- legacy
-
- {/if}
- {#if apiVersion === 'v1'}
-
- {/if}
{#if selectedSection === 'admin'}
{/if}
@@ -229,9 +161,6 @@
Sorry, we are performing some maintenance on fractal-server. It will be back online soon.
{/if}
- {#if apiVersion === 'v1' && $page.data.apiV1Mode === 'include_read_only'}
- Warning: legacy API is in read-only mode.
- {/if}
{#if warningBanner}
{#each warningBanner.split('\n') as line, index}
@@ -289,20 +218,6 @@
transform: rotate(-7deg) scale(1.2);
}
- nav.legacy {
- background-color: #e4e4e4 !important;
- border-bottom-color: #888 !important;
- }
-
- nav.legacy .nav-link.active {
- background-color: #d0d0d0 !important;
- }
-
- .legacy-border {
- height: 6px;
- background-color: #888;
- }
-
.nav-link.active {
background-color: #eee;
border-bottom-width: 3px;
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index c5dd053d..3a9bf191 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -34,19 +34,6 @@
Jobs
- {#if $page.data.v1Enabled}
-
- This is the new version 2 of Fractal. Your older projects and workflows are still available in
- the legacy version that you can access in the legacy project page .
- We encourage you to switch to Fractal V2 for all new projects and report any issues you find.
-
-
- We strictly separate projects, datasets and workflows into Fractal V2 and legacy. You can use
- many of your existing tasks in the Fractal V2 version without any changes required. If you
- don't find the task you require in Fractal V2, please reach out to the support.
-
- {/if}
-
{#if env.PUBLIC_FRACTAL_ADMIN_SUPPORT_EMAIL}
Where to get support
diff --git a/src/routes/v1/+layout.server.js b/src/routes/v1/+layout.server.js
deleted file mode 100644
index 370bbcee..00000000
--- a/src/routes/v1/+layout.server.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { getLogger } from '$lib/server/logger';
-import { redirect } from '@sveltejs/kit';
-import { env } from '$env/dynamic/private';
-
-const logger = getLogger('v1 pages');
-
-export async function load() {
- if (env.FRACTAL_API_V1_MODE === 'exclude') {
- logger.warn('v1 pages has been disabled, redirecting to home');
- redirect(307, '/');
- }
-}
diff --git a/src/routes/v1/admin/+page.svelte b/src/routes/v1/admin/+page.svelte
deleted file mode 100644
index f13303df..00000000
--- a/src/routes/v1/admin/+page.svelte
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- Jobs
-
diff --git a/src/routes/v1/admin/jobs/+page.server.js b/src/routes/v1/admin/jobs/+page.server.js
deleted file mode 100644
index 2991c174..00000000
--- a/src/routes/v1/admin/jobs/+page.server.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { listUsers } from '$lib/server/api/auth_api.js';
-import { listProjects } from '$lib/server/api/v1/admin_api.js';
-import { getLogger } from '$lib/server/logger';
-
-const logger = getLogger('admin jobs page [v1]');
-
-export async function load({ fetch }) {
- logger.trace('Loading admin jobs page');
-
- const projects = await listProjects(fetch);
- const users = await listUsers(fetch);
-
- return {
- projects,
- users
- };
-}
diff --git a/src/routes/v1/admin/jobs/+page.svelte b/src/routes/v1/admin/jobs/+page.svelte
deleted file mode 100644
index c449886c..00000000
--- a/src/routes/v1/admin/jobs/+page.svelte
+++ /dev/null
@@ -1,485 +0,0 @@
-
-
-
-
-
Jobs
-
-
-
-
-
-
Status
-
-
- All
- Submitted
- Done
- Failed
-
-
-
-
-
-
-
User
-
-
- All
- {#each users as user}
- {user.email}
- {/each}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Input dataset Id
-
-
-
-
-
-
-
-
-
Output dataset Id
-
-
-
-
-
-
-
-
- {#if searching}
-
- {:else}
-
- {/if}
- Search jobs
-
-
- Reset
-
-
-
-
-
-
- The query returned {jobs.length} matching {jobs.length !== 1 ? 'jobs' : 'job'}
-
-
-
-
- Download CSV
-
-
-
- {#if row.status === 'submitted'}
-
- openEditStatusModal(row)}>
-
-
- {/if}
-
-
-
-
-
-
-
- {#if jobInEditing}
- Editing job #{jobInEditing.id}
- {/if}
-
-
-
-
-
- Warning : this operation will not cancel job execution but only modify its
- status in the database
-
-
-
- {#if updatingStatus}
-
- {/if}
- Set status to failed
-
-
- Cancel
-
-
-
-
-
diff --git a/src/routes/v1/jobs/+page.server.js b/src/routes/v1/jobs/+page.server.js
deleted file mode 100644
index 19d3e61b..00000000
--- a/src/routes/v1/jobs/+page.server.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import {
- removeDuplicatedItems,
- sortProjectsByTimestampCreatedDesc
-} from '$lib/common/component_utilities';
-import { getUserJobs, listProjects } from '$lib/server/api/v1/project_api';
-
-export async function load({ fetch }) {
- const projects = await listProjects(fetch);
- sortProjectsByTimestampCreatedDesc(projects);
-
- const jobs = await getUserJobs(fetch);
-
- const workflows = removeDuplicatedItems(
- /** @type {{id: number, name: string}[]} */ (
- jobs.filter((j) => j.workflow_dump).map((j) => j.workflow_dump)
- )
- );
- const inputDatasets = removeDuplicatedItems(
- /** @type {{id: number, name: string}[]} */
- (jobs.filter((j) => j.input_dataset_dump).map((j) => j.input_dataset_dump))
- );
- const outputDatasets = removeDuplicatedItems(
- /** @type {{id: number, name: string}[]} */
- (jobs.filter((j) => j.output_dataset_dump).map((j) => j.output_dataset_dump))
- );
-
- return {
- projects,
- workflows,
- inputDatasets,
- outputDatasets,
- jobs
- };
-}
diff --git a/src/routes/v1/jobs/+page.svelte b/src/routes/v1/jobs/+page.svelte
deleted file mode 100644
index 36fc58eb..00000000
--- a/src/routes/v1/jobs/+page.svelte
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
diff --git a/src/routes/v1/projects/+page.server.js b/src/routes/v1/projects/+page.server.js
deleted file mode 100644
index ec2e2c9f..00000000
--- a/src/routes/v1/projects/+page.server.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { sortProjectsByTimestampCreatedDesc } from '$lib/common/component_utilities';
-import { listProjects } from '$lib/server/api/v1/project_api';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('projects page [v1]');
-
-export async function load({ fetch }) {
- logger.trace('Loading projects page');
-
- // Load projects from server
- const projects = await listProjects(fetch);
- sortProjectsByTimestampCreatedDesc(projects);
-
- return {
- projects
- };
-}
diff --git a/src/routes/v1/projects/+page.svelte b/src/routes/v1/projects/+page.svelte
deleted file mode 100644
index ebd2f362..00000000
--- a/src/routes/v1/projects/+page.svelte
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
diff --git a/src/routes/v1/projects/[projectId]/+page.server.js b/src/routes/v1/projects/[projectId]/+page.server.js
deleted file mode 100644
index f935664c..00000000
--- a/src/routes/v1/projects/[projectId]/+page.server.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getProject, getProjectDatasets } from '$lib/server/api/v1/project_api';
-import { getWorkflows } from '$lib/server/api/v1/workflow_api';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('project page [v1]');
-
-export async function load({ fetch, params }) {
- logger.trace('Load project page');
-
- // Load project from Server
- const project = await getProject(fetch, params.projectId);
-
- const datasets = await getProjectDatasets(fetch, params.projectId);
- const workflows = await getWorkflows(fetch, params.projectId);
-
- return {
- project,
- datasets,
- workflows
- };
-}
diff --git a/src/routes/v1/projects/[projectId]/+page.svelte b/src/routes/v1/projects/[projectId]/+page.svelte
deleted file mode 100644
index 2999bee9..00000000
--- a/src/routes/v1/projects/[projectId]/+page.svelte
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-{#if project}
-
-
-
Project {project.name} #{project.id}
-
-
- (updatedProjectName = project.name)}
- >
-
-
-
-
-
-
-
-
-{/if}
-
-
-
- Project properties
-
-
-
- {#if project}
-
-
- Project name
-
-
-
- {/if}
-
-
-
- {#if updating}
-
- {/if}
- Save
-
-
-
diff --git a/src/routes/v1/projects/[projectId]/datasets/[datasetId]/+page.server.js b/src/routes/v1/projects/[projectId]/datasets/[datasetId]/+page.server.js
deleted file mode 100644
index 1428fd32..00000000
--- a/src/routes/v1/projects/[projectId]/datasets/[datasetId]/+page.server.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getDataset } from '$lib/server/api/v1/project_api';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('dataset page [v1]');
-
-export async function load({ fetch, params }) {
- logger.trace('Load Dataset Page');
-
- const { projectId, datasetId } = params;
-
- const dataset = await getDataset(fetch, projectId, datasetId);
-
- return {
- dataset
- };
-}
diff --git a/src/routes/v1/projects/[projectId]/datasets/[datasetId]/+page.svelte b/src/routes/v1/projects/[projectId]/datasets/[datasetId]/+page.svelte
deleted file mode 100644
index 2612e901..00000000
--- a/src/routes/v1/projects/[projectId]/datasets/[datasetId]/+page.svelte
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
-
-
- Projects
-
- {#if dataset}
-
- {dataset.project.name}
-
- Datasets
- {dataset.name}
- {/if}
-
-
-
- {#if dataset}
-
-
- Show dataset metadata
-
-
-
- Show dataset history
-
- {/if}
-
-
-
-{#if dataset}
-
-
-
-
-
Dataset properties
-
-
-
- Id
-
-
- {dataset.id}
-
-
- Name
-
-
- {dataset.name}
-
-
- Type
-
-
- {dataset.type || 'Unknown'}
-
-
- Readonly
-
-
- {dataset.read_only}
-
-
-
-
-
-
Dataset resources
-
-
-
-
- Id
- Path
-
-
-
- {#each dataset.resource_list as resource}
-
- {resource.id}
- {resource.path}
-
- {/each}
-
-
-
-
-
-{/if}
-
-{#if dataset}
-
-
- Dataset meta properties
-
-
-
- {#if Object.keys(dataset.meta).length > 0}
- {#each Object.entries(dataset.meta) as [key, value]}
-
- {key}
-
-
- {#if value === null}
- -
- {:else if typeof value == 'object'}
- {#if Object.keys(value).length > 1}
- {JSON.stringify(value, null, 2)}
- {:else}
- {JSON.stringify(value, null)}
- {/if}
- {:else}
- {value}
- {/if}
-
- {/each}
- {:else}
- No meta properties
- {/if}
-
-
-
-
-
- Dataset history
-
-
-
- {#if dataset.history && Object.keys(dataset.history).length > 0}
- {#each Object.entries(dataset.history) as [, value]}
-
-
- Task "{value.workflowtask.task.name}", status "{value.status}"
-
-
-
- {formatDatasetHistory(value)}
-
- {/each}
- {:else}
- No history
- {/if}
-
-
-
-{/if}
diff --git a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/+page.server.js b/src/routes/v1/projects/[projectId]/workflows/[workflowId]/+page.server.js
deleted file mode 100644
index 326befa0..00000000
--- a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/+page.server.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getWorkflow } from '$lib/server/api/v1/workflow_api';
-import { getProjectDatasets } from '$lib/server/api/v1/project_api';
-import { getLogger } from '$lib/server/logger.js';
-
-const logger = getLogger('workflow page [v1]');
-
-export async function load({ fetch, params }) {
- logger.trace('Load workflow page');
-
- const { projectId, workflowId } = params;
-
- // Get the workflow
- const workflow = await getWorkflow(fetch, projectId, workflowId);
-
- // Get the datasets
- const datasets = await getProjectDatasets(fetch, projectId);
-
- return {
- workflow,
- datasets
- };
-}
diff --git a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/+page.svelte b/src/routes/v1/projects/[projectId]/workflows/[workflowId]/+page.svelte
deleted file mode 100644
index 297a8d23..00000000
--- a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/+page.svelte
+++ /dev/null
@@ -1,1126 +0,0 @@
-
-
-
-
-
-
- Projects
-
- {#if $page.params.projectId}
-
- {project?.name}
-
- {/if}
- Workflows
- {#if workflow}
-
- {workflow.name}
-
- {/if}
-
-
-
-
- List jobs
-
-
-
-
-
Download workflow link
-
-
-
-
{
- if (argumentsWithUnsavedChanges === false) {
- runWorkflowModal.toggle();
- } else {
- toggleUnsavedChangesModal();
- }
- }}
- > Run workflow
-
-
-
-
-{#if workflow}
-
-
-
-
-
-
-
-
-
-
- {#if workflow.task_list.length == 0}
-
No workflow tasks yet, add one.
- {:else}
-
- {#each workflow.task_list as workflowTask}
-
- {workflowTask.task.name} #{workflowTask.id}
-
- {#if newVersionsMap[workflowTask.task.id]?.length > 0}
-
-
-
- {/if}
-
- {/each}
-
- {/if}
-
-
-
-
-
-
- {#if workflowTabContextId === 0}
-
-
- {#if selectedWorkflowTask}
- {#key selectedWorkflowTask}
- {#if argsSchemaAvailable && argsSchemaValid}
- {#if argsChangesSaved}
-
- Arguments changes saved successfully
-
- {/if}
-
- {:else}
-
- {/if}
- {/key}
- {/if}
-
-
- {:else if workflowTabContextId === 1}
-
- {:else if workflowTabContextId === 2}
-
-
- {#if selectedWorkflowTask}
-
- {/if}
-
-
- {/if}
-
-
- {#if selectedWorkflowTask}
-
- {/if}
-
-
-
-
-
-
-
-{/if}
-
-
-
- New workflow task
-
-
-
-
-
-
-
-
-
- Task order in workflow
-
-
-
-
- {#if creatingWorkflowTask}
-
- {/if}
- Insert
-
-
-
-
-
-
-
- Workflow properties
-
-
-
- {#if workflow}
-
-
- Workflow name
-
-
-
- {/if}
-
-
-
- {#if workflowUpdating}
-
- {/if}
- Save
-
-
-
-
-
-
- Edit workflow tasks order
-
-
-
- {#if workflow !== undefined && updatableWorkflowList.length == 0}
- No workflow tasks yet, add one.
- {:else if workflow !== undefined}
- {#key updatableWorkflowList}
-
- {#each updatableWorkflowList as workflowTask, i}
-
-
-
- {workflowTask.task.name} #{workflowTask.id}
-
-
- {#if i !== 0}
- moveWorkflowTask(i, 'up')}
- >
-
-
- {/if}
- {#if i !== updatableWorkflowList.length - 1}
- moveWorkflowTask(i, 'down')}
- >
-
-
- {/if}
-
-
-
- {/each}
-
- {/key}
- {/if}
-
-
-
- {#if workflowTaskSorting}
-
- {/if}
- Save
-
-
-
-
-
-
- Run workflow
-
-
-
-
-
- Input dataset
-
- Select an input dataset
- {#each datasets as dataset}
- {dataset.name}
- {/each}
-
-
-
- Output dataset
-
- Select an output dataset
- {#each datasets as dataset}
- {dataset.name}
- {/each}
-
-
-
- First task (Optional)
-
- Select first task
- {#each updatableWorkflowList as wft}
- {wft.task.name}
- {/each}
-
-
-
- Last task (Optional)
-
- Select last task
- {#each updatableWorkflowList as wft}
- {#if firstTaskIndexControl === '' || wft.order >= parseInt(firstTaskIndexControl)}
- {wft.task.name}
- {/if}
- {/each}
-
-
-
- Worker initialization (Optional)
-
-
- {#if slurmAccounts.length > 0}
-
-
-
- Set SLURM account
-
-
- {#if setSlurmAccount}
-
- SLURM account
-
- {#each slurmAccounts as account}
- {account}
- {/each}
-
-
- {/if}
- {/if}
-
-
-
- {#if checkingConfiguration}
- {
- checkingConfiguration = false;
- }}>Cancel
-
- {#if applyingWorkflow}
-
- {/if}
- Confirm
-
- {:else}
- {
- checkingConfiguration = true;
- }}>Run
- {/if}
-
-
-
-
-
- There are argument changes unsaved
-
-
-
- Do you want to save the changes made to the arguments of the current selected workflow task?
-
-
-
- Cancel
- {
- argumentsWithUnsavedChanges = false;
- setWorkflowTaskContext(preventedTaskContextChange);
- }}
- data-bs-dismiss="modal"
- >Discard changes
-
- Save changes
-
-
-
diff --git a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/jobs/+page.server.js b/src/routes/v1/projects/[projectId]/workflows/[workflowId]/jobs/+page.server.js
deleted file mode 100644
index aab862e5..00000000
--- a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/jobs/+page.server.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import { removeDuplicatedItems } from '$lib/common/component_utilities';
-import { getProject } from '$lib/server/api/v1/project_api';
-import { getWorkflow, getWorkflowJobs } from '$lib/server/api/v1/workflow_api';
-
-export async function load({ fetch, params }) {
- const { projectId, workflowId } = params;
-
- const project = await getProject(fetch, projectId);
-
- const jobs = await getWorkflowJobs(fetch, projectId, workflowId);
-
- const workflows = removeDuplicatedItems(
- /** @type {{id: number, name: string}[]} */ (
- jobs.filter((j) => j.workflow_dump).map((j) => j.workflow_dump)
- )
- );
- let workflow;
- if (workflows.length > 0) {
- workflow = workflows[0];
- } else {
- workflow = await getWorkflow(fetch, projectId, workflowId);
- }
-
- const inputDatasets = removeDuplicatedItems(
- /** @type {{id: number, name: string}[]} */
- (jobs.filter((j) => j.input_dataset_dump).map((j) => j.input_dataset_dump))
- );
- const outputDatasets = removeDuplicatedItems(
- /** @type {{id: number, name: string}[]} */
- (jobs.filter((j) => j.output_dataset_dump).map((j) => j.output_dataset_dump))
- );
-
- return {
- project: project,
- projects: [project],
- workflow,
- workflows,
- inputDatasets,
- outputDatasets,
- jobs
- };
-}
diff --git a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/jobs/+page.svelte b/src/routes/v1/projects/[projectId]/workflows/[workflowId]/jobs/+page.svelte
deleted file mode 100644
index e5dd7274..00000000
--- a/src/routes/v1/projects/[projectId]/workflows/[workflowId]/jobs/+page.svelte
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-{#if project && workflow}
-
-
-
-
- Projects
-
-
- {project.name}
-
- Workflows
-
- {workflow.name}
-
- Jobs
-
-
-
-
-
-
-{/if}
diff --git a/src/routes/v1/tasks/+page.server.js b/src/routes/v1/tasks/+page.server.js
deleted file mode 100644
index 17cd5489..00000000
--- a/src/routes/v1/tasks/+page.server.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { orderTasksByOwnerThenByNameThenByVersion } from '$lib/common/component_utilities';
-import { listTasks } from '$lib/server/api/v1/task_api';
-
-export async function load({ fetch }) {
- const tasks = await listTasks(fetch);
-
- orderTasksByOwnerThenByNameThenByVersion(tasks, null, 'desc');
-
- return {
- tasks
- };
-}
diff --git a/src/routes/v1/tasks/+page.svelte b/src/routes/v1/tasks/+page.svelte
deleted file mode 100644
index b89214ea..00000000
--- a/src/routes/v1/tasks/+page.svelte
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-
-
-
-
Add tasks
-
-
Package type:
-
-
-
PyPI
-
-
-
Local
-
-
-
Single task
-
-
- {#if packageType === 'pypi' || packageType === 'local'}
-
- {:else}
-
- {/if}
-
-
-
-
Task List
-
-
-
-
-
-
-
-
-
-
-
- Name
- Version
- Owner
- Options
-
-
-
-
- {task.owner || '–'}
-
- taskInfoModal.open(task)}
- >
-
- Info
-
- taskEditModal.open(task)}
- >
-
- Edit
-
- handleDeleteTask(task.id)}
- />
-
-
-
-
-
-
-
-
-
diff --git a/tests/fake-job-server.js b/tests/fake-job-server.js
index 20445c60..f9e25a08 100644
--- a/tests/fake-job-server.js
+++ b/tests/fake-job-server.js
@@ -5,9 +5,7 @@ const PORT = process.env.PORT || 8080;
const server = createServer();
/** @type {Map} */
-const jobsStatusMapV1 = new Map();
-/** @type {Map} */
-const jobsStatusMapV2 = new Map();
+const jobsStatusMap = new Map();
server.on('request', (request, response) => {
response.setHeader('Content-type', 'text/plain');
@@ -23,27 +21,26 @@ server.on('request', (request, response) => {
if (!task) {
return badRequest(response, 'missing task identifier');
}
- const { version, jobId } = extractJobInfo(task);
- const status = getJobStatus(version, jobId);
+ const { jobId } = extractJobInfo(task);
+ const status = getJobStatus(jobId);
if (request.method === 'GET' && status !== 'submitted') {
console.log(`Removing job ${jobId}`);
- getJobStatusMap(version).delete(jobId);
+ jobsStatusMap.delete(jobId);
}
response.end(status);
} else {
// PUT method is called by Playwright tests to update the desired task status
- const match = url.pathname.match(/\/(v1|v2)\/(\d+)/);
+ const match = url.pathname.match(/\/v2\/(\d+)/);
if (!match) {
return badRequest(response, `missing job identifier in ${url.pathname}`);
}
- const jobId = Number(match[2]);
+ const jobId = Number(match[1]);
const status = url.searchParams.get('status');
if (!status) {
return badRequest(response, 'missing status');
}
- const version = url.pathname.startsWith('/v2') ? 'v2' : 'v1';
console.log(`Setting job ${jobId} status to ${status}`);
- getJobStatusMap(version).set(Number(jobId), status);
+ jobsStatusMap.set(Number(jobId), status);
response.end(status);
}
});
@@ -56,17 +53,14 @@ function extractJobInfo(taskFolder) {
if (!match) {
throw new Error(`Unable to extract job id from ${taskFolder}`);
}
- const version = taskFolder.includes('proj_v2') ? 'v2' : 'v1';
- return { jobId: Number(match[1]), version };
+ return { jobId: Number(match[1]) };
}
/**
- * @param {string} version
* @param {number} jobId
* @returns {string|undefined}
*/
-function getJobStatus(version, jobId) {
- const jobsStatusMap = getJobStatusMap(version);
+function getJobStatus(jobId) {
if (!jobsStatusMap.has(jobId)) {
console.log(`Creating entry for job ${jobId}`);
jobsStatusMap.set(jobId, 'submitted');
@@ -74,17 +68,6 @@ function getJobStatus(version, jobId) {
return jobsStatusMap.get(jobId);
}
-/**
- * @param {string} version
- */
-function getJobStatusMap(version) {
- if (version === 'v1') {
- return jobsStatusMapV1;
- } else {
- return jobsStatusMapV2;
- }
-}
-
function badRequest(response, reason) {
response.statusCode = 400;
response.end(`Bad Request: ${reason}`);
diff --git a/tests/v2/task_utils.js b/tests/v2/task_utils.js
index 0706166f..97a4758c 100644
--- a/tests/v2/task_utils.js
+++ b/tests/v2/task_utils.js
@@ -78,19 +78,13 @@ export async function createFakeTask(page, task) {
/**
* @param {import('@playwright/test').Page} page
* @param {string} taskName
- * @param {'v1'|'v2'} version
*/
-export async function deleteTask(page, taskName, version = 'v2') {
- if (!page.url().endsWith(`/${version}/tasks/management`)) {
- await page.goto(`/${version}/tasks/management`);
+export async function deleteTask(page, taskName) {
+ if (!page.url().endsWith(`/v2/tasks/management`)) {
+ await page.goto(`/v2/tasks/management`);
await waitPageLoading(page);
}
- let row;
- if (version === 'v1') {
- row = await getTaskRow(page, taskName);
- } else {
- row = await getTaskGroupRow(page, taskName);
- }
+ const row = await getTaskGroupRow(page, taskName);
await row.getByRole('button', { name: 'Delete' }).click();
const modal = page.locator('.modal.show');
await modal.waitFor();
@@ -98,17 +92,6 @@ export async function deleteTask(page, taskName, version = 'v2') {
await waitModalClosed(page);
}
-/**
- * @param {import('@playwright/test').Page} page
- * @param {string} taskName
- * @returns {Promise}
- */
-async function getTaskRow(page, taskName) {
- const row = page.getByRole('table').last().getByRole('row', { name: taskName });
- await row.waitFor();
- return row;
-}
-
/**
* @param {import('@playwright/test').Page} page
* @param {string} taskName