Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
573a8422
Commit
573a8422
authored
6 years ago
by
Anca Ursachi
Browse files
Options
Downloads
Patches
Plain Diff
fix(fixPipelineProblems):
parent
55a2e200
No related branches found
No related tags found
1 merge request
!111
Hin 1059
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/xpub-faraday/config/authsome-helpers.js
+0
-2
0 additions, 2 deletions
packages/xpub-faraday/config/authsome-helpers.js
packages/xpub-faraday/tests/config/authsome-helpers.test.js
+0
-84
0 additions, 84 deletions
packages/xpub-faraday/tests/config/authsome-helpers.test.js
with
0 additions
and
86 deletions
packages/xpub-faraday/config/authsome-helpers.js
+
0
−
2
View file @
573a8422
...
...
@@ -4,10 +4,8 @@ const logger = require('@pubsweet/logger')
const
statuses
=
config
.
get
(
'
statuses
'
)
const
keysToOmit
=
[
'
email
'
,
'
id
'
]
const
publicStatusesPermissions
=
[
'
author
'
,
'
reviewer
'
]
const
authorAllowedStatuses
=
[
'
revisionRequested
'
,
'
rejected
'
,
'
accepted
'
]
const
authorCanViewHENameStatuses
=
[
'
rejected
'
,
'
accepted
'
]
const
parseAuthorsData
=
(
coll
,
matchingCollPerm
)
=>
{
if
([
'
reviewer
'
].
includes
(
matchingCollPerm
.
permission
))
{
...
...
This diff is collapsed.
Click to expand it.
packages/xpub-faraday/tests/config/authsome-helpers.test.js
+
0
−
84
View file @
573a8422
...
...
@@ -9,90 +9,6 @@ describe('Authsome Helpers', () => {
testFixtures
=
cloneDeep
(
fixturesService
.
fixtures
)
models
=
fixturesService
.
Model
.
build
(
testFixtures
)
})
it
(
'
stripeCollection - should return collection
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
const
result
=
ah
.
stripeCollectionByRole
({
collection
})
expect
(
result
).
toBeTruthy
()
})
it
(
'
stripeFragment - should return fragment
'
,
()
=>
{
const
{
fragment
}
=
testFixtures
.
fragments
const
result
=
ah
.
stripeFragmentByRole
({
fragment
})
expect
(
result
).
toBeTruthy
()
})
it
(
'
stripeCollection - author should not see accepted HE name before recommendation made
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
collection
.
status
=
'
underReview
'
collection
.
handlingEditor
=
{
...
collection
.
handlingEditor
,
isAccepted
:
true
,
}
const
role
=
'
author
'
const
result
=
ah
.
stripeCollectionByRole
({
collection
,
role
})
const
{
handlingEditor
=
{}
}
=
result
expect
(
handlingEditor
.
email
).
toBeFalsy
()
expect
(
handlingEditor
.
name
).
toEqual
(
'
Assigned
'
)
})
it
(
'
stripeCollection - author should not see Assigned until HE accepted
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
collection
.
status
=
'
underReview
'
collection
.
handlingEditor
=
{
...
collection
.
handlingEditor
,
isAccepted
:
false
,
}
const
role
=
'
author
'
const
result
=
ah
.
stripeCollectionByRole
({
collection
,
role
})
const
{
handlingEditor
=
{}
}
=
result
expect
(
handlingEditor
).
toBeFalsy
()
expect
(
handlingEditor
.
name
).
not
.
toEqual
(
'
Assigned
'
)
})
it
(
'
stripeCollection - author should see HE name after recommendation made
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
collection
.
status
=
'
revisionRequested
'
const
role
=
'
author
'
const
result
=
ah
.
stripeCollectionByRole
({
collection
,
role
})
const
{
handlingEditor
=
{}
}
=
result
expect
(
handlingEditor
.
name
).
not
.
toEqual
(
'
Assigned
'
)
})
it
(
'
stripeCollection - other user than author should see HE name before recommendation made
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
collection
.
status
=
'
underReview
'
const
role
=
'
admin
'
const
result
=
ah
.
stripeCollectionByRole
({
collection
,
role
})
const
{
handlingEditor
=
{}
}
=
result
expect
(
handlingEditor
.
name
).
not
.
toEqual
(
'
Assigned
'
)
})
it
(
'
stripeCollection - other user than author should see HE name after recommendation made
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
collection
.
status
=
'
revisionRequested
'
const
role
=
'
admin
'
const
result
=
ah
.
stripeCollectionByRole
({
collection
,
role
})
const
{
handlingEditor
=
{}
}
=
result
expect
(
handlingEditor
.
name
).
not
.
toEqual
(
'
Assigned
'
)
})
it
(
'
stripeCollection - returns if collection does not have HE
'
,
()
=>
{
const
{
collection
}
=
testFixtures
.
collections
delete
collection
.
handlingEditor
const
role
=
'
admin
'
const
result
=
ah
.
stripeCollectionByRole
({
collection
,
role
})
expect
(
result
.
handlingEditor
).
toBeFalsy
()
})
describe
(
'
stripeFragmentByRole
'
,
()
=>
{
it
(
'
reviewer should not see authors email
'
,
()
=>
{
...
...
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