Setup link fixes (#2316)

* Add missing success toast

* Remove auto routing

* Add translation

* added TODO

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
This commit is contained in:
Aswin V 2024-02-16 20:42:38 +05:30 committed by GitHub
parent 241f12b1b0
commit d410fe2b76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 6 deletions

View File

@ -73,10 +73,11 @@ const ConnectionList = ({
const noConnections = connections.length === 0 && paginate.offset === 0;
const noMoreResults = connections.length === 0 && paginate.offset > 0;
if (connections && setupLinkToken && connections.length === 0) {
router.replace(`/setup/${setupLinkToken}/sso-connection/new`);
return null;
}
// TODO: Redirect to create a new connection if there are no connections
// if (connections && setupLinkToken && connections.length === 0) {
// router.replace(`/setup/${setupLinkToken}/sso-connection/new`);
// return null;
// }
// Find the display name for a connection
const connectionDisplayName = (connection: SAMLSSORecord | OIDCSSORecord) => {

View File

@ -2,7 +2,8 @@ import { useRouter } from 'next/router';
import { CreateSAMLConnection as CreateSAML, CreateOIDCConnection as CreateOIDC } from '@boxyhq/react-ui/sso';
import styles from 'styles/sdk-override.module.css';
import { errorToast } from '@components/Toaster';
import { errorToast, successToast } from '@components/Toaster';
import { useTranslation } from 'next-i18next';
interface CreateSSOConnectionProps {
setupLinkToken: string;
@ -11,8 +12,10 @@ interface CreateSSOConnectionProps {
const CreateSSOConnection = ({ setupLinkToken, idpType }: CreateSSOConnectionProps) => {
const router = useRouter();
const { t } = useTranslation('common');
const onSuccess = () => {
successToast(t('sso_connection_created_successfully'));
router.push({
pathname: '/setup/[token]/sso-connection',
query: { token: setupLinkToken },

View File

@ -277,5 +277,6 @@
"id_token_from_oidc_idp": "ID Token (from OIDC Provider)",
"access_token_from_oidc_idp": "Access Token (from OIDC Provider)",
"session_state_from_oidc_idp": "Session State (from OIDC Provider)",
"scope_from_op_error": "Scope (from OIDC Provider)"
"scope_from_op_error": "Scope (from OIDC Provider)",
"sso_connection_created_successfully": "SSO Connection created successfully"
}