From dc927a3e79e3632e3a23e97d7e6dc3dd42be47dd Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 24 Mar 2025 01:43:27 +0600 Subject: [PATCH] PKP Sciflow TEST : initial intehration of editor via component demo --- .npmrc | 2 + package-lock.json | 6 + package.json | 1 + src/pages/workflow/WorkflowPageOJS.vue | 2 + .../publication/WorkflowPublicationEditor.vue | 407 ++++++++++++++++++ .../workflowConfigEditorialOJS.js | 19 + .../useWorkflowNavigationConfigOJS.js | 7 + 7 files changed, 444 insertions(+) create mode 100644 .npmrc create mode 100644 src/pages/workflow/components/publication/WorkflowPublicationEditor.vue diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..b5ef2ce4c --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@sciflow:registry=https://gitlab.com/api/v4/projects/67023583/packages/npm/ +//gitlab.com/api/v4/projects/67023583/packages/npm/:_authToken="${NPM_TOKEN}" diff --git a/package-lock.json b/package-lock.json index 1a70d0825..437a4ea60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@highlightjs/vue-plugin": "^2.1.2", "@lk77/vue3-color": "^3.0.6", "@storybook/test": "^8.6.12", + "@sciflow/component-demo": "^0.0.1-1668088552", "@tinymce/tinymce-vue": "^6.1.0", "@vue-a11y/announcer": "^3.1.5", "@vueuse/core": "^10.11.1", @@ -1546,6 +1547,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@sciflow/component-demo": { + "version": "0.0.1-1668088552", + "resolved": "https://gitlab.com/api/v4/projects/67023583/packages/npm/@sciflow/component-demo/-/@sciflow/component-demo-0.0.1-1668088552.tgz", + "integrity": "sha1-aTBjvre6FXN8viAkPPJijkDwW5o=" + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", diff --git a/package.json b/package.json index 077ed0536..58f8ec006 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@highlightjs/vue-plugin": "^2.1.2", "@lk77/vue3-color": "^3.0.6", "@storybook/test": "^8.6.12", + "@sciflow/component-demo": "^0.0.1-1668088552", "@tinymce/tinymce-vue": "^6.1.0", "@vue-a11y/announcer": "^3.1.5", "@vueuse/core": "^10.11.1", diff --git a/src/pages/workflow/WorkflowPageOJS.vue b/src/pages/workflow/WorkflowPageOJS.vue index bf4bc16d1..c4b5b458e 100644 --- a/src/pages/workflow/WorkflowPageOJS.vue +++ b/src/pages/workflow/WorkflowPageOJS.vue @@ -23,6 +23,7 @@ import WorkflowListingEmails from './components/primary/WorkflowListingEmails.vu import WorkflowPaymentDropdown from './components/header/WorkflowPaymentDropdown.vue'; import WorkflowPublicationForm from './components/publication/WorkflowPublicationForm.vue'; import WorkflowPublicationJats from './components/publication/WorkflowPublicationJats.vue'; +import WorkflowPublicationEditor from './components/publication/WorkflowPublicationEditor.vue'; import WorkflowPublicationVersionControl from './components/publication/WorkflowPublicationVersionControl.vue'; import WorkflowChangeSubmissionLanguage from './components/publication/WorkflowChangeSubmissionLanguage.vue'; import WorkflowPrimaryBasicMetadata from './components/primary/WorkflowPrimaryBasicMetadata.vue'; @@ -54,6 +55,7 @@ const Components = markRaw({ WorkflowPrimaryBasicMetadata, WorkflowPublicationForm, WorkflowPublicationJats, + WorkflowPublicationEditor, WorkflowPublicationVersionControl, WorkflowChangeSubmissionLanguage, WorkflowSubmissionStatus, diff --git a/src/pages/workflow/components/publication/WorkflowPublicationEditor.vue b/src/pages/workflow/components/publication/WorkflowPublicationEditor.vue new file mode 100644 index 000000000..15988272b --- /dev/null +++ b/src/pages/workflow/components/publication/WorkflowPublicationEditor.vue @@ -0,0 +1,407 @@ + + + + + diff --git a/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOJS.js b/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOJS.js index 1351a5939..eadc4b531 100644 --- a/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOJS.js +++ b/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOJS.js @@ -959,6 +959,25 @@ export const PublicationConfig = { ]; }, }, + editors: { + getPrimaryItems: ({ + submission, + selectedPublication, + pageInitConfig, + permissions, + }) => { + return [ + { + component: 'WorkflowPublicationEditor', + props: { + canEdit: permissions.canEditPublication, + submission, + publication: selectedPublication, + }, + }, + ]; + }, + }, galleys: { getPrimaryItems: ({submission, selectedPublication, permissions}) => { return [ diff --git a/src/pages/workflow/composables/useWorkflowNavigationConfig/useWorkflowNavigationConfigOJS.js b/src/pages/workflow/composables/useWorkflowNavigationConfig/useWorkflowNavigationConfigOJS.js index bc498f72f..b4edd3eef 100644 --- a/src/pages/workflow/composables/useWorkflowNavigationConfig/useWorkflowNavigationConfigOJS.js +++ b/src/pages/workflow/composables/useWorkflowNavigationConfig/useWorkflowNavigationConfigOJS.js @@ -250,6 +250,13 @@ export function useWorkflowNavigationConfigOJS(pageInitConfig) { }), ); + items.push( + getPublicationItem({ + name: 'editors', + label: 'Fulltext Editor', + }), + ); + if (permissions.canAccessProduction) { items.push( getPublicationItem({