fix: If the labels are empty for inputs then show default values and also show the last label if the inputs are in split mode in event types.#10727
Conversation
|
@ZainGulbaz is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Thank you for following the naming conventions! 🙏 |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
…y done in App and on booking page
|
|
||
| variantField.label = variantField.label || t(defaultVariantFieldLabel || ""); | ||
| const fieldTypeVariantConfig = fieldTypeVariantsConfig?.variants[variantName]; | ||
| variantField.label = getVariantFieldLabel({ |
There was a problem hiding this comment.
@ZainGulbaz Reused getVariantFieldLabel here to make the implementation consistent with the app that you implemented. Earlier, if just spaces are entered, then booker was showing just the spaces and not the fallback, now with your fix it would fallback to default.
| fieldTypeVariantConfig: FieldTypeVariantConfig | undefined; | ||
| t: TFunction; | ||
| }) { | ||
| if (!variantField.label?.trim()) { |
There was a problem hiding this comment.
Your logic is here now. Also removed length check, it's a string and we can simply check for truthy.
|
Thank you for the PR @ZainGulbaz and double thanks @MehulZR for pointing out the issue. I have made a small refactor and it looks good to me. |
|
This PR is being marked as stale due to inactivity. |
|
This PR is being closed due to inactivity. Please reopen if work is intended to be continued. |
What does this PR do?
This PR rectifies the label issue when the label for field types of config variants in field form of event's booking question is split and shows default label if the label fields are empty
Fixes # (10390)
Before:
https://www.loom.com/share/63704afcc62b4253b26477f448de94ac
After:
https://www.loom.com/share/99a142ebd593499aa741251aac07226b
Type of change
How should this be tested?
The user can edit the event and from advanced setting he can edit the "name" field and change the label in split mode.
Add empty label in all fields or any one field.
Checklist