Skip to content

fix: simplify the common schedule toggle check logic#17439

Merged
anikdhabal merged 1 commit into
calcom:mainfrom
anikdhabal:common_schedule_issue
Nov 5, 2024
Merged

fix: simplify the common schedule toggle check logic#17439
anikdhabal merged 1 commit into
calcom:mainfrom
anikdhabal:common_schedule_issue

Conversation

@anikdhabal
Copy link
Copy Markdown
Contributor

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A-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.
  • N/A-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

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 1, 2024

@anikdhabal is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the event-types area: event types, event-types label Nov 1, 2024
@keithwillcode keithwillcode added the core area: core, team members only label Nov 1, 2024
@graphite-app graphite-app Bot added the community Created by Linear-GitHub Sync label Nov 1, 2024
@graphite-app graphite-app Bot requested a review from a team November 1, 2024 19:59
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Nov 1, 2024

Graphite Automations

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

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

"Add community label" took an action on this PR • (11/01/24)

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


const [useHostSchedulesForTeamEvent, setUseHostSchedulesForTeamEvent] = useState(
!Boolean(getFieldState("schedule").isDirty ? getValues("schedule") : eventType.schedule)
!Boolean(eventType.schedule)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For a team event, when the common schedule toggle is disabled, the scheduleId of the event is null, and when enabled, it’s an int. So let’s keep it simple and make the toggle check or the default state dependent only on the eventType scheduleId

@keithwillcode keithwillcode added this to the v4.7 milestone Nov 3, 2024
@anikdhabal anikdhabal removed the community Created by Linear-GitHub Sync label Nov 4, 2024
@anikdhabal anikdhabal enabled auto-merge (squash) November 5, 2024 04:52
@anikdhabal anikdhabal merged commit f39e817 into calcom:main Nov 5, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 5, 2024

E2E results are ready!

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 ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants