Skip to content

Commit

Permalink
Update table and checkbox style to not trim off some portion of checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-deepfence committed Jun 21, 2024
1 parent 28ed945 commit 11a940f
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ export const ReportTable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
minSize: 15,
size: 20,
maxSize: 30,
minSize: 10,
size: 10,
maxSize: 10,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -237,26 +237,26 @@ export const ReportTable = ({
);
},
header: () => '',
minSize: 20,
size: 25,
maxSize: 30,
minSize: 15,
size: 15,
maxSize: 15,
enableResizing: false,
}),
columnHelper.accessor('type', {
enableSorting: true,
cell: (cell) => <span className="uppercase">{cell.getValue()}</span>,
header: () => 'Report type',
minSize: 30,
size: 40,
maxSize: 55,
minSize: 50,
size: 70,
maxSize: 80,
}),
columnHelper.accessor('created_at', {
enableSorting: true,
cell: (cell) => formatMilliseconds(cell.getValue() ?? ''),
header: () => 'Created at',
minSize: 40,
size: 50,
maxSize: 70,
minSize: 50,
size: 70,
maxSize: 80,
}),
columnHelper.display({
id: 'duration',
Expand All @@ -279,9 +279,9 @@ export const ReportTable = ({
enableSorting: true,
cell: (cell) => <ScanStatusBadge status={cell.getValue() ?? ''} />,
header: () => 'Status',
minSize: 30,
size: 40,
maxSize: 70,
minSize: 50,
size: 70,
maxSize: 80,
}),
columnHelper.accessor('filters', {
enableSorting: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ const AIIntegrationTable = () => {
header: () => '',
minSize: 30,
size: 30,
maxSize: 35,
maxSize: 30,
enableResizing: false,
}),
columnHelper.accessor('integration_type', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,9 @@ const MalwareTable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
size: 45,
minSize: 45,
maxSize: 45,
size: 35,
minSize: 35,
maxSize: 35,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -1448,9 +1448,9 @@ const MalwareTable = ({
/>
),
header: () => '',
size: 55,
minSize: 40,
maxSize: 55,
size: 35,
minSize: 35,
maxSize: 35,
enableResizing: false,
}),
columnHelper.accessor('node_id', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,9 @@ const ScansTable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
size: 45,
minSize: 45,
maxSize: 45,
size: 35,
minSize: 35,
maxSize: 35,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -719,9 +719,9 @@ const ScansTable = ({
/>
),
header: () => '',
size: 30,
minSize: 30,
maxSize: 50,
size: 35,
minSize: 35,
maxSize: 35,
enableResizing: false,
}),
columnHelper.accessor('node_type', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1223,9 +1223,9 @@ const AccountTable = ({
);
},
header: () => '',
size: 20,
minSize: 20,
maxSize: 20,
minSize: 15,
size: 15,
maxSize: 15,
enableResizing: false,
}),
columnHelper.accessor('node_name', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,9 +1417,9 @@ const SecretTable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
size: 40,
minSize: 40,
maxSize: 40,
size: 35,
minSize: 35,
maxSize: 35,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -1442,9 +1442,9 @@ const SecretTable = ({
/>
),
header: () => '',
size: 45,
minSize: 40,
maxSize: 55,
size: 35,
minSize: 35,
maxSize: 35,
enableResizing: false,
}),
columnHelper.accessor('node_id', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ const ScansTable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
size: 45,
minSize: 45,
maxSize: 45,
size: 35,
minSize: 35,
maxSize: 35,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -708,18 +708,16 @@ const ScansTable = ({
row={cell.row.original}
onTableAction={onTableAction}
trigger={
<button className="p-1 flex">
<span className="block h-4 w-4 text-text-text-and-icon rotate-90 shrink-0">
<EllipsisIcon />
</span>
<button className="block h-4 w-4 text-text-text-and-icon rotate-90 shrink-0">
<EllipsisIcon />
</button>
}
/>
),
header: () => '',
size: 30,
minSize: 30,
maxSize: 50,
size: 35,
minSize: 35,
maxSize: 35,
enableResizing: false,
}),
columnHelper.accessor('node_type', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,8 @@ const UsersTable = ({
user={cell.row.original}
onTableAction={onTableAction}
trigger={
<button className="p-1">
<div className="h-[16px] w-[16px] text-text-text-and-icon rotate-90">
<EllipsisIcon />
</div>
<button className="h-[16px] w-[16px] text-text-text-and-icon rotate-90">
<EllipsisIcon />
</button>
}
/>
Expand All @@ -795,7 +793,7 @@ const UsersTable = ({
cell: (cell) => cell.getValue(),
header: () => 'ID',
minSize: 30,
size: 30,
size: 40,
maxSize: 85,
}),
columnHelper.accessor('first_name', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,52 @@ const DataTable = ({
() => [
getRowSelectionColumn(columnHelper, {
minSize: 20,
size: 25,
maxSize: 40,
size: 20,
maxSize: 20,
}),
columnHelper.display({
id: 'actions',
enableSorting: false,
cell: (cell) => (
<Dropdown
triggerAsChild={true}
align={'start'}
content={
<>
<DropdownItem>
<DFLink
to={`../compute/host/table?clusters=${cell.row.original.node_id}`}
unstyled
>
Go to hosts
</DFLink>
</DropdownItem>
<DropdownItem>
<DFLink
to={`../compute/container/table?clusters=${cell.row.original.node_id}`}
unstyled
>
Go to containers
</DFLink>
</DropdownItem>
<DropdownItem>
<DFLink to={`../compute/pod/table?clusters=${name}`} unstyled>
Go to pods
</DFLink>
</DropdownItem>
</>
}
>
<div className="cursor-pointer h-3 w-4 text-text-text-and-icon rotate-90">
<EllipsisIcon />
</div>
</Dropdown>
),
header: () => '',
size: 35,
minSize: 35,
maxSize: 35,
enableResizing: false,
}),
columnHelper.accessor('node_name', {
cell: (info) => {
Expand All @@ -396,44 +440,7 @@ const DataTable = ({
} else {
name = info.row.original.node_id;
}
return (
<div className="flex gap-x-2 items-center">
<Dropdown
triggerAsChild={true}
align={'start'}
content={
<>
<DropdownItem>
<DFLink
to={`../compute/host/table?clusters=${info.row.original.node_id}`}
unstyled
>
Go to hosts
</DFLink>
</DropdownItem>
<DropdownItem>
<DFLink
to={`../compute/container/table?clusters=${info.row.original.node_id}`}
unstyled
>
Go to containers
</DFLink>
</DropdownItem>
<DropdownItem>
<DFLink to={`../compute/pod/table?clusters=${name}`} unstyled>
Go to pods
</DFLink>
</DropdownItem>
</>
}
>
<div className="cursor-pointer h-3 w-4 text-text-text-and-icon rotate-90">
<EllipsisIcon />
</div>
</Dropdown>
<TruncatedText text={name} />
</div>
);
return <TruncatedText text={name} />;
},
header: () => 'Name',
minSize: 140,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1767,9 +1767,9 @@ const CVETable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
size: 35,
minSize: 35,
maxSize: 35,
size: 30,
minSize: 30,
maxSize: 30,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -1783,18 +1783,16 @@ const CVETable = ({
nodeType={nodeType}
isDockerImageNameEmpty={isDockerImageNameEmpty}
trigger={
<button className="p-1">
<div className="h-[16px] w-[16px] text-text-text-and-icon rotate-90">
<EllipsisIcon />
</div>
<button className="h-[16px] w-[16px] text-text-text-and-icon rotate-90">
<EllipsisIcon />
</button>
}
/>
),
header: () => '',
size: 40,
minSize: 40,
maxSize: 40,
size: 30,
minSize: 30,
maxSize: 30,
enableResizing: false,
}),
columnHelper.accessor('cve_id', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ const ScansTable = ({
const columns = useMemo(() => {
const columns = [
getRowSelectionColumn(columnHelper, {
size: 45,
minSize: 45,
maxSize: 45,
size: 35,
minSize: 35,
maxSize: 35,
}),
columnHelper.display({
id: 'actions',
Expand All @@ -453,9 +453,9 @@ const ScansTable = ({
/>
),
header: () => '',
size: 50,
minSize: 50,
maxSize: 60,
size: 35,
minSize: 35,
maxSize: 35,
enableResizing: false,
}),
columnHelper.accessor('node_type', {
Expand Down
Loading

0 comments on commit 11a940f

Please sign in to comment.