diff --git a/ui/components/table.js b/ui/components/table.js index a2ebda25ca..594f75c3f2 100644 --- a/ui/components/table.js +++ b/ui/components/table.js @@ -14,6 +14,7 @@ export default function Table({ columns, data, href, + type = '', empty = 'No data', count = data?.length, allowDelete = false, @@ -105,10 +106,7 @@ export default function Table({ return ( {allowDelete && data?.length > 0 && ( - + ( {header.isPlaceholder @@ -149,7 +147,7 @@ export default function Table({ href && href(row) ? 'cursor-pointer hover:bg-gray-50/50' : '' - }`} + } ${type === 'detail' ? 'h-[60px]' : ''}`} key={row.id} > {allowDelete && data?.length > 0 && ( @@ -172,32 +170,39 @@ export default function Table({ /> )} - {row.getVisibleCells().map(cell => ( - - {href && href(row) ? ( - - {flexRender( + {row.getVisibleCells().map(cell => { + return ( + + {href && href(row) ? ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ) : ( + flexRender( cell.column.columnDef.cell, cell.getContext() - )} - - ) : ( - flexRender( - cell.column.columnDef.cell, - cell.getContext() - ) - )} - - ))} + ) + )} + + ) + })} ) })} diff --git a/ui/pages/access-control/index.js b/ui/pages/access-control/index.js index 5e2243b3d3..57a0297104 100644 --- a/ui/pages/access-control/index.js +++ b/ui/pages/access-control/index.js @@ -78,12 +78,6 @@ function CreateAccessDialog({ setOpen, onCreated = () => {} }) { setRoles(sortByRole(selectedResource?.roles)) }, [selectedResource]) - useEffect(() => { - if (roles.length > 0) { - setSelectedRoles([roles[0]]) - } - }, [roles]) - async function onSubmit(e) { e.preventDefault() try { @@ -301,7 +295,7 @@ function CreateAccessDialog({ setOpen, onCreated = () => {} }) { multiple >
- +
{} }) { value={selectedRoles} onChange={v => { setError({}) - if (selectedRoles.length === 1 && v.length === 0) { - return - } const add = v.filter(x => !selectedRoles.includes(x)) const remove = selectedRoles.filter(x => !v.includes(x)) @@ -395,7 +386,7 @@ function CreateAccessDialog({ setOpen, onCreated = () => {} }) { multiple >
- +
{} }) { /> - {selectedRoles.join(', ')} + {selectedRoles.length > 0 + ? selectedRoles.join(', ') + : 'Select roles'}
@@ -469,7 +462,9 @@ function CreateAccessDialog({ setOpen, onCreated = () => {} }) {
) diff --git a/ui/pages/destinations/index.js b/ui/pages/destinations/index.js index 410630c6e9..660db30fb7 100644 --- a/ui/pages/destinations/index.js +++ b/ui/pages/destinations/index.js @@ -85,24 +85,12 @@ export default function Destinations() {
{info.getValue()}
- {info.row.original.kind !== 'ssh' ? ( -
- {info.row.original.resources?.length > 0 && ( - - {info.row.original.resources?.length}  - {info.row.original.resources?.length === 1 - ? 'namespace' - : 'namespaces'} - - )} -
- ) : ( -
- {info.row.original.connection.url === '' - ? '-' - : info.row.original.connection.url} -
- )} + +
+ {info.row.original.connection.url === '' + ? '-' + : info.row.original.connection.url} +
),