Fix label delete

This commit is contained in:
Paulo Gustavo Veiga 2022-02-09 16:49:48 -08:00
parent 62e009b7e4
commit 571895a2b3
2 changed files with 8 additions and 11 deletions

View File

@ -496,7 +496,7 @@ public class MindmapController extends BaseController {
} }
} }
@RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/xml", "application/json", "application/wisemapping+xml"}) @RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/xml", "application/json"})
@ResponseStatus(value = HttpStatus.CREATED) @ResponseStatus(value = HttpStatus.CREATED)
public void createMap(@RequestBody(required = false) RestMindmap restMindmap, @NotNull HttpServletResponse response, @RequestParam(required = false) String title, @RequestParam(required = false) String description) throws IOException, WiseMappingException { public void createMap(@RequestBody(required = false) RestMindmap restMindmap, @NotNull HttpServletResponse response, @RequestParam(required = false) String title, @RequestParam(required = false) String description) throws IOException, WiseMappingException {
// If a default maps has not been defined, just create one ... // If a default maps has not been defined, just create one ...
@ -508,11 +508,9 @@ public class MindmapController extends BaseController {
if (title != null && !title.isEmpty()) { if (title != null && !title.isEmpty()) {
restMindmap.setTitle(title); restMindmap.setTitle(title);
} }
if (description != null && !description.isEmpty()) {
description = description != null && !description.isEmpty() ? description : "";
restMindmap.setDescription(description); restMindmap.setDescription(description);
} else {
restMindmap.setDescription("");
}
// Validate ... // Validate ...
final BindingResult result = new BeanPropertyBindingResult(restMindmap, ""); final BindingResult result = new BeanPropertyBindingResult(restMindmap, "");
@ -578,7 +576,7 @@ public class MindmapController extends BaseController {
return new ValidationException(result); return new ValidationException(result);
} }
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}/labels/{lid)}") @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}/labels/{lid}")
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void removeLabelFromMap(@PathVariable int id, @PathVariable int lid) throws WiseMappingException { public void removeLabelFromMap(@PathVariable int id, @PathVariable int lid) throws WiseMappingException {
final User user = Utils.getUser(); final User user = Utils.getUser();

View File

@ -38,7 +38,6 @@
var readOnly = ${readOnlyMode}; var readOnly = ${readOnlyMode};
var lockTimestamp = '${lockTimestamp}'; var lockTimestamp = '${lockTimestamp}';
var lockSession = '${lockSession}'; var lockSession = '${lockSession}';
var locale = '${locale}';
var mindmapLocked = ${mindmapLocked}; var mindmapLocked = ${mindmapLocked};
var mindmapLockedMsg = '<spring:message code="MINDMAP_LOCKED" arguments="${lockInfo.user.fullName},${lockInfo.user.email}"/>'; var mindmapLockedMsg = '<spring:message code="MINDMAP_LOCKED" arguments="${lockInfo.user.fullName},${lockInfo.user.email}"/>';
var userOptions = ${mindmap.properties}; var userOptions = ${mindmap.properties};