- {sortedAuthClients.map((client) => (
+ {sortedOAuthClients.map((client) => (
@@ -70,8 +71,13 @@ function AdminApplicationAuthClients(props) {
))}
-
@@ -79,8 +85,8 @@ function AdminApplicationAuthClients(props) {
);
}
-AdminApplicationAuthClients.propTypes = {
+AdminApplicationOAuthClients.propTypes = {
appKey: PropTypes.string.isRequired,
};
-export default AdminApplicationAuthClients;
+export default AdminApplicationOAuthClients;
diff --git a/packages/web/src/components/AdminApplicationSettings/index.jsx b/packages/web/src/components/AdminApplicationSettings/index.jsx
index 34ef8d0c..99b46a74 100644
--- a/packages/web/src/components/AdminApplicationSettings/index.jsx
+++ b/packages/web/src/components/AdminApplicationSettings/index.jsx
@@ -46,9 +46,8 @@ function AdminApplicationSettings(props) {
const defaultValues = useMemo(
() => ({
- customConnectionAllowed:
- appConfig?.data?.customConnectionAllowed || false,
- shared: appConfig?.data?.shared || false,
+ useOnlyPredefinedAuthClients:
+ appConfig?.data?.useOnlyPredefinedAuthClients || false,
disabled: appConfig?.data?.disabled || false,
}),
[appConfig?.data],
@@ -62,21 +61,17 @@ function AdminApplicationSettings(props) {
-
-
+
+
+
({
...field,
@@ -31,13 +31,13 @@ function AdminApplicationUpdateAuthClient(props) {
}));
const submitHandler = async (values) => {
- if (!adminAppAuthClient) {
+ if (!adminOAuthClient) {
return;
}
const { name, active, ...formattedAuthDefaults } = values;
- await updateAppAuthClient({
+ await updateOAuthClient({
name,
active,
formattedAuthDefaults,
@@ -64,31 +64,31 @@ function AdminApplicationUpdateAuthClient(props) {
const defaultValues = useMemo(
() => ({
- name: adminAppAuthClient?.data?.name || '',
- active: adminAppAuthClient?.data?.active || false,
+ name: adminOAuthClient?.data?.name || '',
+ active: adminOAuthClient?.data?.active || false,
...getAuthFieldsDefaultValues(),
}),
- [adminAppAuthClient, getAuthFieldsDefaultValues],
+ [adminOAuthClient, getAuthFieldsDefaultValues],
);
return (
-
);
}
-AdminApplicationUpdateAuthClient.propTypes = {
+AdminApplicationUpdateOAuthClient.propTypes = {
application: AppPropType.isRequired,
onClose: PropTypes.func.isRequired,
};
-export default AdminApplicationUpdateAuthClient;
+export default AdminApplicationUpdateOAuthClient;
diff --git a/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx b/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
deleted file mode 100644
index a9cce58d..00000000
--- a/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import PropTypes from 'prop-types';
-import Dialog from '@mui/material/Dialog';
-import DialogTitle from '@mui/material/DialogTitle';
-import List from '@mui/material/List';
-import ListItem from '@mui/material/ListItem';
-import ListItemButton from '@mui/material/ListItemButton';
-import ListItemText from '@mui/material/ListItemText';
-import * as React from 'react';
-import useAppAuthClients from 'hooks/useAppAuthClients';
-import useFormatMessage from 'hooks/useFormatMessage';
-
-function AppAuthClientsDialog(props) {
- const { appKey, onClientClick, onClose } = props;
- const { data: appAuthClients } = useAppAuthClients(appKey);
-
- const formatMessage = useFormatMessage();
-
- React.useEffect(
- function autoAuthenticateSingleClient() {
- if (appAuthClients?.data.length === 1) {
- onClientClick(appAuthClients.data[0].id);
- }
- },
- [appAuthClients?.data],
- );
-
- if (!appAuthClients?.data.length || appAuthClients?.data.length === 1)
- return ;
-
- return (
-
- );
-}
-
-AppAuthClientsDialog.propTypes = {
- appKey: PropTypes.string.isRequired,
- onClientClick: PropTypes.func.isRequired,
- onClose: PropTypes.func.isRequired,
-};
-
-export default AppAuthClientsDialog;
diff --git a/packages/web/src/components/AppConnectionContextMenu/index.jsx b/packages/web/src/components/AppConnectionContextMenu/index.jsx
index fb94e4b3..8e7eb318 100644
--- a/packages/web/src/components/AppConnectionContextMenu/index.jsx
+++ b/packages/web/src/components/AppConnectionContextMenu/index.jsx
@@ -11,14 +11,7 @@ import { useQueryClient } from '@tanstack/react-query';
import Can from 'components/Can';
function ContextMenu(props) {
- const {
- appKey,
- connection,
- onClose,
- onMenuItemClick,
- anchorEl,
- disableReconnection,
- } = props;
+ const { appKey, connection, onClose, onMenuItemClick, anchorEl } = props;
const formatMessage = useFormatMessage();
const queryClient = useQueryClient();
@@ -73,11 +66,11 @@ function ContextMenu(props) {
{(allowed) => (
);
}
diff --git a/packages/web/src/components/OAuthClientsDialog/index.ee.jsx b/packages/web/src/components/OAuthClientsDialog/index.ee.jsx
new file mode 100644
index 00000000..c8e204cb
--- /dev/null
+++ b/packages/web/src/components/OAuthClientsDialog/index.ee.jsx
@@ -0,0 +1,43 @@
+import PropTypes from 'prop-types';
+import Dialog from '@mui/material/Dialog';
+import DialogTitle from '@mui/material/DialogTitle';
+import List from '@mui/material/List';
+import ListItem from '@mui/material/ListItem';
+import ListItemButton from '@mui/material/ListItemButton';
+import ListItemText from '@mui/material/ListItemText';
+import * as React from 'react';
+import useOAuthClients from 'hooks/useOAuthClients';
+import useFormatMessage from 'hooks/useFormatMessage';
+
+function AppOAuthClientsDialog(props) {
+ const { appKey, onClientClick, onClose } = props;
+ const { data: appOAuthClients } = useOAuthClients(appKey);
+
+ const formatMessage = useFormatMessage();
+
+ if (!appOAuthClients?.data.length) return ;
+
+ return (
+
+ );
+}
+
+AppOAuthClientsDialog.propTypes = {
+ appKey: PropTypes.string.isRequired,
+ onClientClick: PropTypes.func.isRequired,
+ onClose: PropTypes.func.isRequired,
+};
+
+export default AppOAuthClientsDialog;
diff --git a/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx b/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx
index 50903dbf..e5752321 100644
--- a/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx
+++ b/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx
@@ -39,14 +39,14 @@ const PermissionCatalogFieldLoader = () => {
{[...Array(5)].map((action, index) => (
-
+
))}
-
+
diff --git a/packages/web/src/components/PermissionCatalogField/index.ee.jsx b/packages/web/src/components/PermissionCatalogField/index.ee.jsx
index 5f2bf909..21c89f81 100644
--- a/packages/web/src/components/PermissionCatalogField/index.ee.jsx
+++ b/packages/web/src/components/PermissionCatalogField/index.ee.jsx
@@ -21,13 +21,15 @@ const PermissionCatalogField = ({
name = 'permissions',
disabled = false,
syncIsCreator = false,
+ loading = false,
}) => {
const { data, isLoading: isPermissionCatalogLoading } =
usePermissionCatalog();
const permissionCatalog = data?.data;
const [dialogName, setDialogName] = React.useState();
- if (isPermissionCatalogLoading) return ;
+ if (isPermissionCatalogLoading || loading)
+ return ;
return (
@@ -118,6 +120,7 @@ PermissionCatalogField.propTypes = {
name: PropTypes.string,
disabled: PropTypes.bool,
syncIsCreator: PropTypes.bool,
+ loading: PropTypes.bool,
};
export default PermissionCatalogField;
diff --git a/packages/web/src/components/SignUpForm/index.ee.jsx b/packages/web/src/components/SignUpForm/index.ee.jsx
index e931d394..a7daa326 100644
--- a/packages/web/src/components/SignUpForm/index.ee.jsx
+++ b/packages/web/src/components/SignUpForm/index.ee.jsx
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom';
import Paper from '@mui/material/Paper';
import Typography from '@mui/material/Typography';
import LoadingButton from '@mui/lab/LoadingButton';
+import Alert from '@mui/material/Alert';
import * as yup from 'yup';
import { yupResolver } from '@hookform/resolvers/yup';
@@ -12,24 +13,41 @@ import Form from 'components/Form';
import TextField from 'components/TextField';
import useFormatMessage from 'hooks/useFormatMessage';
import useCreateAccessToken from 'hooks/useCreateAccessToken';
-import useEnqueueSnackbar from 'hooks/useEnqueueSnackbar';
import useRegisterUser from 'hooks/useRegisterUser';
-const validationSchema = yup.object().shape({
- fullName: yup.string().trim().required('signupForm.mandatoryInput'),
- email: yup
- .string()
- .trim()
- .email('signupForm.validateEmail')
- .required('signupForm.mandatoryInput'),
- password: yup.string().required('signupForm.mandatoryInput'),
- confirmPassword: yup
- .string()
- .required('signupForm.mandatoryInput')
- .oneOf([yup.ref('password')], 'signupForm.passwordsMustMatch'),
-});
+const getValidationSchema = (formatMessage) => {
+ const getMandatoryInputMessage = (inputNameId) =>
+ formatMessage('signupForm.mandatoryInput', {
+ inputName: formatMessage(inputNameId),
+ });
-const initialValues = {
+ return yup.object().shape({
+ fullName: yup
+ .string()
+ .trim()
+ .required(getMandatoryInputMessage('signupForm.fullNameFieldLabel')),
+ email: yup
+ .string()
+ .trim()
+ .required(getMandatoryInputMessage('signupForm.emailFieldLabel'))
+ .email(formatMessage('signupForm.validateEmail')),
+ password: yup
+ .string()
+ .required(getMandatoryInputMessage('signupForm.passwordFieldLabel'))
+ .min(6, formatMessage('signupForm.passwordMinLength')),
+ confirmPassword: yup
+ .string()
+ .required(
+ getMandatoryInputMessage('signupForm.confirmPasswordFieldLabel'),
+ )
+ .oneOf(
+ [yup.ref('password')],
+ formatMessage('signupForm.passwordsMustMatch'),
+ ),
+ });
+};
+
+const defaultValues = {
fullName: '',
email: '',
password: '',
@@ -40,7 +58,6 @@ function SignUpForm() {
const navigate = useNavigate();
const authentication = useAuthentication();
const formatMessage = useFormatMessage();
- const enqueueSnackbar = useEnqueueSnackbar();
const { mutateAsync: registerUser, isPending: isRegisterUserPending } =
useRegisterUser();
const { mutateAsync: createAccessToken, isPending: loginLoading } =
@@ -67,27 +84,8 @@ function SignUpForm() {
const { token } = data;
authentication.updateToken(token);
} catch (error) {
- const errors = error?.response?.data?.errors
- ? Object.values(error.response.data.errors)
- : [];
-
- if (errors.length) {
- for (const [error] of errors) {
- enqueueSnackbar(error, {
- variant: 'error',
- SnackbarProps: {
- 'data-test': 'snackbar-sign-up-error',
- },
- });
- }
- } else {
- enqueueSnackbar(error?.message || formatMessage('signupForm.error'), {
- variant: 'error',
- SnackbarProps: {
- 'data-test': 'snackbar-sign-up-error',
- },
- });
- }
+ const errors = error?.response?.data?.errors;
+ throw errors || error;
}
};
@@ -108,11 +106,13 @@ function SignUpForm() {
}
+ path={`/oauth-clients/*`}
+ element={