diff --git a/content-service/src/main/java/io/meeds/news/model/News.java b/content-service/src/main/java/io/meeds/news/model/News.java index 8ede3a6db..f4c345599 100644 --- a/content-service/src/main/java/io/meeds/news/model/News.java +++ b/content-service/src/main/java/io/meeds/news/model/News.java @@ -146,5 +146,11 @@ public class News { private boolean fromDraft; private boolean fromExternalPage; + + private boolean canRefer; + + private boolean isReferred; + + private long deReferPageId; } diff --git a/content-service/src/main/java/io/meeds/news/rest/NewsRest.java b/content-service/src/main/java/io/meeds/news/rest/NewsRest.java index 907e727d1..141a7fbf0 100644 --- a/content-service/src/main/java/io/meeds/news/rest/NewsRest.java +++ b/content-service/src/main/java/io/meeds/news/rest/NewsRest.java @@ -235,6 +235,7 @@ public ResponseEntity updateNews(@PathVariable("id") news.setScheduleUnpublishDate(updatedNews.getScheduleUnpublishDate()); news.setProperties(updatedNews.getProperties()); news.setLang(updatedNews.getLang()); + news.setReferred(updatedNews.isReferred()); news = newsService.updateNews(news, currentIdentity.getUserId(), post, updatedNews.isPublished(), newsObjectType, newsUpdateType); return ResponseEntity.ok(news); diff --git a/content-service/src/main/java/io/meeds/news/service/impl/NewsServiceImpl.java b/content-service/src/main/java/io/meeds/news/service/impl/NewsServiceImpl.java index b4b2d550b..4f65d002f 100644 --- a/content-service/src/main/java/io/meeds/news/service/impl/NewsServiceImpl.java +++ b/content-service/src/main/java/io/meeds/news/service/impl/NewsServiceImpl.java @@ -22,20 +22,13 @@ import static io.meeds.news.utils.NewsUtils.NewsObjectType.ARTICLE; import static io.meeds.news.utils.NewsUtils.NewsObjectType.LATEST_DRAFT; import static io.meeds.news.utils.NewsUtils.NewsUpdateType.CONTENT_AND_TITLE; +import static io.meeds.news.utils.NewsUtils.NewsUpdateType.PAGE_REFERENCE; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.regex.Matcher; import java.util.stream.Stream; @@ -168,6 +161,10 @@ public class NewsServiceImpl implements NewsService { public static final String NEWS_METADATA_LATEST_DRAFT_OBJECT_TYPE = "newsLatestDraftPage"; public static final String EXTERNAL_PAGE = "externalPage"; + + public static final String PAGE_REFERRED = "pageReferred"; + + public static final String DE_REFER_PAGE_ID = "deReferPageId"; public static final String ARTICLE_CONTENT = "content"; @@ -292,6 +289,8 @@ public News updateNews(News news, } else if (ARTICLE.name().equalsIgnoreCase(newsObjectType) && CONTENT_AND_TITLE.name().equalsIgnoreCase(newsUpdateType) && StringUtils.isNotEmpty(news.getLang())) { return addNewArticleVersionWithLang(news, updaterIdentity, space); + } else if (ARTICLE.name().equalsIgnoreCase(newsObjectType) && PAGE_REFERENCE.name().equalsIgnoreCase(newsUpdateType)) { + return updateArticle(news, updaterIdentity, newsUpdateType); } if (publish != news.isPublished() && news.isCanPublish()) { news.setPublished(publish); @@ -513,6 +512,7 @@ public News getNewsByIdAndLang(String newsId, news.setCanEdit(canEditNews(news, currentIdentity.getUserId())); news.setCanDelete(canDeleteNews(currentIdentity, news)); news.setCanPublish(NewsUtils.canPublishNews(news.getSpaceId(), currentIdentity)); + news.setCanRefer(NewsUtils.canReferToNote(news.getSpaceId(), news, currentIdentity)); Space space = spaceService.getSpaceById(news.getSpaceId()); if (space != null) { news.setCanSchedule(canScheduleNews(space, currentIdentity, news)); @@ -579,6 +579,7 @@ public List getNews(NewsFilter filter, Identity currentIdentity) throws Ex news.setCanEdit(canEditNews(news, currentIdentity.getUserId())); news.setCanDelete(canDeleteNews(currentIdentity, news)); news.setCanPublish(NewsUtils.canPublishNews(news.getSpaceId(), currentIdentity)); + news.setCanRefer(NewsUtils.canReferToNote(news.getSpaceId(), news, currentIdentity)); Space space = spaceService.getSpaceById(news.getSpaceId()); if (space != null) { news.setCanSchedule(canScheduleNews(space, currentIdentity, news)); @@ -1232,6 +1233,16 @@ private void buildNewArticleProperties(News article, false); } + private void referOrDeReferArticlePage(News article, Page articlePage, Map properties) { + if (article.isReferred()) { + properties.put(PAGE_REFERRED, Boolean.TRUE.toString()); + properties.put(DE_REFER_PAGE_ID, articlePage.getParentPageId()); + } else { + properties.remove(PAGE_REFERRED); + properties.remove(DE_REFER_PAGE_ID); + } + } + private News updateDraftArticleForNewPage(News draftArticle, String draftArticleUpdater, Space space) throws WikiException, IllegalAccessException { DraftPage draftArticlePage = noteService.getDraftNoteById(draftArticle.getId(), draftArticleUpdater); @@ -1362,6 +1373,12 @@ private void buildArticleProperties(News article, String currentUsername, Metada if (properties.containsKey(EXTERNAL_PAGE) && StringUtils.isNotEmpty(properties.get(EXTERNAL_PAGE))) { article.setFromExternalPage(Boolean.parseBoolean(properties.get(EXTERNAL_PAGE))); } + if (properties.containsKey(PAGE_REFERRED) && StringUtils.isNotEmpty(properties.get(PAGE_REFERRED))) { + article.setReferred(Boolean.parseBoolean(properties.get(PAGE_REFERRED))); + } + if (properties.containsKey(DE_REFER_PAGE_ID) && StringUtils.isNotEmpty(properties.get(DE_REFER_PAGE_ID))) { + article.setDeReferPageId(Long.parseLong(properties.get(DE_REFER_PAGE_ID))); + } if (properties.containsKey(NEWS_VIEWS) && StringUtils.isNotEmpty(properties.get(NEWS_VIEWS))) { article.setViewsCount(Long.parseLong(properties.get(NEWS_VIEWS))); } @@ -1881,6 +1898,7 @@ private News updateArticle(News news, Identity updater, String newsUpdateType) t if (StringUtils.isNotEmpty(news.getPublicationState())) { newsPageProperties.put(NEWS_PUBLICATION_STATE, news.getPublicationState()); } + referOrDeReferArticlePage(news, existingPage, newsPageProperties); newsPageProperties.put(NEWS_ACTIVITY_POSTED, String.valueOf(news.isActivityPosted())); existingPageMetadataItem.setProperties(newsPageProperties); Date updateDate = Calendar.getInstance().getTime(); diff --git a/content-service/src/main/java/io/meeds/news/utils/NewsUtils.java b/content-service/src/main/java/io/meeds/news/utils/NewsUtils.java index 4ec26978c..1a7e8845e 100644 --- a/content-service/src/main/java/io/meeds/news/utils/NewsUtils.java +++ b/content-service/src/main/java/io/meeds/news/utils/NewsUtils.java @@ -99,12 +99,14 @@ public class NewsUtils { public static final String UPDATE_CONTENT_PERMISSIONS = "content.update.permissions"; + private static SpaceService spaceService; + public enum NewsObjectType { DRAFT, LATEST_DRAFT, ARTICLE, EXISTING_PAGE } public enum NewsUpdateType { - CONTENT_AND_TITLE, SCHEDULE, POSTING_AND_PUBLISHING + CONTENT_AND_TITLE, SCHEDULE, POSTING_AND_PUBLISHING, PAGE_REFERENCE } public static void broadcastEvent(String eventName, Object source, Object data) { @@ -283,10 +285,29 @@ public static String buildIllustrationUrl(NotePageProperties properties, String return illustrationUrl.toString(); } + public static boolean canReferToNote(String spaceId, News article, org.exoplatform.services.security.Identity currentIdentity) { + Space space = getSpaceService().getSpaceById(spaceId); + if (space == null || currentIdentity == null) { + return false; + } + if (article.isFromExternalPage()) { + return false; + } + return getSpaceService().canRedactOnSpace(space, currentIdentity) + || getSpaceService().canPublishOnSpace(space, currentIdentity.getUserId()); + } + + private static SpaceService getSpaceService() { + if (spaceService == null) { + spaceService = CommonsUtils.getService(SpaceService.class); + } + return spaceService; + } + private static List getMySpaces(org.exoplatform.services.security.Identity userIdentity) throws Exception { SpaceService spaceService = CommonsUtils.getService(SpaceService.class); ListAccess memberSpacesListAccess = spaceService.getMemberSpaces(userIdentity.getUserId()); return Arrays.asList(memberSpacesListAccess.load(0, memberSpacesListAccess.getSize())); } - + } diff --git a/content-service/src/main/resources/locale/portlet/news/News_en.properties b/content-service/src/main/resources/locale/portlet/news/News_en.properties index 7915bc547..eaac6361d 100644 --- a/content-service/src/main/resources/locale/portlet/news/News_en.properties +++ b/content-service/src/main/resources/locale/portlet/news/News_en.properties @@ -281,3 +281,10 @@ content.alert.success.label.translation.deleted=Translation successfully deleted article.automatic.translation.label=Automatic translation article.label.translation.originalVersion=Original version article.label.chooseLanguage=Choose a language + +content.article.refer.to.note=Refer in the Notes +content.article.refer.label=Refer +content.article.deRefer.label=Derefer the note +content.article.referred.success=Article successfully referred +content.article.referred.error=Error while referring article +content.article.deReferred.success=Note dereferred successfully diff --git a/content-service/src/main/resources/locale/portlet/news/News_fr.properties b/content-service/src/main/resources/locale/portlet/news/News_fr.properties index c91d26e54..c06ae5311 100644 --- a/content-service/src/main/resources/locale/portlet/news/News_fr.properties +++ b/content-service/src/main/resources/locale/portlet/news/News_fr.properties @@ -281,3 +281,10 @@ content.alert.success.label.translation.deleted=La traduction a été supprimée article.automatic.translation.label=Traduction automatique article.label.translation.originalVersion=Version originale article.label.chooseLanguage=Choisir une langue + +content.article.refer.to.note=R\u00E9f\u00E9rencer dans les notes +content.article.refer.label=R\u00E9f\u00E9rencer +content.article.deRefer.label=D\u00E9r\u00E9f\u00E9rencer la note +content.article.referred.success=Article r\u00E9f\u00E9renc\u00E9 avec succ\u00E8s +content.article.referred.error=Erreur lors de la r\u00E9f\u00E9rence de l'article +content.article.deReferred.success=Note d\u00E9r\u00E9f\u00E9renc\u00E9e avec succ\u00E8s diff --git a/content-service/src/test/java/io/meeds/news/utils/NewsUtilsTest.java b/content-service/src/test/java/io/meeds/news/utils/NewsUtilsTest.java index f969fa4d5..85c7297db 100644 --- a/content-service/src/test/java/io/meeds/news/utils/NewsUtilsTest.java +++ b/content-service/src/test/java/io/meeds/news/utils/NewsUtilsTest.java @@ -24,7 +24,9 @@ import static org.mockito.Mockito.mockStatic; import static org.mockito.Mockito.when; +import io.meeds.news.model.News; import org.junit.AfterClass; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -53,6 +55,11 @@ public class NewsUtilsTest { @Mock private Identity adminAclIdentity; + @Before + public void setUp() { + COMMONS_UTILS.when(() -> CommonsUtils.getService(SpaceService.class)).thenReturn(spaceService); + } + @AfterClass public static void afterRunBare() throws Exception { // NOSONAR COMMONS_UTILS.close(); @@ -64,7 +71,6 @@ public void testCanPublishNews() { when(space.getId()).thenReturn("2"); assertFalse(NewsUtils.canPublishNews(null, null)); - COMMONS_UTILS.when(() -> CommonsUtils.getService(SpaceService.class)).thenReturn(spaceService); assertFalse(NewsUtils.canPublishNews(space.getId(), null)); assertFalse(NewsUtils.canPublishNews(space.getId(), userAclIdentity)); @@ -93,4 +99,23 @@ public void testCanPublishNews() { assertTrue(NewsUtils.canPublishNews(space.getId(), userAclIdentity)); } + @Test + public void testCanReferArticleToNote() { + News article = new News(); + when(userAclIdentity.getUserId()).thenReturn("user"); + when(spaceService.getSpaceById("2")).thenReturn(null, space); + assertFalse(NewsUtils.canReferToNote("2", article, null)); + assertFalse(NewsUtils.canReferToNote("2", article, null)); + + article.setFromExternalPage(true); + assertFalse(NewsUtils.canReferToNote("2", article, userAclIdentity)); + article.setFromExternalPage(false); + when(spaceService.canRedactOnSpace(space, userAclIdentity)).thenReturn(false, true, false, true); + when(spaceService.canPublishOnSpace(space, "user")).thenReturn(false, true, true, false); + assertFalse(NewsUtils.canReferToNote("2", article, userAclIdentity)); + + assertTrue(NewsUtils.canReferToNote("2", article, userAclIdentity)); + assertTrue(NewsUtils.canReferToNote("2", article, userAclIdentity)); + assertTrue(NewsUtils.canReferToNote("2", article, userAclIdentity)); + } } diff --git a/content-webapp/src/main/webapp/WEB-INF/conf/news/feature-flags-configuration.xml b/content-webapp/src/main/webapp/WEB-INF/conf/news/feature-flags-configuration.xml index 0d1a2a220..abb6f075a 100644 --- a/content-webapp/src/main/webapp/WEB-INF/conf/news/feature-flags-configuration.xml +++ b/content-webapp/src/main/webapp/WEB-INF/conf/news/feature-flags-configuration.xml @@ -31,6 +31,8 @@ Content Feature enablement flag + diff --git a/content-webapp/src/main/webapp/WEB-INF/gatein-resources.xml b/content-webapp/src/main/webapp/WEB-INF/gatein-resources.xml index 1d9de5b88..ea75d7667 100644 --- a/content-webapp/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/content-webapp/src/main/webapp/WEB-INF/gatein-resources.xml @@ -296,6 +296,9 @@ NotesPublication + + NotesTreeview + vue diff --git a/content-webapp/src/main/webapp/groovy/webui/workspace/UIContentHeadTemplate.gtmpl b/content-webapp/src/main/webapp/groovy/webui/workspace/UIContentHeadTemplate.gtmpl index 1932be644..561519b9f 100644 --- a/content-webapp/src/main/webapp/groovy/webui/workspace/UIContentHeadTemplate.gtmpl +++ b/content-webapp/src/main/webapp/groovy/webui/workspace/UIContentHeadTemplate.gtmpl @@ -7,4 +7,5 @@ diff --git a/content-webapp/src/main/webapp/vue-app/news-details-app/components/ExoNewsDetailsApp.vue b/content-webapp/src/main/webapp/vue-app/news-details-app/components/ExoNewsDetailsApp.vue index 85b6c1eee..3f2346928 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details-app/components/ExoNewsDetailsApp.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details-app/components/ExoNewsDetailsApp.vue @@ -16,6 +16,7 @@ :news-type="newsType" :show-edit-button="showEditButton" :show-publish-button="showPublishButton" + :show-refer-button="showReferButton" :show-delete-button="showDeleteButton" :translations="translations" :selected-translation="selectedTranslation" @@ -42,6 +43,7 @@ export default { showEditButton: false, showPublishButton: false, showDeleteButton: false, + showReferButton: false, selectedTranslation: {value: eXo.env.portal.language}, translations: [], languages: [], diff --git a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue index a0d4ba59e..51cfc5ce8 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue @@ -34,6 +34,7 @@ :show-delete-button="showDeleteButton" :show-publish-button="showPublishButton" :show-copy-link-button="showCopyLinkButton" + :show-refer-button="showReferButton" @delete-article="deleteConfirmDialog" @edit-article="editLink" @open-publication-drawer="openPublicationDrawer" /> @@ -77,6 +78,14 @@ :news="news" @edit-article="editLink" @delete-article="deleteConfirmDialog" /> + @@ -127,6 +136,10 @@ export default { required: false, default: false }, + showReferButton: { + type: Boolean, + default: false + }, translations: { type: Array, default: () => { @@ -157,7 +170,8 @@ export default { }, iframelyOriginRegex: /^https?:\/\/if-cdn.com/, isPublishing: false, - allowedTargets: [] + allowedTargets: [], + articlePage: null }; }, computed: { @@ -186,6 +200,7 @@ export default { } this.$root.$emit('application-loaded'); } + this.getArticlePage(); window.addEventListener('message', (event) => { if (this.iframelyOriginRegex.exec(event.origin)) { const data = JSON.parse(event.data); @@ -195,13 +210,53 @@ export default { } }); this.$root.$on('open-edit-publishing-drawer', this.openPublicationDrawer); + this.$root.$on('refer-article-to-note', this.referArticle); + this.$root.$on('move-page', this.moveArticlePage); }, methods: { + moveArticlePage(page, newParentPage) { + const previousParentPageId = page.parentPageId; + page.parentPageId = newParentPage.id; + this.news.referred = true; + this.$refs.noteTreeview.isLoading = true; + return this.$newsServices.updateNews(this.news, false, this.$newsConstants.newsObjectType.ARTICLE, + this.$newsConstants.newsUpdateType.PAGE_REFERENCE).then(() => { + return this.$newsServices.moveArticlePage(page, newParentPage).then(() => { + this.news.deReferPageId = previousParentPageId; + this.$refs.noteTreeview.isLoading = true; + this.$refs.noteTreeview.close(); + this.$root.$emit('alert-message', this.$t('content.article.referred.success'), 'success'); + }); + }).catch(() => { + this.$root.$emit('alert-message', this.$t('content.article.referred.error'), 'error'); + }); + }, + referArticle() { + if (this.news.referred) { + return this.$newsServices.getArticlePage(this.news.deReferPageId).then((deReferPage) => { + this.articlePage.parentPageId = deReferPage.id; + return this.$newsServices.moveArticlePage(this.articlePage, deReferPage).then(() => { + this.news.referred = false; + return this.$newsServices.updateNews(this.news, false, this.$newsConstants.newsObjectType.ARTICLE, + this.$newsConstants.newsUpdateType.PAGE_REFERENCE).then(() => { + this.$root.$emit('alert-message', this.$t('content.article.deReferred.success'), 'success'); + }); + }); + }); + } else { + this.$refs.noteTreeview.open(this.articlePage, 'movePage'); + } + }, openPublicationDrawer() { if (this.newPublicationDrawerEnabled) { this.$refs?.publicationDrawer?.open(this.news); } }, + getArticlePage() { + return this.$newsServices.getArticlePage(this.news?.id || this.newsId).then((page) => { + this.articlePage = page; + }); + }, getSpaceById(spaceId) { return this.$spaceService.getSpaceById(spaceId, 'identity') .then((space) => { diff --git a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsActivity.vue b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsActivity.vue index 34bf06b4d..91632db8a 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsActivity.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsActivity.vue @@ -29,6 +29,7 @@ :show-publish-button="showPublishButton" :show-delete-button="showDeleteButton" :show-copy-link-button="true" + :show-refer-button="showReferButton" :translations="translations" :selected-translation="selectedTranslation" /> @@ -76,6 +77,9 @@ export default { showEditButton() { return this.news?.canEdit; }, + showReferButton() { + return eXo?.env?.portal?.referArticleEnabled && this.news?.canRefer; + }, showPublishButton() { return this.news?.canPublish || this.news?.canSchedule; }, diff --git a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue index 524e9f6c5..7aaf6d1ab 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue @@ -41,6 +41,7 @@ :show-delete-button="showDeleteButton" :show-publish-button="showPublishButton" :show-copy-link-button="showCopyLinkButton" + :show-refer-button="showReferButton" @delete-article="$emit('delete-article')" @edit-article="$emit('edit-article')" /> @@ -98,6 +99,10 @@ export default { type: Boolean, required: false, default: false + }, + showReferButton: { + type: Boolean, + default: false } }, data: () => ({ @@ -158,6 +163,7 @@ export default { showDeleteButton: this.showDeleteButton, showPublishButton: this.showPublishButton, showCopyLinkButton: this.showCopyLinkButton, + showReferButton: this.showReferButton, currentApp: this.currentApp }); } diff --git a/content-webapp/src/main/webapp/vue-app/news/components/NewsActionMenuItems.vue b/content-webapp/src/main/webapp/vue-app/news/components/NewsActionMenuItems.vue index 254722544..807afa5f7 100644 --- a/content-webapp/src/main/webapp/vue-app/news/components/NewsActionMenuItems.vue +++ b/content-webapp/src/main/webapp/vue-app/news/components/NewsActionMenuItems.vue @@ -85,6 +85,20 @@ {{ $t('news.details.header.menu.publish') }} + + + {{ !news.referred && 'fas fa-sitemap' || 'fas fa-unlink' }} + + + {{ !news.referred && $t('content.article.refer.to.note') + || $t('content.article.deRefer.label') }} + + @@ -51,7 +52,8 @@ export default { showDeleteButton: false, showPublishButton: false, currentApp: null, - showCopyLinkButton: false + showCopyLinkButton: false, + showReferButton: false }; }, computed: { @@ -75,6 +77,7 @@ export default { this.showDeleteButton = config.showDeleteButton; this.showPublishButton = config.showPublishButton; this.showCopyLinkButton = config.showCopyLinkButton; + this.showReferButton = config.showReferButton; this.currentApp = config.currentApp; this.$refs.newsMobileActionMenu.open(); }, diff --git a/content-webapp/src/main/webapp/vue-app/news/main.js b/content-webapp/src/main/webapp/vue-app/news/main.js index 8b9f75894..f1c56ac51 100644 --- a/content-webapp/src/main/webapp/vue-app/news/main.js +++ b/content-webapp/src/main/webapp/vue-app/news/main.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - + import './initComponents.js'; Vue.use(Vuetify); @@ -52,4 +52,4 @@ export function init() { vuetify, }).$mount(`#${appId}`); }); -} \ No newline at end of file +} diff --git a/content-webapp/src/main/webapp/vue-app/services/newsConstants.js b/content-webapp/src/main/webapp/vue-app/services/newsConstants.js index db3f122fe..d721519d3 100644 --- a/content-webapp/src/main/webapp/vue-app/services/newsConstants.js +++ b/content-webapp/src/main/webapp/vue-app/services/newsConstants.js @@ -39,7 +39,8 @@ export const newsConstants = { export const newsUpdateType = { CONTENT_AND_TITLE: 'CONTENT_AND_TITLE', POSTING_AND_PUBLISHING: 'POSTING_AND_PUBLISHING', - SCHEDULE: 'SCHEDULE' + SCHEDULE: 'SCHEDULE', + PAGE_REFERENCE: 'PAGE_REFERENCE' }; export const newsObjectType = { diff --git a/content-webapp/src/main/webapp/vue-app/services/newsServices.js b/content-webapp/src/main/webapp/vue-app/services/newsServices.js index 0d2cf4551..9638f6e2c 100644 --- a/content-webapp/src/main/webapp/vue-app/services/newsServices.js +++ b/content-webapp/src/main/webapp/vue-app/services/newsServices.js @@ -307,3 +307,11 @@ export function getArticleLanguages(articleId, withDrafts) { return resp.json(); }); } + +export function getArticlePage(pageId) { + return Vue.prototype.$notesService.getNoteById(pageId); +} + +export function moveArticlePage(page, newParentPage) { + return Vue.prototype.$notesService.moveNotes(page, newParentPage); +}