-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Long source and destination names make the connection list table scro…
…ll horizontally - Removed styled-components - Refactored Table component - Added responsive columns - Created new cell components
- Loading branch information
Mark Berger
committed
Jan 26, 2023
1 parent
229d1c9
commit 6f0de4d
Showing
16 changed files
with
288 additions
and
217 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
14 changes: 14 additions & 0 deletions
14
airbyte-webapp/src/components/EntityTable/components/ConnectionStatusCell.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,14 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
$connector_icon_width: 20px; | ||
$connector_icon_margin: 10px; | ||
|
||
.content { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.text { | ||
width: calc(100% - #{$connector_icon_width + $connector_icon_margin}); | ||
} |
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
32 changes: 0 additions & 32 deletions
32
airbyte-webapp/src/components/EntityTable/components/ConnectorCell.tsx
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
airbyte-webapp/src/components/EntityTable/components/ConnectorNameCell.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,14 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
$status_icon_width: 25px; | ||
|
||
.content { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.text { | ||
width: calc(100% - #{$status_icon_width}); | ||
margin-left: variables.$spacing-md; | ||
} |
21 changes: 21 additions & 0 deletions
21
airbyte-webapp/src/components/EntityTable/components/ConnectorNameCell.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,21 @@ | ||
import React from "react"; | ||
|
||
import { ConnectorIcon } from "components/common/ConnectorIcon"; | ||
|
||
import styles from "./ConnectorNameCell.module.scss"; | ||
import { EntityNameCell } from "./EntityNameCell"; | ||
|
||
interface ConnectorNameCellProps { | ||
enabled: boolean; | ||
value: string; | ||
icon: string | undefined; | ||
} | ||
|
||
export const ConnectorNameCell: React.FC<ConnectorNameCellProps> = ({ value, enabled, icon }) => { | ||
return ( | ||
<div className={styles.content} title={value}> | ||
<ConnectorIcon icon={icon} /> | ||
<EntityNameCell className={styles.text} value={value} enabled={enabled} /> | ||
</div> | ||
); | ||
}; |
14 changes: 14 additions & 0 deletions
14
airbyte-webapp/src/components/EntityTable/components/EntityNameCell.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,14 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
.text { | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
font-weight: 500; | ||
color: colors.$grey; | ||
|
||
&.enabled { | ||
color: colors.$dark-blue; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
airbyte-webapp/src/components/EntityTable/components/EntityNameCell.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,20 @@ | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
|
||
import { Text } from "components/ui/Text"; | ||
|
||
import styles from "./EntityNameCell.module.scss"; | ||
|
||
interface EntityNameCellProps { | ||
value: string; | ||
enabled: boolean; | ||
className?: string; | ||
} | ||
|
||
export const EntityNameCell: React.FC<EntityNameCellProps> = ({ value, enabled, className }) => { | ||
return ( | ||
<Text className={classNames(styles.text, { [styles.enabled]: enabled }, className)} size="sm" title={value}> | ||
{value} | ||
</Text> | ||
); | ||
}; |
10 changes: 10 additions & 0 deletions
10
airbyte-webapp/src/components/EntityTable/components/FrequencyCell.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,10 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
.text { | ||
color: colors.$grey; | ||
|
||
&.enabled { | ||
color: colors.$dark-blue; | ||
} | ||
} |
22 changes: 10 additions & 12 deletions
22
airbyte-webapp/src/components/EntityTable/components/FrequencyCell.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 |
---|---|---|
@@ -1,36 +1,34 @@ | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
import styled from "styled-components"; | ||
|
||
import { Text } from "components/ui/Text"; | ||
|
||
import { ConnectionScheduleData, ConnectionScheduleType } from "core/request/AirbyteClient"; | ||
|
||
import styles from "./FrequencyCell.module.scss"; | ||
|
||
interface FrequencyCellProps { | ||
value: ConnectionScheduleData; | ||
enabled?: boolean; | ||
scheduleType?: ConnectionScheduleType; | ||
} | ||
|
||
const Content = styled.div<{ enabled?: boolean }>` | ||
color: ${({ theme, enabled }) => (!enabled ? theme.greyColor40 : "inherit")}; | ||
`; | ||
|
||
const FrequencyCell: React.FC<FrequencyCellProps> = ({ value, enabled, scheduleType }) => { | ||
export const FrequencyCell: React.FC<FrequencyCellProps> = ({ value, enabled, scheduleType }) => { | ||
if (scheduleType === ConnectionScheduleType.cron || scheduleType === ConnectionScheduleType.manual) { | ||
return ( | ||
<Content enabled={enabled}> | ||
<Text className={classNames(styles.text, { [styles.enabled]: enabled })} size="sm"> | ||
<FormattedMessage id={`frequency.${scheduleType}`} /> | ||
</Content> | ||
</Text> | ||
); | ||
} | ||
|
||
return ( | ||
<Content enabled={enabled}> | ||
<Text className={classNames(styles.text, { [styles.enabled]: enabled })} size="sm"> | ||
<FormattedMessage | ||
id={`frequency.${value ? value.basicSchedule?.timeUnit : "manual"}`} | ||
values={{ value: value.basicSchedule?.units }} | ||
/> | ||
</Content> | ||
</Text> | ||
); | ||
}; | ||
|
||
export default FrequencyCell; |
10 changes: 10 additions & 0 deletions
10
airbyte-webapp/src/components/EntityTable/components/LastSyncCell.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,10 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
.text { | ||
color: colors.$grey; | ||
|
||
&.enabled { | ||
color: colors.$dark-blue; | ||
} | ||
} |
28 changes: 13 additions & 15 deletions
28
airbyte-webapp/src/components/EntityTable/components/LastSyncCell.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 |
---|---|---|
@@ -1,26 +1,24 @@ | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
import { FormattedRelativeTime } from "react-intl"; | ||
import styled from "styled-components"; | ||
|
||
const Content = styled.div<{ enabled?: boolean }>` | ||
color: ${({ theme, enabled }) => (!enabled ? theme.greyColor40 : "inherit")}; | ||
`; | ||
import { Text } from "components/ui/Text"; | ||
|
||
interface IProps { | ||
import styles from "./LastSyncCell.module.scss"; | ||
|
||
interface LastSyncCellProps { | ||
timeInSecond: number; | ||
enabled?: boolean; | ||
} | ||
|
||
const LastSyncCell: React.FC<IProps> = ({ timeInSecond, enabled }) => { | ||
if (!timeInSecond) { | ||
return null; | ||
} | ||
|
||
export const LastSyncCell: React.FC<LastSyncCellProps> = ({ timeInSecond, enabled }) => { | ||
return ( | ||
<Content enabled={enabled}> | ||
<FormattedRelativeTime value={timeInSecond - Date.now() / 1000} updateIntervalInSeconds={60} /> | ||
</Content> | ||
<> | ||
{timeInSecond ? ( | ||
<Text className={classNames(styles.text, { [styles.enabled]: enabled })} size="sm"> | ||
<FormattedRelativeTime value={timeInSecond - Date.now() / 1000} updateIntervalInSeconds={60} /> | ||
</Text> | ||
) : null} | ||
</> | ||
); | ||
}; | ||
|
||
export default LastSyncCell; |
Oops, something went wrong.