Conversation
| "next-seo": "^6.0.0", | ||
| "next-themes": "^0.2.0", | ||
| "nodemailer": "^6.7.8", | ||
| "nuqs": "^1.20.0", |
There was a problem hiding this comment.
We've talked about using this a lot before so thought now would be a good time
| const [selectedAttribute, setSelectedAttribute] = useQueryState("a", parseAsString); | ||
| const utils = trpc.useUtils(); | ||
| const attributeData = utils.viewer.attributes.list.getData(); | ||
| const foundAttribute = attributeData?.find((attr) => attr.id === selectedAttribute); |
There was a problem hiding this comment.
Get the data from cache instead of propdrilling / requerying on ID
We know it exists as we fetch all attributes from org
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (10/08/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (10/09/24)1 label was added to this PR based on Keith Williams's automation. |
| } | ||
| const translateableType = getTranslateableStringFromType(foundAttribute.type); | ||
|
|
||
| const isSelectable = foundAttribute.type === "SINGLE_SELECT" || foundAttribute.type === "MULTI_SELECT"; |
There was a problem hiding this comment.
Used to determine if we use checkboxes or text input
|
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
| ); | ||
| } | ||
|
|
||
| if (showMultiSelectWarning) { |
There was a problem hiding this comment.
Warning to show the behaviour of multi select merging with existing options for that attribute.
| if ( | ||
| foundAttributeInCache?.type === "MULTI_SELECT" || | ||
| foundAttributeInCache?.type === "SINGLE_SELECT" | ||
| ) { | ||
| attributesToAssign = [ | ||
| { | ||
| id: foundAttributeInCache.id, | ||
| options: selectedAttributeOptions.map((v) => ({ | ||
| value: v, | ||
| })), | ||
| }, | ||
| ]; | ||
| } else { | ||
| attributesToAssign = [ | ||
| { id: foundAttributeInCache.id, value: selectedAttributeOptions[0] }, | ||
| ]; | ||
| } |
There was a problem hiding this comment.
This isnt that nice i created https://linear.app/calcom/issue/CAL-4481/refactor-assignment-of-attributes to refactor how we pass data into the assignAttributes
| @@ -0,0 +1,2 @@ | |||
| -- DropIndex | |||
| DROP INDEX "AttributeOption_attributeId_value_key"; | |||
There was a problem hiding this comment.
We couldnt unique here - i found out that you couldnt assign the two different member the same value. It has no effect on anything else
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
alishaz-polymath
left a comment
There was a problem hiding this comment.
Let's go. Looking great 🚀 🚀
E2E results are ready! |
What does this PR do?
Implements mass assignment of attributes
Fixes: #16985
Loom: https://www.loom.com/share/e821740381b644cabf6508f84800a198
TODO: https://linear.app/calcom/issue/CAL-4481/refactor-assignment-of-attributes (Out of scope for this PR)
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist