diff --git a/notes-service/src/main/java/org/exoplatform/wiki/service/NoteService.java b/notes-service/src/main/java/org/exoplatform/wiki/service/NoteService.java index 7f6c07fc28..65f504fbb4 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/service/NoteService.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/service/NoteService.java @@ -591,6 +591,7 @@ DraftPage createDraftForExistPage(DraftPage draftNoteToSave, String revision, long currentTimeMillis, String username) throws WikiException; + /** * Creates a draft for a new page * diff --git a/notes-service/src/main/java/org/exoplatform/wiki/service/impl/NoteServiceImpl.java b/notes-service/src/main/java/org/exoplatform/wiki/service/impl/NoteServiceImpl.java index 9b19af7e1e..9feea5227c 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/service/impl/NoteServiceImpl.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/service/impl/NoteServiceImpl.java @@ -656,6 +656,7 @@ public Page getNoteOfNoteBookByName(String noteType, Map> metadata = retrieveMetadataItems(page.getId(), userIdentity.getUserId()); page.setMetadatas(metadata); } + return page; } @@ -1079,6 +1080,7 @@ public void createVersionOfNote(Page note, String userName) throws WikiException Utils.broadcast(listenerService, "note.page.version.created", this, eventData); } } + /** * {@inheritDoc} */ diff --git a/notes-service/src/main/java/org/exoplatform/wiki/service/rest/NotesRestService.java b/notes-service/src/main/java/org/exoplatform/wiki/service/rest/NotesRestService.java index 32ffe7dbd7..386c803ce6 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/service/rest/NotesRestService.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/service/rest/NotesRestService.java @@ -508,7 +508,6 @@ public Response createNote(@Parameter(description = "note object to be created", } String noteBookType = note.getWikiType(); String noteBookOwner = note.getWikiOwner(); - String draftId = note.getProperties().isDraft() ? String.valueOf(note.getProperties().getNoteId()) : null; try { Identity identity = ConversationState.getCurrent().getIdentity(); if (StringUtils.isNotEmpty(note.getParentPageId())) { @@ -543,7 +542,6 @@ public Response createNote(@Parameter(description = "note object to be created", note.getParentPageName(), io.meeds.notes.rest.utils.EntityBuilder.toPage(note), identity); - noteService.createVersionOfNote(createdNote, currentUser); return Response.ok(createdNote, MediaType.APPLICATION_JSON).cacheControl(cc).build(); } catch (IllegalAccessException e) { log.error("User does not have view permissions on the note {}", note.getName(), e); @@ -570,7 +568,6 @@ public Response saveDraft(@RequestBody(description = "Note draft page object to log.warn("Draft Note's title should not be number"); return Response.status(Response.Status.BAD_REQUEST).entity("{ message: Draft Note's title should not be number}").build(); } - draftNoteToSave.setContent(draftNoteToSave.getContent()); String noteBookType = draftNoteToSave.getWikiType(); String noteBookOwner = draftNoteToSave.getWikiOwner(); Page parentNote = null; diff --git a/notes-service/src/main/java/org/exoplatform/wiki/utils/Utils.java b/notes-service/src/main/java/org/exoplatform/wiki/utils/Utils.java index 4d0e1395f3..956a0b71d3 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/utils/Utils.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/utils/Utils.java @@ -40,17 +40,14 @@ import java.util.Objects; import java.util.ResourceBundle; import java.util.Set; -import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.apache.commons.lang3.StringUtils; -import org.exoplatform.wiki.service.plugin.WikiDraftPageAttachmentPlugin; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; import org.suigeneris.jrcs.diff.DifferentiationFailedException; import org.exoplatform.commons.api.notification.NotificationContext; @@ -796,4 +793,5 @@ public static void sendMentionInNoteNotification(Page note, Page originalNote, S .with(mentionNotificationCtx.makeCommand(PluginKey.key(MentionInNoteNotificationPlugin.ID))) .execute(mentionNotificationCtx); } + } diff --git a/notes-webapp/src/main/webapp/vue-app/notes-editor/components/NotesEditorDashboard.vue b/notes-webapp/src/main/webapp/vue-app/notes-editor/components/NotesEditorDashboard.vue index f94d12c5c6..6cdae2ca0e 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes-editor/components/NotesEditorDashboard.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes-editor/components/NotesEditorDashboard.vue @@ -64,7 +64,6 @@