Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion frontend/.storybook/decorators/withPublicTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PublicBase from 'design-library/templates/base/public-base/public-base';
import SignupSigninBase from 'design-library/templates/base/signup-signin-base/signup-signin-base';
import ExplorerPublicPage from 'design-library/pages/public-pages/explorer-public-page/explorer-public-page/explorer-public-page';

export const withPublicTemplate = (Story: any, context: any) => {
Expand Down Expand Up @@ -27,4 +28,12 @@ export const withPublicExplorerTemplate = (Story: any, context: any) => {
<Story />
</ExplorerPublicPage>
)
};
};

export const withSignupSigninBaseTemplate = (Story: any, context: any) => {
return (
<SignupSigninBase>
<Story />
</SignupSigninBase>
)
};
9 changes: 4 additions & 5 deletions frontend/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ module.exports = {
webpackFinal: async (config) => {
config.resolve.alias = {
...config.resolve.alias,
images: path.resolve(__dirname, "../src/images"), // Add your alias
app: path.resolve(__dirname, "../src"), // Add your alias
"images": path.resolve(__dirname, "../src/images"), // Add your alias
"design-library": path.resolve(__dirname, "../src/components/design-library"), // Add your alias
"@material-ui/core": "@mui/material", // map MUI v4 import to MUI v5 if present
images: path.resolve(__dirname, "../src/images"),
app: path.resolve(__dirname, "../src"),
"images": path.resolve(__dirname, "../src/images"),
"design-library": path.resolve(__dirname, "../src/components/design-library"),
};
config.resolve.fallback = {
...config.resolve.fallback,
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/actions/loginActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ export const forgotPassword = data => {
.post(api.API_URL + '/auth/forgot-password', data)
.then(response => {
if(response) {
dispatch(addNotification('user.forgot.password.successfull'))
return dispatch(addNotification('user.forgot.password.successfull'))
} else {
dispatch(addNotification('user.forgot.password.error'))
return dispatch(addNotification('user.forgot.password.error'))
}
})
.catch(error => {
Expand Down Expand Up @@ -286,7 +286,7 @@ const searchUserRequested = () => {
}

const searchUserSuccess = user => {
return { type: SEARCH_USER_SUCCESS, logged: false, completed: true, user: user }
return { type: SEARCH_USER_SUCCESS, logged: false, completed: true, data: user }
}

const searchUserError = error => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ We may update this Cookie Policy from time to time to reflect changes in our pra
{br}{br}
Contact us
{br}{br}
If you have any questions or concerns about this Cookie Policy or our use of cookies on Gitpay, please contact us at [insert contact information].
If you have any questions or concerns about this Cookie Policy or our use of cookies on Gitpay, please contact us at contact@gitpay.me.
{br}
Please note that this Cookie Policy should be read in conjunction with our Privacy Policy, which provides further information on how we collect, use, and disclose your personal data.
`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { useEffect } from 'react'
import Auth from '../../../../../../modules/auth'
import { useHistory, useParams } from 'react-router-dom'

const Session = () => {
const history = useHistory()
const { token } = useParams<{ token: string }>()

useEffect(() => {
const referer = Auth.getReferer()

Auth.authenticateUser(token)

if (referer && referer !== '/') {
history.replace(referer)
} else {
history.replace('/profile')
}
}, [token, history])

return null
}

export default Session
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import AccountActivation from 'design-library/pages/public-pages/session-public-pages/account-activation/account-activation';

const AccountActivationPage = ({
activateAccount,
}) => {

return <AccountActivation onActivateAccount={activateAccount} />;
}

export default AccountActivationPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import ForgotPasswordPage from 'design-library/pages/public-pages/session-public-pages/forgot-password-page/forgot-password-page';

const ForgotPage = ({
forgotPassword,
}) => {
return (
<ForgotPasswordPage
forgotPassword={forgotPassword}
/>
);
};
export default ForgotPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { useEffect } from "react"
import ResetPasswordPage from "design-library/pages/public-pages/session-public-pages/reset-password-page/reset-password-page"
import { useParams } from "react-router-dom";

const ResetPage = ({ user, searchUser, resetPassword }) => {
const { token } = useParams<{ token: string }>()

useEffect(() => {
if (token) {
searchUser({ recover_password_token: token })
}
}, [token, searchUser])

return (
<ResetPasswordPage
user={user}
resetPassword={resetPassword}
/>
);
}

export default ResetPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { HashRouter, Route, Switch } from 'react-router-dom';
import SignupSigninPage from 'design-library/templates/base/signup-signin-base/signup-signin-base';
import Session from '../components/session';
import AccountActivation from '../../../../../../containers/account-activation'
import LoginPageContainer from '../../../../../../containers/login-page'
import RegisterPageContainer from '../../../../../../containers/register-page'
import ForgotPasswordPageContainer from '../../../../../../containers/forgot-password-page'
import ResetPasswordPageContainer from '../../../../../../containers/reset-password-page'

const SessionPage = () => {
return (
<SignupSigninPage>
<HashRouter>
<Switch>
<Route exact path="/signin" component={ LoginPageContainer } />
<Route exact path="/signin/:status" component={ LoginPageContainer } />
<Route exact path="/signup" component={ RegisterPageContainer } />
<Route exact path="/reset-password/:token" component={ ResetPasswordPageContainer } />
<Route exact path="/token/:token" component={ Session } />
<Route exact path="/activate/user/:userId/token/:token" component={ AccountActivation } />
<Route exact path="/signup/:status" component={ RegisterPageContainer } />
<Route exact path="/forgot" component={ ForgotPasswordPageContainer } />
</Switch>
</HashRouter>
</SignupSigninPage>
);
};

export default SessionPage;

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'
import SigninPageTemplate from 'design-library/pages/public-pages/session-public-pages/signin-page/signin-page'

const SigninPage = ({
addNotification,
}) => {
return (
<SigninPageTemplate
addNotification={addNotification}
/>
)
}

export default SigninPage
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
import SignupPageTemplate from 'design-library/pages/public-pages/session-public-pages/signup-page/signup-page'

const SignupPage = ({
fetchRoles,
registerUser,
roles,
}) => {
return (
<SignupPageTemplate
fetchRoles={fetchRoles}
handleSignup={registerUser}
roles={roles}
/>
)
}

export default SignupPage

This file was deleted.

This file was deleted.

Loading