Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 53 additions & 8 deletions classes/components/forms/publication/IssueEntryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@

use APP\facades\Repo;
use PKP\components\forms\FieldAutosuggestPreset;
use PKP\components\forms\FieldRichTextarea;
use PKP\components\forms\FieldSelect;
use PKP\components\forms\FieldText;
use PKP\components\forms\FieldUploadImage;
use PKP\components\forms\FormComponent;
use PKP\publication\enums\UpdateType;

class IssueEntryForm extends FormComponent
{
public const FORM_ISSUE_ENTRY = 'issueEntry';

public const GROUP_PLACEMENT = 'placement';
public const GROUP_PUBLICATION_TIMING = 'publicationTiming';
public const GROUP_VERSION_AND_UPDATES = 'versionAndUpdates';
public const GROUP_DISPLAY = 'display';
public const GROUP_ACCESS = 'access';

public $id = self::FORM_ISSUE_ENTRY;
public $method = 'PUT';

Expand All @@ -49,6 +58,13 @@ public function __construct(
$this->action = $action;
$this->locales = $locales;

$this
->addGroup(['id' => self::GROUP_PLACEMENT, 'label' => __('publication.placement')])
->addGroup(['id' => self::GROUP_PUBLICATION_TIMING, 'label' => __('publication.publicationTiming')])
->addGroup(['id' => self::GROUP_VERSION_AND_UPDATES, 'label' => __('publication.versionAndUpdates')])
->addGroup(['id' => self::GROUP_DISPLAY, 'label' => __('publication.display')])
->addGroup(['id' => self::GROUP_ACCESS, 'label' => __('publication.access')]);

// Section options
$sections = Repo::section()->getSectionList($publicationContext->getId());
$sectionOptions = [];
Expand All @@ -60,7 +76,9 @@ public function __construct(
}

$this->addField(new FieldSelect('sectionId', [
'groupId' => self::GROUP_PLACEMENT,
'label' => __('section.section'),
'description' => __('publication.section.description'),
'options' => $sectionOptions,
'value' => (int) $publication->getData('sectionId'),
'size' => 'large',
Expand All @@ -86,8 +104,9 @@ public function __construct(
$vocabulary = Repo::category()->getCategoryVocabularyStructure($categories);

$this->addField(new FieldAutosuggestPreset('categoryIds', [
'groupId' => self::GROUP_PLACEMENT,
'label' => __('submission.submit.placement.categories'),
'description' => $hasAllBreadcrumbs ? '' : __('submission.categories.circularReferenceWarning'),
'description' => __('publication.categories.description') . ($hasAllBreadcrumbs ? '' : ' ' . __('submission.categories.circularReferenceWarning')),
'value' => $publication->getData('categoryIds'),
'options' => $categoryOptions,
'vocabularies' => [
Expand All @@ -102,8 +121,35 @@ public function __construct(
}

$this
->addField(new FieldText('datePublished', [
'groupId' => self::GROUP_PUBLICATION_TIMING,
'label' => __('publication.publicationDate'),
'description' => __('publication.datePublished.description'),
'value' => $publication->getData('datePublished'),
'size' => 'large',
]))
->addField(new FieldSelect('updateType', [
'groupId' => self::GROUP_VERSION_AND_UPDATES,
'label' => __('publication.updateType.label'),
'description' => __('publication.updateType.description'),
'options' => array_map(
fn (UpdateType $case) => ['value' => $case->value, 'label' => $case->label()],
UpdateType::cases()
),
'value' => $publication->getData('updateType') ?? UpdateType::NEW_VERSION->value,
'size' => 'large',
]))
->addField(new FieldRichTextarea('summaryOfChanges', [
'groupId' => self::GROUP_VERSION_AND_UPDATES,
'label' => __('submission.form.summaryOfChanges'),
'description' => __('publication.summaryOfChanges.description'),
'isMultilingual' => true,
'value' => $publication->getData('summaryOfChanges'),
]))
->addField(new FieldUploadImage('coverImage', [
'groupId' => self::GROUP_DISPLAY,
'label' => __('editor.article.coverImage'),
'description' => __('publication.coverImage.description'),
'value' => $publication->getData('coverImage'),
'isMultilingual' => true,
'baseUrl' => $baseUrl,
Expand All @@ -112,19 +158,18 @@ public function __construct(
],
]))
->addField(new FieldText('pages', [
'groupId' => self::GROUP_DISPLAY,
'label' => __('editor.issues.pages'),
'description' => __('publication.pages.description'),
'value' => $publication->getData('pages'),
'size' => 'large',
]))
->addField(new FieldText('urlPath', [
'groupId' => self::GROUP_ACCESS,
'label' => __('publication.urlPath'),
'description' => __('publication.urlPath.description'),
'description' => __('publication.publicationSettings.urlPath.description'),
'value' => $publication->getData('urlPath'),
]))
->addField(new FieldText('datePublished', [
'label' => __('publication.datePublished'),
'description' => __('publication.datePublished.description'),
'value' => $publication->getData('datePublished'),
'size' => 'small',
'size' => 'large',
]));
}
}
2 changes: 2 additions & 0 deletions classes/migration/install/OJSMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use PKP\publication\enums\UpdateType;

class OJSMigration extends \PKP\migration\Migration
{
Expand Down Expand Up @@ -245,6 +246,7 @@ public function up(): void
$table->enum('version_stage', array_column(VersionStage::cases(), 'value'))->nullable();
$table->integer('version_minor')->nullable();
$table->integer('version_major')->nullable();
$table->enum('update_type', array_column(UpdateType::cases(), 'value'))->nullable();
$table->datetime('created_at')->useCurrent();

$table->bigInteger('issue_id')->nullable();
Expand Down
1 change: 1 addition & 0 deletions classes/publication/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DAO extends \PKP\publication\DAO
'versionStage' => 'version_stage',
'versionMinor' => 'version_minor',
'versionMajor' => 'version_major',
'updateType' => 'update_type',
'createdAt' => 'created_at',
'sourcePublicationId' => 'source_publication_id'
];
Expand Down
6 changes: 3 additions & 3 deletions cypress/tests/data/60-content/AmwandengaSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ describe('Data suite: Amwandenga', function() {
cy.get('[role="status"]').contains('Saved');
//cy.wait(1000);

// Issue
cy.openWorkflowMenu('Unassigned version', 'Issue')
// Publication Settings
cy.openWorkflowMenu('Unassigned version', 'Publication Settings')

// Initially set to no issue
cy.get('label:Contains("Don\'t Assign To An Issue")').click();
Expand Down Expand Up @@ -518,7 +518,7 @@ describe('Data suite: Amwandenga', function() {
cy.get('[data-cy="galley-manager"]').contains("PDF Version 2");

// Edit url path and select issue
cy.openWorkflowMenu('Version of Record 1.1', 'Issue')
cy.openWorkflowMenu('Version of Record 1.1', 'Publication Settings')
cy.wait(2000);
cy.get('select[name="issueId"]').select('Vol. 1 No. 2 (2014)');
cy.get('[name="urlPath"]').clear();
Expand Down
2 changes: 1 addition & 1 deletion cypress/tests/data/60-content/VkarbasizaedSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('Data suite tests', function() {
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Active submissions').click();
cy.openSubmission(author.familyName);
cy.openWorkflowMenu('Version of Record 1.0', 'Issue')
cy.openWorkflowMenu('Version of Record 1.0', 'Publication Settings')

// update issue selection and publish
cy.get('button').contains('Schedule For Publication').click();
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/integration/Z_ArticleViewDCMetadata.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ describe('Article View Metadata - DC Plugin', function() {
});


// Issue
cy.openWorkflowMenu('Unassigned version', 'Issue')
// Publication Settings
cy.openWorkflowMenu('Unassigned version', 'Publication Settings')
cy.get('label:Contains("'+issueAssignmentOption+'")').click();
cy.get('select[name="issueId"]').select(submission.source.issueTitle);
submission.publishIssueSections.forEach((sectionTitle) => {
Expand Down
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
<migration class="PKP\migration\upgrade\v3_6_0\I6278_DataCitations" />
<migration class="PKP\migration\upgrade\v3_6_0\I12307_ReviewRoundRequestAuthorResponseMail" />
<migration class="PKP\migration\upgrade\v3_6_0\I12251_SupportMediaFiles" />
<migration class="PKP\migration\upgrade\v3_6_0\I12584_AddPublicationUpdateType" />
<code function="rebuildSearchIndex" />
<note file="docs/release-notes/README-3.6.0" />
</upgrade>
Expand Down
2 changes: 2 additions & 0 deletions js/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import StatsContextPage from '@/components/Container/StatsContextPage.vue';
import StatsIssuesPage from '@/components/Container/StatsIssuesPage.vue';
import StatsUsersPage from '@/components/Container/StatsUsersPage.vue';
import SubmissionWizardPage from '@/components/Container/SubmissionWizardPage.vue';
import FileMetadataForm from '@/managers/FileManager/modals/FileMetadataForm.vue';
import DashboardPage from '@/pages/dashboard/DashboardPage.vue';

// Helper for initializing and tracking Vue controllers
Expand Down Expand Up @@ -62,6 +63,7 @@ window.pkp = Object.assign(PkpLoad, window.pkp || {}, {
StatsIssuesPage,
StatsUsersPage,
SubmissionWizardPage,
FileMetadataForm,
DashboardPage,
},
});
45 changes: 45 additions & 0 deletions locale/en/submission.po
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,54 @@ msgstr ""
msgid "galley.publicationNotFound"
msgstr "The publication for this galley could not be found."

msgid "publication.access"
msgstr "Access"

msgid "publication.assignToIssue.description"
msgstr "Choose whether to publish this now or include it in an issue."

msgid "publication.assignToissue"
msgstr "Assign to Issue"

msgid "publication.categories.description"
msgstr "Assign categories to help organize and filter this publication."

msgid "publication.coverImage.description"
msgstr "Upload an image to represent this publication."

msgid "publication.display"
msgstr "Display"

msgid "publication.insertContent.empty"
msgstr "No saved summaries found for this submission's review revisions."

msgid "publication.pages.description"
msgstr "Enter page numbers for this publication, if applicable."

msgid "publication.placement"
msgstr "Placement"

msgid "publication.publicationDate"
msgstr "Publication Date"

msgid "publication.publicationSettings"
msgstr "Publication Settings"

msgid "publication.publicationSettings.urlPath.description"
msgstr "Set a custom URL for this publication, or leave blank to use the default."

msgid "publication.publicationTiming"
msgstr "Publication Timing"

msgid "publication.section.description"
msgstr "Choose the journal section where this publication will appear."

msgid "publication.summaryOfChanges.description"
msgstr "This will appear publicly as the version amendment notice. Ensure it accurately reflects the changes made in this version before publishing."

msgid "publication.versionAndUpdates"
msgstr "Version and Updates"

msgid "publication.assignedToIssue"
msgstr ""
"This has been assigned to <a href=\"{$issueUrl}\">{$issueName}</a> but it "
Expand Down
11 changes: 11 additions & 0 deletions pages/dashboard/DashboardHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use APP\facades\Repo;
use APP\template\TemplateManager;
use PKP\pages\dashboard\PKPDashboardHandler;
use PKP\publication\enums\UpdateType;
use PKP\submission\reviewer\recommendation\ReviewerRecommendation;

class DashboardHandler extends PKPDashboardHandler
Expand Down Expand Up @@ -56,6 +57,16 @@ public function setupIndex($request)
->filterByContextIds([$context->getId()])
->getCount();

$updateTypeOptions = [];
foreach (UpdateType::cases() as $updateType) {
$updateTypeOptions[] = [
'label' => $updateType->label(),
'value' => $updateType->value,
];
}
$pageInitConfig['componentForms']['updateTypeOptions'] = $updateTypeOptions;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we have this pattern already used for VersionStage. Lets think about some alternatives on wednesday. I would like to keep these data snippets being passed on page load to minimum as we are aiming for higher independency between frontend and backend. Will need to think about more about solid approach. But for this PR keep as is.

$pageInitConfig['componentForms']['defaultUpdateType'] = UpdateType::NEW_VERSION->value;

$templateMgr->setState(['pageInitConfig' => $pageInitConfig]);
}

Expand Down
Loading