remove IS_API_KEY_ROLES_ENABLED feature flag (#14366)
This commit is contained in:
+5
-12
@@ -7,10 +7,9 @@ import {
|
||||
} from '@/settings/developers/utils/formatExpiration';
|
||||
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
||||
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { IconChevronRight } from 'twenty-ui/display';
|
||||
import { MOBILE_VIEWPORT } from 'twenty-ui/theme';
|
||||
import { type ApiKey, FeatureFlagKey } from '~/generated-metadata/graphql';
|
||||
import { type ApiKey } from '~/generated-metadata/graphql';
|
||||
|
||||
export const StyledApisFieldTableRow = styled(TableRow)`
|
||||
@media (max-width: ${MOBILE_VIEWPORT}px) {
|
||||
@@ -47,11 +46,7 @@ export const SettingsApiKeysFieldItemTableRow = ({
|
||||
const theme = useTheme();
|
||||
const formattedExpiration = formatExpiration(apiKey.expiresAt || null);
|
||||
|
||||
const isApiKeyRolesEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_API_KEY_ROLES_ENABLED,
|
||||
);
|
||||
|
||||
const gridColumns = isApiKeyRolesEnabled ? '5fr 2fr 3fr 1fr' : '5fr 3fr 1fr';
|
||||
const gridColumns = '5fr 2fr 3fr 1fr';
|
||||
|
||||
return (
|
||||
<StyledApisFieldTableRow gridAutoColumns={gridColumns} to={to}>
|
||||
@@ -59,11 +54,9 @@ export const SettingsApiKeysFieldItemTableRow = ({
|
||||
<StyledEllipsisLabel>{apiKey.name}</StyledEllipsisLabel>
|
||||
</StyledTruncatedCell>
|
||||
|
||||
{isApiKeyRolesEnabled && (
|
||||
<StyledTruncatedCell color={theme.font.color.tertiary}>
|
||||
<StyledEllipsisLabel>{apiKey.role?.label || '-'}</StyledEllipsisLabel>
|
||||
</StyledTruncatedCell>
|
||||
)}
|
||||
<StyledTruncatedCell color={theme.font.color.tertiary}>
|
||||
<StyledEllipsisLabel>{apiKey.role?.label || '-'}</StyledEllipsisLabel>
|
||||
</StyledTruncatedCell>
|
||||
|
||||
<StyledTruncatedCell
|
||||
color={
|
||||
|
||||
+5
-17
@@ -3,32 +3,22 @@ import { Table } from '@/ui/layout/table/components/Table';
|
||||
import { TableBody } from '@/ui/layout/table/components/TableBody';
|
||||
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
|
||||
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import styled from '@emotion/styled';
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { SettingsPath } from 'twenty-shared/types';
|
||||
import { getSettingsPath } from 'twenty-shared/utils';
|
||||
import {
|
||||
FeatureFlagKey,
|
||||
useGetApiKeysQuery,
|
||||
} from '~/generated-metadata/graphql';
|
||||
import { useGetApiKeysQuery } from '~/generated-metadata/graphql';
|
||||
|
||||
const StyledTableBody = styled(TableBody)`
|
||||
border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
|
||||
`;
|
||||
|
||||
export const SettingsApiKeysTable = () => {
|
||||
const isApiKeyRolesEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_API_KEY_ROLES_ENABLED,
|
||||
);
|
||||
|
||||
const { data: apiKeysData } = useGetApiKeysQuery();
|
||||
|
||||
const apiKeys = apiKeysData?.apiKeys;
|
||||
|
||||
const gridAutoColumns = isApiKeyRolesEnabled
|
||||
? '5fr 2fr 3fr 1fr'
|
||||
: '5fr 3fr 1fr';
|
||||
const gridAutoColumns = '5fr 2fr 3fr 1fr';
|
||||
|
||||
return (
|
||||
<Table>
|
||||
@@ -36,11 +26,9 @@ export const SettingsApiKeysTable = () => {
|
||||
<TableHeader>
|
||||
<Trans>Name</Trans>
|
||||
</TableHeader>
|
||||
{isApiKeyRolesEnabled && (
|
||||
<TableHeader>
|
||||
<Trans>Role</Trans>
|
||||
</TableHeader>
|
||||
)}
|
||||
<TableHeader>
|
||||
<Trans>Role</Trans>
|
||||
</TableHeader>
|
||||
<TableHeader>
|
||||
<Trans>Expiration</Trans>
|
||||
</TableHeader>
|
||||
|
||||
Reference in New Issue
Block a user