Skip to content
Snippets Groups Projects
Commit 9352b9fd authored by Jure's avatar Jure
Browse files

Merge branch 'small_improvements' into 'main'

Small improvements

See merge request kotahi/kotahi!43
parents 57bfa674 ac4ebfac
No related branches found
No related tags found
No related merge requests found
import React from 'react' import React from 'react'
import { Button } from '@pubsweet/ui' import { Action, ActionGroup } from '@pubsweet/ui'
// import Authorize from 'pubsweet-client/src/helpers/Authorize' // import Authorize from 'pubsweet-client/src/helpers/Authorize'
import { import { Item } from '../../style'
Item,
Divider,
Links,
LinkContainer,
Actions,
ActionContainer,
} from '../../style'
import JournalLink from '../JournalLink'
import VersionTitle from './VersionTitle' import VersionTitle from './VersionTitle'
// TODO: only return links if version id is in reviewer.accepted array // TODO: only return links if version id is in reviewer.accepted array
...@@ -31,52 +23,43 @@ const ReviewerItem = ({ version, journals, currentUser, reviewerRespond }) => { ...@@ -31,52 +23,43 @@ const ReviewerItem = ({ version, journals, currentUser, reviewerRespond }) => {
<VersionTitle version={version} /> <VersionTitle version={version} />
{(status === 'accepted' || status === 'completed') && ( {(status === 'accepted' || status === 'completed') && (
<Links> <ActionGroup>
<LinkContainer> <Action to={`/journal/versions/${version.id}/reviews`}>
<JournalLink id={version.id} page="reviews" version={version}> {status === 'completed' ? 'Completed' : 'Do Review'}
{status === 'completed' ? 'Completed' : 'Do Review'} </Action>
</JournalLink> </ActionGroup>
</LinkContainer>
</Links>
)} )}
{status === 'invited' && ( {status === 'invited' && (
<Actions> <ActionGroup>
<ActionContainer> <Action
<Button data-testid="accept-review"
data-testid="accept-review" onClick={() => {
onClick={() => { reviewerRespond({
reviewerRespond({ variables: {
variables: { currentUserId: currentUser.id,
currentUserId: currentUser.id, action: 'accepted',
action: 'accepted', teamId: team.id,
teamId: team.id, },
}, })
}) }}
}} >
> Accept
accept </Action>
</Button> <Action
</ActionContainer> onClick={() => {
reviewerRespond({
<Divider separator="|" /> variables: {
currentUserId: currentUser.id,
<ActionContainer> action: 'rejected',
<Button teamId: team.id,
onClick={() => { },
reviewerRespond({ })
variables: { }}
currentUserId: currentUser.id, >
action: 'rejected', Reject
teamId: team.id, </Action>
}, </ActionGroup>
})
}}
>
reject
</Button>
</ActionContainer>
</Actions>
)} )}
{status === 'rejected' && 'rejected'} {status === 'rejected' && 'rejected'}
</Item> </Item>
......
...@@ -3,9 +3,6 @@ const fs = require('fs-extra') ...@@ -3,9 +3,6 @@ const fs = require('fs-extra')
const config = require('config') const config = require('config')
const { pick } = require('lodash') const { pick } = require('lodash')
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const smp = new SpeedMeasurePlugin()
const rules = require('./common-rules') const rules = require('./common-rules')
const contentBase = path.resolve(__dirname, '..', '_build', 'assets') const contentBase = path.resolve(__dirname, '..', '_build', 'assets')
...@@ -37,7 +34,7 @@ module.exports = webpackEnv => { ...@@ -37,7 +34,7 @@ module.exports = webpackEnv => {
'/api': 'http://localhost:3000', '/api': 'http://localhost:3000',
'/auth': 'http://localhost:3000', '/auth': 'http://localhost:3000',
'/graphql': 'http://localhost:3000', '/graphql': 'http://localhost:3000',
'/static/uploads': 'http://locahost:3000', '/static/uploads': 'http://localhost:3000',
'/static/profiles': 'http://localhost:3000', '/static/profiles': 'http://localhost:3000',
'/public': 'http://localhost:3000', '/public': 'http://localhost:3000',
}, },
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment