-
Notifications
You must be signed in to change notification settings - Fork 71
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
DT-1407 - add RadioInput component and replace existing native radio inputs #1670
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/lib/components/workflow/filter-search/datetime-filter.svelte
Outdated
Show resolved
Hide resolved
src/lib/components/workflow/filter-search/datetime-filter.svelte
Outdated
Show resolved
Hide resolved
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.
🎉
let endpoint = $codecEndpoint ?? ''; | ||
let port = $dataConverterPort ?? ''; | ||
let passToken = $passAccessToken ?? false; | ||
let includeCreds = $includeCredentials ?? false; | ||
let override = $overrideRemoteCodecConfiguration ?? false; | ||
let override = writable($overrideRemoteCodecConfiguration); |
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.
Curious why you've chosen writable
over ⬇️ here
let override = writable($overrideRemoteCodecConfiguration); | |
let override = $overrideRemoteCodecConfiguration ?? false; |
and if we want to change the other variables to stores as well 🤔
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.
I did it this way because override
needs to be a Writable
, and let override = $overrideRemoteCodecConfiguration
would make override
the value of the store, i.e. a boolean
. Additionally, let override = overrideRemoteCodecConfiguration
(without the $
) would assign override
by reference and thus the store value would still be mutated.
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 forgot about the context r.e. the group needing to be a store in the note for this PR, thanks!
Description & motivation 💭
Adds
RadioInput
andRadioGroup
components following the new component spec and replaces existing native<input type="radio" />
with the new Component(s)Some implementation notes:
<RadioInput />
can be used with or without a<RadioGroup />
. To use it standalone, aname
andgroup
prop must be passed to each<RadioInput />
to use with a
<RadioGroup />
,name
andgroup
can be passed as props to<RadioGroup />
and will be set on child<RadioInput />
's via context.Note: binding to
group
is not necessary, as the value is a store.group
had to be made a store, because context is not reactive by default. For reactivity in svelte context, a reactive value must be used.Screenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Radio inputs were used in 3 places
Test for no regressions in functionality in these 3 areas.
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Docs
Any docs updates needed?