Skip to content

Enum entry & default label #3216

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 3 commits into from
May 23, 2024
Merged

Enum entry & default label #3216

merged 3 commits into from
May 23, 2024

Conversation

CarsonF
Copy link
Member

@CarsonF CarsonF commented May 22, 2024

https://seed-company-squad.monday.com/boards/5989610236/pulses/6697386106

  • Added EnumX.entry(EnumX.Y) to retrieve the entry for the given value.
    e.g.
    ProjectStep.entry('DiscussingChangeToPlan')
    ProjectStep.entry(ProjectStep.DiscussingChangeToPlan)
    I thought about calling it .get() instead. Thoughts?
  • Added default label to all entries that didn't have one provided / handwritten.
  • Swapped usage across app to use enum labels instead of adhoc conversion.
// handwritten
ProjectType.entry('MomentumTranslation').label // => "Momentum"
ProductMedium.entry('EBook').label // => "E-Book"
// automatic convention
ProjectStep.entry('DiscussingChangeToPlan').label // => "Discussing Change to Plan"

CarsonF added 3 commits May 22, 2024 15:59
This heuristic matches what the UI does too.
Not declaring these to GQL schema though, so only handwritten labels are provided there.
Copy link
Contributor

@andrewmurraydavid andrewmurraydavid left a comment

Choose a reason for hiding this comment

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

Nice quality of life changes!

@CarsonF CarsonF merged commit 016e520 into develop May 23, 2024
15 checks passed
@CarsonF CarsonF deleted the enum-label branch May 23, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants