Skip to content

Firewall rules table: use + popup for overflow when there are too many targets/filters #2118

Closed

Description

@david-crespo

Right now they stack and can overflow the cell.

Activity

  1. benjaminleonard commented on Apr 8, 2024

    @benjaminleonard
    Contributor

    Do we want to make this a generic cell component that can handle overflow + popup? We've got it in a few places.

  2. david-crespo commented on Apr 8, 2024

    @david-crespo
    CollaboratorAuthor

    We sort of have that already. We take the first child and show it in the cell and put the rest in the popup. No rest, no popup. I wouldn't want to make it smarter than that because that logic about what to put in cell vs. popup seems pretty specific to each call site.

    export const ListPlusCell = ({ tooltipTitle, children }: ListPlusCellProps) => {
    const [first, ...rest] = React.Children.toArray(children)
    const content = (
    <div>
    <div className="mb-2">{tooltipTitle}</div>
    {...rest}
    </div>
    )
    return (
    <div className="flex items-baseline gap-2">
    {first}
    {rest.length > 0 && (
    <Tooltip content={content} placement="bottom">
    <div className="text-mono-sm">+{rest.length}</div>
    </Tooltip>
    )}
    </div>
    )
    }

  3. added this to the 8 milestone on Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions