feat: setting to enable weights on attribute in route#18592
Merged
CarinaWolli merged 17 commits intomainfrom Jan 30, 2025
Merged
feat: setting to enable weights on attribute in route#18592CarinaWolli merged 17 commits intomainfrom
CarinaWolli merged 17 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Contributor
E2E results are ready! |
Udit-takkar
reviewed
Jan 28, 2025
Contributor
Udit-takkar
left a comment
There was a problem hiding this comment.
Code looks fine. will wait for hariom's review before merging
Comment on lines
+878
to
+882
| const attributeWithEnabledWeights = await prisma.attribute.findFirst({ | ||
| where: { | ||
| id: attributeIdForWeights, | ||
| teamId: organizationId, | ||
| isWeightsEnabled: true, |
Member
There was a problem hiding this comment.
We could make this query potentially faster by using findUnique with just id as we have that now.
Member
Author
There was a problem hiding this comment.
Good point. I changed it to findUnique
Member
|
Removed the weighted attributes logi from Route component https://github.com/calcom/cal.com/pull/18974/files# |
Co-authored-by: Hariom Balhara <hariombalhara@gmgmail.com>
hariombalhara
previously approved these changes
Jan 29, 2025
Member
Author
|
@hariombalhara can I get another approval please, only changed |
hariombalhara
approved these changes
Jan 30, 2025
MuhammadAimanSulaiman
pushed a commit
to hit-pay/cal.com
that referenced
this pull request
Feb 25, 2025
* add UI to Routes * add attributeIdForWeights to route json * fixes and clean up * clean up onChangeAttributeIdForWeights * fix type errors * fix attribute weights in getLuckyUser * adjust tests * fixes for attribute rule changes * fix type error * Keep weighted attributes logic outside Route (calcom#18974) Co-authored-by: Hariom Balhara <hariombalhara@gmgmail.com> * use findUnique * fix test --------- Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Hariom Balhara <hariombalhara@gmgmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a new setting to routing from routes to choose if attribute weights should be used with a dropdown to pick the attribute. You can only pick attributes that have weights enabled and that are used in the route with 'Value of field ...'.
Before it was not transparent when we switch to attribute weights. That's the logic used before:
If an attribute had weights enabled and any routing form used this attribute with 'Value of field ...' it would always automatically switch to attribute weights.
Mandatory Tasks (DO NOT REMOVE)