-
Notifications
You must be signed in to change notification settings - Fork 289
fix: default slot QoL #2212
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
base: integrations/makeswift
Are you sure you want to change the base?
fix: default slot QoL #2212
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
|
817c440
to
75305ba
Compare
75305ba
to
4e3b49a
Compare
4e3b49a
to
8c769d1
Compare
8c769d1
to
ac549ea
Compare
ac549ea
to
c980cc5
Compare
c980cc5
to
9545414
Compare
9545414
to
0151967
Compare
d232af6
to
36f67e8
Compare
36f67e8
to
eaf8ec2
Compare
4432749
to
616c78a
Compare
616c78a
to
2eaf036
Compare
const actualSlot = allSlots?.find((s) => s.group === `${customerGroupId}`)?.slot ?? ( | ||
<UntargetedGroup /> | ||
); | ||
const customerGroup = customerGroupId || DEFAULT_GROUP_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you set the default to `DEFAULT_GROUP_ID1 in line 46 directly so you don't have to do it here?
function CustomerGroupSlot({ className, slots, simulatedGroup = NO_GROUP_ID, noGroupSlot }: Props) { | ||
const allSlots = slots?.concat({ group: NO_GROUP_ID, slot: noGroupSlot }); | ||
function CustomerGroupSlot({ className, slots, simulatedGroup, defaultSlot }: Props) { | ||
const targetedSlots = slots?.concat({ group: DEFAULT_GROUP_ID, slot: defaultSlot }); | ||
const isInBuilder = useIsInBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a decision made on if this function was something that was ok to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, Miguel approved the usage
2eaf036
to
585ee1c
Compare
79bcaf3
to
87d22de
Compare
87d22de
to
3919a8b
Compare
3919a8b
to
e5d8ec6
Compare
e5d8ec6
to
f420817
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewpledger, these changes look good to me. I thought we were planning on getting rid of this component due to some issues we found, though?
})) | ||
.filter((option) => option.label.toLowerCase().includes(query.toLowerCase())); | ||
return [ | ||
{ id: NO_GROUP_ID, label: 'No-group', value: NO_GROUP_ID }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the label be "No group", without the hyphen?
fc89443
to
2b647d9
Compare
⚡️🏠 Lighthouse reportLighthouse ran against https://catalyst-canary-c3fta4b1f-bigcommerce-platform.vercel.app 🖥️ DesktopWe ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:
📱 MobileWe ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:
|
There is now a default slot that is used where conditions do not apply, or a user does not have a group id
Before, if a group was simulated that did not exist in the "Targeted customer groups" control, we would render a message saying that you need to add this group before it can render properly. However, I realized after documenting our instructions for this that this would present several issues when modifying your storefront customer groups.
This PR aims to address those potential issues:
CleanShot.2025-04-09.at.18.19.38.mp4