From 18d4b99e8036c2083401997776a69aba028a9a83 Mon Sep 17 00:00:00 2001 From: Yi Cai Date: Tue, 16 Apr 2024 10:06:42 -0400 Subject: [PATCH] Addressed review comments Signed-off-by: Yi Cai --- .../AddRepositories/AddRepositoriesDrawer.tsx | 15 ++++---- .../AddRepositories/OrganizationTableRow.tsx | 10 +++--- .../AddRepositories/RepositoriesHeader.tsx | 34 +++++++++---------- .../AddRepositories/RepositoriesTable.tsx | 2 +- .../AddRepositories/RepositoryTableRow.tsx | 17 ++++++---- .../src/utils/repository-utils.tsx | 8 ----- 6 files changed, 41 insertions(+), 45 deletions(-) diff --git a/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx b/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx index 3d277fcfbe7..456a756555e 100644 --- a/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx +++ b/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx @@ -48,6 +48,12 @@ const useStyles = makeStyles(theme => ({ }, }, }, + drawerContainer: { + padding: '20px', + height: '100%', + display: 'flex', + flexDirection: 'column', + }, })); export const AddRepositoriesDrawer = ({ @@ -81,14 +87,7 @@ export const AddRepositoriesDrawer = ({ variant="temporary" className={classes.drawerPaper} > - +
{data?.name} diff --git a/plugins/bulk-import/src/components/AddRepositories/OrganizationTableRow.tsx b/plugins/bulk-import/src/components/AddRepositories/OrganizationTableRow.tsx index 911a751d140..ee21af38597 100644 --- a/plugins/bulk-import/src/components/AddRepositories/OrganizationTableRow.tsx +++ b/plugins/bulk-import/src/components/AddRepositories/OrganizationTableRow.tsx @@ -13,7 +13,7 @@ import { urlHelper, } from '../../utils/repository-utils'; -const tableRowStyle = { +const tableCellStyle = { lineHeight: '1.5rem', fontSize: '0.875rem', padding: '15px 16px 15px 24px', @@ -30,10 +30,10 @@ export const OrganizationTableRow = ({ }) => { return ( - + {data.name} - + <> {urlHelper(data.url)} @@ -43,10 +43,10 @@ export const OrganizationTableRow = ({ - + {getSelectedRepositories(onOrgRowSelected, data, alreadyAdded)} - + {getRepositoryStatusForOrg(data, alreadyAdded)} diff --git a/plugins/bulk-import/src/components/AddRepositories/RepositoriesHeader.tsx b/plugins/bulk-import/src/components/AddRepositories/RepositoriesHeader.tsx index 6210230b7bc..b365bf63564 100644 --- a/plugins/bulk-import/src/components/AddRepositories/RepositoriesHeader.tsx +++ b/plugins/bulk-import/src/components/AddRepositories/RepositoriesHeader.tsx @@ -45,37 +45,37 @@ export const RepositoriesHeader = ({ return RepositoriesColumnHeader; }; - const tableRowStyle = { + const tableCellStyle = { lineHeight: '1.5rem', fontSize: '0.875rem', - padding: '15px 16px 15px 24px', + padding: showOrganizations ? '15px 16px 15px 24px' : '15px 16px 15px 6px', fontWeight: '700', }; return ( - {!showOrganizations && ( - - 0 && numSelected < rowCount} - checked={rowCount > 0 && numSelected === rowCount} - onChange={onSelectAllClick} - inputProps={{ - 'aria-label': 'select all repositories', - }} - /> - - )} - {getColumnHeader().map(headCell => ( + {getColumnHeader().map((headCell, index) => ( + {index === 0 && !showOrganizations && ( + 0 && numSelected < rowCount} + checked={rowCount > 0 && numSelected === rowCount} + onChange={onSelectAllClick} + inputProps={{ + 'aria-label': 'select all repositories', + }} + /> + )} - + { + const tableCellStyle = { + lineHeight: '1.5rem', + fontSize: '0.875rem', + padding: '15px 16px 15px 6px', + }; return ( - + handleClick(event, data.id)} + style={{ padding: '0 12px' }} /> - - {data.name} {!isDrawer && data.organization && ( - + <> {urlHelper(data.url)} @@ -56,7 +61,7 @@ export const RepositoryTableRow = ({ )} - + <> {urlHelper(data.url)} @@ -66,7 +71,7 @@ export const RepositoryTableRow = ({ - + {getRepositoryStatus( data.catalogInfoYaml?.status || '', isItemSelected, diff --git a/plugins/bulk-import/src/utils/repository-utils.tsx b/plugins/bulk-import/src/utils/repository-utils.tsx index 17c27954820..fa4f54374da 100644 --- a/plugins/bulk-import/src/utils/repository-utils.tsx +++ b/plugins/bulk-import/src/utils/repository-utils.tsx @@ -162,14 +162,6 @@ export const getNewSelectedRepositories = ( export const getRepositoriesSelected = (data: AddRepositoriesFormValues) => { return data.repositories?.length || 0; - // if (data.repositoryType === 'repository') { - // } - // return ( - // data.organizations?.reduce((acc, org) => { - // const repos = acc + (org.selectedRepositories as number) || 0; - // return repos; - // }, 0) || 0 - // ); }; export const filterSelectedForActiveDrawer = (