Skip to content

Commit

Permalink
pkp/pkp-lib#10674 Refine editorial activity, dateConfirmed, fix mista…
Browse files Browse the repository at this point in the history
…kes from refactor
  • Loading branch information
jardakotesovec committed Feb 25, 2025
1 parent 3af7fbf commit 36b6bfd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -224,7 +222,7 @@ const ConfigPerStatus = {
textAction: null,
primaryAction: ReviewActivityActions.VIEW_RECOMMENDATION,
negativeAction: null,
dateToDisplay: 'dateCompleted',
dateToDisplay: 'dateConsidered',
},

// editor cancelled review request
Expand Down Expand Up @@ -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],
Expand All @@ -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;
Expand All @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/dashboardPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export const useDashboardPageStore = defineComponentStore(
});
}

function getReviewActivityIndicatorPopoverProps(...args) {
function getReviewActivityIndicatorPopoverProps(args) {
return dashboardConfigReviewActivity.getReviewActivityIndicatorPopoverProps(
{
...args,
Expand Down

0 comments on commit 36b6bfd

Please sign in to comment.