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 10f9630f41..c4e81abaab 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 @@ -761,8 +761,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 +783,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 +799,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 +815,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()); 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 b1d1cc1b49..5aadc45123 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 @@ -68,6 +68,8 @@ notes.featuredImage.size.error.message=Featured image size should be less or equ notes.publication.publish.label=Publish notes.publication.label=Choose your publication options notes.publication.check.properties.label=Check the teaser +notes.publication.publish.next.label=Next + popup.confirm=Confirm 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 43f44b1c04..32f05dd990 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 @@ -67,6 +67,7 @@ notes.featuredImage.size.error.message=La taille de l'illustration doit être in notes.publication.publish.label=Publier notes.publication.label=Choisir les options de publication notes.publication.check.properties.label=Vérifier l'accroche +notes.publication.publish.next.label=Suivant popup.confirm=Confirmer popup.msg.confirmation=Confirmation 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 ca30c2f91a..eb15d3f0eb 100644 --- a/notes-webapp/src/main/webapp/skin/less/notes/notes.less +++ b/notes-webapp/src/main/webapp/skin/less/notes/notes.less @@ -212,7 +212,7 @@ } } -#editorMetadataDrawer { +#editorMetadataDrawer, #editorPublicationDrawer { .add-image-area, .image-preview { background-color: @primaryBackground !important; diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue index 4ea5b5428f..7b894e9ddf 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue @@ -80,6 +80,10 @@ :has-featured-image="hasFeaturedImage" /> @@ -94,7 +98,8 @@ export default { instanceReady: false, noteTitleMaxLength: 500, updatingProperties: false, - enablePostKeys: 0 + enablePostKeys: 0, + isPublishing: false }; }, props: { @@ -234,6 +239,15 @@ export default { saveNoteButtonDisabled() { return this.updatingProperties || this.saveButtonDisabled; }, + 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; } @@ -249,6 +263,9 @@ export default { document.addEventListener('note-custom-plugins', this.openCustomPluginsDrawer); }, methods: { + setPublishing(publishing) { + this.isPublishing = publishing; + }, metadataUpdated(properties) { this.updatingProperties = true; this.noteObject.properties = properties; @@ -343,12 +360,20 @@ export default { }, 200); } }, - postNote(toPublish) { - if (this.newPublicationDrawerEnabled && this.publicationEnabled) { + postNote() { + if (this.newPublicationDrawerEnabled && this.publicationEnabled + && !this.isTranslation && !this.editMode) { this.openPublicationDrawer(this.noteObject); return; } - this.$emit('post-note', toPublish); + this.postAndPublishNote(); + }, + postAndPublishNote(note) { + if (this.newPublicationDrawerEnabled) { + this.noteObject = note; + this.updateData(); + } + this.$emit('post-note', false); }, resetEditorData() { this.noteObject.title = null; @@ -521,7 +546,7 @@ export default { return this.$refs.featuredImageDrawer.isClosed(); }, openPublicationDrawer() { - this.$refs.editorPublicationDrawer.open(); + this.$refs.editorPublicationDrawer.open(this.noteObject); }, publicationDrawerClosed() { this.enablePostKeys ++; @@ -536,7 +561,7 @@ export default { }})); }, displayNoteTitleMaxLengthCheckAlert(newTitle, oldTitle) { - if (newTitle.length > this.noteTitleMaxLength) { + if (newTitle?.length > this.noteTitleMaxLength) { this.noteObject.title = oldTitle; this.displayAlert({ type: 'warning', 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 index 5145528b5c..3c87df704f 100644 --- 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 @@ -44,7 +44,7 @@ :current-properties="currentNoteProperties" :has-featured-image="hasFeaturedImage" :summary-max-length="summaryMaxLength" - @properties-updated="propertiesUpdated"/> + @properties-updated="propertiesUpdated" />