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 4452fbd1bb..b6e0e39877 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 @@ -104,6 +104,9 @@ notes.publication.schedule.publish.now.tooltip=By scheduling only a end date you notes.publication.advanced.option.label=Advanced options notes.publication.hide.author.label=Hide author notes.publication.hide.reaction.label=Hide reaction +notes.publication.success.message=Note successfully published +notes.schedule.success.message=Note scheduled successfully +notes.publication.externalPage.publish.cancel.label=Cancel publishing popup.confirm=Confirm popup.msg.confirmation=Confirmation 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 94bf19edf0..feb72e9477 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 @@ -104,6 +104,9 @@ notes.publication.schedule.publish.now.tooltip=En programmant uniquement une dat 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 +notes.publication.success.message=Note publi\u00E9e avec succ\u00E8s +notes.schedule.success.message=Note planifi\u00E9 avec succ\u00E8s +notes.publication.externalPage.publish.cancel.label=Annuler la publication popup.confirm=Confirmer popup.msg.confirmation=Confirmation diff --git a/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/feature-flags-configuration.xml b/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/feature-flags-configuration.xml new file mode 100644 index 0000000000..5202dd8bad --- /dev/null +++ b/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/feature-flags-configuration.xml @@ -0,0 +1,53 @@ + + + + + NoteFeatureProperties + org.exoplatform.container.ExtendedPropertyConfigurator + + + NoteFeatureProperties + Note Feature enablement flag + + + + + + + org.exoplatform.groovyscript.text.TemplateService + + UIPortalApplication-head + addTemplateExtension + org.exoplatform.groovyscript.text.TemplateExtensionPlugin + + + templates + The list of templates to include in HTML Page Header with UIPortalApplication.gtmpl + war:/groovy/webui/workspace/UINotesHeadTemplate.gtmpl + + + + + 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 fbb9ee85ed..30e78d4ab6 100644 --- a/notes-webapp/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/notes-webapp/src/main/webapp/WEB-INF/gatein-resources.xml @@ -49,6 +49,12 @@ false /javascript/notes.bundle.js + + NotesPublication + + + imageCropper + html2canvas diff --git a/notes-webapp/src/main/webapp/groovy/webui/workspace/UINotesHeadTemplate.gtmpl b/notes-webapp/src/main/webapp/groovy/webui/workspace/UINotesHeadTemplate.gtmpl new file mode 100644 index 0000000000..e9aacd6a2d --- /dev/null +++ b/notes-webapp/src/main/webapp/groovy/webui/workspace/UINotesHeadTemplate.gtmpl @@ -0,0 +1,11 @@ +<% + import org.exoplatform.commons.api.settings.ExoFeatureService; + def rcontext = _ctx.getRequestContext(); + ExoFeatureService featureService = uicomponent.getApplicationComponent(ExoFeatureService.class); + def userName = rcontext.getRemoteUser(); +%> + + 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 index bda62e85b1..db4019ab4c 100644 --- 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 @@ -342,6 +342,8 @@ export default { this.cloneScheduleSettings(); this.cloneAdvancedSettings(); this.clonePublicationSettings(); + } else { + this.initSettings(); } this.currentScheduleSettings = structuredClone(this.scheduleSettings); this.currentAdvancedSettings = structuredClone(this.advancedSettings); @@ -400,6 +402,11 @@ export default { this.$refs?.scheduleOption?.cancelChanges(); this.$refs?.advancedOption?.cancelChanges(); }, + initSettings() { + this.scheduleSettings = {}; + this.advancedSettings = {}; + this.publicationSettings = {post: true}; + }, reset() { setTimeout(() => { this.cancelChanges(); @@ -422,7 +429,7 @@ export default { return; } this.$emit('metadata-updated', this.noteObject.properties); - this.$emit('publish', this.noteObject, this.publicationSettings); + this.$emit('publish', this.publicationSettings, this.noteObject,); }, updateCurrentNoteObjectProperties(properties) { this.noteObject.properties.noteId = Number(properties.noteId); 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 index a2bfb8e007..7232a10188 100644 --- 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 @@ -91,6 +91,7 @@ export default { }, initSettings() { if (!this.editMode) { + this.resetSettings(); return; } this.hideAuthor = this.savedAdvancedSettings?.hideAuthor; @@ -98,6 +99,10 @@ export default { }, cancelChanges() { this.initSettings(); + }, + resetSettings() { + this.hideAuthor = false; + this.hideReaction = false; } } }; 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 index 1df7e12d1d..139a8803be 100644 --- 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 @@ -30,8 +30,17 @@ :multiple="isMultipleSelectionOption" class="d-flex ms-n1 mt-0 pt-0"> + v-if="fromExternalPage && !hasSavedUnpublishSchedule" + :label="$t('notes.publication.externalPage.publish.cancel.label')" + :value="CANCEL_SCHEDULE_OPTION" /> + + ]*?)(\s+src="data:image\/[^;]+;base64,[^"]*")/g; + content = content.replace(regex, '$1'); + return content; +} + +export function isHasImagesToBeProcessed(htmlStringContent, objectType) { + // Parse the HTML content + const parser = new DOMParser(); + const document = parser.parseFromString(htmlStringContent, 'text/html'); + + const imgTags = document.querySelectorAll('img'); + const prefix = '/portal/rest/v1/social/attachments/'; + + for (const imgTag of imgTags) { + const src = imgTag.getAttribute('src'); + if (src?.startsWith?.(prefix)) { + const srcPart = src.substring(prefix.length); + const sourceObject = srcPart.substring(0, srcPart.indexOf('/')); + if (sourceObject !== objectType) { + return true; + } + } + } + return htmlStringContent.includes('cke_upload_id='); +} diff --git a/notes-webapp/src/main/webapp/vue-app/notes/components/NoteBreadcrumb.vue b/notes-webapp/src/main/webapp/vue-app/notes/components/NoteBreadcrumb.vue index 7cc648d9fb..fe432dc79f 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes/components/NoteBreadcrumb.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes/components/NoteBreadcrumb.vue @@ -134,6 +134,7 @@ export default { openNote(note) { if (note.noteId !== this.actualNoteId ) { this.$emit('open-note',note.id); + document.dispatchEvent(new CustomEvent('note-navigation-updated', {detail: note})); } } } 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 66f1ccd2a2..59e9ecb012 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 @@ -627,6 +627,7 @@ export default { this.$root.$emit('open-note-by-name', noteName, note.draftPage); this.$refs.breadcrumbDrawer.close(); } + document.dispatchEvent(new CustomEvent('note-navigation-updated', {detail: note})); } else { this.$refs.breadcrumbDrawer.close(); } 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 99556f55f3..116c20ca77 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 @@ -279,15 +279,23 @@ + + :note="note" /> + :note="note" /> - + + +