Skip to content
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

🪟 🎨 Refining BulkEditPanel component #20474

Merged
merged 16 commits into from
Jan 10, 2023

Conversation

YatsukBogdan1
Copy link
Contributor

@YatsukBogdan1 YatsukBogdan1 commented Dec 14, 2022

What

Closes #20372
Closes #20731

How

  • Updates rendering logic, for the cases while Primary Key or Cursor is not available or defined by source
  • We also had discussion with @edmundito that Switch styling will be done in separate PR

Screenshots

Screenshot 2022-12-14 at 16 24 30

Screenshot 2022-12-14 at 16 24 37

Screenshot 2022-12-22 at 15 18 27
Screenshot 2022-12-22 at 15 18 31
Screenshot 2022-12-22 at 15 18 48

@YatsukBogdan1 YatsukBogdan1 requested a review from a team as a code owner December 14, 2022 14:26
@YatsukBogdan1 YatsukBogdan1 requested review from dizel852 and matter-q and removed request for a team December 14, 2022 14:27
@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Dec 14, 2022
@teallarson
Copy link
Contributor

the cases while Primary Key or Cursor is not available

Would that be in cases where all of the selected streams do not have at least one column with the same name? Are there any other cases?

@krishnaglick
Copy link
Contributor

Failing snapshot tests :)

Copy link
Contributor

@krishnaglick krishnaglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this PR have more tests added?

);
node = props.isMulti ? props.path.map(pathDisplayName).join(", ") : pathDisplayName(props.path);
} else {
node = <FormattedMessage id="connection.catalogTree.sourceDefined" />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This could be in a useMemo

@YatsukBogdan1
Copy link
Contributor Author

YatsukBogdan1 commented Dec 20, 2022

the cases while Primary Key or Cursor is not available

Would that be in cases where all of the selected streams do not have at least one column with the same name? Are there any other cases?

@tealjulia for now we decided to put only design updates in this PR, and keep any logic updates in separate one

Should this PR have more tests added?

@krishnaglick as we discussed on the stand up yesterday, the component itself is dumb, and just renders what is passed from useBulkEditService hook, so the component itself is tested, and lets keep any tests related to the logic, into another PR

Copy link
Contributor

@edmundito edmundito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-tested again and did notice a discrepancy in the table itself. It looks like the non-selectable values have a background, but that only applies to the bulk edit

Here you can see that id is not selectable but it has the pill background around it
Screen Shot 2022-12-21 at 16 23 58

But this is really similar to what's needed in #20731

@YatsukBogdan1
Copy link
Contributor Author

@edmundito I updated table row cursor and primary key as you suggested

Screenshot 2022-12-22 at 15 18 27
Screenshot 2022-12-22 at 15 18 31
Screenshot 2022-12-22 at 15 18 48

…ty pillIfChangeUnavailable for cases when we need or not to render pill under unavailable to change path text
@YatsukBogdan1
Copy link
Contributor Author

Added a few more updates:

  • removed animation for <BulkEditPanel />
  • added <StreamPathSelect /> new property pillIfChangeUnavailable for cases when we need or not to render pill under unavailable to change path text

image

@edmundito
Copy link
Contributor

@YatsukBogdan1 Just checked the latest changes and I noticed that what I see doesn't match the screenshot int he previous comment.
Screen Shot 2023-01-03 at 14 39 05

@YatsukBogdan1
Copy link
Contributor Author

updated PR with next changes:

  • disables pointer events for PillButton component while disabled: true

Copy link
Contributor

@edmundito edmundito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and the functionality looks good but had some comments about the implmentation.

@@ -34,7 +36,7 @@ export const PillSelect: React.FC<PillSelectProps> = ({ className, ...props }) =
active={isOpen}
className={className}
>
{label}
{disabled ? <FormattedMessage id="connectionForm.bulkEdit.pillButtonLabel.notAvailable" /> : label}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This formatted message is part of the connection form, but this component is part of the UI, so it crosses different domains. We're not sure if the default behavior for disabled is always to say "not available"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edmundito I added renderDisabledState: () => React.ReactNode property for PillSelect, so now, when disabled: true, the content can be controlled from different application parts. please let me know if this looks good to you

Comment on lines +55 to +57
<PillButton disabled variant={variant} className={styles.streamPathSelect}>
{SourceDefinedNode}
</PillButton>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my comment on PillSelect, this code could be used to render when selecting the path is not available, instead of having to modify the PillButton.

# Conflicts:
#	airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.tsx
#	airbyte-webapp/src/components/ui/PillSelect/PillSelect.tsx
Copy link
Contributor

@edmundito edmundito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested locally.

@YatsukBogdan1 YatsukBogdan1 merged commit 94fcb13 into master Jan 10, 2023
@YatsukBogdan1 YatsukBogdan1 deleted the byatsuk/feature-bulk-edit-panel-refining branch January 10, 2023 11:51
jbfbell pushed a commit that referenced this pull request Jan 13, 2023
* Adds handling for source defined and unavailable stream paths inside PillSelect

* Adds handling of unavailable cursor and primary key field for PillButton components

* Adds useMemo to SyncPathSelect component

* Add InfoText component for cursor field and primary key to match table design in Figma

* Removes animation for BulkEditPanel; Adds StreamPathSelect new property pillIfChangeUnavailable for cases when we need or not to render pill under unavailable to change path text

* Disables pointer event while PillButton is disabled

* Adds renderDisabledState property to control PillSelect content while disabled

* Changes renderDisabledState -> disabledLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update source defined cursor and primary key to match selected color New Bulk Edit Panel changes
5 participants