Skip to content

Commit deedeb7

Browse files
authored
WebUI: Align integration and plugin tiles (#49029)
* align integration and plugin tiles * update integrationtile test
1 parent 9356889 commit deedeb7

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('render', async () => {
3131
</MemoryRouter>
3232
);
3333

34-
expect(screen.getByText(/amazon web services/i)).toBeInTheDocument();
34+
expect(screen.getByText(/AWS OIDC Identity Provider/i)).toBeInTheDocument();
3535
expect(screen.queryByText(/no permission/i)).not.toBeInTheDocument();
3636
expect(screen.getAllByTestId('res-icon-aws')).toHaveLength(2);
3737
expect(screen.getAllByRole('link')).toHaveLength(2);

web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import React from 'react';
2020
import { Link } from 'react-router-dom';
21-
import { Text, Box, ResourceIcon } from 'design';
21+
import { Text, Flex } from 'design';
2222

2323
import cfg from 'teleport/config';
2424
import {
@@ -27,7 +27,7 @@ import {
2727
} from 'teleport/components/ToolTipNoPermBadge';
2828
import { IntegrationKind } from 'teleport/services/integrations';
2929

30-
import { IntegrationTile } from './common';
30+
import { IntegrationTile, IntegrationIcon } from './common';
3131

3232
export function IntegrationTiles({
3333
hasIntegrationAccess = true,
@@ -52,14 +52,12 @@ export function IntegrationTiles({
5252
}
5353
data-testid="tile-aws-oidc"
5454
>
55-
<Box mt={3} mb={2}>
56-
<ResourceIcon name="aws" width="80px" />
57-
</Box>
58-
<Text>
59-
Amazon Web Services
60-
<br />
61-
OIDC
62-
</Text>
55+
<Flex flexBasis={100}>
56+
<IntegrationIcon name="aws" />
57+
</Flex>
58+
<Flex flexBasis={50}>
59+
<Text>AWS OIDC Identity Provider</Text>
60+
</Flex>
6361
{!hasIntegrationAccess && (
6462
<ToolTipNoPermBadge
6563
children={
@@ -85,10 +83,12 @@ export function IntegrationTiles({
8583
}
8684
data-testid="tile-external-audit-storage"
8785
>
88-
<Box mt={3} mb={2}>
89-
<ResourceIcon name="aws" width="80px" />
90-
</Box>
91-
<Text>AWS External Audit Storage</Text>
86+
<Flex flexBasis={100}>
87+
<IntegrationIcon name="aws" />
88+
</Flex>
89+
<Flex flexBasis={50}>
90+
<Text>AWS External Audit Storage</Text>
91+
</Flex>
9292
{renderExternalAuditStorageBadge(
9393
hasExternalAuditStorage,
9494
externalAuditStorageEnabled

web/packages/teleport/src/Integrations/Enroll/common.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import React from 'react';
20-
import { Box, Flex, H2 } from 'design';
20+
import { Box, Flex, H2, ResourceIcon } from 'design';
2121
import styled from 'styled-components';
2222
import { P } from 'design/Text/Text';
2323

@@ -29,8 +29,10 @@ export const IntegrationTile = styled(Flex)<{
2929
text-decoration: none;
3030
flex-direction: column;
3131
align-items: center;
32+
justify-content: center;
3233
position: relative;
3334
border-radius: 4px;
35+
padding: 15px 10px 6px 10px;
3436
height: 170px;
3537
width: 170px;
3638
background-color: ${({ theme }) => theme.colors.buttons.secondary.default};
@@ -60,3 +62,17 @@ export const NoCodeIntegrationDescription = () => (
6062
</P>
6163
</Box>
6264
);
65+
66+
/**
67+
* IntegrationIcon wraps ResourceIcon with css required for integration
68+
* and plugin tiles.
69+
*/
70+
export const IntegrationIcon = styled(ResourceIcon)<{ size?: number }>`
71+
display: inline-block;
72+
height: 100%;
73+
${({ size }) =>
74+
size &&
75+
`
76+
max-height: ${size}px;
77+
`}
78+
`;

0 commit comments

Comments
 (0)