-
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.
Jamakase/update connector version (#2462)
* Add indicator * Add current and latest version to tables * Add latest note * Show indicator in sidebar * Add improvements to useNotification hook
- Loading branch information
Showing
12 changed files
with
251 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import styled from "styled-components"; | ||
|
||
const Indicator = styled.div` | ||
height: 10px; | ||
width: 10px; | ||
border-radius: 50%; | ||
background: ${({ theme }) => theme.dangerColor}; | ||
`; | ||
|
||
export default Indicator; |
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,4 @@ | ||
import Indicator from "./Indicator"; | ||
|
||
export default Indicator; | ||
export { Indicator }; |
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
44 changes: 44 additions & 0 deletions
44
airbyte-webapp/src/components/hooks/services/useNotification.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,44 @@ | ||
import { useResource } from "rest-hooks"; | ||
import config from "config"; | ||
import { useMemo } from "react"; | ||
|
||
import SourceDefinitionResource from "../../../core/resources/SourceDefinition"; | ||
import DestinationDefinitionResource from "../../../core/resources/DestinationDefinition"; | ||
|
||
type NotificationService = { | ||
hasNewVersions: boolean; | ||
}; | ||
|
||
const useNotification = (): NotificationService => { | ||
const { sourceDefinitions } = useResource( | ||
SourceDefinitionResource.listShape(), | ||
{ | ||
workspaceId: config.ui.workspaceId, | ||
} | ||
); | ||
const { destinationDefinitions } = useResource( | ||
DestinationDefinitionResource.listShape(), | ||
{ | ||
workspaceId: config.ui.workspaceId, | ||
} | ||
); | ||
|
||
const hasNewVersions = useMemo(() => { | ||
const hasNewSourceVersion = sourceDefinitions.some( | ||
(source) => source.latestDockerImageTag !== source.dockerImageTag | ||
); | ||
|
||
const hasNewDestinationVersion = destinationDefinitions.some( | ||
(destination) => | ||
destination.latestDockerImageTag !== destination.dockerImageTag | ||
); | ||
|
||
return hasNewSourceVersion || hasNewDestinationVersion; | ||
}, [sourceDefinitions, destinationDefinitions]); | ||
|
||
return { | ||
hasNewVersions, | ||
}; | ||
}; | ||
|
||
export default useNotification; |
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
11 changes: 10 additions & 1 deletion
11
airbyte-webapp/src/pages/AdminPage/components/ConnectorCell.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
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.