ClickHouse / click-ui

The home of the ClickHouse design system and component library.

Home Page:https://click-ui.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable tile component from being clicked when disabled

pjhampton opened this issue · comments

Overview

The business case is we want to stop users onboarding a ClickPipe if their instance is idle. This wouldn't be uncommon for new customers using dev instances while they evaluate the product. If the ClickHouse instance is idle we can't do important operations such as list roles, create tables, etc. This is going to become even more problematic as we start to roll out more pipe types that require access to ClickHouse from the discovery stage.

Reproduce

  1. Go to https://click-ui.vercel.app/?path=/docs/cards-primary-card--docs and disable a tile. Clicking on it doesn't show the cursor: not-allowed attribute which I would expect to the there.
  2. Go to the ClickPipes tiles code in the control plane and disable some tiles.

Code

Based on the code in https://github.com/ClickHouse/click-ui/blob/main/src/components/CardPrimary/CardPrimary.tsx I think this may be a regression.

...
  &[disabled],
  &[disabled]:hover,
  &[disabled]:active {
    background-color: ${({ theme }) =>
      theme.click.card.primary.color.background.disabled};
    color: ${({ theme }) => theme.click.card.primary.color.title.disabled};
    border: 1px solid ${({ theme }) => theme.click.card.primary.color.stroke.disabled};
    cursor: not-allowed;

    button {
      background-color: ${({ theme }) =>
        theme.click.button.basic.color.primary.background.disabled};
      border-color: ${({ theme }) =>
        theme.click.button.basic.color.primary.stroke.disabled};
      &:active {
        background-color: ${({ theme }) =>
          theme.click.button.basic.color.primary.background.disabled};
        border-color: ${({ theme }) =>
          theme.click.button.basic.color.primary.stroke.disabled};
      }
    }
  }

@gjones Should we implement the disable cursor in click-ui?

@vineethasok yeah I think so, I thought they had disabled states but must be mistaken

Fixed it with updated click-ui