Read the{' '}
SDK overview
{' '}
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx
index 567e4f71b025..21c2ccb7e7a2 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx
@@ -26,9 +26,9 @@ const ApiTokenForm: React.FC = ({
+
Please be aware of our{' '}
-
+
fair use policy
.
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/EnvironmentSelector/EnvironmentSelector.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/EnvironmentSelector/EnvironmentSelector.tsx
index f77a6048e168..c0186e20ea89 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/EnvironmentSelector/EnvironmentSelector.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/EnvironmentSelector/EnvironmentSelector.tsx
@@ -21,10 +21,10 @@ export const EnvironmentSelector = ({
const selectableEnvs =
type === TokenType.ADMIN
? [{ key: '*', label: 'ALL' }]
- : environments.map(environment => ({
+ : environments.map((environment) => ({
key: environment.name,
label: `${environment.name.concat(
- !environment.enabled ? ' - deprecated' : ''
+ !environment.enabled ? ' - deprecated' : '',
)}`,
title: environment.name,
disabled: false,
@@ -40,9 +40,9 @@ export const EnvironmentSelector = ({
options={selectableEnvs}
value={environment}
onChange={setEnvironment}
- label="Environment"
- id="api_key_environment"
- name="environment"
+ label='Environment'
+ id='api_key_environment'
+ name='environment'
IconComponent={KeyboardArrowDownOutlined}
fullWidth
/>
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/ProjectSelector.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/ProjectSelector.tsx
index 18162609fd4f..4838325ba042 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/ProjectSelector.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/ProjectSelector.tsx
@@ -23,7 +23,7 @@ export const ProjectSelector = ({
const projectId = useOptionalPathParam('projectId');
const { projects: availableProjects } = useProjects();
- const selectableProjects = availableProjects.map(project => ({
+ const selectableProjects = availableProjects.map((project) => ({
value: project.id,
label: project.name,
}));
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectAllButton/SelectAllButton.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectAllButton/SelectAllButton.tsx
index 7e7b4ee8188e..755a2457bff4 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectAllButton/SelectAllButton.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectAllButton/SelectAllButton.tsx
@@ -17,7 +17,7 @@ export const SelectAllButton: FC = ({
}) => {
return (
-
+
{isAllSelected ? 'Deselect all' : 'Select all'}
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.test.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.test.tsx
index f013194bb550..2210259a5f3d 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.test.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.test.tsx
@@ -36,7 +36,7 @@ describe('SelectProjectInput', () => {
render();
const checkbox = screen.getByLabelText(
- /all current and future projects/i
+ /all current and future projects/i,
);
expect(checkbox).toBeChecked();
@@ -52,7 +52,7 @@ describe('SelectProjectInput', () => {
await user.click(screen.getByTestId('select-all-projects'));
expect(
- screen.getByLabelText(/all current and future projects/i)
+ screen.getByLabelText(/all current and future projects/i),
).not.toBeChecked();
expect(screen.getByLabelText('Projects')).toBeEnabled();
@@ -60,7 +60,7 @@ describe('SelectProjectInput', () => {
await user.click(screen.getByTestId('select-all-projects'));
expect(
- screen.getByLabelText(/all current and future projects/i)
+ screen.getByLabelText(/all current and future projects/i),
).toBeChecked();
expect(screen.getByLabelText('Projects')).toBeDisabled();
@@ -68,11 +68,11 @@ describe('SelectProjectInput', () => {
it('renders with autocomplete enabled if default value is not a wildcard', () => {
render(
-
+ ,
);
const checkbox = screen.getByLabelText(
- /all current and future projects/i
+ /all current and future projects/i,
);
expect(checkbox).not.toBeChecked();
@@ -117,7 +117,7 @@ describe('SelectProjectInput', () => {
{ label: 'Project1', value: 'project1' },
{ label: 'Project2', value: 'project2' },
]}
- />
+ />,
);
await user.click(screen.getByLabelText('Projects'));
@@ -140,7 +140,7 @@ describe('SelectProjectInput', () => {
{ label: 'Charlie', value: 'charlie' },
{ label: 'Alpaca', value: 'alpaca' },
]}
- />
+ />,
);
const input = await screen.findByLabelText('Projects');
await user.type(input, 'alp');
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.tsx
index 62c10564fa93..8c48b76248ae 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ProjectSelector/SelectProjectInput/SelectProjectInput.tsx
@@ -48,10 +48,10 @@ export const SelectProjectInput: VFC = ({
onFocus,
}) => {
const [projects, setProjects] = useState(
- typeof defaultValue === 'string' ? [defaultValue] : defaultValue
+ typeof defaultValue === 'string' ? [defaultValue] : defaultValue,
);
const [isWildcardSelected, selectWildcard] = useState(
- typeof defaultValue === 'string' || defaultValue.includes(ALL_PROJECTS)
+ typeof defaultValue === 'string' || defaultValue.includes(ALL_PROJECTS),
);
const isAllSelected =
projects.length > 0 &&
@@ -60,7 +60,7 @@ export const SelectProjectInput: VFC = ({
const onAllProjectsChange = (
e: ChangeEvent,
- checked: boolean
+ checked: boolean,
) => {
if (checked) {
selectWildcard(true);
@@ -82,12 +82,12 @@ export const SelectProjectInput: VFC = ({
const renderOption = (
props: object,
option: IAutocompleteBoxOption,
- { selected }: AutocompleteRenderOptionState
+ { selected }: AutocompleteRenderOptionState,
) => (
}
- checkedIcon={}
+ icon={}
+ checkedIcon={}
checked={selected}
/>
{option.label}
@@ -114,11 +114,11 @@ export const SelectProjectInput: VFC = ({
{...params}
error={Boolean(error)}
helperText={error}
- variant="outlined"
- label="Projects"
- placeholder="Select one or more projects"
+ variant='outlined'
+ label='Projects'
+ placeholder='Select one or more projects'
onFocus={onFocus}
- data-testid="select-input"
+ data-testid='select-input'
/>
);
@@ -127,14 +127,14 @@ export const SelectProjectInput: VFC = ({
}
- label="ALL current and future projects"
+ label='ALL current and future projects'
/>
= ({
value={
isWildcardSelected || disabled
? options
- : options.filter(option =>
- projects.includes(option.value)
+ : options.filter((option) =>
+ projects.includes(option.value),
)
}
onChange={(_, input) => {
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/TokenInfo/TokenInfo.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/TokenInfo/TokenInfo.tsx
index 86fbd6546eb1..0625f7dcf5c2 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/TokenInfo/TokenInfo.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/TokenInfo/TokenInfo.tsx
@@ -22,9 +22,9 @@ export const TokenInfo = ({
setUsername(e.target.value)}
- label="Token name"
+ name='username'
+ onChange={(e) => setUsername(e.target.value)}
+ label='Token name'
error={errors.username !== undefined}
errorText={errors.username}
onFocus={() => clearErrors('username')}
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/TokenTypeSelector/TokenTypeSelector.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/TokenTypeSelector/TokenTypeSelector.tsx
index 27553d19aa09..192b2208315e 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/TokenTypeSelector/TokenTypeSelector.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/TokenTypeSelector/TokenTypeSelector.tsx
@@ -29,13 +29,13 @@ export const TokenTypeSelector = ({
return (
-
+
What do you want to connect?
setType(value as TokenType)}
>
@@ -59,8 +59,8 @@ export const TokenTypeSelector = ({
{label}
{title}
@@ -68,7 +68,7 @@ export const TokenTypeSelector = ({
}
/>
- )
+ ),
)}
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/useApiTokenForm.ts b/frontend/src/component/admin/apiToken/ApiTokenForm/useApiTokenForm.ts
index 71422f61a30a..7295120c1db9 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/useApiTokenForm.ts
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/useApiTokenForm.ts
@@ -16,12 +16,12 @@ export type ApiTokenFormErrorType = 'username' | 'projects';
export const useApiTokenForm = (project?: string) => {
const { environments } = useEnvironments();
const { uiConfig } = useUiConfig();
- const initialEnvironment = environments?.find(e => e.enabled)?.name;
+ const initialEnvironment = environments?.find((e) => e.enabled)?.name;
const hasCreateTokenPermission = useHasRootAccess(CREATE_CLIENT_API_TOKEN);
const hasCreateProjectTokenPermission = useHasRootAccess(
CREATE_PROJECT_API_TOKEN,
- project
+ project,
);
const apiTokenTypes: SelectOption[] = [
@@ -38,7 +38,7 @@ export const useApiTokenForm = (project?: string) => {
const hasCreateFrontendAccess = useHasRootAccess(CREATE_FRONTEND_API_TOKEN);
const hasCreateFrontendTokenAccess = useHasRootAccess(
CREATE_PROJECT_API_TOKEN,
- project
+ project,
);
if (!project) {
apiTokenTypes.push({
@@ -58,7 +58,7 @@ export const useApiTokenForm = (project?: string) => {
});
}
- const firstAccessibleType = apiTokenTypes.find(t => t.enabled)?.key;
+ const firstAccessibleType = apiTokenTypes.find((t) => t.enabled)?.key;
const [username, setUsername] = useState('');
const [type, setType] = useState(firstAccessibleType || TokenType.CLIENT);
@@ -99,10 +99,10 @@ export const useApiTokenForm = (project?: string) => {
const isValid = () => {
const newErrors: Partial> = {};
if (!username) {
- newErrors['username'] = 'Username is required';
+ newErrors.username = 'Username is required';
}
if (projects.length === 0) {
- newErrors['projects'] = 'At least one project is required';
+ newErrors.projects = 'At least one project is required';
}
setErrors(newErrors);
diff --git a/frontend/src/component/admin/apiToken/ApiTokenPage/ApiTokenPage.tsx b/frontend/src/component/admin/apiToken/ApiTokenPage/ApiTokenPage.tsx
index 94cd56b66fee..537da13f5aad 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenPage/ApiTokenPage.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenPage/ApiTokenPage.tsx
@@ -34,7 +34,7 @@ export const ApiTokenPage = () => {
setGlobalFilter,
setHiddenColumns,
columns,
- } = useApiTokenTable(tokens, props => {
+ } = useApiTokenTable(tokens, (props) => {
const READ_PERMISSION =
props.row.original.type === 'client'
? READ_CLIENT_API_TOKEN
@@ -91,7 +91,7 @@ export const ApiTokenPage = () => {
CREATE_CLIENT_API_TOKEN,
ADMIN,
]}
- path="/admin/api/create-token"
+ path='/admin/api/create-token'
/>
>
}
diff --git a/frontend/src/component/admin/apiToken/ConfirmToken/ConfirmToken.tsx b/frontend/src/component/admin/apiToken/ConfirmToken/ConfirmToken.tsx
index 333c7f6f0e13..8974757b13b1 100644
--- a/frontend/src/component/admin/apiToken/ConfirmToken/ConfirmToken.tsx
+++ b/frontend/src/component/admin/apiToken/ConfirmToken/ConfirmToken.tsx
@@ -25,21 +25,21 @@ export const ConfirmToken = ({
open={open}
setOpen={setOpen}
onClick={closeConfirm}
- primaryButtonText="Close"
- title="New token created"
+ primaryButtonText='Close'
+ title='New token created'
>
-
+
Your new token has been created successfully.
+
By default, all {TokenType.FRONTEND} tokens may be used
from any CORS origin. If you'd like to configure a
strict set of origins, please use the{' '}
-
+
CORS origins configuration page
.
diff --git a/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx b/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx
index 4a048cf84df4..edc4f66e9074 100644
--- a/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx
+++ b/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx
@@ -25,7 +25,7 @@ export const UserToken = ({ token }: IUserTokenProps) => {
return (
({
+ sx={(theme) => ({
backgroundColor: theme.palette.background.elevation2,
padding: theme.spacing(4),
borderRadius: `${theme.shape.borderRadius}px`,
@@ -37,8 +37,8 @@ export const UserToken = ({ token }: IUserTokenProps) => {
})}
>
{token}
-
-
+
+
diff --git a/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx b/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx
index 37b11cb92798..236d6a0ca21a 100644
--- a/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx
+++ b/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx
@@ -66,8 +66,8 @@ export const CreateApiToken = ({ modal = false }: ICreateApiTokenProps) => {
const payload = getApiTokenPayload();
await createToken(payload)
- .then(res => res.json())
- .then(api => {
+ .then((res) => res.json())
+ .then((api) => {
scrollToTop();
setToken(api.secret);
setShowConfirm(true);
@@ -84,9 +84,7 @@ export const CreateApiToken = ({ modal = false }: ICreateApiTokenProps) => {
};
const formatApiCode = () => {
- return `curl --location --request POST '${
- uiConfig.unleashUrl
- }/${PATH}' \\
+ return `curl --location --request POST '${uiConfig.unleashUrl}/${PATH}' \\
--header 'Authorization: INSERT_API_KEY' \\
--header 'Content-Type: application/json' \\
--data-raw '${JSON.stringify(getApiTokenPayload(), undefined, 2)}'`;
@@ -102,17 +100,17 @@ export const CreateApiToken = ({ modal = false }: ICreateApiTokenProps) => {
title={pageTitle}
modal={modal}
description="Unleash SDKs use API tokens to authenticate to the Unleash API. Client SDKs need a token with 'client privileges', which allows them to fetch feature toggle configurations and post usage metrics."
- documentationLink="https://docs.getunleash.io/reference/api-tokens-and-client-keys"
- documentationLinkLabel="API tokens documentation"
+ documentationLink='https://docs.getunleash.io/reference/api-tokens-and-client-keys'
+ documentationLinkLabel='API tokens documentation'
formatApiCode={formatApiCode}
>
{
it('should prioritize new "projects" array over deprecated "project"', async () => {
render(
+ />,
);
const links = await screen.findAllByRole('link');
@@ -21,7 +21,7 @@ describe('ProjectsList', () => {
});
it('should render correctly with single "project"', async () => {
- render();
+ render();
const links = await screen.findAllByRole('link');
expect(links).toHaveLength(1);
diff --git a/frontend/src/component/admin/apiToken/ProjectsList/ProjectsList.tsx b/frontend/src/component/admin/apiToken/ProjectsList/ProjectsList.tsx
index 16351698e5b9..40abec227076 100644
--- a/frontend/src/component/admin/apiToken/ProjectsList/ProjectsList.tsx
+++ b/frontend/src/component/admin/apiToken/ProjectsList/ProjectsList.tsx
@@ -23,7 +23,7 @@ export const ProjectsList: VFC = ({
project,
}) => {
const { searchQuery } = useSearchHighlightContext();
- let fields: string[] =
+ const fields: string[] =
projects && Array.isArray(projects)
? projects
: project
diff --git a/frontend/src/component/admin/auth/AuthSettings.tsx b/frontend/src/component/admin/auth/AuthSettings.tsx
index 2f14b9e50195..7cc9f247bc9f 100644
--- a/frontend/src/component/admin/auth/AuthSettings.tsx
+++ b/frontend/src/component/admin/auth/AuthSettings.tsx
@@ -34,7 +34,7 @@ export const AuthSettings = () => {
component: ,
},
].filter(
- item => uiConfig.flags?.googleAuthEnabled || item.label !== 'Google'
+ (item) => uiConfig.flags?.googleAuthEnabled || item.label !== 'Google',
);
const [activeTab, setActiveTab] = useState(0);
@@ -52,8 +52,8 @@ export const AuthSettings = () => {
onChange={(_, tabId) => {
setActiveTab(tabId);
}}
- indicatorColor="primary"
- textColor="primary"
+ indicatorColor='primary'
+ textColor='primary'
>
{tabs.map((tab, index) => (
{
>
}
+ show={}
/>
+
You are running Unleash in demo mode. You have
to use the Enterprise edition in order configure
Single Sign-on.
@@ -90,7 +90,7 @@ export const AuthSettings = () => {
+
You have decided to use custom authentication
type. You have to use the Enterprise edition in
order configure Single Sign-on from the user
@@ -101,7 +101,7 @@ export const AuthSettings = () => {
+
Your Unleash instance is managed by the Unleash
team.
@@ -113,6 +113,7 @@ export const AuthSettings = () => {
{tabs.map((tab, index) => (
key={index}
value={activeTab}
index={index}
diff --git a/frontend/src/component/admin/auth/AutoCreateForm/AutoCreateForm.tsx b/frontend/src/component/admin/auth/AutoCreateForm/AutoCreateForm.tsx
index bc89340ad64e..a8c9f12cd71a 100644
--- a/frontend/src/component/admin/auth/AutoCreateForm/AutoCreateForm.tsx
+++ b/frontend/src/component/admin/auth/AutoCreateForm/AutoCreateForm.tsx
@@ -51,12 +51,12 @@ export const AutoCreateForm = ({
control={
}
- label="Auto-create users"
+ label='Auto-create users'
/>
@@ -70,22 +70,22 @@ export const AutoCreateForm = ({
-
+
Default Role
@@ -101,16 +101,16 @@ export const AutoCreateForm = ({
diff --git a/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx b/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx
index d871b6f2effe..931392ec88cc 100644
--- a/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx
+++ b/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx
@@ -69,17 +69,17 @@ export const GoogleAuth = () => {
return (
<>
-
+
This integration is deprecated and will be removed in next
major version. Please use OpenID Connect to
enable Google SSO.
-
+
Read the{' '}
documentation
{' '}
@@ -103,7 +103,7 @@ export const GoogleAuth = () => {
}
@@ -122,13 +122,13 @@ export const GoogleAuth = () => {
@@ -144,13 +144,13 @@ export const GoogleAuth = () => {
@@ -172,13 +172,13 @@ export const GoogleAuth = () => {
@@ -193,7 +193,7 @@ export const GoogleAuth = () => {
@@ -209,24 +209,24 @@ export const GoogleAuth = () => {
-
+
Signing algorithm
@@ -277,9 +277,9 @@ export const OidcAuth = () => {