Skip to content

Commit

Permalink
pkp/pkp-lib#7495 initial adjustments for new submission listing & wor…
Browse files Browse the repository at this point in the history
…kflow for OPS
  • Loading branch information
jardakotesovec committed Nov 6, 2024
1 parent 1f9bfc7 commit 7e33c9e
Show file tree
Hide file tree
Showing 8 changed files with 364 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ cypress/tests/**/*
lib/pkp/cypress/**/*
cypress/support/**/*
plugins/themes/default/**/*

schemas/**/*.json
package.json
41 changes: 41 additions & 0 deletions classes/components/forms/dashboard/SubmissionFilters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* @file classes/components/form/dashboard/SubmissionFilters.php
*
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2000-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class SubmissionFilters
*
* @ingroup classes_controllers_form
*
* @brief A preset form to add and remove filters in the submissions dashboard
*/

namespace APP\components\forms\dashboard;

use Illuminate\Support\LazyCollection;
use PKP\components\forms\dashboard\PKPSubmissionFilters;
use PKP\context\Context;

class SubmissionFilters extends PKPSubmissionFilters
{
public function __construct(
public Context $context,
public array $userRoles,
public LazyCollection $sections,
public LazyCollection $categories
) {
$this
->addPage(['id' => 'default', 'submitButton' => null])
->addGroup(['id' => 'default', 'pageId' => 'default'])
->addSectionFields()
->addAssignedTo()
->addCategories()
->addDaysSinceLastActivity()
;
}


}
7 changes: 3 additions & 4 deletions classes/components/forms/publication/RelationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ class RelationForm extends FormComponent
* Constructor
*
* @param string $action URL to submit the form to
* @param Publication $publication The publication to change settings for
*/
public function __construct($action, $publication)
public function __construct($action)
{
$this->action = $action;
$this->locales = [];
Expand All @@ -41,7 +40,7 @@ public function __construct($action, $publication)
$this->addField(new FieldOptions('relationStatus', [
'label' => __('publication.relation.label'),
'type' => 'radio',
'value' => (int) $publication->getData('relationStatus'),
'value' => null,
'options' => [
[
'value' => Publication::PUBLICATION_RELATION_NONE,
Expand All @@ -55,7 +54,7 @@ public function __construct($action, $publication)
]))
->addField(new FieldText('vorDoi', [
'label' => __('publication.relation.vorDoi'),
'value' => $publication->getData('vorDoi'),
'value' => null,
'size' => 'large',
'showWhen' => ['relationStatus', Publication::PUBLICATION_RELATION_PUBLISHED],
]));
Expand Down
5 changes: 5 additions & 0 deletions js/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import PkpLoad from '../lib/pkp/js/load.js';
import Container from '@/components/Container/Container.vue';
import AdvancedSearchReviewerContainer from '@/components/Container/AdvancedSearchReviewerContainer.vue';
import Page from '@/components/Container/Page.vue';
import WorkflowPageOPS from '@/pages/workflow/WorkflowPageOPS.vue';
import AccessPage from '@/components/Container/AccessPage.vue';
import AddContextContainer from '@/components/Container/AddContextContainer.vue';
import AdminPage from '@/components/Container/AdminPage.vue';
Expand All @@ -34,6 +35,10 @@ import StatsUsersPage from '@/components/Container/StatsUsersPage.vue';
import SubmissionWizardPage from '@/components/Container/SubmissionWizardPageOPS.vue';
import WorkflowPage from '@/components/Container/WorkflowPageOPS.vue';

// Helper for initializing and tracking Vue controllers
import VueRegistry from '../lib/pkp/js/classes/VueRegistry.js';
VueRegistry.registerComponent('WorkflowPage', WorkflowPageOPS);

// Expose Vue, the registry and controllers in a global var
window.pkp = Object.assign(PkpLoad, window.pkp || {}, {
controllers: {
Expand Down
75 changes: 75 additions & 0 deletions pages/dashboard/DashboardHandlerNext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php
/**
* @file pages/dashboard/DashboardHandlerNext.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class DashboardHandlerNext
*
* @ingroup pages_dashboard
*
* @brief Handle requests for user's dashboard.
*/

namespace APP\pages\dashboard;

use APP\components\forms\dashboard\SubmissionFilters;
use APP\core\Request;
use APP\facades\Repo;
use APP\template\TemplateManager;
use PKP\pages\dashboard\PKPDashboardHandlerNext;

class DashboardHandlerNext extends PKPDashboardHandlerNext
{
/**
* Setup variables for the template
*
* @param Request $request
*/
public function setupIndex($request)
{
parent::setupIndex($request);

$templateMgr = TemplateManager::getManager($request);

$relationForm = new \APP\components\forms\publication\RelationForm('emit');

$pageInitConfig = $templateMgr->getState('pageInitConfig');
$pageInitConfig['componentForms']['relationForm'] = $relationForm->getConfig();
$templateMgr->setState(['pageInitConfig' => $pageInitConfig]);

$templateMgr->assign([
'pageComponent' => 'Page',
]);

$templateMgr->setConstants([

]);
}


protected function getSubmissionFiltersForm($userRoles, $context)
{

$sections = Repo::section()
->getCollector()
->filterByContextIds([$context->getId()])
->getMany();

$categories = Repo::category()
->getCollector()
->filterByContextIds([$context->getId()])
->getMany();

return new SubmissionFilters(
$context,
$userRoles,
$sections,
$categories
);
}


}
29 changes: 29 additions & 0 deletions pages/dashboard/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* @defgroup pages_submissions Submissions editorial page
*/

/**
* @file lib/pkp/pages/dashboard/index.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup pages_submissions
*
* @brief Handle requests for submissions functions.
*
*/


switch ($op) {
case 'index':
case 'editorial':
return new APP\pages\dashboard\DashboardHandlerNext(PKP\pages\dashboard\DashboardPage::EditorialDashboard);
case 'mySubmissions':
return new APP\pages\dashboard\DashboardHandlerNext(PKP\pages\dashboard\DashboardPage::MySubmissions);
case 'reviewAssignments':
return new APP\pages\dashboard\DashboardHandlerNext(PKP\pages\dashboard\DashboardPage::MyReviewAssignments);
}
Loading

0 comments on commit 7e33c9e

Please sign in to comment.