Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
sofyenne committed Nov 27, 2024
1 parent f549fb0 commit c3a0b76
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ DraftPage createDraftForExistPage(DraftPage draftNoteToSave,
String revision,
long currentTimeMillis,
String username) throws WikiException;

/**
* Creates a draft for a new page
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ public Page getNoteOfNoteBookByName(String noteType,
Map<String, List<MetadataItem>> metadata = retrieveMetadataItems(page.getId(), userIdentity.getUserId());
page.setMetadatas(metadata);
}

return page;
}

Expand Down Expand Up @@ -1079,6 +1080,7 @@ public void createVersionOfNote(Page note, String userName) throws WikiException
Utils.broadcast(listenerService, "note.page.version.created", this, eventData);
}
}

/**
* {@inheritDoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -796,4 +793,5 @@ public static void sendMentionInNoteNotification(Page note, Page originalNote, S
.with(mentionNotificationCtx.makeCommand(PluginKey.key(MentionInNoteNotificationPlugin.ID)))
.execute(mentionNotificationCtx);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
</v-app>
</template>
<script>
export default {
data() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,4 @@ export function isSameContent(content, originalContent) {
}
function getString(body) {
return new DOMParser().parseFromString(body, 'text/html').documentElement.textContent.replace(/&nbsp;/g, '').trim();
}


}

0 comments on commit c3a0b76

Please sign in to comment.