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
bd674da3
Commit
bd674da3
authored
6 years ago
by
Alexandru Munteanu
Browse files
Options
Downloads
Patches
Plain Diff
feat(dashboard-card): new statuses on FE
parent
e0045d67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Agree/Decline to work on a manuscript
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/components-faraday/src/components/Dashboard/DashboardCard.js
+5
-6
5 additions, 6 deletions
...ponents-faraday/src/components/Dashboard/DashboardCard.js
packages/components-faraday/src/components/utils.js
+11
-2
11 additions, 2 deletions
packages/components-faraday/src/components/utils.js
with
16 additions
and
8 deletions
packages/components-faraday/src/components/Dashboard/DashboardCard.js
+
5
−
6
View file @
bd674da3
...
...
@@ -34,7 +34,6 @@ const DashboardCard = ({
...
rest
})
=>
{
const
{
submitted
,
title
,
type
}
=
parseVersion
(
version
)
const
status
=
get
(
project
,
'
status
'
)
const
metadata
=
get
(
version
,
'
metadata
'
)
const
files
=
get
(
version
,
'
files
'
)
const
customId
=
project
.
customId
||
project
.
id
.
split
(
'
-
'
)[
0
]
...
...
@@ -81,7 +80,7 @@ const DashboardCard = ({
<
/Top
>
<
Bottom
>
<
LeftDetails
flex
=
"
3
"
>
<
Status
>
{
mapStatusToLabel
(
status
)}
<
/Status
>
<
Status
>
{
mapStatusToLabel
(
project
)}
<
/Status
>
<
DateField
>
{
submitted
||
''
}
<
/DateField
>
<
/LeftDetails
>
<
RightDetails
flex
=
"
4
"
>
...
...
@@ -197,22 +196,22 @@ export default compose(
// this can be changed, but it works; cba
if
(
isAdmin
||
isEic
)
{
if
(
status
===
'
submitted
'
||
status
===
'
he
-i
nvited
'
)
if
(
status
===
'
submitted
'
||
status
===
'
he
I
nvited
'
)
return
<
EditorInChiefActions
project
=
{
project
}
/
>
if
(
status
===
'
under
-r
eview
'
)
if
(
status
===
'
under
R
eview
'
)
return
<
AssignedHE
>
{
get
(
handlingEditor
,
'
name
'
)}
<
/AssignedHE
>
return
<
div
/>
}
if
(
isHe
)
{
if
(
status
===
'
he
-i
nvited
'
)
if
(
status
===
'
he
I
nvited
'
)
return
(
<
HandlingEditorActions
currentUser
=
{
currentUser
}
project
=
{
project
}
/
>
)
if
(
status
===
'
under
-r
eview
'
)
if
(
status
===
'
under
R
eview
'
||
status
===
'
heAssigned
'
)
return
<
AssignedHE
>
{
get
(
handlingEditor
,
'
name
'
)}
<
/AssignedHE
>
}
},
...
...
This diff is collapsed.
Click to expand it.
packages/components-faraday/src/components/utils.js
+
11
−
2
View file @
bd674da3
import
moment
from
'
moment
'
import
{
get
,
find
}
from
'
lodash
'
import
{
get
,
find
,
capitalize
}
from
'
lodash
'
export
const
parseTitle
=
version
=>
{
const
title
=
get
(
version
,
'
metadata.title
'
)
...
...
@@ -43,7 +43,7 @@ export const parseVersion = version => ({
export
const
parseJournalIssue
=
(
journal
,
metadata
)
=>
journal
.
issueTypes
.
find
(
t
=>
t
.
value
===
get
(
metadata
,
'
issue
'
))
export
const
mapStatusToLabel
=
status
=>
{
export
const
mapStatusToLabel
2
=
status
=>
{
switch
(
status
)
{
case
'
he-invited
'
:
return
'
Handling Editor Assigned
'
...
...
@@ -56,6 +56,15 @@ export const mapStatusToLabel = status => {
}
}
export
const
mapStatusToLabel
=
({
visibleStatus
,
status
})
=>
{
if
(
visibleStatus
)
{
return
visibleStatus
}
else
if
(
status
)
{
return
capitalize
(
status
)
}
return
'
Draft
'
}
export
const
handleError
=
fn
=>
e
=>
{
fn
(
get
(
JSON
.
parse
(
e
.
response
),
'
error
'
)
||
'
Oops! Something went wrong!
'
)
}
...
...
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