From 36b6bfd1b0096034cbc14223777aa60827761346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Tue, 25 Feb 2025 18:40:31 +0100 Subject: [PATCH] pkp/pkp-lib#10674 Refine editorial activity, dateConfirmed, fix mistakes from refactor --- ...DashboardCellSubmissionActivityReviewsItem.vue | 6 ++++-- .../useDashboardConfigReviewActivity.js | 15 ++++++--------- src/pages/dashboard/dashboardPageStore.js | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/pages/dashboard/components/DashboardTable/DashboardCellSubmissionActivity/DashboardCellSubmissionActivityReviewsItem.vue b/src/pages/dashboard/components/DashboardTable/DashboardCellSubmissionActivity/DashboardCellSubmissionActivityReviewsItem.vue index 6c150d984..7a3cd3041 100644 --- a/src/pages/dashboard/components/DashboardTable/DashboardCellSubmissionActivity/DashboardCellSubmissionActivityReviewsItem.vue +++ b/src/pages/dashboard/components/DashboardTable/DashboardCellSubmissionActivity/DashboardCellSubmissionActivityReviewsItem.vue @@ -35,10 +35,12 @@ const { const emit = defineEmits('action'); const reviewActivityIndicatorProps = computed(() => - getReviewActivityIndicatorProps(props.reviewAssignment), + getReviewActivityIndicatorProps({reviewAssignment: props.reviewAssignment}), ); const reviewActivityIndicatorPopoverProps = computed(() => - getReviewActivityIndicatorPopoverProps(props.reviewAssignment), + getReviewActivityIndicatorPopoverProps({ + reviewAssignment: props.reviewAssignment, + }), ); diff --git a/src/pages/dashboard/composables/useDashboardConfigReviewActivity.js b/src/pages/dashboard/composables/useDashboardConfigReviewActivity.js index 99081a082..1fb748547 100644 --- a/src/pages/dashboard/composables/useDashboardConfigReviewActivity.js +++ b/src/pages/dashboard/composables/useDashboardConfigReviewActivity.js @@ -203,9 +203,7 @@ const ConfigPerStatus = { textAction: null, primaryAction: ReviewActivityActions.VIEW_RECOMMENDATION, negativeAction: null, - // TODO: THIS IS INCORRECT this is when the review was completed!! - // https://github.com/pkp/pkp-lib/issues/10359 - dateToDisplay: 'dateCompleted', + dateToDisplay: 'dateConsidered', }, // reviewer has been thanked // indicated currently exactly same as status complete @@ -224,7 +222,7 @@ const ConfigPerStatus = { textAction: null, primaryAction: ReviewActivityActions.VIEW_RECOMMENDATION, negativeAction: null, - dateToDisplay: 'dateCompleted', + dateToDisplay: 'dateConsidered', }, // editor cancelled review request @@ -269,7 +267,7 @@ const ConfigPerStatus = { }; function getDays(config, reviewAssignment) { - if (config.dateToDisplay) { + if (config.dateToDisplay && reviewAssignment[config.dateToDisplay]) { return calculateDaysBetweenDates( new Date(), reviewAssignment[config.dateToDisplay], @@ -280,7 +278,7 @@ function getDays(config, reviewAssignment) { } export function useDashboardConfigReviewActivity() { - function getReviewActivityIndicatorProps(reviewAssignment) { + function getReviewActivityIndicatorProps({reviewAssignment}) { const config = ConfigPerStatus[reviewAssignment.statusId]; const reviewActivityConfig = config.reviewActivityIndicator; @@ -307,18 +305,17 @@ export function useDashboardConfigReviewActivity() { }; } - function getReviewActivityIndicatorPopoverProps(reviewAssignment) { + function getReviewActivityIndicatorPopoverProps({reviewAssignment}) { const config = ConfigPerStatus[reviewAssignment.statusId]; function getDate() { - if (config.dateToDisplay) { + if (config.dateToDisplay && reviewAssignment[config.dateToDisplay]) { return reviewAssignment[config.dateToDisplay]; } return ''; } const date = getDate(config, reviewAssignment); - function getRecommendation() { return RecommendationTranslations[reviewAssignment.recommendation] ? t(RecommendationTranslations[reviewAssignment.recommendation]) diff --git a/src/pages/dashboard/dashboardPageStore.js b/src/pages/dashboard/dashboardPageStore.js index 8756ba6a3..ac5f5b957 100644 --- a/src/pages/dashboard/dashboardPageStore.js +++ b/src/pages/dashboard/dashboardPageStore.js @@ -462,7 +462,7 @@ export const useDashboardPageStore = defineComponentStore( }); } - function getReviewActivityIndicatorPopoverProps(...args) { + function getReviewActivityIndicatorPopoverProps(args) { return dashboardConfigReviewActivity.getReviewActivityIndicatorPopoverProps( { ...args,