Skip to content

Commit 81598bd

Browse files
ajay-sentryandrewshie-sentry
authored andcommitted
chore(prevent): Repo token table polish (#97538)
This PR fixes some repo token table styling so it looks a little more responsive. Will add a video on slack thread Also uses some of the new sentry components rather than what I had prior Closes https://linear.app/getsentry/issue/CCMRG-1336/token-gen-page-polish <!-- Sentry employees and contractors can delete or ignore the following. --> ### Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
1 parent 1adde18 commit 81598bd

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

static/app/views/codecov/tokens/repoTokenTable/repoTokenTable.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import GridEditable, {type GridColumnHeader} from 'sentry/components/tables/gridEditable';
1+
import GridEditable, {
2+
COL_WIDTH_UNDEFINED,
3+
type GridColumnHeader,
4+
} from 'sentry/components/tables/gridEditable';
25
import {t} from 'sentry/locale';
36
import type {Sort} from 'sentry/utils/discover/fields';
47
import {renderTableBody} from 'sentry/views/codecov/tokens/repoTokenTable/tableBody';
@@ -9,7 +12,7 @@ type RepoTokenTableResponse = {
912
token: string;
1013
};
1114

12-
export type Row = Pick<RepoTokenTableResponse, 'name' | 'token'>;
15+
export type Row = RepoTokenTableResponse;
1316
export type Column = GridColumnHeader<'name' | 'token' | 'regenerateToken'>;
1417

1518
type ValidField = (typeof SORTABLE_FIELDS)[number];
@@ -23,8 +26,8 @@ export type ValidSort = Sort & {
2326
};
2427

2528
const COLUMNS_ORDER: Column[] = [
26-
{key: 'name', name: t('Repository Name'), width: 400},
27-
{key: 'token', name: t('Token'), width: 350},
29+
{key: 'name', name: t('Repository Name'), width: COL_WIDTH_UNDEFINED},
30+
{key: 'token', name: t('Token'), width: COL_WIDTH_UNDEFINED},
2831
{key: 'regenerateToken', name: '', width: 100},
2932
];
3033

static/app/views/codecov/tokens/tokens.tsx

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import styled from '@emotion/styled';
44
import {useCodecovContext} from 'sentry/components/codecov/context/codecovContext';
55
import {IntegratedOrgSelector} from 'sentry/components/codecov/integratedOrgSelector/integratedOrgSelector';
66
import {integratedOrgIdToName} from 'sentry/components/codecov/integratedOrgSelector/utils';
7-
import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
7+
import {Flex} from 'sentry/components/core/layout/flex';
8+
import {Text} from 'sentry/components/core/text';
89
import Pagination from 'sentry/components/pagination';
9-
import {t} from 'sentry/locale';
10-
import {space} from 'sentry/styles/space';
10+
import {t, tct} from 'sentry/locale';
1111
import type {Integration} from 'sentry/types/integrations';
1212
import {useApiQuery} from 'sentry/utils/queryClient';
1313
import {decodeSorts} from 'sentry/utils/queryString';
@@ -72,36 +72,30 @@ export default function TokensPage() {
7272
);
7373

7474
return (
75-
<LayoutGap>
76-
<PageFilterBar condensed>
77-
<IntegratedOrgSelector />
78-
</PageFilterBar>
75+
<Flex direction="column" gap="xl" maxWidth="1000px">
76+
<IntegratedOrgSelector />
7977
<HeaderValue>{t('Repository tokens')}</HeaderValue>
80-
<p>
81-
{t('View the list of tokens created for your repositories in')}{' '}
82-
<strong>{integratedOrgIdToName(integratedOrgId, integrations)}</strong>.{' '}
83-
{t("Use them for uploading reports to all Sentry Prevent's features.")}
84-
</p>
78+
<Text>
79+
{tct(
80+
`View the list of tokens created for your repositories in [org]. Use them for uploading reports to all Sentry Prevent's features.`,
81+
{
82+
org: <Text bold>{integratedOrgIdToName(integratedOrgId, integrations)}</Text>,
83+
}
84+
)}
85+
</Text>
8586
<RepoTokenTable response={response} sort={sorts[0]} />
8687
{/* We don't need to use the pageLinks prop because Codecov handles pagination using our own cursor implementation. But we need to
8788
put a dummy value here because otherwise the component wouldn't render. */}
8889
<StyledPagination pageLinks="showComponent" onCursor={handleCursor} />
89-
</LayoutGap>
90+
</Flex>
9091
);
9192
}
9293

93-
const LayoutGap = styled('div')`
94-
display: grid;
95-
gap: ${space(1)};
96-
max-width: 1000px;
97-
`;
98-
9994
const HeaderValue = styled('div')`
100-
margin-top: ${space(4)};
101-
font-size: ${p => p.theme.headerFontSize};
95+
font-size: ${p => p.theme.fontSize['2xl']};
10296
font-weight: ${p => p.theme.fontWeight.bold};
10397
`;
10498

10599
const StyledPagination = styled(Pagination)`
106-
margin-top: 0px;
100+
margin: 0px;
107101
`;

0 commit comments

Comments
 (0)