Skip to content

Commit 2c6e684

Browse files
authored
Merge pull request #84 from databucket/3.4.3
v.3.4.3
2 parents d038000 + 8ac8816 commit 2c6e684

14 files changed

Lines changed: 55 additions & 23 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = 'pl.databucket'
9-
version = '3.4.2'
9+
version = '3.4.3'
1010
targetCompatibility = 8
1111
sourceCompatibility = 8
1212

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"homepage": ".",
33
"name": "databucket",
4-
"version": "3.4.2",
4+
"version": "3.4.3",
55
"private": true,
66
"dependencies": {
77
"@material-ui/core": "4.12.4",

frontend/src/components/dialogs/InfoDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function InfoDialog() {
6262
>
6363
<img style={{marginLeft: '100px', marginTop: '20px'}} src={DatabucketLogo} alt='' width='399' height='65'/>
6464
<div style={{margin: '20px'}}>
65-
<Typography color='secondary'>Version: <b>3.4.2</b></Typography>
65+
<Typography color='secondary'>Version: <b>3.4.3</b></Typography>
6666
<Link target='_blank' href='https://www.databucket.pl' color="primary">www.databucket.pl</Link><br/>
6767
<Link target='_blank' href='https://github.com/databucket/databucket-server' color="textSecondary">Source code</Link><br/>
6868
<Link target='_blank' href='https://github.com/databucket/databucket-server/wiki' color="textSecondary">Documentation</Link><br/>

frontend/src/components/public/LoginPage.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ export default function LoginPage() {
273273
return getProjectsPaper();
274274
case 2:
275275
const pathname = getPathname();
276-
if (pathname != null && pathname !== "null") {
276+
if (pathname != null
277+
&& pathname !== "null"
278+
&& !pathname.includes("confirmation")
279+
&& !pathname.includes("forgot-password")
280+
&& !pathname.includes("sign-up")
281+
) {
277282
setPathname(null);
278283
return redirectTo(pathname)
279284
} else {
@@ -291,7 +296,7 @@ export default function LoginPage() {
291296
<div className="ContainerClass">
292297
{<img src={Logo} alt=''/>}
293298
{paper()}
294-
<Typography variant="caption">3.4.2</Typography>
299+
<Typography variant="caption">3.4.3</Typography>
295300
<MessageBox
296301
config={messageBox}
297302
onClose={() => setMessageBox({...messageBox, open: false})}

frontend/src/components/public/SignUpPage.jsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Link from "@material-ui/core/Link";
1010
import {Redirect} from "react-router-dom";
1111
import {validateEmail} from "../../utils/Misc";
1212
import {getBaseUrl, getContextPath} from "../../utils/UrlBuilder";
13-
import {handleLoginErrors} from "../../utils/FetchHelper";
13+
import {handleErrors, handleLoginErrors} from "../../utils/FetchHelper";
1414

1515
export default function SignUpPage() {
1616

@@ -83,6 +83,7 @@ export default function SignUpPage() {
8383
}
8484

8585
const submitData = token => {
86+
let errorResp = false;
8687
const payload = {
8788
username: username,
8889
email: email,
@@ -96,15 +97,20 @@ export default function SignUpPage() {
9697
body: JSON.stringify(payload),
9798
headers: {'Content-Type': 'application/json'}
9899
})
99-
.then(handleLoginErrors)
100-
.then(res => res.json())
101-
.then(res => {
102-
setLoading(false);
103-
setMessageBox({open: true, severity: 'info', title: 'Send confirmation email', message: ""});
104-
})
100+
.then(handleErrors)
105101
.catch(error => {
102+
errorResp = true;
106103
setLoading(false);
107104
setMessageBox({open: true, severity: 'error', title: 'Registration failed', message: error});
105+
})
106+
.then(() => {
107+
if (!errorResp) {
108+
setLoading(false);
109+
setMessageBox({open: true, severity: 'info', title: 'Send confirmation email', message: ""});
110+
setTimeout(() => {
111+
setBack(true);
112+
}, 6000)
113+
}
108114
});
109115
}
110116

frontend/src/route/AppRouter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import {BrowserRouter, Redirect, Switch} from 'react-router-dom';
2+
import {BrowserRouter, Redirect, Route, Switch} from 'react-router-dom';
33
import LoginPage from '../components/public/LoginPage';
44
import NotFoundPage from '../components/NotFoundPage';
55
import PublicRoute from './PublicRoute'
@@ -27,9 +27,9 @@ export default function AppRouter() {
2727
<Switch>
2828
<Redirect exact from='/' to={getProjectDataPath()}/>
2929
<PublicRoute exact restricted={true} path="/login" component={LoginPage}/>
30-
<PublicRoute exact restricted={true} path="/forgot-password" component={ForgotPasswordPage}/>
31-
<PublicRoute exact restricted={true} path="/sign-up" component={SignUpPage}/>
32-
<PublicRoute exact restricted={true} path="/confirmation/*" component={ConfirmationPage}/>
30+
<Route exact restricted={true} path="/forgot-password" component={ForgotPasswordPage}/>
31+
<Route exact restricted={true} path="/sign-up" component={SignUpPage}/>
32+
<Route path="/confirmation/*" component={ConfirmationPage}/>
3333
<ChangePasswordRoute exact path="/change-password" component={ChangePasswordPage}/>
3434
<ManagementRoute path="/management" component={_ManagementTabs}/>
3535
<ProjectRoute path="/project" component={_ProjectRouteInternal}/>

src/main/java/pl/databucket/server/configuration/SwaggerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Docket confDataContext() {
4848
private ApiInfo apiInfo() {
4949
return new ApiInfoBuilder()
5050
.title("Databucket API")
51-
.version("3.4.2")
51+
.version("3.4.3")
5252
.build();
5353
}
5454
}

src/main/java/pl/databucket/server/controller/PublicController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public ResponseEntity<?> signUp(@RequestBody SignUpDtoRequest signUpDtoRequest)
225225
return exceptionFormatter.customPublicException("Given email already exists", HttpStatus.CONFLICT);
226226

227227
manageUserService.signUpUser(signUpDtoRequest);
228-
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
228+
return exceptionFormatter.responseMessage("An account has been created for a new user", HttpStatus.CREATED);
229229
} catch (MessagingException | MailSendException e) {
230230
return exceptionFormatter.customException("Mail service exception!", HttpStatus.SERVICE_UNAVAILABLE);
231231
} catch (Exception e) {

src/main/java/pl/databucket/server/exception/ExceptionFormatter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,10 @@ public ResponseEntity<Map<String, Object>> customPublicException(String message,
5353
return new ResponseEntity<>(response, status);
5454
}
5555

56+
public ResponseEntity<Map<String, Object>> responseMessage(String message, HttpStatus status) {
57+
Map<String, Object> response = new HashMap<>();
58+
response.put("message", message);
59+
return new ResponseEntity<>(response, status);
60+
}
61+
5662
}

src/main/java/pl/databucket/server/security/WebSecurityConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ protected void configure(HttpSecurity http) throws Exception {
5858
"/actuator/**",
5959
"/**/favicon.ico",
6060
"/login",
61+
"/confirmation/**",
62+
"/forgot-password",
63+
"/sign-up",
6164
"/change-password",
6265
"/project",
6366
"/project/**",

0 commit comments

Comments
 (0)