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

[v16] Web UI tweaks #42502

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ export function EnrollRdsDatabase() {
<ToggleSection
wantAutoDiscover={wantAutoDiscover}
toggleWantAutoDiscover={() => setWantAutoDiscover(b => !b)}
isDisabled={tableData.items.length === 0}
discoveryGroupName={discoveryGroupName}
setDiscoveryGroupName={setDiscoveryGroupName}
clusterPublicUrl={ctx.storeUser.state.cluster.publicURL}
Expand Down Expand Up @@ -443,25 +442,19 @@ function getRdsEngineIdentifier(engine: DatabaseEngine): RdsEngineIdentifier {
function ToggleSection({
wantAutoDiscover,
toggleWantAutoDiscover,
isDisabled,
discoveryGroupName,
setDiscoveryGroupName,
clusterPublicUrl,
}: {
wantAutoDiscover: boolean;
isDisabled: boolean;
toggleWantAutoDiscover(): void;
discoveryGroupName: string;
setDiscoveryGroupName(n: string): void;
clusterPublicUrl: string;
}) {
return (
<Box mb={2}>
<Toggle
isToggled={wantAutoDiscover}
onToggle={toggleWantAutoDiscover}
disabled={isDisabled}
>
<Toggle isToggled={wantAutoDiscover} onToggle={toggleWantAutoDiscover}>
<Box ml={2} mr={1}>
Auto-enroll all databases for selected region
</Box>
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Integrations/Enroll/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const IntegrationTile = styled(Flex)`
cursor: pointer;
${props => {
const pointerEvents = props.disabled || props.$exists ? 'none' : null;
const pointerEvents = props.disabled || props.$exists ? 'none' : 'auto';
if (props.$exists) {
return { pointerEvents };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export function ServerSideSupportedList(props: CommonListProps) {
}

const table = useMemo(() => {
// If there is a fetchStatus, a fetching is going on.
// Show the loading indicator instead of trying to process previous data.
const resources = fetchStatus === 'loading' ? [] : fetchedData.agents;
const listProps: ServerSideListProps = {
fetchStatus,
customSort: {
Expand All @@ -120,21 +123,17 @@ export function ServerSideSupportedList(props: CommonListProps) {

switch (props.selectedResourceKind) {
case 'role':
return (
<Roles roles={fetchedData.agents as RoleResource[]} {...listProps} />
);
return <Roles roles={resources as RoleResource[]} {...listProps} />;
case 'node':
return <Nodes nodes={fetchedData.agents as Node[]} {...listProps} />;
return <Nodes nodes={resources as Node[]} {...listProps} />;
case 'windows_desktop':
return (
<Desktops desktops={fetchedData.agents as Desktop[]} {...listProps} />
);
return <Desktops desktops={resources as Desktop[]} {...listProps} />;
default:
console.error(
`[ServerSideSupportedList.tsx] table not defined for resource kind ${props.selectedResourceKind}`
);
}
}, [props.attempt, fetchedData, fetchStatus, props.selectedResources]);
}, [fetchedData, fetchStatus, props.selectedResources]);

return (
<TableWrapper
Expand Down
Loading