Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xpub-epmc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Literature-services
public-projects
xpub-epmc
Commits
26b1ff76
Commit
26b1ff76
authored
6 years ago
by
ahamelers
Browse files
Options
Downloads
Patches
Plain Diff
closes #17
parent
9a6216ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!90
Dev
,
!89
Shared data model
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/activity/MetaEdit.jsx
+58
-19
58 additions, 19 deletions
app/components/activity/MetaEdit.jsx
app/components/activity/operations.js
+6
-0
6 additions, 0 deletions
app/components/activity/operations.js
with
64 additions
and
19 deletions
app/components/activity/MetaEdit.jsx
+
58
−
19
View file @
26b1ff76
import
React
from
'
react
'
import
{
Mutation
}
from
'
react-apollo
'
import
{
omit
}
from
'
lodash
'
import
styled
,
{
withTheme
}
from
'
styled-components
'
import
{
Button
,
Icon
,
TextField
}
from
'
@pubsweet/ui
'
import
{
Action
,
Button
,
Icon
,
TextField
}
from
'
@pubsweet/ui
'
import
{
states
}
from
'
config
'
import
{
Portal
,
Buttons
,
Close
,
CloseButton
}
from
'
../ui
'
import
{
Portal
,
Buttons
,
Close
,
CloseButton
,
Notification
}
from
'
../ui
'
import
{
ManuscriptMutations
,
NoteMutations
}
from
'
../SubmissionMutations
'
import
ResolveDuplicates
from
'
../ResolveDuplicates
'
import
GrantSearch
from
'
../GrantSearch
'
import
CitationEdit
,
{
Exit
}
from
'
./CitationEdit
'
import
{
DELETE_MANUSCRIPT
,
QUERY_ACTIVITY_INFO
}
from
'
./operations
'
const
RouteButton
=
styled
(
Button
)
`
align-items: center;
...
...
@@ -134,23 +136,60 @@ const MetaEdit = withTheme(
</
React
.
Fragment
>
)
}
</
p
>
<
p
>
{
curr
>=
done
?
(
<
RouteButton
>
<
Icon
color
=
"currentColor"
size
=
{
2.5
}
>
delete
</
Icon
>
Withdraw manuscript
</
RouteButton
>
)
:
(
<
RouteButton
>
<
Icon
color
=
"currentColor"
size
=
{
2.5
}
>
trash-2
</
Icon
>
Remove manuscript
</
RouteButton
>
)
}
</
p
>
<
Mutation
mutation
=
{
DELETE_MANUSCRIPT
}
refetchQueries
=
{
()
=>
[
{
query
:
QUERY_ACTIVITY_INFO
,
variables
:
{
id
:
manuscript
.
id
},
},
]
}
>
{
(
deleteManuscript
,
{
data
})
=>
{
const
deleteIt
=
async
button
=>
{
await
deleteManuscript
({
variables
:
{
id
:
manuscript
.
id
,
},
})
button
.
parentElement
.
parentElement
.
nextElementSibling
.
classList
.
remove
(
'
hidden
'
,
)
}
return
(
<
React
.
Fragment
>
<
p
>
<
RouteButton
disabled
=
{
curr
>=
done
}
onClick
=
{
e
=>
e
.
currentTarget
.
nextElementSibling
.
classList
.
remove
(
'
hidden
'
,
)
}
>
<
Icon
color
=
"currentColor"
size
=
{
2.5
}
>
trash-2
</
Icon
>
Delete manuscript
</
RouteButton
>
<
span
className
=
"hidden"
>
{
` Are you certain? `
}
<
Action
onClick
=
{
e
=>
deleteIt
(
e
.
currentTarget
)
}
>
Confirm deletion
</
Action
>
</
span
>
{
curr
>=
done
&&
'
Manuscript has been sent to PMC and must be withdrawn.
'
}
</
p
>
<
Notification
className
=
"hidden"
type
=
"info"
>
{
`Manuscript succesfully deleted. If not already sent, please send a message to the user(s) explaining the deletion.`
}
</
Notification
>
</
React
.
Fragment
>
)
}
}
</
Mutation
>
<
Exit
close
=
{
close
}
/>
</
React
.
Fragment
>
)
...
...
This diff is collapsed.
Click to expand it.
app/components/activity/operations.js
+
6
−
0
View file @
26b1ff76
...
...
@@ -26,6 +26,12 @@ export const GET_JOURNAL = gql`
}
`
export
const
DELETE_MANUSCRIPT
=
gql
`
mutation DeleteManuscript($id: ID!) {
deleteManuscript(id: $id)
}
`
export
const
QUERY_ACTIVITY_INFO
=
gql
`
query QueryActivitiesByManuscriptId($id: ID!) {
activities: epmc_queryActivitiesByManuscriptId(id: $id) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment