Skip to content

Commit

Permalink
pkp/pkp-lib#10674 Bring back the Submit Revision button on Author das…
Browse files Browse the repository at this point in the history
…hboard (#479)
  • Loading branch information
jardakotesovec authored Jan 8, 2025
1 parent f9aca59 commit 495c6ab
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
20 changes: 16 additions & 4 deletions src/pages/dashboard/composables/useEditorialLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import {useSubmission} from '@/composables/useSubmission.js';
import {useLocalize} from '@/composables/useLocalize';
import {useDate} from '@/composables/useDate';
import {Actions as ParticipantManagerActions} from '@/managers/ParticipantManager/useParticipantManagerActions';
import {Actions as WorkflowActions} from '@/pages/workflow/composables/useWorkflowActions';
import {Actions as ReviewerManagerActions} from '@/managers/ReviewerManager/useReviewerManagerActions';

import {Actions as FileManagerActions} from '@/managers/FileManager/useFileManagerActions';
const {formatShortDate} = useDate();

const {t} = useLocalize();
Expand Down Expand Up @@ -212,21 +211,34 @@ export function useEditorialLogic() {
function getEditorialActivityForMySubmissions(submission) {
const activeStage = getActiveStage(submission);

if (activeStage.id === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW) {
if (
activeStage.id === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW ||
activeStage.id === pkp.const.WORKFLOW_STAGE_ID_INTERNAL_REVIEW
) {
const activeRound = getCurrentReviewRound(submission);

if (
[pkp.const.REVIEW_ROUND_STATUS_REVISIONS_REQUESTED].includes(
activeRound.statusId,
)
) {
const fileStage =
activeStage.id === pkp.const.WORKFLOW_STAGE_ID_INTERNAL_REVIEW
? pkp.const.SUBMISSION_FILE_INTERNAL_REVIEW_REVISION
: pkp.const.SUBMISSION_FILE_REVIEW_REVISION;
return [
{
component: 'CellSubmissionActivityActionAlert',
props: {
alert: t('dashboard.revisionRequested'),
actionLabel: t('dashboard.submitRevisions'),
actionName: WorkflowActions.UPLOAD_REVISIONS,
actionName: FileManagerActions.FILE_UPLOAD,
actionArgs: {
submissionId: submission.id,
fileStage,
reviewRoundId: activeRound.id,
wizardTitleKey: t('editor.submissionReview.uploadFile'),
},
},
},
];
Expand Down
13 changes: 12 additions & 1 deletion src/pages/dashboard/dashboardPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {useWorkflowActions} from '../workflow/composables/useWorkflowActions';
import {useReviewerManagerActions} from '@/managers/ReviewerManager/useReviewerManagerActions';
import {useDashboardBulkDelete} from './composables/useDashboardBulkDelete';
import {useParticipantManagerActions} from '@/managers/ParticipantManager/useParticipantManagerActions';
import {useFileManagerActions} from '@/managers/FileManager/useFileManagerActions';

import {useEditorialLogic} from './composables/useEditorialLogic';
import {useReviewActivityLogic} from './composables/useReviewActivityLogic';
Expand Down Expand Up @@ -230,7 +231,7 @@ export const useDashboardPageStore = defineComponentStore(
const _reviewerManagerActionFns = useReviewerManagerActions(pageInitConfig);
const _participantManagerActionsFns =
useParticipantManagerActions(pageInitConfig);

const _fileManagerActionFns = useFileManagerActions();
const {getCurrentPublication} = useSubmission();

function refetchCallback() {
Expand Down Expand Up @@ -336,6 +337,13 @@ export const useDashboardPageStore = defineComponentStore(
);
}

/**
* File Manager actions
*/
function fileUpload(args) {
_fileManagerActionFns.fileUpload(enrichActionArgs(args), refetchCallback);
}

/**
* Participants Actions
*
Expand Down Expand Up @@ -459,6 +467,9 @@ export const useDashboardPageStore = defineComponentStore(
// Reviewer listing
openReviewerForm,

// File manager actions
fileUpload,

// Reviewer manager actions
reviewerAddReviewer,
reviewerReviewDetails,
Expand Down

0 comments on commit 495c6ab

Please sign in to comment.