-
Notifications
You must be signed in to change notification settings - Fork 377
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
Copy custom group properties in group-utils
copyGroup function
#1843
Conversation
Not sure if this works in your case, but we have a If it isn't working with |
@mkszepp thanks for the suggestion! I don't believe the
EDIT: I took a stab at writing tests for this |
@lukasnys for test i would like you add a test like a real usecase... for example creating a component in which you are passing this property... so we don't need to export the function right? With |
Hey @mkszepp, that makes sense! I removed the unit tests and added an integration test for my change. |
I also created #1844 where I add the same test to showcase that it's currently failing. |
Thanks looks already good! Can you add als a test for single select? Than i think we test everything Can you fix also the embroider test? |
Added the single select test case and fixed the Embroider test! |
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.
Thank you! LGTM!
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.
Ah one thing.. for TS i think we need to extend the Group
with [key: string]: unknown
otherwise its not possibile to use inside TS project... can you maybe add also this one?
Line 120 in group-utils
group-utils
copyGroup function
group-utils
copyGroup functiongroup-utils
copyGroup function
Will do 👀 In the implementation of the Implementation below as reference function copyGroup(group: Group, suboptions: any[]): Group {
const groupCopy: Group = { ...group, options: suboptions };
if (Object.prototype.hasOwnProperty.call(group, 'disabled')) {
groupCopy.disabled = group.disabled;
}
return groupCopy;
} |
I think, we can hold like it is, so the autocomplete is better |
Added |
Thank you... i will release it on begin of next week |
Thanks! 🎉 |
Why?
In our use case of
ember-power-select
we add custom properties onto the groups to conditionally render those groups in a different way (in the@groupComponent
that we pass toPowerSelectMultiple
).However, because the
copyGroup
function strips those custom properties, our styling is broken as soon as a user enters a search term.What?
Change the
copyGroup
function to include all fields.