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

Refactor & convert PageTitle to SCSS #17139

Merged
merged 14 commits into from
Sep 30, 2022
Merged

Conversation

natalyjazzviolin
Copy link
Contributor

@natalyjazzviolin natalyjazzviolin commented Sep 26, 2022

What

Closes #1569

How

  • Converts the PageTitle from styled components to SCSS.
  • This should not cause any UI changes. Example of a PageTitle component is below (Destinations & New Destination button):

Screen Shot 2022-09-26 at 9 54 18 AM

Recommended reading order

  1. airbyte-webapp/src/components/PageTitle/PageTitle.tsx
  2. airbyte-webapp/src/components/PageTitle/PageTitle.module.scss

@natalyjazzviolin natalyjazzviolin requested a review from a team as a code owner September 26, 2022 12:26
@natalyjazzviolin natalyjazzviolin marked this pull request as draft September 26, 2022 12:26
@github-actions github-actions bot added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Sep 26, 2022
@natalyjazzviolin natalyjazzviolin marked this pull request as ready for review September 26, 2022 14:06
@natalyjazzviolin natalyjazzviolin changed the title Refactor & convertPageTitle to SCSS Refactor & convert PageTitle to SCSS Sep 26, 2022
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.

Screen Shot 2022-09-26 at 10 12 19 AM
The Connection string is smaller now. I think fixing my comment may remedy this.

"lockfileVersion": 2,
"requires": true,
"packages": {}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks to have been generated in error and should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

<MainContainer withLine={withLine}>
<TitleBlock>{title}</TitleBlock>
<div className={classNames(styles.container)} data-withLine={withLine}>
<H3
Copy link
Contributor

@krishnaglick krishnaglick Sep 26, 2022

Choose a reason for hiding this comment

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

This H3 is deprecated.
/** @deprecated Use `<Text as="h1 | h2 | h3 | h4 | h5" size="md" />` */

{middleTitleBlock ? (
<MiddleTitleBlock>{middleTitleBlock}</MiddleTitleBlock>
<Text as="h3" size="md" className={classNames(styles.middleTitleBlock)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is the page title, we should use "h1" instead of "h3"

overflow: hidden;
text-overflow: ellipsis;
`;

const PageTitle: React.FC<PageTitleProps> = ({ title, withLine, middleComponent, middleTitleBlock, endComponent }) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

This component should be named PageHeader and moved to src/components/ui/
Can you also add a storybook file?

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 added a storybook file with a Primary story. I wasn't sure of the best way to implement the 'middle' component in a story as it needs to hold state, if that needs to be included in this PR - happy to do it, but need more direction :)

Comment on lines 1 to 4
import PageHeader from "./PageHeader";

export default PageHeader;
export { PageHeader };
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import PageHeader from "./PageHeader";
export default PageHeader;
export { PageHeader };
export * from "./PageHeader";

title: React.ReactNode;
}

const PageHeader: React.FC<PageHeaderProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const PageHeader: React.FC<PageHeaderProps> = ({
export const PageHeader: React.FC<PageHeaderProps> = ({

</div>
);

export default PageHeader;
Copy link
Contributor

Choose a reason for hiding this comment

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

The codebase is moving away from using the default export

Suggested change
export default PageHeader;

@natalyjazzviolin natalyjazzviolin marked this pull request as draft September 29, 2022 20:03
@natalyjazzviolin
Copy link
Contributor Author

@krishnaglick I compared just to make sure, looks the same to me at this point:

Cloud:
Screen Shot 2022-09-30 at 1 59 59 PM

This branch:
Screen Shot 2022-09-30 at 2 00 20 PM

@natalyjazzviolin natalyjazzviolin marked this pull request as ready for review September 30, 2022 18:11
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.

One last comment then LGTM

Comment on lines 1 to 4
import { PageHeader } from "./PageHeader";

export default PageHeader;
export { PageHeader };
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { PageHeader } from "./PageHeader";
export default PageHeader;
export { PageHeader };
export * from "./PageHeader";

@natalyjazzviolin natalyjazzviolin merged commit 0daa9f2 into master Sep 30, 2022
@natalyjazzviolin natalyjazzviolin deleted the nataly-update-pageTitle branch September 30, 2022 20:16
letiescanciano added a commit that referenced this pull request Oct 3, 2022
…ations

* master: (75 commits)
  source-sentry: migrate to per-stream states (#17466)
  Greg/clickhouse polishing (#17483)
  upgrade debezium version to 1.9.6 (#17459)
  🐛 Source Twilio: Lookback_window config (#17478)
  hide S3 source connector from catalog (#17472)
  🪟 Migrate styles for Connection-related Components (#17339)
  Added new title (#17480)
  Refactor & convert `PageTitle` to SCSS (#17139)
  updated releaseStage for zendesk-talk (#17477)
  [low-code] Apply log level to stream loggers (#17284)
  🐛 Source Salesforce: filter out objects not supported by the Bulk API (#17453)
  Source Marketo: certify GA (#17445)
  Update greenhouse paginator (#17429)
  Add some services start validation to acceptance_tests.sh (#17425)
  📖 Removes $ from terminal commands to allow direct copying. (#17467)
  migrate source GA connectors to per-stream states (2) (#17410)
  Source Klaviyo: bump CDK dependency (#17422)
  Source Pinterest: change releaseStage to GA (#17045)
  Source Pinterest: Set start_date dynamically based on API restrictions for lookup (#17387)
  updated releaseStage to generally_available (#17374)
  ...
letiescanciano added a commit that referenced this pull request Oct 3, 2022
* master:
  source-sentry: migrate to per-stream states (#17466)
  Greg/clickhouse polishing (#17483)
  upgrade debezium version to 1.9.6 (#17459)
  🐛 Source Twilio: Lookback_window config (#17478)
  hide S3 source connector from catalog (#17472)
  🪟 Migrate styles for Connection-related Components (#17339)
  Added new title (#17480)
  Refactor & convert `PageTitle` to SCSS (#17139)
  updated releaseStage for zendesk-talk (#17477)
  [low-code] Apply log level to stream loggers (#17284)
  🐛 Source Salesforce: filter out objects not supported by the Bulk API (#17453)
  Source Marketo: certify GA (#17445)
  Update greenhouse paginator (#17429)
  Add some services start validation to acceptance_tests.sh (#17425)
  📖 Removes $ from terminal commands to allow direct copying. (#17467)
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
* Converts PageTitle from styled components to SCSS.

* Delete package-lock.json

* Swapped deprecated H3 for Text base component.

* Renames and moves the PageTitle component.

* Adds primary story.

* Removes PageTitle component.

* Regenerates failing snapshot tests.

* Requested changes.
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 page headers to align with the current designs
3 participants