Skip to content

feat: added custom classnames to event-assignment tab atom #17527

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 15 commits into from
Nov 25, 2024

Conversation

SomayChauhan
Copy link
Member

@SomayChauhan SomayChauhan commented Nov 7, 2024

What does this PR do?

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

NOTE
assignment tab is only available for team events

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

{
  "eventAssignmentTab": {
    "assignmentType": {
      "container": "border border-purple-200 bg-white rounded-lg p-6",
      "label": "text-purple-700 font-semibold",
      "description": "text-gray-600 text-sm",
      "schedulingTypeSelect": {
        "container": "mt-2",
        "label": "text-purple-700",
        "select": "border border-purple-300 rounded-md bg-white",
        "innerClassNames": {
          "control": "border-purple-300",
          "input": "text-purple-900",
          "option": "hover:bg-purple-100",
          "menu": "border border-purple-200 rounded-md",
          "singleValue": "text-purple-700"
        }
      }
    },
    "hosts": {
      "fixedHosts": {
        "container": "mt-4 border border-purple-200 bg-purple-50 rounded-lg p-6",
        "label": "text-purple-700 font-semibold",
        "description": "text-purple-600 text-sm",
        "addMembers": {
          "assingAllTeamMembers": {
            "container": "border border-purple-200 bg-white rounded-md",
            "label": "text-purple-700",
            "description": "text-gray-600"
          },
          "teamMemberSelect": {
            "hostsSelect": {
              "container": "mt-2",
              "select": "border border-purple-300 rounded-md bg-white",
              "label": "text-purple-700",
              "innerClassNames": {
                "input": "text-purple-900",
                "option": "hover:bg-purple-100",
                "control": "border-purple-300",
                "singleValue": "text-purple-700"
              }
            },
            "selectedHostList": {
              "container": "mt-4 border border-purple-200 rounded-md bg-white",
              "listItem": {
                "container": "flex items-center gap-2 p-3 bg-white hover:bg-purple-50",
                "avatar": "rounded-full border border-purple-300",
                "name": "text-purple-800 font-semibold",
                "changePriorityButton": "text-purple-700 hover:bg-purple-100",
                "changeWeightButton": "text-purple-700 hover:bg-purple-100",
                "removeButton": "text-purple-600 hover:bg-purple-100"
              }
            },
            "priorityDialog": {
              "confirmButton": "bg-purple-700 text-white rounded-md px-4 py-2",
              "label": "text-purple-700",
              "select": "border border-purple-300 rounded-md bg-white"
            },
            "weightDialog": {
              "container": "w-full bg-white p-4 rounded-md border border-purple-300",
              "label": "text-purple-700 font-semibold",
              "confirmButton": "bg-purple-700 text-white rounded-md px-4 py-2",
              "weightInput": {
                "container": "w-24",
                "label": "text-purple-700",
                "input": "border border-purple-300 rounded-md bg-white text-purple-900",
                "addOn": "text-purple-500"
              }
            }
          }
        }
      },
      "roundRobinHosts": {
        "container": "mt-4 border border-purple-200 bg-purple-50 rounded-lg p-6",
        "label": "text-purple-700 font-semibold",
        "description": "text-purple-600 text-sm",
        "enableWeights": {
          "container": "border border-purple-200 bg-white rounded-md",
          "label": "text-purple-700",
          "description": "text-gray-600"
        },
        "addMembers": {
          "assingAllTeamMembers": {
            "container": "border border-purple-200 bg-white rounded-md",
            "label": "text-purple-700",
            "description": "text-gray-600"
          },
          "teamMemberSelect": {
            "hostsSelect": {
              "container": "mt-2",
              "select": "border border-purple-300 rounded-md bg-white",
              "label": "text-purple-700",
              "innerClassNames": {
                "input": "text-purple-900",
                "option": "hover:bg-purple-100",
                "control": "border-purple-300",
                "singleValue": "text-purple-700"
              }
            },
            "selectedHostList": {
              "container": "mt-4 border border-purple-200 rounded-md bg-white",
              "listItem": {
                "container": "flex items-center gap-2 p-3 bg-white hover:bg-purple-50",
                "avatar": "rounded-full border border-purple-300",
                "name": "text-purple-800 font-semibold",
                "changePriorityButton": "text-purple-700 hover:bg-purple-100",
                "changeWeightButton": "text-purple-700 hover:bg-purple-100",
                "removeButton": "text-purple-600 hover:bg-purple-100"
              }
            }
          }
        }
      }
    },
    "childrenEventTypes": {
      "container": "mt-4 border border-purple-200 bg-purple-50 rounded-lg p-6",
      "assignAllTeamMembers": {
        "container": "border border-purple-200 bg-white rounded-md",
        "label": "text-purple-700",
        "description": "text-gray-600"
      },
      "childrenEventTypesList": {
        "assignToSelect": {
          "container": "mt-2",
          "select": "border border-purple-300 rounded-md bg-white",
          "label": "text-purple-700",
          "innerClassNames": {
            "input": "text-purple-900",
            "option": "hover:bg-purple-100",
            "control": "border-purple-300",
            "singleValue": "text-purple-700"
          }
        },
        "selectedChildrenList": {
          "container": "mt-4 border border-purple-200 rounded-md bg-white",
          "listItem": {
            "container": "flex items-center gap-2 p-3 bg-white hover:bg-purple-50",
            "avatar": "rounded-full border border-purple-300",
            "name": "text-purple-800 font-semibold",
            "ownerBadge": "text-purple-600 bg-purple-100 rounded-md px-2",
            "memberBadge": "text-purple-600 bg-purple-100 rounded-md px-2",
            "hiddenBadge": "text-gray-400 bg-gray-100 rounded-md px-2",
            "badgeContainer": "flex gap-1",
            "eventLink": "text-purple-700",
            "showOnProfileTooltip": "text-purple-600",
            "previewEventTypeTooltip": "text-purple-600",
            "previewEventTypeButton": "text-purple-700 hover:bg-purple-100",
            "deleteEventTypeTooltip": "text-red-500",
            "deleteEventTypeButton": "text-red-600 hover:bg-red-100"
          }
        }
      }
    }
  }
}

Screenshot of Changes

Screenshot 2024-11-11 at 12 04 35 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 ✨ feature New feature or request labels Nov 7, 2024
@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Nov 7, 2024
@graphite-app graphite-app bot requested review from a team November 7, 2024 07:22
Copy link

graphite-app bot commented Nov 7, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (11/07/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/07/24)

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

Copy link

vercel bot commented Nov 7, 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 4:20am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Nov 25, 2024 4:20am

Copy link
Contributor

github-actions bot commented Nov 11, 2024

E2E results are ready!

@supalarry
Copy link
Contributor

We have:

"roundRobinHosts": {
       ...
        "switchContainer": "flex items-center justify-between",
        "enableWeightsToggle": {
          "switchContainer": "border border-purple-300 bg-purple-200 rounded-md", 
          ...
        },

There are 2 switch containers and I don't know which one refers to what also given that there is "enableWeightsToggle".

is it possible to bring top level "switchContainer" into the switch itself aka:

"roundRobinHosts": {
       ...
        "enableWeightsToggle": {
          "container": "flex items-center justify-between border border-purple-300 bg-purple-200 rounded-md", 
          ...
        },

i don't know if what i am saying makes sense, but I find switchContainer repeating on top level and then within toggle confusing.

turbo.json Outdated
@@ -461,6 +461,7 @@
"NEXT_PUBLIC_POSTHOG_KEY",
"NEXT_PUBLIC_POSTHOG_HOST",
"VAPID_PRIVATE_KEY",
"HUDDLE01_API_TOKEN"
"HUDDLE01_API_TOKEN",
"REPLEXICA_API_KEY"
Copy link
Member Author

Choose a reason for hiding this comment

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

added to fix
Screenshot 2024-11-20 at 1 40 13 PM
171:34 error $REPLEXICA_API_KEY is not listed as a dependency in turbo.json turbo/no-undeclared-env-vars

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed a TypeScript error from an empty arrow function by adding return.

supalarry
supalarry previously approved these changes Nov 20, 2024
@supalarry supalarry self-requested a review November 20, 2024 09:07
Copy link
Contributor

@supalarry supalarry left a comment

Choose a reason for hiding this comment

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

We have assingAllTeamMembersToggle that has switchContainer - we can rename it to assingAllTeamMembersSwitch to have 1 word to describe concept and then what do you think about having assingAllTeamMembersSwitch.switchContainer simply as assingAllTeamMembersSwitch.container ?

This also is for other PRs where we use toggle and switch - we just need to stick with 1 in a structure thats easy to understand.

assingAllTeamMembersToggle -> assingAllTeamMembers
enableWeightsToggle -> enableWeights
assingAllTeamMembersToggle -> assingAllTeamMembers
supalarry
supalarry previously approved these changes Nov 22, 2024
@SomayChauhan SomayChauhan merged commit 9e9dd60 into main Nov 25, 2024
37 checks passed
@SomayChauhan SomayChauhan deleted the event-assignment-tab-classnames branch November 25, 2024 05:10
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