Skip to content

Commit

Permalink
Merge branch 'main' into fix/losing_redirect_on_provider_login
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-unleash committed Jan 19, 2024
2 parents 94e56b4 + a096b2a commit 17b9a8a
Show file tree
Hide file tree
Showing 112 changed files with 3,882 additions and 982 deletions.
15 changes: 12 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "unleash-frontend-local",
"version": "0.0.0",
"private": true,
"files": ["index.js", "build"],
"files": [
"index.js",
"build"
],
"engines": {
"node": ">=18"
},
Expand Down Expand Up @@ -50,6 +53,7 @@
"@types/deep-diff": "1.0.5",
"@types/jest": "29.5.11",
"@types/lodash.clonedeep": "4.5.9",
"@types/lodash.isequal": "^4.5.8",
"@types/lodash.mapvalues": "^4.6.9",
"@types/lodash.omit": "4.5.9",
"@types/node": "18.19.6",
Expand Down Expand Up @@ -83,6 +87,7 @@
"immer": "9.0.21",
"jsdom": "23.1.0",
"lodash.clonedeep": "4.5.0",
"lodash.isequal": "^4.5.0",
"lodash.mapvalues": "^4.6.0",
"lodash.omit": "4.5.0",
"mermaid": "^9.3.0",
Expand All @@ -101,7 +106,7 @@
"react-joyride": "^2.5.3",
"react-linkify": "^1.0.0-alpha",
"react-markdown": "^8.0.4",
"react-router-dom": "6.21.1",
"react-router-dom": "6.21.2",
"react-table": "7.8.0",
"react-test-renderer": "17.0.2",
"react-timeago": "7.2.0",
Expand Down Expand Up @@ -138,7 +143,11 @@
}
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ChangeEvent, Dispatch, SetStateAction, useState } from 'react';
import { Visibility } from '@mui/icons-material';
import { BannerDialog } from 'component/banners/Banner/BannerDialog/BannerDialog';

const StyledForm = styled('form')(({ theme }) => ({
const StyledForm = styled('div')(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
gap: theme.spacing(4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ import {
IPersonalAPIToken,
} from 'interfaces/personalAPIToken';
import { useMemo, useState } from 'react';
import {
useTable,
SortingRule,
useSortBy,
useFlexLayout,
Column,
} from 'react-table';
import { useTable, SortingRule, useSortBy, useFlexLayout } from 'react-table';
import { sortTypes } from 'utils/sortTypes';
import { ServiceAccountCreateTokenDialog } from './ServiceAccountCreateTokenDialog/ServiceAccountCreateTokenDialog';
import { ServiceAccountTokenDialog } from 'component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountTokenDialog/ServiceAccountTokenDialog';
Expand Down Expand Up @@ -157,66 +151,62 @@ export const ServiceAccountTokens = ({
};

const columns = useMemo(
() =>
[
{
Header: 'Description',
accessor: 'description',
Cell: HighlightCell,
minWidth: 100,
searchable: true,
},
{
Header: 'Expires',
accessor: 'expiresAt',
Cell: ({ value }: { value: string }) => {
const date = new Date(value);
if (
date.getFullYear() >
new Date().getFullYear() + 100
) {
return <TextCell>Never</TextCell>;
}
return <DateCell value={value} />;
},
maxWidth: 150,
},
{
Header: 'Created',
accessor: 'createdAt',
Cell: DateCell,
maxWidth: 150,
},
{
Header: 'Last seen',
accessor: 'seenAt',
Cell: TimeAgoCell,
maxWidth: 150,
},
{
Header: 'Actions',
id: 'Actions',
align: 'center',
Cell: ({ row: { original: rowToken } }: any) => (
<ActionCell>
<Tooltip title='Delete token' arrow describeChild>
<span>
<IconButton
onClick={() => {
setSelectedToken(rowToken);
setDeleteOpen(true);
}}
>
<Delete />
</IconButton>
</span>
</Tooltip>
</ActionCell>
),
maxWidth: 100,
disableSortBy: true,
() => [
{
Header: 'Description',
accessor: 'description',
Cell: HighlightCell,
minWidth: 100,
searchable: true,
},
{
Header: 'Expires',
accessor: 'expiresAt',
Cell: ({ value }: { value: string }) => {
const date = new Date(value);
if (date.getFullYear() > new Date().getFullYear() + 100) {
return <TextCell>Never</TextCell>;
}
return <DateCell value={value} />;
},
] as Column<IPersonalAPIToken>[],
maxWidth: 150,
},
{
Header: 'Created',
accessor: 'createdAt',
Cell: DateCell,
maxWidth: 150,
},
{
Header: 'Last seen',
accessor: 'seenAt',
Cell: TimeAgoCell,
maxWidth: 150,
},
{
Header: 'Actions',
id: 'Actions',
align: 'center',
Cell: ({ row: { original: rowToken } }: any) => (
<ActionCell>
<Tooltip title='Delete token' arrow describeChild>
<span>
<IconButton
onClick={() => {
setSelectedToken(rowToken);
setDeleteOpen(true);
}}
>
<Delete />
</IconButton>
</span>
</Tooltip>
</ActionCell>
),
maxWidth: 100,
disableSortBy: true,
},
],
[setSelectedToken, setDeleteOpen],
);

Expand All @@ -228,7 +218,7 @@ export const ServiceAccountTokens = ({

const { headerGroups, rows, prepareRow, setHiddenColumns } = useTable(
{
columns,
columns: columns as any[],
data,
initialState,
sortTypes,
Expand Down
Loading

0 comments on commit 17b9a8a

Please sign in to comment.