-
Notifications
You must be signed in to change notification settings - Fork 2
Add connector status overview to entity details page #1535
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
Merged
kiahna-tucker
merged 9 commits into
main
from
kiahna-tucker/entity-status/init-connector-status
Apr 8, 2025
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0860617
Placeholder: create connector status overview card
kiahna-tucker 396f03c
Merge branch 'main' into kiahna-tucker/entity-status/init-connector-s…
kiahna-tucker 31804f9
Create connector status overview card
kiahna-tucker 9531655
Hide entity status section for non-support users
kiahna-tucker 844d466
Consolidate last updated status overview subheading ids
kiahna-tucker f9d70c0
Merge branch 'main' into kiahna-tucker/entity-status/init-connector-s…
kiahna-tucker 50af3c2
Add comment contextualizing the connector status indicator state
kiahna-tucker 69b63be
Fix linting issues after merging with main
kiahna-tucker bbbcd61
Hide connector status overview card for collections
kiahna-tucker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/components/shared/Entity/Details/Logs/Status/Overview/ConnectorOverview.tsx
This file contains hidden or 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,36 @@ | ||
import { Grid, Stack, Typography } from '@mui/material'; | ||
import CardWrapper from 'components/shared/CardWrapper'; | ||
import { cardHeaderSx } from 'context/Theme'; | ||
import { useIntl } from 'react-intl'; | ||
import ConnectorStatus from './ConnectorStatus'; | ||
import ConnectorStatusDetail from './ConnectorStatusDetail'; | ||
import ConnectorUpdatedDetail from './ConnectorUpdatedDetail'; | ||
|
||
export default function ConnectorOverview() { | ||
const intl = useIntl(); | ||
|
||
return ( | ||
<Grid item xs={12} md={6} lg={3}> | ||
<CardWrapper> | ||
<Stack | ||
direction="row" | ||
style={{ marginBottom: 16, marginLeft: -4 }} | ||
> | ||
<ConnectorStatus /> | ||
|
||
<Typography component="div" sx={{ ...cardHeaderSx, mr: 3 }}> | ||
{intl.formatMessage({ | ||
id: 'details.ops.status.overview.connector.header', | ||
})} | ||
</Typography> | ||
</Stack> | ||
|
||
<Stack spacing={2} style={{ marginLeft: 14 }}> | ||
<ConnectorStatusDetail headerMessageId="details.ops.status.overview.connector.subheaderLastStatus" /> | ||
|
||
<ConnectorUpdatedDetail headerMessageId="details.ops.status.overview.generic.subheaderLastUpdated" /> | ||
</Stack> | ||
</CardWrapper> | ||
</Grid> | ||
); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/components/shared/Entity/Details/Logs/Status/Overview/ConnectorStatus.tsx
This file contains hidden or 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,23 @@ | ||
import { useTheme } from '@mui/material'; | ||
import useGlobalSearchParams, { | ||
GlobalSearchParams, | ||
} from 'hooks/searchParams/useGlobalSearchParams'; | ||
import { useEntityStatusStore_singleResponse } from 'stores/EntityStatus/hooks'; | ||
import { getConnectorStatusIndicatorState } from 'utils/entityStatus-utils'; | ||
import StatusIndicator from './StatusIndicator'; | ||
|
||
export default function ConnectorStatus() { | ||
const catalogName = useGlobalSearchParams(GlobalSearchParams.CATALOG_NAME); | ||
|
||
const theme = useTheme(); | ||
|
||
const connectorStatus = | ||
useEntityStatusStore_singleResponse(catalogName)?.connector_status; | ||
|
||
const status = getConnectorStatusIndicatorState( | ||
theme.palette.mode, | ||
connectorStatus | ||
); | ||
|
||
return <StatusIndicator status={status} />; | ||
} |
31 changes: 31 additions & 0 deletions
31
src/components/shared/Entity/Details/Logs/Status/Overview/ConnectorStatusDetail.tsx
This file contains hidden or 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,31 @@ | ||
import { Skeleton, Typography } from '@mui/material'; | ||
import useGlobalSearchParams, { | ||
GlobalSearchParams, | ||
} from 'hooks/searchParams/useGlobalSearchParams'; | ||
import { useEntityStatusStore_singleResponse } from 'stores/EntityStatus/hooks'; | ||
import { useEntityStatusStore } from 'stores/EntityStatus/Store'; | ||
import DetailWrapper from './DetailWrapper'; | ||
import { BaseDetailProps } from './types'; | ||
|
||
export default function ConnectorStatusDetail({ | ||
headerMessageId, | ||
}: BaseDetailProps) { | ||
const catalogName = useGlobalSearchParams(GlobalSearchParams.CATALOG_NAME); | ||
|
||
const hydrating = useEntityStatusStore((state) => !state.hydrated); | ||
|
||
const lastStatus = | ||
useEntityStatusStore_singleResponse(catalogName)?.connector_status | ||
?.message; | ||
|
||
return ( | ||
<DetailWrapper | ||
headerMessageId={headerMessageId} | ||
Hydrating={ | ||
hydrating ? <Skeleton height={21} width={75} /> : undefined | ||
} | ||
> | ||
<Typography> {lastStatus ?? '--'} </Typography> | ||
</DetailWrapper> | ||
); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/components/shared/Entity/Details/Logs/Status/Overview/ConnectorUpdatedDetail.tsx
This file contains hidden or 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,19 @@ | ||
import useGlobalSearchParams, { | ||
GlobalSearchParams, | ||
} from 'hooks/searchParams/useGlobalSearchParams'; | ||
import { useEntityStatusStore_singleResponse } from 'stores/EntityStatus/hooks'; | ||
import TimestampDetail from './TimestampDetail'; | ||
import { BaseDetailProps } from './types'; | ||
|
||
export default function ConnectorUpdatedDetail({ | ||
headerMessageId, | ||
}: BaseDetailProps) { | ||
const catalogName = useGlobalSearchParams(GlobalSearchParams.CATALOG_NAME); | ||
|
||
const lastUpdated = | ||
useEntityStatusStore_singleResponse(catalogName)?.connector_status?.ts; | ||
|
||
return ( | ||
<TimestampDetail headerMessageId={headerMessageId} time={lastUpdated} /> | ||
); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.