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
e8255714
Commit
e8255714
authored
6 years ago
by
Bogdan Cochior
Browse files
Options
Downloads
Patches
Plain Diff
fix(mts): EQA and EQS get correct fragment files
parent
1b448e05
No related branches found
No related tags found
2 merge requests
!34
Sprint 17 features
,
!30
fix(mts): EQA and EQS get correct fragment files
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-mts-package/src/PackageManager.js
+8
-11
8 additions, 11 deletions
packages/component-mts-package/src/PackageManager.js
packages/component-mts-package/tests/MTS.test.js
+1
-1
1 addition, 1 deletion
packages/component-mts-package/tests/MTS.test.js
with
9 additions
and
12 deletions
packages/component-mts-package/src/PackageManager.js
+
8
−
11
View file @
e8255714
...
@@ -17,30 +17,27 @@ const createFilesPackage = (s3Config, archiver = nodeArchiver) => {
...
@@ -17,30 +17,27 @@ const createFilesPackage = (s3Config, archiver = nodeArchiver) => {
})
})
const
s3
=
new
AWS
.
S3
()
const
s3
=
new
AWS
.
S3
()
const
asyncGetObject
=
promisify
(
s3
.
getObject
.
bind
(
s3
))
const
asyncGetObject
=
promisify
(
s3
.
getObject
.
bind
(
s3
))
const
asyncListObjects
=
promisify
(
s3
.
listObjects
.
bind
(
s3
))
return
async
({
fragment
,
fileTypes
,
xmlFile
,
isEQA
=
false
})
=>
{
return
async
({
fragment
,
fileTypes
,
xmlFile
,
isEQA
=
false
})
=>
{
const
{
id
}
=
fragment
const
{
files
=
{}
}
=
fragment
let
packageName
=
get
(
xmlFile
,
'
name
'
,
''
).
replace
(
'
.xml
'
,
''
)
let
packageName
=
get
(
xmlFile
,
'
name
'
,
''
).
replace
(
'
.xml
'
,
''
)
if
(
isEQA
)
{
if
(
isEQA
)
{
packageName
=
`ACCEPTED_
${
packageName
}
`
packageName
=
`ACCEPTED_
${
packageName
}
`
}
}
try
{
try
{
const
params
=
{
const
s3FileIDs
=
Object
.
values
(
files
)
Bucket
:
s3Config
.
bucket
,
.
reduce
((
acc
,
f
)
=>
[...
acc
,
...
f
],
[])
Prefix
:
`
${
id
}
`
,
.
map
(
f
=>
f
.
id
)
}
const
s3Items
=
await
asyncListObjects
(
params
)
if
(
s3FileIDs
)
{
if
(
s3Items
)
{
const
s3Files
=
await
Promise
.
all
(
const
s3Files
=
await
Promise
.
all
(
s3
Items
.
Contents
.
map
(
content
=>
s3
FileIDs
.
map
(
fileID
=>
asyncGetObject
({
asyncGetObject
({
Bucket
:
s3Config
.
bucket
,
Bucket
:
s3Config
.
bucket
,
Key
:
content
.
Key
,
Key
:
fileID
,
}),
}),
),
),
)
)
if
(
s3Files
)
{
if
(
s3Files
)
{
const
packageOutput
=
fs
.
createWriteStream
(
`
${
packageName
}
.zip`
)
const
packageOutput
=
fs
.
createWriteStream
(
`
${
packageName
}
.zip`
)
const
archive
=
archiver
(
'
zip
'
)
const
archive
=
archiver
(
'
zip
'
)
...
...
This diff is collapsed.
Click to expand it.
packages/component-mts-package/tests/MTS.test.js
+
1
−
1
View file @
e8255714
...
@@ -27,7 +27,7 @@ describe('MTS integration', () => {
...
@@ -27,7 +27,7 @@ describe('MTS integration', () => {
})
})
it
(
'
should contain configured journal name
'
,
()
=>
{
it
(
'
should contain configured journal name
'
,
()
=>
{
const
result
=
MTS
.
composeJson
(
mocks
.
fragment
)
const
result
=
MTS
.
composeJson
(
{
fragment
:
mocks
.
fragment
}
)
expect
(
result
).
toHaveProperty
(
expect
(
result
).
toHaveProperty
(
'
article.front.journal-meta.journal-title-group.journal-title._text
'
,
'
article.front.journal-meta.journal-title-group.journal-title._text
'
,
'
Bioinorganic Chemistry and Applications
'
,
'
Bioinorganic Chemistry and Applications
'
,
...
...
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