-
Notifications
You must be signed in to change notification settings - Fork 52
pkp/pkp-lib#9453 Let reviewers view their recommendations for previous rounds #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nibou230
wants to merge
13
commits into
pkp:main
Choose a base branch
from
nibou230:9453
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
588446c
pkp/pkp-lib#9453 Add sections to the round history modal
nibou230 05b3554
pkp/pkp-lib#9453 Connect the new API for the round history
nibou230 ae8c333
pkp/pkp-lib#9453 Use the localized recommandation value
nibou230 0a4167f
pkp/pkp-lib#9453 Show review comments as HTML
nibou230 794cc6e
pkp/pkp-lib#9453 Refactor the round history UI to follow the proper d…
nibou230 9543376
pkp/pkp-lib#9453 Fix the download URL for file component
nibou230 d50000a
pkp/pkp-lib#9453 Adding ReviewerSubmissionPage to storybook
jardakotesovec bb4e773
pkp/pkp-lib#9453 Use tailwind instead of panels and localize data fro…
nibou230 960323b
pkp/pkp-lib#9453 Fix for chromatic
nibou230 cf4253c
pkp/pkp-lib#9453 Better data for review history mocks
nibou230 1313fb8
pkp/pkp-lib#9453 Fix typo
nibou230 67c81f6
pkp/pkp-lib#9453 Adjust the viewport height for storybook
nibou230 ec59e77
pkp/pkp-lib#9453 Minor UI ajustements asked by Devika
nibou230 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/components/ListPanel/listingFiles/ListingFilesListPanel.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Primary, Controls, Stories, Meta, ArgTypes} from '@storybook/blocks'; | ||
|
||
import * as ReviewerSubmissionPageStories from './ReviewerSubmissionPage.stories.js'; | ||
|
||
<Meta of={ReviewerSubmissionPageStories} /> | ||
|
||
# Reviewer Page | ||
|
||
Only reviews history for now, until rest of the page is migrated from old stack. | ||
|
||
## Server side configuration | ||
|
||
<ArgTypes /> |
86 changes: 86 additions & 0 deletions
86
src/pages/reviewerSubmission/ReviewerSubmissionPage.stories.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import {within, userEvent} from '@storybook/testing-library'; | ||
import {http, HttpResponse} from 'msw'; | ||
|
||
import ReviewerSubmissionPage from './ReviewerSubmissionPage.vue'; | ||
import Review1Mock from './mocks/review1'; | ||
import Review2Mock from './mocks/review2'; | ||
|
||
export default { | ||
title: 'Pages/ReviewerSubmission', | ||
component: ReviewerSubmissionPage, | ||
render: (args) => ({ | ||
components: {ReviewerSubmissionPage}, | ||
setup() { | ||
return {args}; | ||
}, | ||
template: '<ReviewerSubmissionPage v-bind="args.pageInitConfig" />', | ||
}), | ||
args: { | ||
pageInitConfig: { | ||
reviewRoundHistories: [ | ||
{ | ||
submissionId: 16, | ||
reviewRoundId: 15, | ||
reviewRoundNumber: 1, | ||
submittedOn: '2024-02-08 12:45:38', | ||
}, | ||
{ | ||
submissionId: 16, | ||
reviewRoundId: 16, | ||
reviewRoundNumber: 2, | ||
submittedOn: '2024-02-08 12:51:12', | ||
}, | ||
], | ||
}, | ||
}, | ||
parameters: { | ||
msw: { | ||
handlers: [ | ||
http.get( | ||
'https://mock/index.php/publicknowledge/api/v1/reviews/history/16/15', | ||
async (r) => { | ||
return HttpResponse.json(Review1Mock); | ||
}, | ||
), | ||
http.get( | ||
'https://mock/index.php/publicknowledge/api/v1/reviews/history/16/16', | ||
async (r) => { | ||
return HttpResponse.json(Review2Mock); | ||
}, | ||
), | ||
], | ||
}, | ||
}, | ||
}; | ||
|
||
export const Base = {}; | ||
|
||
export const OpenModalAccepted = { | ||
play: async ({canvasElement}) => { | ||
// Assigns canvas to the component root element | ||
const canvas = within(canvasElement); | ||
const user = userEvent.setup(); | ||
|
||
await user.click(canvas.getByText('Read Round 1 Review')); | ||
}, | ||
decorators: [ | ||
() => ({ | ||
template: '<div style="height: 1200px"><story/></div>', | ||
}), | ||
], | ||
}; | ||
|
||
export const OpenModalDeclined = { | ||
play: async ({canvasElement}) => { | ||
// Assigns canvas to the component root element | ||
const canvas = within(canvasElement); | ||
const user = userEvent.setup(); | ||
|
||
await user.click(canvas.getByText('Read Round 2 Review')); | ||
}, | ||
decorators: [ | ||
() => ({ | ||
template: '<div style="height: 1200px"><story/></div>', | ||
}), | ||
], | ||
}; | ||
nibou230 marked this conversation as resolved.
Show resolved
Hide resolved
nibou230 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
<template> | ||
<div class="mb-4 space-x-2"> | ||
<PkpButton | ||
<div class="bg-lightest border border-light text-dark p-8 mb-4"> | ||
<h2 class="text-dark-accent">{{ t('reviewer.submission.reviewRound.info') }}</h2> | ||
<p | ||
v-for="review in store.reviewRoundHistories" | ||
:key="review.reviewRoundId" | ||
@click="store.openRoundHistoryModal(review)" | ||
> | ||
{{ t('submission.round', {round: review.reviewRoundNumber}) }} | ||
</PkpButton> | ||
<span class="text-lg-normal"> | ||
{{ t( | ||
'reviewer.submission.reviewRound.info.submittedOn', | ||
{round: review.reviewRoundNumber, submittedOn: formatShortDate(review.submittedOn)} | ||
) }} | ||
</span> | ||
<PkpButton | ||
is-link="true" | ||
class="ms-4" | ||
@click="store.openRoundHistoryModal(review)" | ||
nibou230 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
{{ t('reviewer.submission.reviewRound.info.read', {round: review.reviewRoundNumber}) }} | ||
</PkpButton> | ||
</p> | ||
</div> | ||
<SideModal | ||
:open="store.isRoundHistoryModalOpened" | ||
|
@@ -20,13 +32,15 @@ | |
|
||
<script setup> | ||
import {defineProps} from 'vue'; | ||
|
||
import SideModal from '@/components/Modal/SideModal.vue'; | ||
import RoundHistoryModal from './RoundHistoryModal.vue'; | ||
|
||
import {useTranslation} from '@/composables/useTranslation'; | ||
|
||
import {useReviewerSubmissionPageStore} from './reviewerSubmissionPageStore'; | ||
import moment from 'moment'; | ||
|
||
function formatShortDate(dateString) { | ||
return moment(dateString).format('DD-MM-YYYY'); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be localised - but thats something to investigate for me separately - pkp/pkp-lib#9733 . |
||
const {t} = useTranslation(); | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.