- {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/AdminApplicationUpdateAuthClient/index.jsx b/packages/web/src/components/AdminApplicationUpdateOAuthClient/index.jsx
similarity index 56%
rename from packages/web/src/components/AdminApplicationUpdateAuthClient/index.jsx
rename to packages/web/src/components/AdminApplicationUpdateOAuthClient/index.jsx
index 0dc3d795..18389bed 100644
--- a/packages/web/src/components/AdminApplicationUpdateAuthClient/index.jsx
+++ b/packages/web/src/components/AdminApplicationUpdateOAuthClient/index.jsx
@@ -4,26 +4,26 @@ import { useParams } from 'react-router-dom';
import { AppPropType } from 'propTypes/propTypes';
import useFormatMessage from 'hooks/useFormatMessage';
-import AdminApplicationAuthClientDialog from 'components/AdminApplicationAuthClientDialog';
-import useAdminAppAuthClient from 'hooks/useAdminAppAuthClient.ee';
-import useAdminUpdateAppAuthClient from 'hooks/useAdminUpdateAppAuthClient.ee';
+import AdminApplicationOAuthClientDialog from 'components/AdminApplicationOAuthClientDialog';
+import useAdminOAuthClient from 'hooks/useAdminOAuthClient.ee';
+import useAdminUpdateOAuthClient from 'hooks/useAdminUpdateOAuthClient.ee';
import useAppAuth from 'hooks/useAppAuth';
-function AdminApplicationUpdateAuthClient(props) {
+function AdminApplicationUpdateOAuthClient(props) {
const { application, onClose } = props;
const formatMessage = useFormatMessage();
const { clientId } = useParams();
- const { data: adminAppAuthClient, isLoading: isAdminAuthClientLoading } =
- useAdminAppAuthClient(application.key, clientId);
+ const { data: adminOAuthClient, isLoading: isAdminOAuthClientLoading } =
+ useAdminOAuthClient(application.key, clientId);
const { data: auth } = useAppAuth(application.key);
const {
- mutateAsync: updateAppAuthClient,
- isPending: isUpdateAppAuthClientPending,
- error: updateAppAuthClientError,
- } = useAdminUpdateAppAuthClient(application.key, clientId);
+ mutateAsync: updateOAuthClient,
+ isPending: isUpdateOAuthClientPending,
+ error: updateOAuthClientError,
+ } = useAdminUpdateOAuthClient(application.key, clientId);
const authFields = auth?.data?.fields?.map((field) => ({
...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/AppConnectionContextMenu/index.jsx b/packages/web/src/components/AppConnectionContextMenu/index.jsx
index f17fb860..8e7eb318 100644
--- a/packages/web/src/components/AppConnectionContextMenu/index.jsx
+++ b/packages/web/src/components/AppConnectionContextMenu/index.jsx
@@ -70,7 +70,7 @@ function ContextMenu(props) {
to={URLS.APP_RECONNECT_CONNECTION(
appKey,
connection.id,
- connection.appAuthClientId,
+ connection.oauthClientId,
)}
onClick={createActionHandler({ type: 'reconnect' })}
>
diff --git a/packages/web/src/components/ChooseConnectionSubstep/index.jsx b/packages/web/src/components/ChooseConnectionSubstep/index.jsx
index 0c6ef5c8..2f5df9ee 100644
--- a/packages/web/src/components/ChooseConnectionSubstep/index.jsx
+++ b/packages/web/src/components/ChooseConnectionSubstep/index.jsx
@@ -7,7 +7,7 @@ import TextField from '@mui/material/TextField';
import * as React from 'react';
import AddAppConnection from 'components/AddAppConnection';
-import AppAuthClientsDialog from 'components/AppAuthClientsDialog/index.ee';
+import AppOAuthClientsDialog from 'components/OAuthClientsDialog/index.ee';
import FlowSubstepTitle from 'components/FlowSubstepTitle';
import useAppConfig from 'hooks/useAppConfig.ee';
import { EditorContext } from 'contexts/Editor';
@@ -22,7 +22,7 @@ import useStepConnection from 'hooks/useStepConnection';
import { useQueryClient } from '@tanstack/react-query';
import useAppConnections from 'hooks/useAppConnections';
import useTestConnection from 'hooks/useTestConnection';
-import useAppAuthClients from 'hooks/useAppAuthClients';
+import useOAuthClients from 'hooks/useOAuthClients';
const ADD_CONNECTION_VALUE = 'ADD_CONNECTION';
const ADD_SHARED_CONNECTION_VALUE = 'ADD_SHARED_CONNECTION';
@@ -54,7 +54,7 @@ function ChooseConnectionSubstep(props) {
const [showAddSharedConnectionDialog, setShowAddSharedConnectionDialog] =
React.useState(false);
const queryClient = useQueryClient();
- const { data: appAuthClients } = useAppAuthClients(application.key);
+ const { data: appOAuthClients } = useOAuthClients(application.key);
const { authenticate } = useAuthenticateApp({
appKey: application.key,
@@ -100,9 +100,9 @@ function ChooseConnectionSubstep(props) {
value: ADD_CONNECTION_VALUE,
};
- const addConnectionWithAuthClient = {
+ const addConnectionWithOAuthClient = {
label: formatMessage(
- 'chooseConnectionSubstep.addConnectionWithAuthClient',
+ 'chooseConnectionSubstep.addConnectionWithOAuthClient',
),
value: ADD_SHARED_CONNECTION_VALUE,
};
@@ -115,33 +115,33 @@ function ChooseConnectionSubstep(props) {
// app is disabled.
if (appConfig.data.disabled) return options;
- // means only auth clients are allowed for connection creation and there is app auth client
+ // means only OAuth clients are allowed for connection creation and there is OAuth client
if (
appConfig.data.useOnlyPredefinedAuthClients === true &&
- appAuthClients.data.length > 0
+ appOAuthClients.data.length > 0
) {
- return options.concat([addConnectionWithAuthClient]);
+ return options.concat([addConnectionWithOAuthClient]);
}
- // means there is no app auth client. so we don't show the `addConnectionWithAuthClient`
+ // means there is no OAuth client. so we don't show the `addConnectionWithOAuthClient`
if (
appConfig.data.useOnlyPredefinedAuthClients === true &&
- appAuthClients.data.length === 0
+ appOAuthClients.data.length === 0
) {
return options;
}
- if (appAuthClients.data.length === 0) {
+ if (appOAuthClients.data.length === 0) {
return options.concat([addCustomConnection]);
}
- return options.concat([addCustomConnection, addConnectionWithAuthClient]);
- }, [data, formatMessage, appConfig, appAuthClients]);
+ return options.concat([addCustomConnection, addConnectionWithOAuthClient]);
+ }, [data, formatMessage, appConfig, appOAuthClients]);
- const handleClientClick = async (appAuthClientId) => {
+ const handleClientClick = async (oauthClientId) => {
try {
const response = await authenticate?.({
- appAuthClientId,
+ oauthClientId,
});
const connectionId = response?.createConnection.id;
@@ -292,7 +292,7 @@ function ChooseConnectionSubstep(props) {
)}
{application && showAddSharedConnectionDialog && (
- setShowAddSharedConnectionDialog(false)}
onClientClick={handleClientClick}
diff --git a/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx b/packages/web/src/components/OAuthClientsDialog/index.ee.jsx
similarity index 57%
rename from packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
rename to packages/web/src/components/OAuthClientsDialog/index.ee.jsx
index eea6674b..c8e204cb 100644
--- a/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
+++ b/packages/web/src/components/OAuthClientsDialog/index.ee.jsx
@@ -6,26 +6,26 @@ 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 useOAuthClients from 'hooks/useOAuthClients';
import useFormatMessage from 'hooks/useFormatMessage';
-function AppAuthClientsDialog(props) {
+function AppOAuthClientsDialog(props) {
const { appKey, onClientClick, onClose } = props;
- const { data: appAuthClients } = useAppAuthClients(appKey);
+ const { data: appOAuthClients } = useOAuthClients(appKey);
const formatMessage = useFormatMessage();
- if (!appAuthClients?.data.length) return ;
+ if (!appOAuthClients?.data.length) return ;
return (