Skip to content

Commit

Permalink
pkp#5098 Improve load times for workflow screen
Browse files Browse the repository at this point in the history
- Reduce unnecessary db lookups when getting publication props
- Only pass necessary publications to WorkflowContainer
- Make autosuggest fields load suggestions when focused
- Delay loading author/galley grids to make room for workflow requests
- Reduce sharing of workflow setup so tabs and editorial actions load quicker
  • Loading branch information
NateWr committed Oct 3, 2019
1 parent c3a1a43 commit c42a098
Show file tree
Hide file tree
Showing 7 changed files with 266 additions and 257 deletions.
13 changes: 9 additions & 4 deletions classes/services/PKPPublicationService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ public function getProperties($publication, $props, $args = null) {
$request = $args['request'];
$dispatcher = $request->getDispatcher();

// Get the publication's context object
$submission = Services::get('submission')->get($publication->getData('submissionId'));
$submissionContext = Services::get('context')->get($submission->getData('contextId'));
// Get required submission and context
$submission = !empty($args['submission'])
? $args['submission']
: Services::get('submission')->get($publication->getData('submissionId'));

$submissionContext = !empty($args['context'])
? $args['context']
: Services::get('context')->get($submission->getData('contextId'));

$values = [];

Expand Down Expand Up @@ -158,7 +163,7 @@ function($citation) {
break;
case 'galleys':
$values[$prop] = array_map(
function($galley) use ($request, $prop) {
function($galley) use ($request) {
return Services::get('galley')->getSummaryProperties($galley, ['request' => $request]);
},
$publication->getData('galleys')
Expand Down
9 changes: 7 additions & 2 deletions classes/services/PKPSubmissionService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ public function getProperties($submission, $props, $args = null) {
break;
case 'publications':
$values[$prop] = array_map(
function($publication) use ($args) {
return Services::get('publication')->getFullProperties($publication, $args);
function($publication) use ($args, $submission, $submissionContext) {
return Services::get('publication')->getSummaryProperties(
$publication,
$args + [
'submission' => $submission,
'context' => $submissionContext,
]);
},
(array) $submission->getData('publications')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
* @private
* @type {Object?}
*/
$.pkp.controllers.grid.settings.roles.form.
$.pkp.controllers.grid.users.stageParticipant.form.
StageParticipantNotifyHandler.prototype.
notChangeMetadataEditPermissionRoles_ = null;

Expand All @@ -157,7 +157,7 @@
* @private
* @type {Object?}
*/
$.pkp.controllers.grid.settings.roles.form.
$.pkp.controllers.grid.users.stageParticipant.form.
StageParticipantNotifyHandler.prototype.
permitMetadataEditUserGroupIds_ = null;

Expand Down
Loading

0 comments on commit c42a098

Please sign in to comment.