Skip to content

Commit b9485aa

Browse files
committed
Removed unused fields and calls
1 parent e929c7e commit b9485aa

File tree

6 files changed

+7
-36
lines changed

6 files changed

+7
-36
lines changed

__tests__/v2/workflow_page.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ describe('Workflow page', () => {
4848
switch (url) {
4949
case '/api/v2/task':
5050
return [{ id: 1, workflow_id: 1, task_id: 1, task: { id: 1, name: 'test' } }];
51-
case '/api/v2/task-legacy':
52-
return { data: [] };
5351
case '/api/v2/project/1/dataset/1':
5452
return { id: 1, name: 'test' };
5553
case '/api/v2/project/1/status?dataset_id=1&workflow_id=1':

sandbox/src/lib/components/VersionUpdateSandbox.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@
154154
dummyWorkflowTask = {
155155
id: 1,
156156
args_parallel: deepCopy(oldSchemaData),
157-
task_type: 'parallel',
158-
is_legacy_task: false
157+
task_type: 'parallel'
159158
};
160159
161160
dummyUpdateCandidate = {

src/lib/components/v1/workflow/version-checker.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@ import { AlertError } from '$lib/common/errors';
33

44
/**
55
* @param {import('$lib/types').Task} task
6-
* @param {boolean|false=} v2
76
* @returns {Promise<import('$lib/types').Task[]>} the list of update candidates for the given task
87
*/
9-
export async function getNewVersions(task, v2) {
10-
const updateCandidates = await getAllNewVersions([task], v2);
8+
export async function getNewVersions(task) {
9+
const updateCandidates = await getAllNewVersions([task]);
1110
return updateCandidates[task.id];
1211
}
1312

1413
/**
1514
* @param {import('$lib/types').Task[]} tasks
16-
* @param {boolean|false=} v2
1715
* @returns {Promise<{ [id: string]: import('$lib/types').Task[] }>} the list of update candidates, for each task received as input
1816
*/
19-
export async function getAllNewVersions(tasks, v2 = false) {
20-
const response = await fetch(v2 ? `/api/v2/task-legacy` : `/api/v1/task`);
17+
export async function getAllNewVersions(tasks) {
18+
const response = await fetch(`/api/v1/task`);
2119

2220
if (!response.ok) {
2321
throw new AlertError(await response.json());

src/lib/components/v2/workflow/VersionUpdate.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { page } from '$app/stores';
44
import VersionUpdateFixArgs from './VersionUpdateFixArgs.svelte';
55
import { tick } from 'svelte';
6-
import { getNewVersions as getNewVersionsV2 } from '$lib/components/v2/workflow/version-checker';
6+
import { getNewVersions } from './version-checker';
77
88
/** @type {import('$lib/types-v2').WorkflowTaskV2} */
99
export let workflowTask;
@@ -78,7 +78,7 @@
7878
}
7979
8080
try {
81-
updateCandidates = await getNewVersionsV2(workflowTask.task);
81+
updateCandidates = await getNewVersions(workflowTask.task);
8282
} catch (error) {
8383
errorAlert = displayStandardErrorAlert(error, 'versionUpdateError');
8484
return;

src/lib/server/api/v2/task_api.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,3 @@ export async function listTasks(fetch) {
2929

3030
return await response.json();
3131
}
32-
33-
/**
34-
* Fetches a list of legacy tasks from the server
35-
* @param {typeof fetch} fetch
36-
* @returns {Promise<Array<import('$lib/types').Task>>}
37-
*/
38-
export async function listLegacyTasks(fetch) {
39-
logger.debug('Fetching legacy tasks');
40-
41-
// Compose request
42-
const response = await fetch(env.FRACTAL_SERVER_HOST + '/api/v2/task-legacy/?args_schema=false', {
43-
method: 'GET',
44-
credentials: 'include',
45-
mode: 'cors'
46-
});
47-
48-
if (!response.ok) {
49-
logger.error('Unable to fetch legacy tasks');
50-
await responseError(response);
51-
}
52-
53-
return await response.json();
54-
}

src/lib/types.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type Task = {
2121
docs_link: string
2222
docs_info: string
2323
meta: object
24-
is_v2_compatible: boolean
2524
}
2625

2726
export type Workflow = {

0 commit comments

Comments
 (0)