diff --git a/notes-service/src/main/java/io/meeds/notes/model/NotePageProperties.java b/notes-service/src/main/java/io/meeds/notes/model/NotePageProperties.java index 4e42b68c4..5d2318767 100644 --- a/notes-service/src/main/java/io/meeds/notes/model/NotePageProperties.java +++ b/notes-service/src/main/java/io/meeds/notes/model/NotePageProperties.java @@ -37,5 +37,10 @@ public class NotePageProperties implements Serializable { private NoteFeaturedImage featuredImage; + private boolean hideAuthor; + + private boolean hideReaction; + private boolean isDraft; + } diff --git a/notes-service/src/main/java/io/meeds/notes/rest/model/PageEntity.java b/notes-service/src/main/java/io/meeds/notes/rest/model/PageEntity.java index 1085dc6ca..aaaa3a136 100644 --- a/notes-service/src/main/java/io/meeds/notes/rest/model/PageEntity.java +++ b/notes-service/src/main/java/io/meeds/notes/rest/model/PageEntity.java @@ -44,4 +44,6 @@ public class PageEntity implements Serializable { private String lang; private PagePropertiesEntity properties; + + private boolean extensionDataUpdated; } diff --git a/notes-service/src/main/java/io/meeds/notes/rest/model/PagePropertiesEntity.java b/notes-service/src/main/java/io/meeds/notes/rest/model/PagePropertiesEntity.java index 36a491307..1b79fa827 100644 --- a/notes-service/src/main/java/io/meeds/notes/rest/model/PagePropertiesEntity.java +++ b/notes-service/src/main/java/io/meeds/notes/rest/model/PagePropertiesEntity.java @@ -35,5 +35,9 @@ public class PagePropertiesEntity implements Serializable { private FeaturedImageEntity featuredImage; + private boolean hideAuthor; + + private boolean hideReaction; + private boolean isDraft; } diff --git a/notes-service/src/main/java/io/meeds/notes/rest/utils/EntityBuilder.java b/notes-service/src/main/java/io/meeds/notes/rest/utils/EntityBuilder.java index c382f8e01..f78c7832c 100644 --- a/notes-service/src/main/java/io/meeds/notes/rest/utils/EntityBuilder.java +++ b/notes-service/src/main/java/io/meeds/notes/rest/utils/EntityBuilder.java @@ -40,6 +40,8 @@ public static NotePageProperties toNotePageProperties(PagePropertiesEntity pageP return new NotePageProperties(pagePropertiesEntity.getNoteId(), pagePropertiesEntity.getSummary(), toNoteFeaturedImage(pagePropertiesEntity.getFeaturedImage()), + pagePropertiesEntity.isHideAuthor(), + pagePropertiesEntity.isHideReaction(), pagePropertiesEntity.isDraft()); } diff --git a/notes-service/src/main/java/org/exoplatform/wiki/jpa/EntityConverter.java b/notes-service/src/main/java/org/exoplatform/wiki/jpa/EntityConverter.java index 2cecfe385..9633c1b8b 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/jpa/EntityConverter.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/jpa/EntityConverter.java @@ -38,6 +38,7 @@ import org.exoplatform.social.core.space.model.Space; import org.exoplatform.social.core.space.spi.SpaceService; import org.exoplatform.social.metadata.MetadataService; +import org.exoplatform.social.metadata.model.MetadataItem; import org.exoplatform.social.metadata.model.MetadataKey; import org.exoplatform.social.metadata.model.MetadataType; import org.exoplatform.wiki.WikiException; @@ -51,23 +52,26 @@ import java.io.ByteArrayInputStream; import java.util.*; +import java.util.stream.Collectors; /** * Utility class to convert JPA entity objects */ public class EntityConverter { - private static final Log LOG = ExoLogger.getLogger(EntityConverter.class); + private static final Log LOG = ExoLogger.getLogger(EntityConverter.class); - private static SpaceService spaceService; + private static SpaceService spaceService; - private static MetadataService metadataService; + private static MetadataService metadataService; - public static final MetadataType NOTES_METADATA_TYPE = new MetadataType(1001, "notes"); + public static final MetadataType NOTES_METADATA_TYPE = new MetadataType(1001, "notes"); - public static final MetadataKey NOTES_METADATA_KEY = new MetadataKey(NOTES_METADATA_TYPE.getName(), - Utils.NOTES_METADATA_OBJECT_TYPE, - 0); + public static final MetadataKey NOTES_METADATA_KEY = new MetadataKey(NOTES_METADATA_TYPE.getName(), + Utils.NOTES_METADATA_OBJECT_TYPE, + 0); + + private static final List ORIGINAL_SHARED_PROPERTIES = List.of("hideReaction", "hideAuthor"); public static Wiki convertWikiEntityToWiki(WikiEntity wikiEntity) { Wiki wiki = null; @@ -147,7 +151,7 @@ public static Page convertPageEntityToPage(PageEntity pageEntity) { } return page; } - + public static void buildNotePageMetadata(Page note, boolean isDraft) { if (note == null) { return; @@ -158,6 +162,7 @@ public static void buildNotePageMetadata(Page note, boolean isDraft) { if (note.getLang() != null) { noteId = noteId + "-" + note.getLang(); } + Map originalNoteSharedProperties = getOriginalNoteSharedProperties(note, space.getId()); NoteMetadataObject noteMetadataObject = new NoteMetadataObject(isDraft ? "noteDraftPage" : "notePage", noteId, note.getParentPageId(), @@ -167,40 +172,13 @@ public static void buildNotePageMetadata(Page note, boolean isDraft) { .findFirst() .ifPresent(metadataItem -> { if (!MapUtils.isEmpty(metadataItem.getProperties())) { - buildPageProperties(metadataItem.getProperties(), note); + buildPageProperties(metadataItem.getProperties(), originalNoteSharedProperties, note); } }); } } - - private static void buildPageProperties(Map properties, Page note) { - NotePageProperties notePageProperties = new NotePageProperties(); - NoteFeaturedImage noteFeaturedImage = new NoteFeaturedImage(); - notePageProperties.setNoteId(Long.parseLong(note.getId())); - notePageProperties.setSummary(properties.get(NoteServiceImpl.SUMMARY_PROP)); - noteFeaturedImage.setId(Long.valueOf(properties.getOrDefault(NoteServiceImpl.FEATURED_IMAGE_ID, "0"))); - noteFeaturedImage.setLastUpdated(Long.valueOf(properties.getOrDefault(NoteServiceImpl.FEATURED_IMAGE_UPDATED_DATE, "0"))); - noteFeaturedImage.setAltText(properties.get(NoteServiceImpl.FEATURED_IMAGE_ALT_TEXT)); - notePageProperties.setDraft(note.isDraftPage()); - notePageProperties.setFeaturedImage(noteFeaturedImage); - note.setProperties(notePageProperties); - } - - private static SpaceService getSpaceService() { - if (spaceService == null) { - spaceService = CommonsUtils.getService(SpaceService.class); - } - return spaceService; - } - private static MetadataService getMetadataService() { - if (metadataService == null) { - metadataService = CommonsUtils.getService(MetadataService.class); - } - return metadataService; - } - public static List convertPermissionEntitiesToPermissionEntries(List permissionEntities, List filteredPermissionTypes) { List permissionEntries = new ArrayList<>(); @@ -586,4 +564,60 @@ public static List toPageHistoryVersions(List pa public static List toDraftPages(List draftPageEntities) { return draftPageEntities.stream().map(EntityConverter::convertDraftPageEntityToDraftPage).toList(); } + + private static Map getOriginalNoteSharedProperties(Page note, String spaceId) { + if (note.getLang() == null || note.isDraftPage()) { + return new HashMap<>(); + } + NoteMetadataObject originalNoteMetadataObject = new NoteMetadataObject("notePage", + note.getId(), + note.getParentPageId(), + Long.parseLong(spaceId)); + List metadataItems = getMetadataService().getMetadataItemsByMetadataAndObject(NOTES_METADATA_KEY, + originalNoteMetadataObject); + Map originalNoteSharedProperties = new HashMap<>(); + if (!CollectionUtils.isEmpty(metadataItems)) { + originalNoteSharedProperties = metadataItems.getFirst().getProperties(); + } + return originalNoteSharedProperties.entrySet() + .stream() + .filter(entry -> ORIGINAL_SHARED_PROPERTIES.contains(entry.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } + + private static void buildPageProperties(Map properties, + Map originalNoteSharedProperties, + Page note) { + Map finalProperties = new HashMap<>(properties); + finalProperties.putAll(originalNoteSharedProperties); + NotePageProperties notePageProperties = new NotePageProperties(); + NoteFeaturedImage noteFeaturedImage = new NoteFeaturedImage(); + notePageProperties.setNoteId(Long.parseLong(note.getId())); + notePageProperties.setSummary(finalProperties.get(NoteServiceImpl.SUMMARY_PROP)); + notePageProperties.setHideAuthor(Boolean.parseBoolean(finalProperties.getOrDefault(NoteServiceImpl.HIDE_AUTHOR_PROP, + "false"))); + notePageProperties.setHideReaction(Boolean.parseBoolean(properties.getOrDefault(NoteServiceImpl.HIDE_REACTION_PROP, + "false"))); + noteFeaturedImage.setId(Long.valueOf(finalProperties.getOrDefault(NoteServiceImpl.FEATURED_IMAGE_ID, "0"))); + noteFeaturedImage.setLastUpdated(Long.valueOf(finalProperties.getOrDefault(NoteServiceImpl.FEATURED_IMAGE_UPDATED_DATE, + "0"))); + noteFeaturedImage.setAltText(finalProperties.get(NoteServiceImpl.FEATURED_IMAGE_ALT_TEXT)); + notePageProperties.setDraft(note.isDraftPage()); + notePageProperties.setFeaturedImage(noteFeaturedImage); + note.setProperties(notePageProperties); + } + + private static SpaceService getSpaceService() { + if (spaceService == null) { + spaceService = CommonsUtils.getService(SpaceService.class); + } + return spaceService; + } + + private static MetadataService getMetadataService() { + if (metadataService == null) { + metadataService = CommonsUtils.getService(MetadataService.class); + } + return metadataService; + } } diff --git a/notes-service/src/main/java/org/exoplatform/wiki/model/Page.java b/notes-service/src/main/java/org/exoplatform/wiki/model/Page.java index 415bf763a..e96fddb8a 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/model/Page.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/model/Page.java @@ -95,6 +95,8 @@ public class Page { private boolean hasChild; + private String latestVersionId; + private boolean isDeleted; private Page parent; diff --git a/notes-service/src/main/java/org/exoplatform/wiki/service/ExportThread.java b/notes-service/src/main/java/org/exoplatform/wiki/service/ExportThread.java index 1047f7f8b..c7527a616 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/service/ExportThread.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/service/ExportThread.java @@ -455,7 +455,8 @@ public NoteToExport getNoteToExport(NoteToExport note, int exportId) throws Wiki public String processNotesLinkForExport(NoteToExport note) throws WikiException { String content = note.getContent(); - String noteLinkprefix = "class=\"noteLink\" href=\"(?:.*?/|)(\\d+)"; + String noteLinkprefix = "class=\"noteLink\" href=\"(?:.*?/)?(\\d+)\""; + String contentUpdated = content; Map urlToReplaces = new HashMap<>(); Pattern pattern = Pattern.compile(noteLinkprefix); @@ -480,7 +481,7 @@ public String processNotesLinkForExport(NoteToExport note) throws WikiException String noteParams = IMAGE_URL_REPLACEMENT_PREFIX + linkedNote.getWikiType() + IMAGE_URL_REPLACEMENT_SUFFIX + IMAGE_URL_REPLACEMENT_PREFIX + linkedNote.getWikiOwner() + IMAGE_URL_REPLACEMENT_SUFFIX + IMAGE_URL_REPLACEMENT_PREFIX + linkedNote.getName() + IMAGE_URL_REPLACEMENT_SUFFIX; - urlToReplaces.put(matchedLink + "\"", "class=\"noteLink\" href=\"" + noteParams + "\""); + urlToReplaces.put(matchedLink, "class=\"noteLink\" href=\"" + noteParams + "\""); } } if (!urlToReplaces.isEmpty()) { 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 9c3a97d38..918c3ff06 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 @@ -142,6 +142,10 @@ public class NoteServiceImpl implements NoteService { public static final String SUMMARY_PROP = "summary"; + public static final String HIDE_AUTHOR_PROP = "hideAuthor"; + + public static final String HIDE_REACTION_PROP = "hideReaction"; + public static final String FEATURED_IMAGE_ID = "featuredImageId"; public static final String FEATURED_IMAGE_UPDATED_DATE = "featuredImageUpdatedDate"; @@ -256,6 +260,7 @@ public Page createNote(Wiki noteBook, String parentNoteName, Page note, Identity note.setContent(note.getContent()); Page createdPage = createNote(noteBook, parentPage, note); NotePageProperties properties = note.getProperties(); + String draftPageId = String.valueOf(properties != null && properties.isDraft() ? properties.getNoteId() : null); try { if (properties != null) { properties.setNoteId(Long.parseLong(createdPage.getId())); @@ -274,6 +279,15 @@ public Page createNote(Wiki noteBook, String parentNoteName, Page note, Identity createdPage.setCanImport(canImportNotes(note.getAuthor(), space, note)); createdPage.setCanView(canViewNotes(note.getAuthor(), space, note)); } + dataStorage.addPageVersion(createdPage, userIdentity.getUserId()); + PageVersion pageVersion = dataStorage.getPublishedVersionByPageIdAndLang(Long.valueOf(createdPage.getId()), createdPage.getLang()); + createdPage.setLatestVersionId(pageVersion != null ? pageVersion.getId() : null); + if (pageVersion != null && draftPageId != null) { + Map eventData = new HashMap<>(); + eventData.put("draftPageId", draftPageId); + eventData.put("pageVersionId", pageVersion.getId()); + Utils.broadcast(listenerService, "note.page.version.created", this, eventData); + } return createdPage; } else { throw new EntityNotFoundException("Parent note not found"); @@ -1007,6 +1021,8 @@ public List getVersionsHistoryOfNote(Page note, String userName) th @Override public void createVersionOfNote(Page note, String userName) throws WikiException { PageVersion pageVersion = dataStorage.addPageVersion(note, userName); + String pageVersionId = pageVersion.getId(); + note.setLatestVersionId(pageVersionId); if (note.getLang() != null) { try { NotePageProperties properties = note.getProperties(); @@ -1028,8 +1044,14 @@ public void createVersionOfNote(Page note, String userName) throws WikiException null, NOTE_METADATA_PAGE_OBJECT_TYPE, NOTE_METADATA_VERSION_PAGE_OBJECT_TYPE, - userName - ); + userName); + } + DraftPage draftPage = dataStorage.getLatestDraftPageByTargetPageAndLang(Long.valueOf(note.getId()), note.getLang()); + if (draftPage != null) { + Map eventData = new HashMap<>(); + eventData.put("draftPageId", draftPage.getId()); + eventData.put("pageVersionId", pageVersionId); + Utils.broadcast(listenerService, "note.page.version.created", this, eventData); } } @@ -1212,6 +1234,14 @@ public DraftPage createDraftForExistPage(DraftPage draftPage, log.error("Failed to save draft note metadata", e); } newDraftPage.setProperties(properties); + // + PageVersion pageVersion = getPublishedVersionByPageIdAndLang(Long.valueOf(newDraftPage.getTargetPageId()), newDraftPage.getLang()); + if (pageVersion != null) { + Map eventData = new HashMap<>(); + eventData.put("pageVersionId", pageVersion.getId()); + eventData.put("draftForExistingPageId", newDraftPage.getId()); + Utils.broadcast(listenerService, "note.draft.for.exist.page.created", this, eventData); + } return newDraftPage; } @@ -1407,10 +1437,16 @@ public Page getNoteByIdAndLang(Long pageId, Identity userIdentity, String source page.setContent(publishedVersion.getContent()); page.setLang(publishedVersion.getLang()); page.setProperties(publishedVersion.getProperties()); + page.setLatestVersionId(publishedVersion.getId()); if (lang != null) { page.setMetadatas(retrieveMetadataItems(pageId + "-" + lang, userIdentity.getUserId())); } } + if (page != null && publishedVersion == null && lang != null) { + //no version with lang, set the latest version id without lang + publishedVersion = dataStorage.getPublishedVersionByPageIdAndLang(pageId, null); + page.setLatestVersionId(publishedVersion == null ? null : publishedVersion.getId()); + } return page; } @@ -1423,6 +1459,7 @@ public Page getNoteByIdAndLang(Long pageId, String lang) { page.setTitle(publishedVersion.getTitle()); page.setContent(publishedVersion.getContent()); page.setLang(publishedVersion.getLang()); + page.setLatestVersionId(publishedVersion.getId()); } return page; } @@ -1716,6 +1753,8 @@ public NotePageProperties saveNoteMetadata(NotePageProperties notePageProperties properties = metadataItem.getProperties(); } properties.put(SUMMARY_PROP, notePageProperties.getSummary()); + properties.put(HIDE_AUTHOR_PROP, String.valueOf(notePageProperties.isHideAuthor())); + properties.put(HIDE_REACTION_PROP, String.valueOf(notePageProperties.isHideReaction())); if (featuredImageId != null) { properties.put(FEATURED_IMAGE_ID, String.valueOf(featuredImageId)); properties.put(FEATURED_IMAGE_UPDATED_DATE, String.valueOf(new Date().getTime())); 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 10f9630f4..027989d0d 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 @@ -226,6 +226,9 @@ public Response getNote(@Parameter(description = "NoteBook Type", required = tru } if (StringUtils.isNotBlank(lang)) { note = noteService.getNoteByIdAndLang(Long.valueOf(note.getId()), identity, source, lang); + } else { + PageVersion pageVersion = noteService.getPublishedVersionByPageIdAndLang(Long.valueOf(note.getId()), null); + note.setLatestVersionId(pageVersion == null ? null : pageVersion.getId()); } String content = note.getContent(); if (content.contains(Utils.NOTE_LINK)) { @@ -761,8 +764,8 @@ public Response updateNoteById(@Parameter(description = "Note id", required = tr } note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_CONTENT_AND_TITLE, identity); } else { - note_.setLang(note.getLang()); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_CONTENT_AND_TITLE, identity); + note_.setLang(note.getLang()); note_.setTitle(note.getTitle()); note_.setContent(note.getContent()); note_.setProperties(notePageProperties); @@ -783,8 +786,8 @@ public Response updateNoteById(@Parameter(description = "Note id", required = tr note_.setProperties(notePageProperties); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_TITLE, identity); } else { - note_.setLang(note.getLang()); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_TITLE, identity); + note_.setLang(note.getLang()); note_.setTitle(note.getTitle()); note_.setProperties(notePageProperties); } @@ -799,8 +802,8 @@ public Response updateNoteById(@Parameter(description = "Note id", required = tr note_.setProperties(notePageProperties); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_CONTENT, identity); } else { - note_.setLang(note.getLang()); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_CONTENT, identity); + note_.setLang(note.getLang()); note_.setContent(note.getContent()); note_.setProperties(notePageProperties); } @@ -815,8 +818,8 @@ public Response updateNoteById(@Parameter(description = "Note id", required = tr note_.setProperties(notePageProperties); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_PROPERTIES, identity); } else { - note_.setLang(note.getLang()); note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_PROPERTIES, identity); + note_.setLang(note.getLang()); note_.setProperties(notePageProperties); } noteService.createVersionOfNote(note_, identity.getUserId()); @@ -824,8 +827,15 @@ public Response updateNoteById(@Parameter(description = "Note id", required = tr WikiPageParams noteParams = new WikiPageParams(note_.getWikiType(), note_.getWikiOwner(), newNoteName); noteService.removeDraftOfNote(noteParams, note.getLang()); } - } else if (note_.isToBePublished()){ - note_ = noteService.updateNote(note_, PageUpdateType.PUBLISH, identity); + } else if (note_.isToBePublished()) { + note_ = noteService.updateNote(note_, PageUpdateType.PUBLISH, identity); + } else if (note.isExtensionDataUpdated()) { + note_ = noteService.updateNote(note_, PageUpdateType.EDIT_PAGE_CONTENT_AND_TITLE, identity); + noteService.createVersionOfNote(note_, identity.getUserId()); + if (!Utils.ANONYM_IDENTITY.equals(identity.getUserId())) { + WikiPageParams noteParams = new WikiPageParams(note_.getWikiType(), note_.getWikiOwner(), newNoteName); + noteService.removeDraftOfNote(noteParams, note.getLang()); + } } else { // in this case, the note didnt change on title nor content. As we need the page // url in front side, we compute it here @@ -1151,7 +1161,7 @@ public Response importNote(@Parameter(description = "Note id", required = true) log.error("User does not have move permissions on the note {}", noteId, e); return Response.status(Response.Status.UNAUTHORIZED).build(); } catch (Exception ex) { - log.warn("Failed to export note {} ", noteId, ex); + log.warn("Failed to import note {} ", noteId, ex); return Response.status(HTTPStatus.INTERNAL_ERROR).cacheControl(cc).build(); } } 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 3679f1ed8..956a0b71d 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 @@ -45,7 +45,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang3.StringUtils; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -84,11 +83,7 @@ import org.exoplatform.social.core.storage.api.IdentityStorage; import org.exoplatform.social.core.utils.MentionUtils; import org.exoplatform.social.notification.LinkProviderUtils; -import org.exoplatform.web.WebAppController; import org.exoplatform.web.application.RequestContext; -import org.exoplatform.web.controller.QualifiedName; -import org.exoplatform.web.controller.router.Router; -import org.exoplatform.web.controller.router.URIWriter; import org.exoplatform.web.url.navigation.NavigationResource; import org.exoplatform.web.url.navigation.NodeURL; import org.exoplatform.webui.application.WebuiRequestContext; @@ -605,40 +600,20 @@ public static String getRestContextName() { return PortalContainer.getCurrentRestContextName(); } - public static String getPageUrl(Page page){ - String spaceUri = getSpacesURI(page); - StringBuilder spaceUrl = new StringBuilder("/portal"); - spaceUrl.append(spaceUri); - spaceUrl.append("/notes/"); - if (!StringUtils.isEmpty(page.getId())) { - spaceUrl.append(page.getId()); - } - return spaceUrl.toString(); - } - - public static String getSpacesURI(Page page) { + public static String getPageUrl(Page page) { try { - QualifiedName REQUEST_HANDLER = QualifiedName.create("gtn", "handler"); - QualifiedName REQUEST_SITE_TYPE = QualifiedName.create("gtn", "sitetype"); - QualifiedName REQUEST_SITE_NAME = QualifiedName.create("gtn", "sitename"); - QualifiedName PATH = QualifiedName.create("gtn", "path"); - SpaceService spaceService = CommonsUtils.getService(SpaceService.class); - WebAppController webAppController = CommonsUtils.getService(WebAppController.class); - Router router = webAppController.getRouter(); + SpaceService spaceService = CommonsUtils.getService(SpaceService.class); Space space = spaceService.getSpaceByGroupId(page.getWikiOwner()); - if(space==null){ - return ""; + if (space != null) { + StringBuilder spaceUrl = new StringBuilder("/portal/s/"); + spaceUrl.append(space.getId()); + spaceUrl.append("/notes/"); + if (!StringUtils.isEmpty(page.getId())) { + spaceUrl.append(page.getId()); + } + return spaceUrl.toString(); } - Map qualifiedName = new HashedMap(); - qualifiedName.put(REQUEST_HANDLER, "portal"); - qualifiedName.put(REQUEST_SITE_TYPE, "group"); - - StringBuilder urlBuilder = new StringBuilder(); - qualifiedName.put(REQUEST_SITE_NAME, space.getGroupId()); - qualifiedName.put(PATH, space.getPrettyName()); - router.render(qualifiedName, new URIWriter(urlBuilder)); - return(urlBuilder.toString()); - + return ""; } catch (Exception e) { return ""; } diff --git a/notes-service/src/test/java/org/exoplatform/wiki/service/TestNoteService.java b/notes-service/src/test/java/org/exoplatform/wiki/service/TestNoteService.java index 62845d5ae..415a2ae91 100644 --- a/notes-service/src/test/java/org/exoplatform/wiki/service/TestNoteService.java +++ b/notes-service/src/test/java/org/exoplatform/wiki/service/TestNoteService.java @@ -36,19 +36,20 @@ import java.util.List; import org.apache.commons.io.FileUtils; +import org.exoplatform.commons.file.services.FileService; +import org.exoplatform.social.core.manager.IdentityManager; +import org.exoplatform.social.core.space.model.Space; +import org.exoplatform.social.core.space.spi.SpaceService; +import org.exoplatform.upload.UploadResource; +import org.exoplatform.upload.UploadService; import org.exoplatform.commons.ObjectAlreadyExistsException; -import org.exoplatform.commons.file.services.FileService; import org.exoplatform.portal.config.model.PortalConfig; import org.exoplatform.services.security.Identity; import org.exoplatform.services.security.IdentityConstants; import org.exoplatform.services.security.IdentityRegistry; import org.exoplatform.services.security.MembershipEntry; -import org.exoplatform.social.core.manager.IdentityManager; -import org.exoplatform.social.core.space.model.Space; -import org.exoplatform.social.core.space.spi.SpaceService; -import org.exoplatform.upload.UploadResource; -import org.exoplatform.upload.UploadService; + import org.exoplatform.wiki.WikiException; import org.exoplatform.wiki.jpa.BaseTest; import org.exoplatform.wiki.jpa.JPADataStorage; @@ -736,7 +737,14 @@ public void testRemoveOrphanDraftPagesByParentPage() throws Exception { } private Page createTestNoteWithVersionLang(String name, String lang, Identity user) throws Exception { - Wiki portalWiki = getOrCreateWiki(wService, PortalConfig.PORTAL_TYPE, "testPortal"); + identityManager.getOrCreateUserIdentity("root"); + Space space = new Space(); + space.setDisplayName("test"); + space.setPrettyName("test"); + space.setRegistration(Space.OPEN); + space.setVisibility(Space.PUBLIC); + space = spaceService.createSpace(space, "root"); + Wiki portalWiki = getOrCreateWiki(wService, PortalConfig.PORTAL_TYPE, space.getGroupId()); Page note = noteService.createNote(portalWiki, "Home", new Page(name, name), user); note.setLang(lang); note.setTitle("language title"); @@ -878,7 +886,7 @@ public void testCreateDraftForNewPageWithProperties() throws Exception { } public void testCreateDraftForExistPageWithProperties() throws Exception { - Identity user = new Identity("user"); + Identity user = new Identity("root"); this.bindMockedUploadService(); NotePageProperties notePageProperties = createNotePageProperties(0L, "alt text", "summary Test"); DraftPage draftPage = new DraftPage(); @@ -984,10 +992,10 @@ public void testFeaturedImageWhenRemoveDraftById() throws Exception { } public void testGetDraftsOfWiki() throws Exception { - Identity user = new Identity("user"); + Identity root = new Identity("root"); Wiki portalWiki = getOrCreateWiki(wService, PortalConfig.PORTAL_TYPE, "testPortal"); - Page note = noteService.createNote(portalWiki, "Home", new Page("testGetDraftsOfWiki", "testGetDraftsOfWiki"), user); - Page note2 = noteService.createNote(portalWiki, "Home", new Page("testGetDraftsOfWiki", "testGetDraftsOfWiki"), user); + Page note = noteService.createNote(portalWiki, "Home", new Page("testGetDraftsOfWiki", "testGetDraftsOfWiki"), root); + Page note2 = noteService.createNote(portalWiki, "Home", new Page("testGetDraftsOfWiki", "testGetDraftsOfWiki"), root); DraftPage draftPage = new DraftPage(); draftPage.setTitle("test"); draftPage.setContent("test"); @@ -997,6 +1005,34 @@ public void testGetDraftsOfWiki() throws Exception { draftPage.setParentPageId(note2.getId()); noteService.createDraftForExistPage(draftPage, note, null, new Date().getTime(), "root"); assertEquals(2, noteService.getDraftsOfWiki(portalWiki.getOwner(), portalWiki.getType(), portalWiki.getWikiHome().getName()).size()); + } + + public void testSaveHideAuthorAndHideReactionProperties() throws Exception { + Identity user = new Identity("user"); + Page note = createTestNoteWithVersionLang("testMetadataHideAuthorAndHideReaction", null, user); + + this.bindMockedUploadService(); + NotePageProperties notePageProperties = createNotePageProperties(Long.parseLong(note.getId()), "alt text", "summary test"); + notePageProperties.setHideAuthor(true); + notePageProperties.setHideReaction(true); + NotePageProperties properties = noteService.saveNoteMetadata(notePageProperties, null, 1L); + assertEquals("summary test", properties.getSummary()); + assertTrue(properties.isHideAuthor()); + assertTrue(properties.isHideReaction()); + + note.setLang("en"); + note.setTitle("en title"); + note.setContent("en content"); + noteService.createVersionOfNote(note, user.getUserId()); + notePageProperties = createNotePageProperties(Long.parseLong(note.getId()), "alt text en", "summary test en"); + notePageProperties.setHideAuthor(false); + noteService.saveNoteMetadata(notePageProperties, "en", 1L); + + // when fetch version language metadata properties we should return the original + // note properties values in case of shared original properties values + note = noteService.getNoteByIdAndLang(Long.valueOf(note.getId()), "en"); + assertTrue(note.getProperties().isHideAuthor()); + assertTrue(properties.isHideReaction()); } } diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ar.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ar.properties index 857ce2cc5..49f4b6425 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ar.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ar.properties @@ -43,7 +43,6 @@ notes.button.publish=حفظ notes.button.publishAndPost=حفظ و نشر notes.button.update=تحديث notes.button.updateAndPost=التحديث والنشر -notes.button.ok=Move notes.button.loadMore=تحميل المزيد notes.label.drop.draft=حذفها notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_aro.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_aro.properties index 510c9f4e0..12903eb47 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_aro.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_aro.properties @@ -43,7 +43,6 @@ notes.button.publish=حفظ notes.button.publishAndPost=حفظ و نشر notes.button.update=تحديث notes.button.updateAndPost=التحديث والنشر -notes.button.ok=Move notes.button.loadMore=تحميل المزيد notes.label.drop.draft=حذفها notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_az.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_az.properties index fbe8f3a2b..fc153fac6 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_az.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_az.properties @@ -43,7 +43,6 @@ notes.button.publish=Saxla notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ca.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ca.properties index 3da9feda5..722572f85 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ca.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ca.properties @@ -43,7 +43,6 @@ notes.button.publish=Desa notes.button.publishAndPost=Save and Post notes.button.update=Actualitza notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ceb.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ceb.properties index 1a3399765..91c410e33 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ceb.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ceb.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=I-update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_co.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_co.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_co.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_co.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_cs.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_cs.properties index ebce70c5f..9f82366e4 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_cs.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_cs.properties @@ -43,7 +43,6 @@ notes.button.publish=Uložit notes.button.publishAndPost=Save and Post notes.button.update=Aktualizovat notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_de.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_de.properties index 799ddcb94..017669e5e 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_de.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_de.properties @@ -43,7 +43,6 @@ notes.button.publish=Speichern notes.button.publishAndPost=Speichern und veröffentlichen notes.button.update=Aktualisieren notes.button.updateAndPost=Aktualisieren und im Stream veröffentlichen -notes.button.ok=Verschieben notes.button.loadMore=Mehr laden notes.label.drop.draft=Ablegen notes.composer.createNotes=Erstellen diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_el.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_el.properties index 5f3916b2a..6e075aba2 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_el.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_el.properties @@ -43,7 +43,6 @@ notes.button.publish=Αποθήκευση notes.button.publishAndPost=Save and Post notes.button.update=Ενημέρωση notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_en.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_en.properties index d7814f5f4..4452fbd1b 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_en.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_en.properties @@ -43,7 +43,8 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move +notes.button.move=Move +notes.button.delete=Delete notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create @@ -52,7 +53,7 @@ notes.save.success.message=Note saved successfully notes.view.label=View notes.metadata.properties.label=Properties -notes.metadata.featuredImage.label=Featured images +notes.metadata.featuredImage.label=Featured image notes.metadata.featuredImage.add.label=Add an image notes.metadata.featuredImage.alt=Featured image notes.metadata.summary.label=Summary @@ -64,6 +65,46 @@ notes.featuredImage.remove.error.message=Error while removing featured image notes.featuredImage.remove.success.message=Featured image removed successfully notes.featuredImage.size.error.message=Featured image size should be less or equals to 20MB +notes.publication.publish.label=Publication +notes.publication.label=Choose your publication options +notes.publication.check.properties.label=Check the teaser +notes.publication.publish.next.label=Next +notes.publication.post.in.feed.label=Post in Activity stream of +notes.publication.publish.save.label=Publish +notes.publication.publish.in.list.label=Publish in a News list +notes.publication.where.to.publish.label=Where to publish? +notes.publication.who.will.see.label=Who will see? +notes.publication.choose.location.label=Choose a location +notes.publication.only.space.members.label=Only space members +notes.publication.all.users.label=All users +notes.publication.targets.others.label={0} Others +notes.publication.targets.other.label={0} Other +notes.publication.targets.label=News Targets +notes.publication.targets.select.all.label=Select all +notes.publication.all.users.audience.info=All users will see the article +notes.publication.audience.restricted=Audience Restricted: you cannot change it +notes.publication.remove.selected.target.label=Remove selected target +notes.publication.list.targets.drawer.close.label=Close +notes.publication.schedule.label=Schedule +notes.publication.schedule.between.label=Between +notes.publication.schedule.from.label=From +notes.publication.schedule.until.label=Until +notes.publication.publish.now.label=Publish now +notes.publication.schedule.cancel.label=Cancel and save as draft +notes.publication.publish.cancel.label=Cancel unpublishing +notes.publication.location.label=Publishing location +notes.publication.date.label=Publishing date +notes.publication.startDate.label=Start date +notes.publication.endDate.label=End date +notes.publication.startTime.label=Start time +notes.publication.endTime.label=End time +notes.publication.settings.update.success=Publication settings updated successfully +notes.publication.settings.update.error=Error while updating publication settings +notes.publication.schedule.publish.now.tooltip=By scheduling only a end date you will publish now +notes.publication.advanced.option.label=Advanced options +notes.publication.hide.author.label=Hide author +notes.publication.hide.reaction.label=Hide reaction + popup.confirm=Confirm popup.msg.confirmation=Confirmation popup.confirmation.delete=Delete the note diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_es_ES.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_es_ES.properties index 30ad306c7..3d9d556f3 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_es_ES.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_es_ES.properties @@ -43,7 +43,6 @@ notes.button.publish=Guardar notes.button.publishAndPost=Guardar y publicar notes.button.update=Actualizar notes.button.updateAndPost=Actualizar y publicar -notes.button.ok=Move notes.button.loadMore=Cargar más notes.label.drop.draft=¡Suéltalo! notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_eu.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_eu.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_eu.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_eu.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fa.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fa.properties index f6d845145..08a1eb2bf 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fa.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fa.properties @@ -43,7 +43,6 @@ notes.button.publish=ذخيره notes.button.publishAndPost=Save and Post notes.button.update=به روز رسانی notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fi.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fi.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fi.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fi.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fil.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fil.properties index 591e135fa..dedf70dda 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fil.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fil.properties @@ -43,7 +43,6 @@ notes.button.publish=Seyb notes.button.publishAndPost=Save and Post notes.button.update=Mag-update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fr.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fr.properties index c1bccfcd7..94bf19edf 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fr.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_fr.properties @@ -43,7 +43,8 @@ notes.button.publish=Enregistrer notes.button.publishAndPost=Publier notes.button.update=Mettre à jour notes.button.updateAndPost=Publier -notes.button.ok=Déplacer +notes.button.move=Déplacer +notes.button.delete=Supprimer notes.button.loadMore=Charger plus notes.label.drop.draft=Abandonner notes.composer.createNotes=Créer @@ -64,6 +65,46 @@ notes.featuredImage.remove.error.message=Erreur lors de la suppression de l'illu notes.featuredImage.remove.success.message=Illustration supprimée avec succès notes.featuredImage.size.error.message=La taille de l'illustration doit être inférieure ou égale à 20Mo +notes.publication.publish.label=Publication +notes.publication.label=Choisir les options de publication +notes.publication.check.properties.label=Vérifier l'accroche +notes.publication.publish.next.label=Suivant +notes.publication.post.in.feed.label=Publier dans le fil d'activités de +notes.publication.publish.save.label=Publier +notes.publication.publish.in.list.label=Publier dans une liste d'articles +notes.publication.where.to.publish.label=O\u00FA publier ? +notes.publication.who.will.see.label=Qui le verra ? +notes.publication.choose.location.label=Sélectionner un emplacement +notes.publication.only.space.members.label=Seuls les membres de l'espace +notes.publication.all.users.label=Tous les utilisateurs +notes.publication.targets.others.label={0} Autres +notes.publication.targets.other.label={0} Autre +notes.publication.targets.label=Cibles d'article +notes.publication.targets.select.all.label=Sélectionner tout +notes.publication.all.users.audience.info=Tous les utilisateurs verront l'article +notes.publication.audience.restricted=Audience Restreint : vous ne pouvez pas le modifier +notes.publication.remove.selected.target.label=Supprimer la cible sélectionnée +notes.publication.list.targets.drawer.close.label=Fermer +notes.publication.schedule.label=Programmer +notes.publication.schedule.between.label=Entre +notes.publication.schedule.from.label=Du +notes.publication.schedule.until.label=Jusqu'\u00E0 +notes.publication.publish.now.label=Publier maintenant +notes.publication.schedule.cancel.label=Annuler et enregistrer comme brouillon +notes.publication.publish.cancel.label=Annuler la dépublication +notes.publication.location.label=Lieu de publication +notes.publication.date.label=Date de publication +notes.publication.startDate.label=Date de début +notes.publication.endDate.label=Date de fin +notes.publication.startTime.label=Heure de début +notes.publication.endTime.label=Heure de fin +notes.publication.settings.update.success=Les paramétres de publication ont été mis \u00E0 jour avec succés +notes.publication.settings.update.error=Erreur lors de la mise \u00E0 jour des paramétres de publication +notes.publication.schedule.publish.now.tooltip=En programmant uniquement une date de fin vous allez publier de suite +notes.publication.advanced.option.label=Options avancées +notes.publication.hide.author.label=Masquer l'auteur +notes.publication.hide.reaction.label=Masquer la réaction + popup.confirm=Confirmer popup.msg.confirmation=Confirmation popup.confirmation.delete=Supprimer la note diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hi.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hi.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hi.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hi.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hu.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hu.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hu.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_hu.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_id.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_id.properties index 80ac24913..adab118c9 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_id.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_id.properties @@ -43,7 +43,6 @@ notes.button.publish=Simpan notes.button.publishAndPost=Simpan dan Posting notes.button.update=Perbaharui notes.button.updateAndPost=Perbarharui dan Posting -notes.button.ok=Move notes.button.loadMore=muat lebih banyak notes.label.drop.draft=Lepaskan notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_in.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_in.properties index f9070711b..3c8c27d1c 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_in.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_in.properties @@ -42,7 +42,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Ok notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Write a note for {0} diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_it.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_it.properties index 867fde1a5..ce809c9f9 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_it.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_it.properties @@ -43,7 +43,6 @@ notes.button.publish=Salva notes.button.publishAndPost=Salvare e Pubblicare notes.button.update=Aggiorna notes.button.updateAndPost=Aggiornare e Pubblicare -notes.button.ok=Move notes.button.loadMore=Carica più notes.label.drop.draft=Rilasciarlo notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ja.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ja.properties index b14815151..78dbf8963 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ja.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ja.properties @@ -43,7 +43,6 @@ notes.button.publish=保存 notes.button.publishAndPost=Save and Post notes.button.update=アップデート notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_kab.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_kab.properties index fd8680331..59b16f734 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_kab.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_kab.properties @@ -42,7 +42,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Ok notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Write a note for {0} diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ko.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ko.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ko.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ko.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_lt.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_lt.properties index 80f76b432..6405457c6 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_lt.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_lt.properties @@ -43,7 +43,6 @@ notes.button.publish=Išsaugoti notes.button.publishAndPost=Save and Post notes.button.update=Atnaujinti notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ms.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ms.properties index 9df3649ad..2591e54ca 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ms.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ms.properties @@ -43,7 +43,6 @@ notes.button.publish=Simpan notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_nl.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_nl.properties index 75fee33d7..d86592f28 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_nl.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_nl.properties @@ -43,7 +43,6 @@ notes.button.publish=Opslaan notes.button.publishAndPost=Save and Post notes.button.update=Choose file notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_no.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_no.properties index af0e47149..e0d5e2c31 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_no.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_no.properties @@ -43,7 +43,6 @@ notes.button.publish=Lagre notes.button.publishAndPost=Save and Post notes.button.update=Oppdater notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pcm.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pcm.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pcm.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pcm.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pl.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pl.properties index e1c6a66f9..cfcb354c4 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pl.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pl.properties @@ -43,7 +43,6 @@ notes.button.publish=Zapisz notes.button.publishAndPost=Save and Post notes.button.update=Zaktualizuj notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_BR.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_BR.properties index 5883d08f6..80affd257 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_BR.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_BR.properties @@ -43,7 +43,6 @@ notes.button.publish=Salvar notes.button.publishAndPost=Save and Post notes.button.update=Atualizar notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_PT.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_PT.properties index 76444946a..f3230269f 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_PT.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_pt_PT.properties @@ -43,7 +43,6 @@ notes.button.publish=Gravar notes.button.publishAndPost=Save and Post notes.button.update=Atualizar notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ro.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ro.properties index 11b752abf..fdb3ccf55 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ro.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ro.properties @@ -43,7 +43,6 @@ notes.button.publish=Salvaţi notes.button.publishAndPost=Save and Post notes.button.update=Actualizare notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ru.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ru.properties index 5ea288d65..3a05356d1 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ru.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ru.properties @@ -43,7 +43,6 @@ notes.button.publish=Сохранить notes.button.publishAndPost=Save and Post notes.button.update=Обновить notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sk.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sk.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sk.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sk.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sl.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sl.properties index a10b89779..4bf77b576 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sl.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sl.properties @@ -43,7 +43,6 @@ notes.button.publish=Shrani notes.button.publishAndPost=Save and Post notes.button.update=Posodobi notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Naloži več notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sq.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sq.properties index 4a16dbad3..b4afe214e 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sq.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sq.properties @@ -43,7 +43,6 @@ notes.button.publish=crwdns44670:0crwdne44670:0 notes.button.publishAndPost=crwdns44672:0crwdne44672:0 notes.button.update=crwdns44674:0crwdne44674:0 notes.button.updateAndPost=crwdns44676:0crwdne44676:0 -notes.button.ok=crwdns44678:0crwdne44678:0 notes.button.loadMore=crwdns44680:0crwdne44680:0 notes.label.drop.draft=crwdns44682:0crwdne44682:0 notes.composer.createNotes=crwdns44684:0crwdne44684:0 diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sv_SE.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sv_SE.properties index 2522e0398..3e74f86bb 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sv_SE.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_sv_SE.properties @@ -43,7 +43,6 @@ notes.button.publish=Spara notes.button.publishAndPost=Save and Post notes.button.update=Uppdatering notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_th.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_th.properties index d7814f5f4..3660f84fe 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_th.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_th.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=Update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tl.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tl.properties index 8deedbd99..2302adb97 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tl.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tl.properties @@ -43,7 +43,6 @@ notes.button.publish=Save notes.button.publishAndPost=Save and Post notes.button.update=I-update notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tr.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tr.properties index 164cb56d1..41133b1fd 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tr.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_tr.properties @@ -43,7 +43,6 @@ notes.button.publish=Kaydet notes.button.publishAndPost=Save and Post notes.button.update=Güncelleştirme notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Daha fazla yükle notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_uk.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_uk.properties index 7791616da..3572eb5ee 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_uk.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_uk.properties @@ -43,7 +43,6 @@ notes.button.publish=Зберегти notes.button.publishAndPost=Save and Post notes.button.update=Поновити notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Завантажити ще notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ur_IN.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ur_IN.properties index 0e518daef..489a0bad7 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ur_IN.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_ur_IN.properties @@ -43,7 +43,6 @@ notes.button.publish=محفوظ کریں notes.button.publishAndPost=Save and Post notes.button.update=تازہ کاری کریں notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_vi.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_vi.properties index 923365a02..78580441c 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_vi.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_vi.properties @@ -43,7 +43,6 @@ notes.button.publish=Lưu notes.button.publishAndPost=Save and Post notes.button.update=Cập nhật notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_CN.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_CN.properties index 6379b0377..e4f4898c4 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_CN.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_CN.properties @@ -43,7 +43,6 @@ notes.button.publish=保存 notes.button.publishAndPost=Save and Post notes.button.update=更新 notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_TW.properties b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_TW.properties index 2e3c7d829..be9bf778e 100644 --- a/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_TW.properties +++ b/notes-webapp/src/main/resources/locale/portlet/notes/notesPortlet_zh_TW.properties @@ -43,7 +43,6 @@ notes.button.publish=儲存 notes.button.publishAndPost=Save and Post notes.button.update=更新 notes.button.updateAndPost=Update and Post -notes.button.ok=Move notes.button.loadMore=Load more notes.label.drop.draft=Drop it notes.composer.createNotes=Create diff --git a/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js b/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js index 5fe5ec044..2fa75bd03 100644 --- a/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js +++ b/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js @@ -29,11 +29,13 @@ CKEDITOR.editorConfig = function (config) { 'Table', 'EmbedSemantic', 'CodeSnippet', + 'attachFile', 'InsertOptions' ]; if (webPageNote) { blocksToolbarGroup.splice(blocksToolbarGroup.indexOf('tagSuggester'), 1); blocksToolbarGroup.splice(blocksToolbarGroup.indexOf('InsertOptions'), 1); + blocksToolbarGroup.splice(blocksToolbarGroup.indexOf('attachFile'), 1); } const toolbar = [ {name: 'accessibility', items: ['A11ychecker']}, @@ -71,6 +73,9 @@ CKEDITOR.editorConfig = function (config) { items: ['Blockquote'] }, ]; + if (!webPageNote) { + mobileToolbar[mobileToolbar.findIndex(item => item.name ==='blocks')].items.push('attachFile'); + } let extraPlugins = `a11ychecker,balloonpanel,indent,indentblock,indentlist,codesnippet,sharedspace,copyformatting,table,tabletools,embedsemantic,autolink,colordialog${!webPageNote && ',tagSuggester' || ''},emoji,link,font,justify,widget,${!webPageNote && ',insertOptions' || ''},contextmenu,tabletools,tableresize,toc,linkBalloon,suggester`; let removePlugins = `image,confirmBeforeReload,maximize,resize,autoembed${webPageNote && ',tagSuggester' || ''}`; @@ -87,7 +92,7 @@ CKEDITOR.editorConfig = function (config) { } } const notesEditorExtensions = extensionRegistry.loadExtensions('NotesEditor', 'ckeditor-extensions'); - if (notesEditorExtensions?.length && this.useExtraPlugins) { + if (notesEditorExtensions?.length) { notesEditorExtensions.forEach(notesEditorExtension => { if (notesEditorExtension.extraPlugin) { extraPlugins = `${extraPlugins},${notesEditorExtension.extraPlugin}`; @@ -96,7 +101,7 @@ CKEDITOR.editorConfig = function (config) { removePlugins = `${extraPlugins},${notesEditorExtension.removePlugin}`; } if (notesEditorExtension.extraToolbarItem) { - toolbar[0].push(notesEditorExtension.extraToolbarItem); + toolbar[toolbar.length - 1].items.push(notesEditorExtension.extraToolbarItem); } }); } diff --git a/notes-webapp/src/main/webapp/WEB-INF/gatein-resources.xml b/notes-webapp/src/main/webapp/WEB-INF/gatein-resources.xml index 41917e491..fbb9ee85e 100644 --- a/notes-webapp/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/notes-webapp/src/main/webapp/WEB-INF/gatein-resources.xml @@ -86,6 +86,9 @@ + + NotesPublication + commonVueComponents @@ -114,6 +117,32 @@ + + NotesPublication + NotesGRP + + + commonVueComponents + + + extensionRegistry + + + vue + + + vuetify + + + eXoVueI18n + + + imageCropper + + + NotesEditor diff --git a/notes-webapp/src/main/webapp/javascript/eXo/wiki/notesService.js b/notes-webapp/src/main/webapp/javascript/eXo/wiki/notesService.js index d9411c1e0..1b039df14 100644 --- a/notes-webapp/src/main/webapp/javascript/eXo/wiki/notesService.js +++ b/notes-webapp/src/main/webapp/javascript/eXo/wiki/notesService.js @@ -221,19 +221,6 @@ export function restoreNoteVersion(note,version) { }); } -export function getPathByNoteOwner(note, noteAppName) { - if (!noteAppName) { - noteAppName = 'notes'; - } - if (note.wikiType === 'group' && note?.url) { - const spaceName = note.wikiOwner.split('/spaces/')[1]; - const spaceDisplayName = note.url.split(`/portal/g/:spaces:${spaceName}/`)[1].split('/')[0]; - return `${eXo.env.portal.context}/g/:spaces:${spaceName}/${spaceDisplayName}/${noteAppName}/${note.id}`; - } else { - return `${eXo.env.portal.context}/${eXo.env.portal.portalName}/notes/${note.id}`; - } -} - export function deleteNotes(note) { return fetch(`${notesConstants.PORTAL}/${notesConstants.PORTAL_REST}/notes/note/${note.id}`, { credentials: 'include', diff --git a/notes-webapp/src/main/webapp/skin/less/notes/notes.less b/notes-webapp/src/main/webapp/skin/less/notes/notes.less index 65d9f1a22..ee3d5ba14 100644 --- a/notes-webapp/src/main/webapp/skin/less/notes/notes.less +++ b/notes-webapp/src/main/webapp/skin/less/notes/notes.less @@ -53,7 +53,24 @@ font-size: 22px; } } - + .notes-editor-body-section { + padding-top: 10px; + padding-bottom: 10px; + width: 100%; + .notes-editor-body-section-content { + width: @pageWidth; + max-width: 100%; + box-sizing: border-box; + padding-top: var(--sectionMarginTop, 10px); + padding-bottom: var(--sectionMarginBottom, 10px); + padding-left: 20px; + padding-right: 20px; + margin-left: auto; + margin-right: auto; + margin-top: 0; + margin-bottom: 0; + } + } #notesEditor { position: fixed; height: 100%; @@ -73,6 +90,16 @@ .notes-content-form { min-height: calc(~"100vh - 140px"); + .formInputGroup { + &:first-of-type { + border-top-right-radius: ~"var(--appBorderRadiusTopRight, var(--allPagesBorderRadius, 4px)) !important"; + border-top-left-radius: ~"var(--appBorderRadiusTopLeft, var(--allPagesBorderRadius, 4px)) !important"; + } + &:last-of-type { + border-bottom-right-radius: ~"var(--appBorderRadiusTopRight, var(--allPagesBorderRadius, 4px)) !important"; + border-bottom-left-radius: ~"var(--appBorderRadiusTopLeft, var(--allPagesBorderRadius, 4px)) !important"; + } + } .notes-content-wrapper > div[role="application"] { border-color: transparent; flex: 0 1 100%; @@ -82,11 +109,9 @@ .notesTitle { #notesTitle { width: 100%; - box-sizing: border-box; - font-size: 21px; + font-weight: bold; + font-size: 34px !important; letter-spacing: 0.3px; - border-bottom: solid 1px @greyColor !important; - &:focus { box-shadow: none !important; } @@ -204,6 +229,13 @@ } } +.notesContent { + margin-top: 32px !important; + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; +} + #notesOverviewApplication { .notes-application-content { @@ -212,7 +244,19 @@ } } -#editorMetadataDrawer { +#editorPublicationDrawer { + .post-feed-target { + max-width: 335px; + } + + .custom-clear-button { + top: 2px; + right: 50px ~'; /** orientation=lt */ '; + left: 50px ~'; /** orientation=rt */ '; + } +} + +#editorMetadataDrawer, #editorPublicationDrawer { .add-image-area, .image-preview { background-color: @primaryBackground !important; 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 287b8986c..57078e3e4 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 @@ -129,6 +129,8 @@ export default { saveButtonIcon: 'fas fa-save', translationSwitch: false, newTranslation: false, + autosaveProcessedFromEditorExtension: false, + extensionDataUpdated: false }; }, computed: { @@ -136,7 +138,7 @@ export default { return (!this.note?.title || this.note?.title?.length < 3 || this.note?.title?.length > this.titleMaxLength) || (this.noteNotModified - && !this.propertiesModified && !this.draftNote) || this.savingDraft; + && !this.propertiesModified && !this.draftNote && !this.note.draftPage) || this.savingDraft; }, noteNotModified() { return this.note?.title === this.originalNote?.title && this.$noteUtils.isSameContent(this.note?.content, this.originalNote?.content); @@ -195,6 +197,7 @@ export default { document.addEventListener('automatic-translation-extensions-updated', () => { this.refreshTranslationExtensions(); }); + document.addEventListener('note-editor-extensions-data-updated', (evt) => this.processAutoSaveFromEditorExtension(evt)); this.getAvailableLanguages(); window.addEventListener('beforeunload', () => { if (!this.postingNote && this.note.draftPage && this.note.id) { @@ -248,6 +251,65 @@ export default { }); }, methods: { + processAutoSaveFromEditorExtension(event) { + if (event.detail.processAutoSave) { + this.extensionDataUpdated = true; + this.autosaveProcessedFromEditorExtension = true; + this.draftSavingStatus = this.$t('notes.draft.savingDraftStatus'); + clearTimeout(this.saveDraft); + const draftNote = this.fillDraftNote(); + if (!draftNote.title) { + draftNote.title = this.$t('notes.untitled.title'); + } + draftNote.lang = this.selectedLanguage; + if (this.newDraft){ + draftNote.id = null; + } + if (draftNote.properties) { + draftNote.properties.draft = true; + if (this.newTranslation && !this.featuredImageUpdated) { + draftNote.properties.featuredImage = {}; + } + } + this.$notesService.saveDraftNote(draftNote, this.parentPageId).then(savedDraftNote => { + this.actualNote = { + id: savedDraftNote.id, + name: savedDraftNote.name, + title: savedDraftNote.title, + content: savedDraftNote.content, + author: savedDraftNote.author, + owner: savedDraftNote.owner, + properties: savedDraftNote.properties + }; + this.newDraft=false; + savedDraftNote.parentPageId = this.parentPageId; + this.note = savedDraftNote; + localStorage.setItem(`draftNoteId-${this.note.id}-${this.selectedLanguage}`, JSON.stringify(savedDraftNote)); + this.newTranslation = false; + }).then(() => { + this.savingDraft = false; + setTimeout(() => { + this.draftSavingStatus = this.$t('notes.draft.savedDraftStatus'); + if (this.autosaveProcessedFromEditorExtension) { + document.dispatchEvent(new CustomEvent('note-draft-auto-save-done', { + detail: { + draftId: this.note.id + } + })); + } + this.autosaveProcessedFromEditorExtension = false; + }, this.autoSaveDelay); + }).catch(e => { + console.error('Error when creating draft note: ', e); + this.$root.$emit('show-alert', { + type: 'error', + message: this.$t(`notes.message.${e.message}`) + }); + }); + } else { + this.draftSavingStatus = this.$t('notes.draft.savedDraftStatus'); + } + }, editorClosed() { window.close(); }, @@ -281,7 +343,7 @@ export default { this.note.content = noteObject.content; this.note.properties = noteObject.properties; }, - postNote(toPublish) { + postNote() { this.postingNote = true; clearTimeout(this.saveDraft); const properties = this.note?.properties; @@ -297,9 +359,10 @@ export default { wikiOwner: this.note.wikiOwner, content: this.$noteUtils.getContentToSave('notesContent', this.oembedMinWidth) || this.note.content, parentPageId: this.note?.draftPage && this.note?.targetPageId === this.parentPageId ? null : this.parentPageId, - toBePublished: toPublish, + toBePublished: false, appName: this.appName, - properties: properties + properties: properties, + extensionDataUpdated: this.extensionDataUpdated }; if (note.id) { this.updateNote(note); @@ -332,18 +395,23 @@ export default { }).finally(() => { this.enableClickOnce(); this.removeLocalStorageCurrentDraft(currentDraftId); + this.extensionDataUpdated = false; }); }, createNote(note) { + note.properties = note.properties || {}; + if (!note.properties.noteId) { + note.properties.noteId = this.note?.id; + note.properties.draftPage = this.note?.draftPage; + } return this.$notesService.createNote(note).then(data => { const draftNote = JSON.parse(localStorage.getItem(`draftNoteId-${this.note.id}-${this.selectedLanguage}`)); this.note = data; this.noteId = data.id; this.addParamToUrl('noteId', this.noteId); this.originalNote = structuredClone(data); - const notePath = this.$notesService.getPathByNoteOwner(data, this.appName).replace(/ /g, '_'); // delete draft note - this.deleteDraftNote(draftNote, notePath); + this.deleteDraftNote(draftNote, this.note?.url); this.displayMessage({ type: 'success', message: this.$t('notes.save.success.message'), @@ -508,9 +576,8 @@ export default { if (this.webPageUrl) { return this.webPageUrl; } else { - const notePath = this.$notesService.getPathByNoteOwner(note, this.appName).replace(/ /g, '_'); this.draftSavingStatus = ''; - return `${notePath}?translation=${this.selectedLanguage || 'original'}`; + return `${note.url}?translation=${this.selectedLanguage || 'original'}`; } }, saveNoteDraft(update) { @@ -550,7 +617,7 @@ export default { if (draftNote.properties) { draftNote.properties.draft = true; if (this.newTranslation && !this.featuredImageUpdated) { - draftNote.properties.featuredImage = null; + draftNote.properties.featuredImage = {}; } } this.$notesService.saveDraftNote(draftNote, this.parentPageId).then(savedDraftNote => { @@ -635,7 +702,7 @@ export default { .catch(e => console.error('Error when deleting draft note', e)); } }, - deleteDraftNote(draftNote, notePath) { + deleteDraftNote(draftNote, noteUrl) { if (!draftNote) { draftNote = this.note; } @@ -644,7 +711,7 @@ export default { return this.$notesService.deleteDraftNote(draftNote).then(() => { this.draftSavingStatus = ''; //re-initialize data - if (!notePath) { + if (!noteUrl) { this.note = { id: '', title: '', diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/components/NotePublicationDrawer.vue b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/NotePublicationDrawer.vue new file mode 100644 index 000000000..bda62e85b --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/NotePublicationDrawer.vue @@ -0,0 +1,447 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/components/advanced-option/NotePublicationAdvancedOption.vue b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/advanced-option/NotePublicationAdvancedOption.vue new file mode 100644 index 000000000..a2bfb8e00 --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/advanced-option/NotePublicationAdvancedOption.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublicationTargetDrawer.vue b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublicationTargetDrawer.vue new file mode 100644 index 000000000..01a08aec5 --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublicationTargetDrawer.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublicationTargetList.vue b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublicationTargetList.vue new file mode 100644 index 000000000..726bfe310 --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublicationTargetList.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublishOption.vue b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublishOption.vue new file mode 100644 index 000000000..dced8618d --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/publish-option/NotePublishOption.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/components/schedule-option/NoteScheduleOption.vue b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/schedule-option/NoteScheduleOption.vue new file mode 100644 index 000000000..1df7e12d1 --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/components/schedule-option/NoteScheduleOption.vue @@ -0,0 +1,497 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/initComponents.js b/notes-webapp/src/main/webapp/vue-app/notes-publication/initComponents.js new file mode 100644 index 000000000..0a52aa0c1 --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/initComponents.js @@ -0,0 +1,21 @@ +import NotePublicationDrawer from './components/NotePublicationDrawer.vue'; +import NoteMetadataPropertiesForm from '../notes-rich-editor/components/note-properties/NoteMetadataPropertiesForm.vue'; +import NotePublishOption from './components/publish-option/NotePublishOption.vue'; +import NotePublicationTargetDrawer from './components/publish-option/NotePublicationTargetDrawer.vue'; +import NotePublicationTargetList from './components/publish-option/NotePublicationTargetList.vue'; +import NoteScheduleOption from './components/schedule-option/NoteScheduleOption.vue'; +import NotePublicationAdvancedOption from './components/advanced-option/NotePublicationAdvancedOption.vue'; + +const components = { + 'note-publication-drawer': NotePublicationDrawer, + 'note-metadata-properties-form': NoteMetadataPropertiesForm, + 'note-publish-option': NotePublishOption, + 'note-publication-target-drawer': NotePublicationTargetDrawer, + 'note-publication-target-list': NotePublicationTargetList, + 'note-schedule-option': NoteScheduleOption, + 'note-publication-advanced-option': NotePublicationAdvancedOption +}; + +for (const key in components) { + Vue.component(key, components[key]); +} diff --git a/notes-webapp/src/main/webapp/vue-app/notes-publication/main.js b/notes-webapp/src/main/webapp/vue-app/notes-publication/main.js new file mode 100644 index 000000000..73ebc6d78 --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-publication/main.js @@ -0,0 +1,11 @@ +import './initComponents.js'; + +// get overrided components if exists +if (extensionRegistry) { + const components = extensionRegistry.loadComponents('notesPublication'); + if (components && components.length > 0) { + components.forEach(cmp => { + Vue.component(cmp.componentName, cmp.componentOptions); + }); + } +} diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorMetadataDrawer.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorMetadataDrawer.vue deleted file mode 100644 index 970319b5b..000000000 --- a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorMetadataDrawer.vue +++ /dev/null @@ -1,310 +0,0 @@ - - - - - diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorTopBar.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorTopBar.vue index 73fb9b4f8..9696fa4d9 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorTopBar.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorTopBar.vue @@ -97,7 +97,7 @@
-
-
-
- -
-
- -
+
+
+ - + + @@ -78,6 +88,17 @@ ref="featuredImageDrawer" :note="noteObject" :has-featured-image="hasFeaturedImage" /> + + @@ -90,7 +111,12 @@ export default { initialized: false, instanceReady: false, noteTitleMaxLength: 500, - updatingProperties: null + typingTimer: null, + isUserTyping: false, + editorExtensions: [], + updatingProperties: false, + enablePostKeys: 0, + isPublishing: false }; }, props: { @@ -189,14 +215,15 @@ export default { imagesDownloadFolder: { type: String, default: 'DRIVE_ROOT_NODE/notes/images' + }, + publicationParams: { + type: Object, + default: null } }, watch: { 'noteObject.title': function(newVal, oldVal) { - if (newVal.length > this.noteTitleMaxLength) { - this.displayNoteTitleMaxLengthCheckAlert(); - this.noteObject.title = oldVal; - } + this.displayNoteTitleMaxLengthCheckAlert(newVal, oldVal); this.updateData(); }, 'noteObject.content': function () { @@ -223,15 +250,43 @@ export default { } }, computed: { + newEmptyTranslation() { + return !!this.note?.lang && !this.note?.title?.length && !this.note?.content?.length; + }, + entityId() { + return this.newEmptyTranslation ? null : this.note?.draftPage ? this.note?.id : this.note?.latestVersionId; + }, + extensionParams() { + return { + spaceId: this.getURLQueryParam('spaceId'), + entityId: this.entityId, + entityType: this.note.draftPage && 'WIKI_DRAFT_PAGES' || 'WIKI_PAGE_VERSIONS', + lang: this.note.lang, + isEmptyNoteTranslation: this.newEmptyTranslation + }; + }, hasFeaturedImage() { return !!this.noteObject?.properties?.featuredImage?.id; }, saveNoteButtonDisabled() { - return this.updatingProperties || this.saveButtonDisabled; + return this.updatingProperties || this.saveButtonDisabled || this.isUserTyping; + }, + newPageDraft() { + return !this.noteObject?.id || (this.noteObject?.draftPage && !this.noteObject?.targetPageId); + }, + editMode() { + return this.noteObject?.id && !this.newPageDraft; + }, + isTranslation() { + return !!this.noteObject?.lang; + }, + newPublicationDrawerEnabled() { + return eXo?.env?.portal?.newPublicationDrawerEnabled; } }, created() { this.cloneNoteObject(); + this.refreshEditorExtensions(); this.$root.$on('include-page', this.includePage); this.$root.$on('update-note-title', this.updateTranslatedNoteTitle); this.$root.$on('update-note-content', this.updateTranslatedNoteContent); @@ -239,6 +294,7 @@ export default { this.$root.$on('close-featured-image-byOverlay', this.closeFeaturedImageDrawerByOverlay); document.addEventListener('note-custom-plugins', this.openCustomPluginsDrawer); + document.addEventListener('notes-extensions-updated', this.refreshEditorExtensions); }, methods: { metadataUpdated(properties) { @@ -249,9 +305,12 @@ export default { this.autoSave(); this.waitForNoteMetadataUpdate(); } else { - this.updatingProperties = null; + this.updatingProperties = false; } }, + refreshEditorExtensions() { + this.editorExtensions = extensionRegistry.loadComponents('NotesRichEditor') || []; + }, editorClosed(){ this.$emit('editor-closed'); }, @@ -335,8 +394,20 @@ export default { }, 200); } }, - postNote(toPublish) { - this.$emit('post-note', toPublish); + postNote() { + if (this.newPublicationDrawerEnabled && this.publicationParams + && !this.isTranslation && !this.editMode) { + this.openPublicationDrawer(this.noteObject); + return; + } + this.postAndPublishNote(); + }, + postAndPublishNote(note, publicationSettings) { + if (this.newPublicationDrawerEnabled) { + this.noteObject = note; + this.updateData(); + } + this.$emit('post-note', publicationSettings); }, resetEditorData() { this.noteObject.title = null; @@ -431,6 +502,7 @@ export default { self.initialized = true; return; } + self.waitUserTyping(self); self.noteObject.content = evt.editor.getData(); self.autoSave(); const removeTreeviewBtn = evt.editor.document.getById( 'remove-treeview' ); @@ -504,10 +576,17 @@ export default { return; } this.$refs.editorMetadataDrawer.close(); + this.$refs.editorPublicationDrawer.close(); }, isImageDrawerClosed() { return this.$refs.featuredImageDrawer.isClosed(); }, + openPublicationDrawer() { + this.$refs.editorPublicationDrawer.open(this.noteObject); + }, + publicationDrawerClosed() { + this.enablePostKeys ++; + }, openMetadataDrawer() { this.$refs.editorMetadataDrawer.open(this.noteObject); }, @@ -517,16 +596,35 @@ export default { alertMessage: detail?.message, }})); }, - displayNoteTitleMaxLengthCheckAlert(){ - const messageObject = { - type: 'warning', - message: this.$t('notes.title.max.length.warning.message', {0: this.noteTitleMaxLength}) - }; - this.displayAlert(messageObject); + displayNoteTitleMaxLengthCheckAlert(newTitle, oldTitle) { + if (newTitle?.length > this.noteTitleMaxLength) { + this.noteObject.title = oldTitle; + this.displayAlert({ + type: 'warning', + message: this.$t('notes.title.max.length.warning.message', {0: this.noteTitleMaxLength}) + }); + } }, waitForNoteMetadataUpdate() { setTimeout(() => { - this.updatingProperties = null; + this.updatingProperties = false; + }, 1000); + }, + setPublishing(publishing) { + this.isPublishing = publishing; + }, + getURLQueryParam(paramName) { + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.has(paramName)) { + return urlParams.get(paramName); + } + }, + waitUserTyping(component) { + component ??= this; + clearTimeout(component.typingTimer); + component.isUserTyping = true; + component.typingTimer = setTimeout(function () { + component.isUserTyping = false; }, 1000); } } diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorFeaturedImageDrawer.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteEditorFeaturedImageDrawer.vue similarity index 100% rename from notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteEditorFeaturedImageDrawer.vue rename to notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteEditorFeaturedImageDrawer.vue diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteEditorMetadataDrawer.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteEditorMetadataDrawer.vue new file mode 100644 index 000000000..89fd086cb --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteEditorMetadataDrawer.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteMetadataPropertiesForm.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteMetadataPropertiesForm.vue new file mode 100644 index 000000000..300b78daa --- /dev/null +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/note-properties/NoteMetadataPropertiesForm.vue @@ -0,0 +1,274 @@ + + + + diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/initComponents.js b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/initComponents.js index 91112ea13..b98d5b607 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/initComponents.js +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/initComponents.js @@ -3,8 +3,9 @@ import TranslationsEditBar from '../notes-rich-editor/components/TranslationsEdi import NoteTreeviewDrawer from '../notes/components/NoteTreeviewDrawer.vue'; import NoteEditorTopBar from '../notes-rich-editor/components/NoteEditorTopBar.vue'; import NoteFullRichEditor from './components/NoteFullRichEditor.vue'; -import NoteEditorMetadataDrawer from './components/NoteEditorMetadataDrawer.vue'; -import NoteEditorFeaturedImageDrawer from './components/NoteEditorFeaturedImageDrawer.vue'; +import NoteEditorMetadataDrawer from './components/note-properties/NoteEditorMetadataDrawer.vue'; +import NoteEditorFeaturedImageDrawer from './components/note-properties/NoteEditorFeaturedImageDrawer.vue'; +import NoteMetadataPropertiesForm from './components/note-properties/NoteMetadataPropertiesForm.vue'; const components = { 'note-custom-plugins': NoteCustomPlugins, @@ -13,7 +14,8 @@ const components = { 'note-editor-top-bar': NoteEditorTopBar, 'note-full-rich-editor': NoteFullRichEditor, 'note-editor-metadata-drawer': NoteEditorMetadataDrawer, - 'note-editor-featured-image-drawer': NoteEditorFeaturedImageDrawer + 'note-editor-featured-image-drawer': NoteEditorFeaturedImageDrawer, + 'note-metadata-properties-form': NoteMetadataPropertiesForm }; for (const key in components) { diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/main.js b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/main.js index 40f206f5e..690c7a232 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/main.js +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/main.js @@ -9,5 +9,5 @@ if (extensionRegistry) { }); } } -Vue.prototype.$utils.includeExtensions('WYSIWYGPluginsExtensions'); + diff --git a/notes-webapp/src/main/webapp/vue-app/notes/components/NoteFavoriteAction.vue b/notes-webapp/src/main/webapp/vue-app/notes/components/NoteFavoriteAction.vue index df6c34221..60dddd5c9 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes/components/NoteFavoriteAction.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes/components/NoteFavoriteAction.vue @@ -7,6 +7,7 @@ :top="top" :right="right" :space-id="spaceId" + :icon-size="iconSize" :template-params="templateParams" :small="false" type="notes" @@ -36,6 +37,10 @@ export default { type: Number, default: () => 0, }, + iconSize: { + type: Number, + default: () => 16, + }, }, data: () => ({ spaceId: eXo.env.portal.spaceId, diff --git a/notes-webapp/src/main/webapp/vue-app/notes/components/NoteTreeviewDrawer.vue b/notes-webapp/src/main/webapp/vue-app/notes/components/NoteTreeviewDrawer.vue index 7d76ff208..66f1ccd2a 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes/components/NoteTreeviewDrawer.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes/components/NoteTreeviewDrawer.vue @@ -388,7 +388,7 @@ - {{ $t('notes.button.ok') }} + {{ $t('notes.button.move') }} diff --git a/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue b/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue index 9c097a9ef..99556f55f 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue @@ -97,9 +97,10 @@ + :activity-id="note.activityId" + class="ms-2" />
@@ -133,16 +134,26 @@ width="100%" max-height="400" />
- - {{ noteTitle }} - - +

+ + {{ noteTitle }} + + + + + +

'); - const path = window.location.href; + const path = `${window.location.origin}${this.note.url}`; $('body').append(inputTemp); inputTemp.val(path).select(); document.execCommand('copy'); diff --git a/notes-webapp/src/main/webapp/vue-app/notes/main.js b/notes-webapp/src/main/webapp/vue-app/notes/main.js index d5ec1c3b1..0fd20addd 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes/main.js +++ b/notes-webapp/src/main/webapp/vue-app/notes/main.js @@ -5,6 +5,10 @@ import * as notesService from '../../javascript/eXo/wiki/notesService.js'; // get overrided components if exists if (extensionRegistry) { const components = extensionRegistry.loadComponents('notes'); + const overviewComponents = extensionRegistry.loadComponents('NotesOverview'); + if (overviewComponents.length > 0) { + components.push(...overviewComponents); + } if (components && components.length > 0) { components.forEach(cmp => { Vue.component(cmp.componentName, cmp.componentOptions); diff --git a/notes-webapp/webpack.prod.js b/notes-webapp/webpack.prod.js index 022fdf509..a896dc3f8 100644 --- a/notes-webapp/webpack.prod.js +++ b/notes-webapp/webpack.prod.js @@ -19,7 +19,9 @@ const config = { engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js', connectorEventExtensions: './src/main/webapp/vue-app/connectorEventExtensions/extensions.js', notePageView: './src/main/webapp/vue-app/note-page-view/main.js', - notesNotificationExtension: './src/main/webapp/vue-app/notification-extensions/main.js' + notesNotificationExtension: './src/main/webapp/vue-app/notification-extensions/main.js', + notesPublication: './src/main/webapp/vue-app/notes-publication/main.js', + }, output: { publicPath: '',