Fixed issue where DashboardState was saved with partial details
This commit is contained in:
parent
aab5c2d8f8
commit
921654200d
2 changed files with 20 additions and 19 deletions
2
pom.xml
2
pom.xml
|
@ -16,7 +16,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>2.4</version>
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<!-- Run shade goal on package phase -->
|
<!-- Run shade goal on package phase -->
|
||||||
<execution>
|
<execution>
|
||||||
|
|
|
@ -395,25 +395,26 @@ public class DashboardController implements Initializable {
|
||||||
*/
|
*/
|
||||||
public DashboardState getState() {
|
public DashboardState getState() {
|
||||||
DashboardState dashboardState = null;
|
DashboardState dashboardState = null;
|
||||||
try {
|
switch (httpMethodBox.getValue()) {
|
||||||
switch (httpMethodBox.getValue()) {
|
case "POST":
|
||||||
case "POST":
|
case "PUT":
|
||||||
case "PUT":
|
dashboardState = new DashboardState(bodyTabController.getBasicRequest(httpMethodBox.getValue()));
|
||||||
dashboardState = new DashboardState(bodyTabController.getBasicRequest(httpMethodBox.getValue()));
|
dashboardState.setHeaders(headerTabController.getHeaders());
|
||||||
dashboardState.setHeaders(headerTabController.getHeaders());
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
// For GET, DELETE requests
|
||||||
// For GET, DELETE requests
|
dashboardState = new DashboardState();
|
||||||
dashboardState = new DashboardState();
|
|
||||||
}
|
|
||||||
|
|
||||||
dashboardState.setTarget(addressField.getText());
|
|
||||||
dashboardState.setHttpMethod(httpMethodBox.getValue());
|
|
||||||
dashboardState.setHeaders(headerTabController.getHeaders());
|
|
||||||
dashboardState.setParams(getParams());
|
|
||||||
} catch (MalformedURLException MURLE) {
|
|
||||||
System.out.println("Dashboard state was saved with a malformed URL.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
dashboardState.setTarget(addressField.getText());
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
System.out.println("Dashboard state was saved with an invalid URL.");
|
||||||
|
}
|
||||||
|
dashboardState.setHttpMethod(httpMethodBox.getValue());
|
||||||
|
dashboardState.setHeaders(headerTabController.getHeaders());
|
||||||
|
dashboardState.setParams(getParams());
|
||||||
|
|
||||||
return dashboardState;
|
return dashboardState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue