-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add loading state to switch, convert to scss modules #12790
Conversation
|
||
&.small:before { | ||
transform: translateX(10px); | ||
} |
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.
Doing &:before { &.small {} }
did not work.
airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/components/EnabledControl.tsx
Outdated
Show resolved
Hide resolved
@@ -103,7 +103,7 @@ export const BulkHeader: React.FC<BulkHeaderProps> = ({ destinationSupportedSync | |||
<CheckboxCell /> | |||
<ArrowCell /> | |||
<HeaderCell flex={0.4}> | |||
<Toggle small checked={options.selected} onChange={() => onChangeOption({ selected: !options.selected })} /> | |||
<Switch small checked={options.selected} onChange={() => onChangeOption({ selected: !options.selected })} /> |
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.
This is an example of an async effect caused by a sync option. Hard to know what Switch triggered things.
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.
Looking good so far, comments below.
Could we as part of this PR also add the |
airbyte-webapp/src/pages/SettingsPage/pages/NotificationPage/components/NotificationsForm.tsx
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.
Great!
@timroes Unsure how you wanted to implement a11y features into this. It's at least labeled correctly. |
// Getting the loading state down here may be difficult. | ||
// ConnectionsTable.tsx#28 | ||
// The data is invalidated, then re-loaded. There's no specific action flow for loading. |
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.
@edmundito I think this should rather just be a coment on the PR not in the code. Could we remove this before merging this?
678af52
to
a3e9ab3
Compare
a3e9ab3
to
1af095d
Compare
* Adding sass * Rename Toggle -> Switch * Loading state test works * Mostly working styles * Smooth * cleanup * Added loading where available * Switch to classnames, move svg's, code review bits, move theme content into scss. * Added switch to storybook * Better * LabeledToggle -> LabeledSwitch * Edmundo CR * Import variables from SASS in TS * Minor adjustments * Refactor code * Adjust styling to discussion with Nico * invalidate connection on source and destination item pages when updating status * Fix switch loading status in NotificationForm * Update classnames in package-lock * While updating the connection, disable reset and sync buttons * Disable switch while loading Co-authored-by: Tim Roes <tim@airbyte.io> Co-authored-by: Edmundo Ruiz Ghanem <edmundo@airbyte.io>
Closes #12530
Renamed, has a loading state, and uses sass modules.
Arguably done. Many places this component is used actually cause sync actions that trigger async updates so we don't have a way to track when to start/stop loading. I could code something up, like using a key to track loading state, but I'd argue the problem views (connections list, destinations list, and sources list) merit a refactor that would make this way easier.
Error states are arguably outside the scope of this work. The mocks place them below the label, not the switch itself, and there are several components that implement Switch. Additionally error states are bubbled up to Error Boundaries more often than not so I'm unsure how much value this gets us.
Merits discussion.