-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
🪟 🎨 Updating design for BulkEditPanel component #18912
🪟 🎨 Updating design for BulkEditPanel component #18912
Conversation
@@ -28,7 +28,7 @@ export const Cell = styled.div<{ | |||
lighter?: boolean; | |||
ellipsis?: boolean; | |||
}>` | |||
flex: ${({ flex }) => flex || 1} 0 0; | |||
flex: ${({ flex }) => (flex !== undefined ? flex : 1)} 0 0; |
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.
What was the reason behind this change?
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.
when flex is passed as 0 it will be still 1 since 0 || 1 will result in 1, but my intention was to pass exactly 0
airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.module.scss
Outdated
Show resolved
Hide resolved
|
||
const Context = React.createContext<EditControlsServiceContext | null>(null); | ||
|
||
export interface EditControlsServiceContext { |
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.
These should probably use the world Connection (for example, ConnectionEditControlsService), and the filename should also have this name over BulkEditService
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.
actually, I found that both EditControls
and BulkEditPanel
both inside Formik
, and also Formik
have something called status
object, where you can basically pass anything you want that helps you work with form
https://formik.org/docs/api/formik#status-any
A top-level status object that you can use to represent a form state that can't otherwise be expressed/stored with other methods. This is useful for capturing and passing through API responses to your inner component.
so I decided we can use it
@@ -57,6 +60,9 @@ export const BulkEditServiceProvider: React.FC< | |||
}; | |||
|
|||
const isActive = selectedBatchNodes.size > 0; | |||
useEffect(() => { |
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 effect should be moved above line 43 so that it's below the existing hooks and above non-hooks.
isActive: boolean; | ||
} | ||
|
||
const SchemaHeader = styled(Header)<SchemaHeaderProps>` |
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 still exists over SCSS because Header is a styled component?
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.
yes
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.
😢
|
||
.headerCell { | ||
margin-right: variables.$spacing-xl; | ||
padding-right: 0 !important; |
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.
These !important in the file are because of styled components?
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.
yes
Looks like the unit tests are failing because of recent changes. Tested locally, I noticed one more thing in regards to when there is no primary key or cursor. Looks like the design has changed to provide an "not available" state |
…ons to use Formik state object instead of EditControlsServiceContext; Moves useEffect inside BulkEditServiceProvider; Fixes design of streams count number
…anel in case if pkType or cursorType are null, to show StreamPathSelect in case these values are null
@edmundito I updated currently, it looks like this in and what we need is this: another case is when we have should we have the same styles as when select is not available? just didn't find it in Figma |
export const pathDisplayName = (path: Path): string => path.join("."); | ||
|
||
export type IndexerType = null | "required" | "sourceDefined"; | ||
|
||
interface StreamPathSelectBaseProps { | ||
paths: Path[]; | ||
pathType: "required" | "sourceDefined"; | ||
pathType: "required" | "sourceDefined" | null; |
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.
pathType: "required" | "sourceDefined" | null; | |
pathType?: "required" | "sourceDefined"; |
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.
Changes look good. Discussed over Zoom that the state of the dropdowns will be updated separately. I left a couple of small notes, one should be fixed before merge.
const [selectedBatchNodes, { reset, toggle, add }] = useSet<string | undefined>(new Set()); | ||
const [options, setOptions] = useState<Partial<AirbyteStreamConfiguration>>(defaultOptions); | ||
|
||
const isActive = selectedBatchNodes.size > 0; | ||
useEffect(() => { | ||
setStatus({ editControlsVisible: !isActive }); |
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.
To be safe, the current status should be merge in case it's ever expanded.
setStatus({ ...status, editControlsVisible: !isActive });
# Conflicts: # airbyte-webapp/src/components/SimpleTableComponents/SimpleTableComponents.tsx # airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.module.scss # airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.tsx
…pe; Fixes Formik useStatus usage
# Conflicts: # airbyte-webapp/src/components/SimpleTableComponents/SimpleTableComponents.tsx # airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.module.scss # airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.tsx
# Conflicts: # airbyte-webapp/src/components/SimpleTableComponents/SimpleTableComponents.tsx # airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.module.scss # airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.tsx
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.
Overall - LGTM 👍
Need to fix some comments before merge.
const renderBulkEditPanel = async (): Promise<RenderResult> => { | ||
let renderResult: RenderResult; | ||
await act(async () => { | ||
renderResult = render( | ||
<IntlProvider locale="en" messages={en}> | ||
<BulkEditPanel /> | ||
</IntlProvider> | ||
); | ||
}); | ||
return renderResult!; | ||
}; |
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.
Can be simplified and doesn't throw any errors, so comment on the top can be removed
const renderBulkEditPanel = async (): Promise<RenderResult> => { | |
let renderResult: RenderResult; | |
await act(async () => { | |
renderResult = render( | |
<IntlProvider locale="en" messages={en}> | |
<BulkEditPanel /> | |
</IntlProvider> | |
); | |
}); | |
return renderResult!; | |
}; | |
const renderBulkEditPanel = () => | |
render( | |
<IntlProvider locale="en" messages={en}> | |
<BulkEditPanel /> | |
</IntlProvider> | |
); |
@@ -0,0 +1,230 @@ | |||
/* eslint-disable @typescript-eslint/no-non-null-assertion */ |
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.
can be removed after updating the renderBulkEditPanel function
isActive: boolean; | ||
} | ||
|
||
const SchemaHeader = styled(Header)<SchemaHeaderProps>` |
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.
😢
# Conflicts: # airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionReplicationTab.tsx
What
Related to #18188
How
This PR continues the development of the BulkEditPanel component. Initial PR #18262
This PR implements the latest Figma design updates. Still working on hiding action buttons for connections form, and need to implement tests for this component