Skip to content

Commit

Permalink
Merge branch 'main' into feat/improve-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Feb 8, 2024
2 parents 0da3254 + 7e66a79 commit 208092f
Show file tree
Hide file tree
Showing 131 changed files with 3,386 additions and 1,000 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
12 changes: 6 additions & 6 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"@types/lodash.isequal": "^4.5.8",
"@types/lodash.mapvalues": "^4.6.9",
"@types/lodash.omit": "4.5.9",
"@types/node": "18.19.6",
"@types/react": "17.0.74",
"@types/node": "18.19.12",
"@types/react": "17.0.75",
"@types/react-dom": "17.0.25",
"@types/react-linkify": "1.0.4",
"@types/react-router-dom": "5.3.3",
Expand All @@ -75,7 +75,7 @@
"classnames": "2.5.1",
"copy-to-clipboard": "3.3.3",
"countries-and-timezones": "^3.4.0",
"cypress": "13.6.2",
"cypress": "13.6.4",
"cypress-vite": "^1.4.0",
"date-fns": "2.30.0",
"date-fns-tz": "^2.0.0",
Expand All @@ -85,14 +85,14 @@
"fast-json-patch": "3.1.1",
"http-proxy-middleware": "2.0.6",
"immer": "9.0.21",
"jsdom": "23.1.0",
"jsdom": "23.2.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",
"millify": "^6.0.0",
"msw": "0.49.3",
"msw": "2.1.7",
"pkginfo": "0.4.1",
"plausible-tracker": "0.3.8",
"prop-types": "15.8.1",
Expand Down Expand Up @@ -131,7 +131,7 @@
"@codemirror/state": "6.4.0",
"@xmldom/xmldom": "^0.8.4",
"json5": "^2.2.2",
"@types/react": "17.0.74",
"@types/react": "17.0.75",
"@types/react-dom": "17.0.25",
"semver": "7.5.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useApiTokenForm = (project?: string) => {
{
key: TokenType.CLIENT,
label: `Server-side SDK (${TokenType.CLIENT})`,
title: 'Connect server-side SDK or Unleash Proxy',
title: 'Connect server-side SDK or Unleash Proxy/Edge',
enabled:
hasCreateTokenPermission || hasCreateProjectTokenPermission,
},
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/component/admin/network/Network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { lazy } from 'react';

import { Tab, Tabs } from '@mui/material';
import { Route, Routes, useLocation } from 'react-router-dom';
import { CenteredNavLink } from '../menu/CenteredNavLink';
import { TabLink } from 'component/common/TabNav/TabLink';
import { PageContent } from 'component/common/PageContent/PageContent';

const NetworkOverview = lazy(() => import('./NetworkOverview/NetworkOverview'));
Expand Down Expand Up @@ -39,9 +39,9 @@ export const Network = () => {
key={label}
value={path}
label={
<CenteredNavLink to={path}>
<TabLink to={path}>
<span>{label}</span>
</CenteredNavLink>
</TabLink>
}
sx={{ padding: 0 }}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { Dialogue } from '../../../../common/Dialogue/Dialogue';
import useLoading from '../../../../../hooks/useLoading';
import { Alert, Typography } from '@mui/material';
import { DEL_INACTIVE_USERS_ERROR } from '../../../../../hooks/api/actions/useInactiveUsersApi/useInactiveUsersApi';
import { ConditionallyRender } from '../../../../common/ConditionallyRender/ConditionallyRender';
import { IInactiveUser } from '../../../../../hooks/api/getters/useInactiveUsers/useInactiveUsers';
import { flexRow } from '../../../../../themes/themeStyles';

interface IDeleteInactiveUsersProps {
showDialog: boolean;
closeDialog: () => void;
inactiveUsersLoading: boolean;
removeInactiveUsers: () => void;
inactiveUserApiErrors: Record<string, string>;
inactiveUsers: IInactiveUser[];
}
export const DeleteInactiveUsers = ({
showDialog,
closeDialog,
inactiveUsersLoading,
removeInactiveUsers,
inactiveUserApiErrors,
inactiveUsers,
}: IDeleteInactiveUsersProps) => {
const ref = useLoading(inactiveUsersLoading);
return (
<Dialogue
open={showDialog}
title={`Really delete all inactive users?`}
onClose={closeDialog}
onClick={removeInactiveUsers}
primaryButtonText={'Delete all inactive users'}
secondaryButtonText={'Cancel'}
>
<div ref={ref}>
<ConditionallyRender
condition={Boolean(
inactiveUserApiErrors[DEL_INACTIVE_USERS_ERROR],
)}
show={
<Alert
data-loading
severity='error'
style={{ margin: '1rem 0' }}
>
{inactiveUserApiErrors[DEL_INACTIVE_USERS_ERROR]}
</Alert>
}
/>
<div style={flexRow}>
<Typography variant='subtitle1'>
You will be deleting{' '}
{inactiveUsers.length === 1
? `1 inactive user`
: `${inactiveUsers.length} inactive users`}
</Typography>
</div>
</div>
</Dialogue>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { Dialogue } from 'component/common/Dialogue/Dialogue';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { REMOVE_USER_ERROR } from 'hooks/api/actions/useAdminUsersApi/useAdminUsersApi';
import { Alert, styled } from '@mui/material';
import useLoading from 'hooks/useLoading';
import { Typography } from '@mui/material';
import { useThemeStyles } from 'themes/themeStyles';
import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
import { IInactiveUser } from '../../../../../hooks/api/getters/useInactiveUsers/useInactiveUsers';

const StyledUserAvatar = styled(UserAvatar)(({ theme }) => ({
width: theme.spacing(5),
height: theme.spacing(5),
margin: 0,
}));

interface IDeleteUserProps {
showDialog: boolean;
closeDialog: () => void;
user: IInactiveUser;
userLoading: boolean;
removeUser: () => void;
userApiErrors: Record<string, string>;
}

const DeleteUser = ({
showDialog,
closeDialog,
user,
userLoading,
removeUser,
userApiErrors,
}: IDeleteUserProps) => {
const ref = useLoading(userLoading);
const { classes: themeStyles } = useThemeStyles();

return (
<Dialogue
open={showDialog}
title='Really delete user?'
onClose={closeDialog}
onClick={removeUser}
primaryButtonText='Delete user'
secondaryButtonText='Cancel'
>
<div ref={ref}>
<ConditionallyRender
condition={Boolean(userApiErrors[REMOVE_USER_ERROR])}
show={
<Alert
data-loading
severity='error'
style={{ margin: '1rem 0' }}
>
{userApiErrors[REMOVE_USER_ERROR]}
</Alert>
}
/>
<div data-loading className={themeStyles.flexRow}>
<Typography
variant='subtitle1'
style={{ marginLeft: '1rem' }}
>
{user.username || user.email}
</Typography>
</div>
<Typography
data-loading
variant='body1'
style={{ marginTop: '1rem' }}
>
Are you sure you want to delete{' '}
{`${user.name || 'user'} (${user.email || user.username})`}
</Typography>
</div>
</Dialogue>
);
};

export default DeleteUser;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { VFC } from 'react';
import { Box, styled } from '@mui/material';
import PermissionIconButton from '../../../../common/PermissionIconButton/PermissionIconButton';
import { ADMIN } from '../../../../providers/AccessProvider/permissions';
import { Delete } from '@mui/icons-material';

const StyledBox = styled(Box)(() => ({
display: 'flex',
justifyContent: 'center',
}));
interface IInactiveUsersActionsCellProps {
onDelete: (event: React.SyntheticEvent) => void;
}

export const InactiveUsersActionCell: VFC<IInactiveUsersActionsCellProps> = ({
onDelete,
}) => {
return (
<StyledBox>
<PermissionIconButton
data-loading
onClick={onDelete}
permission={ADMIN}
tooltipProps={{
title: 'Remove user',
}}
>
<Delete />
</PermissionIconButton>
</StyledBox>
);
};
Loading

0 comments on commit 208092f

Please sign in to comment.