Skip to content

Commit

Permalink
fix: WIP
Browse files Browse the repository at this point in the history
Description:
Adding embedded registration form
VAN-1574
  • Loading branch information
ahtesham-quraish committed Aug 9, 2023
1 parent 0846001 commit d5d3fcd
Show file tree
Hide file tree
Showing 8 changed files with 1,305 additions and 109 deletions.
4 changes: 2 additions & 2 deletions src/MainApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ForgotPasswordPage } from './forgot-password';
import Logistration from './logistration/Logistration';
import { ProgressiveProfiling } from './progressive-profiling';
import { RecommendationsPage } from './recommendations';
import { RegistrationPage } from './register';
import { EmbedableRegistrationForm } from './register';
import { ResetPasswordPage } from './reset-password';

import './index.scss';
Expand All @@ -44,7 +44,7 @@ const MainApp = () => (
<EmbeddedRegistrationRoute
exact
path={REGISTER_EMBEDDED_PAGE}
component={RegistrationPage}
component={EmbedableRegistrationForm}
/>
<UnAuthOnlyRoute exact path={LOGIN_PAGE} render={() => <Logistration selectedPage={LOGIN_PAGE} />} />
<UnAuthOnlyRoute exact path={REGISTER_PAGE} component={Logistration} />
Expand Down
15 changes: 1 addition & 14 deletions src/common-components/RedirectLogistration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import { Redirect } from 'react-router-dom';

import {
AUTHN_PROGRESSIVE_PROFILING, RECOMMENDATIONS, REDIRECT,
AUTHN_PROGRESSIVE_PROFILING, RECOMMENDATIONS,
} from '../data/constants';
import { setCookie } from '../data/utils';

Expand All @@ -19,8 +19,6 @@ const RedirectLogistration = (props) => {
redirectToRecommendationsPage,
educationLevel,
userId,
registrationEmbedded,
host,
} = props;
let finalRedirectUrl = '';

Expand All @@ -40,13 +38,6 @@ const RedirectLogistration = (props) => {
// TODO: Do we still need this cookie?
setCookie('van-504-returning-user', true);

if (registrationEmbedded) {
window.parent.postMessage({
action: REDIRECT,
redirectUrl: getConfig().POST_REGISTRATION_REDIRECT_URL,
}, host);
return null;
}
const registrationResult = { redirectUrl: finalRedirectUrl, success };
return (
<Redirect to={{
Expand Down Expand Up @@ -91,8 +82,6 @@ RedirectLogistration.defaultProps = {
optionalFields: {},
redirectToRecommendationsPage: false,
userId: null,
registrationEmbedded: false,
host: '',
};

RedirectLogistration.propTypes = {
Expand All @@ -104,8 +93,6 @@ RedirectLogistration.propTypes = {
optionalFields: PropTypes.shape({}),
redirectToRecommendationsPage: PropTypes.bool,
userId: PropTypes.number,
registrationEmbedded: PropTypes.bool,
host: PropTypes.string,
};

export default RedirectLogistration;
Loading

0 comments on commit d5d3fcd

Please sign in to comment.