From a5b6b1ff1f68f663255bc61af786032fb8210154 Mon Sep 17 00:00:00 2001 From: MellyGray Date: Thu, 26 Oct 2023 10:42:27 +0200 Subject: [PATCH] feat(DownloadFiles): add to the FileActionsHeader --- .../files-table/file-actions/FileActionsHeader.module.scss | 2 ++ .../files-table/file-actions/FileActionsHeader.tsx | 2 ++ .../file-actions/download-files/DownloadFilesButton.tsx | 5 +++-- .../files-table/file-actions/FileActionsHeader.spec.tsx | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.module.scss b/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.module.scss index 743868960..3b4481b8a 100644 --- a/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.module.scss +++ b/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.module.scss @@ -1,3 +1,5 @@ .container { text-align: right; + display: flex; + justify-content: end; } \ No newline at end of file diff --git a/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.tsx b/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.tsx index c71e6a119..c762d8196 100644 --- a/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.tsx +++ b/src/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.tsx @@ -2,6 +2,7 @@ import { EditFilesMenu } from './edit-files-menu/EditFilesMenu' import { File } from '../../../../../files/domain/models/File' import styles from './FileActionsHeader.module.scss' import { useTranslation } from 'react-i18next' +import { DownloadFilesButton } from './download-files/DownloadFilesButton' interface FileActionsHeaderProps { files: File[] } @@ -10,6 +11,7 @@ export function FileActionsHeader({ files }: FileActionsHeaderProps) { return (
+
) } diff --git a/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx b/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx index 2f743dd4c..68ae0dccd 100644 --- a/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx +++ b/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx @@ -25,7 +25,8 @@ export function DownloadFilesButton({ files }: DownloadFilesButtonProps) { id="download-files" icon={} title="Download" - variant="secondary"> + variant="secondary" + withSpacing> Original Format Archival Format (.tab) @@ -33,7 +34,7 @@ export function DownloadFilesButton({ files }: DownloadFilesButtonProps) { } return ( - ) diff --git a/tests/component/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.spec.tsx b/tests/component/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.spec.tsx index acb8f6f79..3b8cbc009 100644 --- a/tests/component/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.spec.tsx +++ b/tests/component/sections/dataset/dataset-files/files-table/file-actions/FileActionsHeader.spec.tsx @@ -11,7 +11,7 @@ describe('FileActionsHeader', () => { it('renders the file actions header', () => { const datasetRepository: DatasetRepository = {} as DatasetRepository const datasetWithUpdatePermissions = DatasetMother.create({ - permissions: DatasetPermissionsMother.createWithUpdateDatasetAllowed(), + permissions: DatasetPermissionsMother.createWithAllAllowed(), hasValidTermsOfAccess: true }) datasetRepository.getByPersistentId = cy.stub().resolves(datasetWithUpdatePermissions) @@ -25,5 +25,6 @@ describe('FileActionsHeader', () => { ) cy.findByRole('button', { name: 'Edit Files' }).should('exist') + cy.findByRole('button', { name: 'Download' }).should('exist') }) })