-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃獰 馃帹 Row highlighting for new streams table (#19449)
* initial pass and cleanup * merge cleanup * get dropdowns colored correctly also * colors for modificationIcon * icon alignment * testing skeleton * move calculation to a hook * update hover styles on rows with changes * add testing Co-authored-by: Krishna (kc) Glick <krishnaglick@users.noreply.github.com> * clarify naming * add mixin, fix selected added/removed rows * WIP test icons using snapshots * fix snapshots, tests for catalog tree table row hook * fix order of logic for disabled rows (disabled trumps everything) * Update airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com> * move icon to its own component, clean up tests * tidy up test linting disables * Update airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.tsx Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io> * Update airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.tsx Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io> * Update airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.tsx Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io> * Update airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io> * Update airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io> * clean up tests * make path-select dropdown full column width * cleanup from rebase Co-authored-by: Krishna (kc) Glick <krishnaglick@users.noreply.github.com> Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com> Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io>
- Loading branch information
1 parent
6b39a1a
commit 7810c92
Showing
11 changed files
with
349 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...yte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRowIcon.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@use "scss/colors"; | ||
|
||
.icon { | ||
margin-right: 7px; | ||
|
||
&.plus { | ||
color: colors.$green; | ||
} | ||
|
||
&.minus { | ||
color: colors.$red; | ||
} | ||
|
||
&.changed { | ||
color: colors.$blue; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
} | ||
} | ||
|
||
:export { | ||
modificationIconColor: colors.$blue; | ||
} |
42 changes: 42 additions & 0 deletions
42
airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRowIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import classNames from "classnames"; | ||
|
||
import { ModificationIcon } from "components/icons/ModificationIcon"; | ||
|
||
import { SyncSchemaStream } from "core/domain/catalog"; | ||
|
||
import styles from "./CatalogTreeTableRowIcon.module.scss"; | ||
import { useCatalogTreeTableRowProps } from "./useCatalogTreeTableRowProps"; | ||
|
||
interface CatalogTreeTableRowIconProps { | ||
stream: SyncSchemaStream; | ||
} | ||
export const CatalogTreeTableRowIcon: React.FC<CatalogTreeTableRowIconProps> = ({ stream }) => { | ||
const { statusToDisplay, isSelected } = useCatalogTreeTableRowProps(stream); | ||
|
||
if (statusToDisplay === "added") { | ||
return ( | ||
<FontAwesomeIcon | ||
icon={faPlus} | ||
size="2x" | ||
className={classNames(styles.icon, { [styles.plus]: !isSelected, [styles.changed]: isSelected })} | ||
/> | ||
); | ||
} else if (statusToDisplay === "removed") { | ||
return ( | ||
<FontAwesomeIcon | ||
icon={faMinus} | ||
size="2x" | ||
className={classNames(styles.icon, { [styles.minus]: !isSelected, [styles.changed]: isSelected })} | ||
/> | ||
); | ||
} else if (statusToDisplay === "changed") { | ||
return ( | ||
<div className={classNames(styles.icon, styles.changed)}> | ||
<ModificationIcon color={styles.modificationIconColor} /> | ||
</div> | ||
); | ||
} | ||
return <div />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.