Skip to content

Commit

Permalink
workflow wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Sep 4, 2024
1 parent bd9181e commit 1e5961b
Show file tree
Hide file tree
Showing 16 changed files with 1,487 additions and 136 deletions.
262 changes: 190 additions & 72 deletions public/globals.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/TableNext/TableColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<th
scope="col"
:aria-sort="props.allowsSorting ? tableContext.sortDirection : undefined"
class="whitespace-nowrap border-b border-t border-light px-2 py-4 text-start text-base-normal uppercase first:border-s first:ps-3 last:border-e last:pe-3"
class="whitespace-nowrap border-b border-t border-light px-2 py-4 text-start text-base-normal uppercase text-heading first:border-s first:ps-3 last:border-e last:pe-3"
>
<template v-if="props.allowsSorting">
<button class="flex items-center" @click="tableContext.onSort(id)">
Expand Down
13 changes: 10 additions & 3 deletions src/composables/useSubmission.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export function useSubmission() {
return submission.stages.find((stage) => stage.isActiveStage);
}

function getReviewAssignmentsForRound(submission, roundId) {
return submission.reviewAssignments.filter(
(reviewAssignment) => reviewAssignment.roundId === roundId,
);
}

function getCurrentReviewRound(
submission,
stageId = pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
Expand Down Expand Up @@ -81,7 +87,9 @@ export function useSubmission() {

function getExtendedStage(submission) {
const activeStage = getActiveStage(submission);

if (submission.status === pkp.const.STATUS_DECLINED) {
return ExtendedStages.DECLINED;
}
switch (activeStage.id) {
case pkp.const.WORKFLOW_STAGE_ID_SUBMISSION:
return submission.submissionProgress
Expand All @@ -99,8 +107,6 @@ export function useSubmission() {
return ExtendedStages.PRODUCTION_SCHEDULED;
case pkp.const.STATUS_PUBLISHED:
return ExtendedStages.PRODUCTION_PUBLISHED;
case pkp.const.STATUS_DECLINED:
return ExtendedStages.PRODUCTION_DECLINED;
}
}
}
Expand Down Expand Up @@ -149,5 +155,6 @@ export function useSubmission() {
getFileStageFromWorkflowStage,
hasNotSubmissionStartedStage,
hasSubmissionPassedStage,
getReviewAssignmentsForRound,
};
}
2 changes: 1 addition & 1 deletion src/managers/ParticipantManager/ParticipantManager.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="border border-light">
<div class="flex items-center justify-between bg-default p-5">
<h3 class="text-2xl-bold uppercase text-default">
<h3 class="text-2xl-bold uppercase text-heading">
{{ t('editor.submission.stageParticipants') }}
</h3>
<PkpButton @click="participantManagerStore.handleAction(Actions.ASSIGN)">
Expand Down
1 change: 1 addition & 0 deletions src/managers/ReviewerManager/ReviewerManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const headingId = generateId();
const props = defineProps({
submission: {type: Object, required: true},
reviewRoundId: {type: Number, required: true},
redactedForAuthors: {type: Boolean, required: false, default: false},
});
Expand Down
13 changes: 9 additions & 4 deletions src/managers/ReviewerManager/reviewerManagerStore.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import {computed} from 'vue';
import {defineComponentStore} from '@/utils/defineComponentStore';
import {useReviewAssignment} from '@/composables/useReviewAssignment';

import {useSubmission} from '@/composables/useSubmission';
export const useReviewerManagerStore = defineComponentStore(
'reviewerManagerStore',
(props) => {
const {getReviewMethodIcons, getOpenReviewAssignments} =
useReviewAssignment();

// todo get only review assignment for current round
const {getReviewAssignmentsForRound} = useSubmission();

const reviewAssignments = computed(() => {
const reviewAssignmentsForSelectedRound = getReviewAssignmentsForRound(
props.submission,
props.reviewRoundId,
);

if (props.redactedForAuthors) {
return getOpenReviewAssignments(props.submission?.reviewAssignments);
return getOpenReviewAssignments(reviewAssignmentsForSelectedRound);
}

return props.submission?.reviewAssignments;
return reviewAssignmentsForSelectedRound;
});

return {
Expand Down
1 change: 0 additions & 1 deletion src/pages/dashboard/DashboardPage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ import * as DashboardPage from './DashboardPage.stories.js';
# DashboardPage page

<ArgTypes />
./DashboardPage.stories.js
Loading

0 comments on commit 1e5961b

Please sign in to comment.