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}{/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} - - {/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 !admin} - - {#if !columnsToHide.includes('id')} - - - {/if} - {#if !columnsToHide.includes('workflow')} - - {/if} - - - {#if !columnsToHide.includes('user_email')} - - {/if} - - - - {#if rows} - {#each $rows as row} - - {#if !columnsToHide.includes('id')} - - {/if} - - - - - {#if !columnsToHide.includes('project')} - - {/if} - {#if !columnsToHide.includes('workflow')} - - {/if} - - - {#if !columnsToHide.includes('user_email')} - - {/if} - - {/each} - {/if} - -
- {/if} - - Options - - {#if !columnsToHide.includes('project')} - - {/if} - {#if !columnsToHide.includes('workflow')} - - {/if} - - - {#if !columnsToHide.includes('user_email')} - - {/if} -
- {/if} - - - - - {#if !columnsToHide.includes('project')} - - {#if projects} - - {#if workflows} - - - - {/if} -
{row.id} - - - {#if admin} - - {/if} - - - - - {#if (admin && row.id) || (row.project_id !== null && row.user_email === $page.data.userInfo.email)} - - - - {/if} - {#if row.status === 'submitted'} - - {/if} - - - - - - {#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 workflows && row.workflow_id !== null && row.user_email === $page.data.userInfo.email} - - {row.workflow_dump.name} - - {:else} - {row.workflow_dump.name} - {/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} - {row.user_email}
-{/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 @@ - - - - - - - - {#if creatingDataset && resources.filter((r) => r.error !== '').length > 0} - - {/if} - -
-
-
- -
- - {#if submitted && !datasetName} -
Required field
- {/if} -
-
-
- -
-
- - -
-
- - -
-
-
-
-
- {#if datasetTypeOption === 'standard'} - - {:else} - - {/if} -
-
-
-
-
- - -
-
-
-
Resources
-
- {#each resources as resource, i} -
-
-
- handleResourceKeyDown(event, i)} - /> - {#if resource.editing} - - {:else} - - {/if} - {#if resources.length > 1} - - {/if} - {#if submitted && !resource.path} -
Required field
- {/if} - {#if submitted && resource.error} -
{resource.error}
- {/if} -
-
-
- {/each} -
-
-
-
- -
-
- -
- - - - -
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 @@ - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - {#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

-
-
-
-
-
- -
-
-
- -
-
-
-
-
- - - - - - - - - - {#key datasets} - {#each filteredDatasets as dataset} - - - - - - {/each} - {/key} - -
NameTypeOptions
{dataset.name}{dataset.type || 'Unknown'} - - Open - - - handleDatasetDelete(dataset.project_id, dataset.id)} - /> -
-
- - 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

- - - - - - - - - - - {#each datasets as { name, read_only, resource_list, type }} - - - - - - - {/each} - -
NameReadonly# ResourcesType
{name}{read_only ? 'Yes' : 'No'}{resource_list.length}{type == '' ? 'Unknown' : type}
- {/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 @@ - - -
-
-
-
-
-
- -
-
-
- -
-
-
-
-
- - - - - - - - - {#key projects} - {#each filteredProjects as { id, name }} - - - - - {/each} - {/key} - -
NameOptions
{name} - - - Open - - handleDeleteProject(id)} - /> -
-
-
- - - -

Create new project

-
- -
-
-
-
- -
- - {#if newProjectNameError} -
{newProjectNameError}
- {/if} -
-
-
-
- - - - - - 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

-
-
-
-
-
- -
-
-
- -
-
-
-
- - - - - - - - - - {#key workflows} - {#each filteredWorkflows as { id, name }} - - - - - - {/each} - {/key} - -
IdNameOptions
{id}{name} - - - Open - - - List jobs - - handleDeleteWorkflow(id)} - /> -
-
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 @@ - - - - -
-
-
-
- - - {$validationErrors['name']} -
-
-
-
-
-
- - - {$validationErrors['command']} -
-
-
-
-
-
- - - {$validationErrors['source']} -
-
- Used to match tasks across installations when a workflow is imported -
-
-
-
-
-
- - - {$validationErrors['input_type']} -
-
- Expected type of input dataset; use Any for a generic type -
-
-
-
- - - {$validationErrors['output_type']} -
-
- Expected type of output dataset; use Any for a generic type -
-
-
-
-
- Optional arguments -
-
-
-
-
- - - {$validationErrors['version']} -
-
-
-
-
-
- - - {#if argsSchemaFiles && argsSchemaFiles.length > 0} - - {/if} - {$validationErrors['args_schema']} -
-
JSON schema of task arguments
-
-
-
- - - {#if metaFiles && metaFiles.length > 0} - - {/if} - {$validationErrors['meta']} -
-
- Additional metadata related to execution (e.g. computational resources) -
-
-
- {#if argsSchemaFiles && argsSchemaFiles.length > 0} -
-
-
- - - {$validationErrors['args_schema_version']} -
-
- Label pointing at how the JSON schema of task arguments was generated -
-
-
- {/if} -
-
-

- -

-
-
-
-
- -