diff --git a/src/stories/files/FileMockLoadingRepository.ts b/src/stories/files/FileMockLoadingRepository.ts index eff4bd897..949ad992c 100644 --- a/src/stories/files/FileMockLoadingRepository.ts +++ b/src/stories/files/FileMockLoadingRepository.ts @@ -1,12 +1,11 @@ import { FileRepository } from '../../files/domain/repositories/FileRepository' import { File } from '../../files/domain/models/File' import { FilesCountInfo } from '../../files/domain/models/FilesCountInfo' -import { FileUserPermissions } from '../../files/domain/models/FileUserPermissions' -import { FileUserPermissionsMother } from '../../../tests/component/files/domain/models/FileUserPermissionsMother' import { DatasetVersion } from '../../dataset/domain/models/Dataset' import { FileCriteria } from '../../files/domain/models/FileCriteria' +import { FileMockRepository } from './FileMockRepository' -export class FileMockLoadingRepository implements FileRepository { +export class FileMockLoadingRepository extends FileMockRepository implements FileRepository { getAllByDatasetPersistentId( // eslint-disable-next-line unused-imports/no-unused-vars datasetPersistentId: string, @@ -26,7 +25,7 @@ export class FileMockLoadingRepository implements FileRepository { // eslint-disable-next-line unused-imports/no-unused-vars datasetVersion: DatasetVersion, // eslint-disable-next-line unused-imports/no-unused-vars - criteria: FileCriteria + criteria?: FileCriteria ): Promise { return new Promise(() => { setTimeout(() => { @@ -34,27 +33,4 @@ export class FileMockLoadingRepository implements FileRepository { }, 1000) }) } - // eslint-disable-next-line unused-imports/no-unused-vars - getUserPermissionsById(id: number): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(FileUserPermissionsMother.create()) - }, 1000) - }) - } - - getFilesTotalDownloadSizeByDatasetPersistentId( - // eslint-disable-next-line unused-imports/no-unused-vars - datasetPersistentId: string, - // eslint-disable-next-line unused-imports/no-unused-vars - datasetVersion: DatasetVersion, - // eslint-disable-next-line unused-imports/no-unused-vars - criteria?: FileCriteria - ): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(19900) - }, 1000) - }) - } } diff --git a/src/stories/files/FileMockNoDataRepository.ts b/src/stories/files/FileMockNoDataRepository.ts index ba7c10a3b..51813c757 100644 --- a/src/stories/files/FileMockNoDataRepository.ts +++ b/src/stories/files/FileMockNoDataRepository.ts @@ -2,12 +2,11 @@ import { FileRepository } from '../../files/domain/repositories/FileRepository' import { File } from '../../files/domain/models/File' import { FilesCountInfo } from '../../files/domain/models/FilesCountInfo' import { FilesCountInfoMother } from '../../../tests/component/files/domain/models/FilesCountInfoMother' -import { FileUserPermissions } from '../../files/domain/models/FileUserPermissions' -import { FileUserPermissionsMother } from '../../../tests/component/files/domain/models/FileUserPermissionsMother' import { DatasetVersion } from '../../dataset/domain/models/Dataset' import { FileCriteria } from '../../files/domain/models/FileCriteria' +import { FileMockRepository } from './FileMockRepository' -export class FileMockNoDataRepository implements FileRepository { +export class FileMockNoDataRepository extends FileMockRepository implements FileRepository { getAllByDatasetPersistentId( // eslint-disable-next-line unused-imports/no-unused-vars datasetPersistentId: string, @@ -48,13 +47,4 @@ export class FileMockNoDataRepository implements FileRepository { }, 1000) }) } - - // eslint-disable-next-line unused-imports/no-unused-vars - getUserPermissionsById(id: number): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(FileUserPermissionsMother.create()) - }, 1000) - }) - } } diff --git a/src/stories/files/FileMockNoFiltersRepository.ts b/src/stories/files/FileMockNoFiltersRepository.ts index eec689eaa..2ce08e666 100644 --- a/src/stories/files/FileMockNoFiltersRepository.ts +++ b/src/stories/files/FileMockNoFiltersRepository.ts @@ -3,12 +3,11 @@ import { File } from '../../files/domain/models/File' import { FilesCountInfo } from '../../files/domain/models/FilesCountInfo' import { FilesCountInfoMother } from '../../../tests/component/files/domain/models/FilesCountInfoMother' import { FilesMockData } from './FileMockData' -import { FileUserPermissions } from '../../files/domain/models/FileUserPermissions' -import { FileUserPermissionsMother } from '../../../tests/component/files/domain/models/FileUserPermissionsMother' import { DatasetVersion } from '../../dataset/domain/models/Dataset' import { FileCriteria } from '../../files/domain/models/FileCriteria' +import { FileMockRepository } from './FileMockRepository' -export class FileMockNoFiltersRepository implements FileRepository { +export class FileMockNoFiltersRepository extends FileMockRepository implements FileRepository { getAllByDatasetPersistentId( // eslint-disable-next-line unused-imports/no-unused-vars datasetPersistentId: string, @@ -28,7 +27,7 @@ export class FileMockNoFiltersRepository implements FileRepository { // eslint-disable-next-line unused-imports/no-unused-vars datasetVersion: DatasetVersion, // eslint-disable-next-line unused-imports/no-unused-vars - criteria: FileCriteria + criteria?: FileCriteria ): Promise { return new Promise((resolve) => { setTimeout(() => { @@ -36,27 +35,4 @@ export class FileMockNoFiltersRepository implements FileRepository { }, 1000) }) } - // eslint-disable-next-line unused-imports/no-unused-vars - getUserPermissionsById(id: number): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(FileUserPermissionsMother.create()) - }, 1000) - }) - } - - getFilesTotalDownloadSizeByDatasetPersistentId( - // eslint-disable-next-line unused-imports/no-unused-vars - datasetPersistentId: string, - // eslint-disable-next-line unused-imports/no-unused-vars - datasetVersion: DatasetVersion, - // eslint-disable-next-line unused-imports/no-unused-vars - criteria?: FileCriteria - ): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(19900) - }, 1000) - }) - } } diff --git a/src/stories/files/FileMockRepository.ts b/src/stories/files/FileMockRepository.ts index 63e1499fa..3086827c5 100644 --- a/src/stories/files/FileMockRepository.ts +++ b/src/stories/files/FileMockRepository.ts @@ -8,6 +8,7 @@ import { FileUserPermissionsMother } from '../../../tests/component/files/domain import { FileUserPermissions } from '../../files/domain/models/FileUserPermissions' import { DatasetVersion } from '../../dataset/domain/models/Dataset' import { FileCriteria } from '../../files/domain/models/FileCriteria' +import { FileMother } from '../../../tests/component/files/domain/models/FileMother' export class FileMockRepository implements FileRepository { // eslint-disable-next-line unused-imports/no-unused-vars @@ -59,4 +60,9 @@ export class FileMockRepository implements FileRepository { }, 1000) }) } + + // eslint-disable-next-line unused-imports/no-unused-vars + getMultipleFileDownloadUrl(ids: number[], downloadMode: string): string { + return FileMother.createDownloadUrl() + } }