Skip to content

Commit

Permalink
update firewall filter type/value visual treatment (#2108)
Browse files Browse the repository at this point in the history
* update firewall filter type/value visual treatment

* use normal-case on values badges

* keep various filters on one line, with wrapping when needed
  • Loading branch information
charliepark authored Apr 3, 2024
1 parent 8e3a200 commit 95f2e49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions app/table/cells/FirewallFilterCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ import { TypeValueCell } from './TypeValueCell'
export const FirewallFilterCell = ({
value: { hosts, ports, protocols },
}: Cell<VpcFirewallRuleFilter>) => (
<div className="space-x-1">
{hosts && hosts.map((tv, i) => <TypeValueCell key={`${tv}-${i}`} value={tv} />)}
{protocols &&
protocols.map((p, i) => (
<Badge key={`${p}-${i}`} variant="default">
<div className="flex flex-col gap-1">
<div className="flex flex-wrap gap-1">
{hosts?.map((tv, i) => <TypeValueCell key={`${tv}-${i}`} value={tv} />)}
</div>
<div className="flex gap-1">
{protocols?.map((p, i) => <Badge key={`${p}-${i}`}>{p}</Badge>)}
{ports?.map((p, i) => (
<Badge key={`${p}-${i}`} variant="solid">
{p}
</Badge>
))}
{ports && ports.map((p, i) => <Badge key={`${p}-${i}`}>{p}</Badge>)}
</div>
</div>
)
4 changes: 3 additions & 1 deletion app/table/cells/TypeValueCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export type TypeValue = {
export const TypeValueCell = ({ value: { type, value } }: Cell<TypeValue>) => (
<div className="space-x-1">
<Badge>{type}</Badge>
<Badge>{value}</Badge>
<Badge variant="solid" className="!normal-case">
{value}
</Badge>
</div>
)

0 comments on commit 95f2e49

Please sign in to comment.