Skip to content

feat: added custom classnames for event-limits tab #17478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Nov 25, 2024

Conversation

SomayChauhan
Copy link
Member

@SomayChauhan SomayChauhan commented Nov 5, 2024

What does this PR do?

This PR introduces customizable class names (customClassnames) for the Event Type limits page in the project. This addition allows developers to style specific elements of the Event Type limits page

Below is a full list of available custom class names with default styling:

{
  "eventLimitsTab": {
    "bufferAndNoticeSection": {
      "container": "border border-purple-200 bg-purple-100 rounded-lg",
      "beforeBufferSelect": {
        "container": "mb-4",
        "label": "text-purple-700",
        "select": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "innerClassNames": {
          "input": "text-purple-900",
          "option": "text-purple-700 hover:bg-purple-200",
          "control": "border-purple-300",
          "singleValue": "text-purple-900",
          "valueContainer": "bg-purple-100",
          "menu": "border border-purple-200 rounded-md",
          "menuList": "bg-white"
        }
      },
      "afterBufferSelect": {
        "container": "mb-4",
        "label": "text-purple-700",
        "select": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "innerClassNames": {
          "input": "text-purple-900",
          "option": "text-purple-700 hover:bg-purple-200",
          "control": "border-purple-300",
          "singleValue": "text-purple-900",
          "valueContainer": "bg-purple-100",
          "menu": "border border-purple-200 rounded-md",
          "menuList": "bg-white"
        }
      },
      "minimumNoticeInput": {
        "container": "mb-4",
        "label": "text-purple-700",
        "input": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "select": "border border-purple-300 rounded-md text-purple-900 bg-purple-50",
        "innerClassNames": {
          "input": "text-purple-900",
          "option": "text-purple-700 hover:bg-purple-200",
          "control": "border-purple-300",
          "singleValue": "text-purple-900",
          "valueContainer": "bg-purple-100"
        }
      },
      "timeSlotIntervalSelect": {
        "container": "mb-4",
        "label": "text-purple-700",
        "select": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "innerClassNames": {
          "input": "text-purple-900",
          "option": "text-purple-700 hover:bg-purple-200",
          "control": "border-purple-300",
          "singleValue": "text-purple-900",
          "valueContainer": "bg-purple-100"
        }
      }
    },
    "bookingFrequencyLimit": {
      "container": "border border-purple-200 bg-purple-100 rounded-lg",
      "label": "text-purple-700",
      "description": "text-purple-500",
      "children": "space-y-4",
      "intervalLimitContainer": "space-y-2",
      "intervalLimitItem": {
        "addLimitButton": "text-purple-500 hover:bg-purple-200 rounded-md",
        "limitText": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "limitSelect": {
          "select": "border border-purple-300 rounded-md text-purple-900 bg-purple-50",
          "innerClassNames": {
            "input": "text-purple-900",
            "option": "text-purple-700 hover:bg-purple-200",
            "control": "border-purple-300",
            "singleValue": "text-purple-900",
            "valueContainer": "bg-purple-100"
          }
        },
        "container": "flex items-center space-x-2"
      }
    },
    "firstAvailableSlotOnly": {
      "container": "border border-purple-200 bg-purple-100 rounded-lg",
      "label": "text-purple-700",
      "description": "text-purple-500",
      "children": "space-y-4"
    },
    "totalDurationLimit": {
      "container": "border border-purple-200 bg-purple-100 rounded-lg",
      "label": "text-purple-700",
      "description": "text-purple-500",
      "children": "space-y-4",
      "intervalLimitItem": {
        "addLimitButton": "text-purple-500 hover:bg-purple-200 rounded-md",
        "limitText": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "limitSelect": {
          "select": "border border-purple-300 rounded-md text-purple-900 bg-purple-50",
          "innerClassNames": {
            "input": "text-purple-900",
            "option": "text-purple-700 hover:bg-purple-200",
            "control": "border-purple-300",
            "singleValue": "text-purple-900",
            "valueContainer": "bg-purple-100"
          }
        },
        "container": "flex items-center space-x-2"
      }
    },
    "futureBookingLimit": {
      "container": "border border-purple-200 bg-purple-100 rounded-lg",
      "label": "text-purple-700",
      "description": "text-purple-500",
      "children": "space-y-4",
      "rollingLimit": {
        "container": "flex items-center space-x-2",
        "textField": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "periodTypeSelect": {
          "select": "border border-purple-300 rounded-md text-purple-900 bg-purple-50",
          "innerClassNames": {
            "input": "text-purple-900",
            "option": "text-purple-700 hover:bg-purple-200",
            "control": "border-purple-300",
            "singleValue": "text-purple-900",
            "valueContainer": "bg-purple-100"
          }
        }
      },
      "rangeLimit": {
        "wrapper": "flex items-center space-x-2",
        "datePickerWraper": "border border-purple-300 rounded-md bg-white",
        "datePicker": "text-purple-900 bg-white"
      }
    },
    "offsetStartTimes": {
      "container": "border border-purple-200 bg-purple-100 rounded-lg",
      "label": "text-purple-700",
      "description": "text-purple-500",
      "children": "space-y-4",
      "offsetInput": {
        "container": "flex items-center space-x-2",
        "label": "text-purple-700",
        "input": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "addOn": "text-purple-500"
      }
    }
  }
}

Screenshot of Changes

Screenshot 2024-11-08 at 4 31 50 PM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@dosubot dosubot bot added event-types area: event types, event-types platform Anything related to our platform plan ✨ feature New feature or request labels Nov 5, 2024
@keithwillcode keithwillcode added the core area: core, team members only label Nov 5, 2024
@graphite-app graphite-app bot requested review from a team November 5, 2024 06:05
Copy link

graphite-app bot commented Nov 5, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (11/05/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add platform team as reviewer" took an action on this PR • (11/05/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@SomayChauhan SomayChauhan changed the title feat: added custom classnames for event limits tab feat: added custom classnames for event-limits tab Nov 5, 2024
Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Nov 25, 2024 6:52am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Nov 25, 2024 6:52am

Copy link
Contributor

github-actions bot commented Nov 7, 2024

E2E results are ready!

export type EventLimitsTabCustomClassNames = {
bufferAndNoticeSection?: {
container?: string;
beforeBufferSelect?: SelectClassNames;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question - what does innerClassNames mean within SelectClassNames ? These are classnames already existing in the code?

I am asking because if we have before buffer select:

        "container": "mb-4",
        "label": "text-purple-700",
        "select": "border border-purple-300 rounded-md text-purple-900 bg-white",
        "innerClassNames": {
          "input": "text-purple-900",
          "option": "text-purple-700 hover:bg-purple-200",
          "control": "border-purple-300",
          "singleValue": "text-purple-900",
          "valueContainer": "bg-purple-100",
          "menu": "border border-purple-200 rounded-md",
          "menuList": "bg-white"
        }
      },

we have select key and then innerClassNames. I wonder if we should rename select to container and innerClassNames to select and then move container within the select so we would have:

"beforeBufferSelect": {
        "container": "mb-4",
        "label": "text-purple-700",
        "select": {
          "container": "border border-purple-300 rounded-md text-purple-900 bg-white",
          "input": "text-purple-900",
          "option": "text-purple-700 hover:bg-purple-200",
          "control": "border-purple-300",
          "singleValue": "text-purple-900",
          "valueContainer": "bg-purple-100",
          "menu": "border border-purple-200 rounded-md",
          "menuList": "bg-white"
        }
      },

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the same for others

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


yes -- these are classnames we already have in our ui/select component

@supalarry supalarry self-requested a review November 20, 2024 09:04
@supalarry
Copy link
Contributor

Screenshot 2024-11-20 at 10 14 22

we have suffix there, but in other places we have addOn - is there a reason for that?

bookingFrequencyLimitSection-> bookingFrequencyLimit
totalDurationLimitSection-> totalDurationLimit
futureBookingLimitSection-> futureBookingLimit
offsetStartTimesSection-> offsetStartTimes
@SomayChauhan
Copy link
Member Author

we have suffix there, but in other places we have addOn - is there a reason for that?

this was a mistake, fixed in 51696e9

supalarry
supalarry previously approved these changes Nov 22, 2024
@SomayChauhan SomayChauhan enabled auto-merge (squash) November 25, 2024 06:52
@supalarry supalarry self-requested a review November 25, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only event-types area: event types, event-types ✨ feature New feature or request platform Anything related to our platform plan ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants