Skip to content
Snippets Groups Projects
Commit f3f8962c authored by Sebastian's avatar Sebastian
Browse files

Merge branch 'faraday-master' of gitlab.coko.foundation:xpub/xpub into faraday-master

parents 41b18d7b 4fea7b71
No related branches found
No related tags found
No related merge requests found
packages/*/node_modules/**/* packages/*/node_modules/**/*
packages/*/node_modules packages/*/node_modules
packages/**/*.env
packages/**/.env
packages/**/config/local*.*
...@@ -13,12 +13,12 @@ RUN [ "yarn", "install", "--frozen-lockfile" ] ...@@ -13,12 +13,12 @@ RUN [ "yarn", "install", "--frozen-lockfile" ]
RUN [ "yarn", "cache", "clean"] RUN [ "yarn", "cache", "clean"]
RUN [ "rm", "-rf", "/npm-packages-offline-cache"] RUN [ "rm", "-rf", "/npm-packages-offline-cache"]
ENV NODE_ENV "production" # ENV NODE_ENV "production"
# We are temporarily going to use the same image with different commands to deploy different apps in the monorepo. This is bad :(. # We are temporarily going to use the same image with different commands to deploy different apps in the monorepo. This is bad :(.
WORKDIR ${HOME}/packages/xpub-collabra # WORKDIR ${HOME}/packages/xpub-collabra
RUN [ "npx", "pubsweet", "build"] # RUN [ "npx", "pubsweet", "build"]
## No xpub-ui to deploy yet ## No xpub-ui to deploy yet
# WORKDIR ${HOME}/packages/xpub-ui # WORKDIR ${HOME}/packages/xpub-ui
...@@ -26,7 +26,11 @@ RUN [ "npx", "pubsweet", "build"] ...@@ -26,7 +26,11 @@ RUN [ "npx", "pubsweet", "build"]
## Create file for kubernetes health checks ## Create file for kubernetes health checks
# RUN touch ./styleguide/health # RUN touch ./styleguide/health
ENV NODE_ENV "development"
WORKDIR ${HOME}/packages/xpub-faraday
RUN [ "npm", "run", "reset", "--username", "admin", "--email", "admin@mailinator.com", "--password", "admin123"]
EXPOSE 3000 EXPOSE 3000
WORKDIR ${HOME} # WORKDIR ${HOME}
CMD [] CMD ["npm", "run", "start-now"]
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import { get, isEmpty } from 'lodash' import { get, isEmpty } from 'lodash'
import styled from 'styled-components' import styled from 'styled-components'
import { Button, Icon } from '@pubsweet/ui' import { Button, Icon } from '@pubsweet/ui'
import { compose, getContext } from 'recompose'
import { parseVersion, getFilesURL, downloadAll } from './utils' import { parseVersion, getFilesURL, downloadAll } from './utils'
...@@ -11,6 +13,8 @@ const DashboardCard = ({ ...@@ -11,6 +13,8 @@ const DashboardCard = ({
project, project,
version, version,
showAbstractModal, showAbstractModal,
journal,
...rest
}) => { }) => {
const { submitted, title, type, version: vers } = parseVersion(version) const { submitted, title, type, version: vers } = parseVersion(version)
const files = getFilesURL(get(version, 'files')) const files = getFilesURL(get(version, 'files'))
...@@ -18,7 +22,6 @@ const DashboardCard = ({ ...@@ -18,7 +22,6 @@ const DashboardCard = ({
const hasFiles = !isEmpty(files) const hasFiles = !isEmpty(files)
const abstract = get(version, 'metadata.abstract') const abstract = get(version, 'metadata.abstract')
const metadata = get(version, 'metadata') const metadata = get(version, 'metadata')
return ( return (
<Card> <Card>
<ListView> <ListView>
...@@ -65,8 +68,10 @@ const DashboardCard = ({ ...@@ -65,8 +68,10 @@ const DashboardCard = ({
</ListView> </ListView>
<DetailsView> <DetailsView>
<LeftDetails> <LeftDetails>
<JournalTitle>{metadata.journal}</JournalTitle> <JournalTitle>{journal.metadata.nameText}</JournalTitle>
<Issue>{metadata.issue}</Issue> <Issue>
{journal.issueTypes.find(t => t.value === metadata.issue).label}
</Issue>
{get(version, 'authors') && ( {get(version, 'authors') && (
<Authors> <Authors>
<span>Authors:</span> <span>Authors:</span>
...@@ -109,7 +114,7 @@ const DashboardCard = ({ ...@@ -109,7 +114,7 @@ const DashboardCard = ({
) )
} }
export default DashboardCard export default compose(getContext({ journal: PropTypes.object }))(DashboardCard)
// #region styled-components // #region styled-components
const PreviewContainer = styled.div` const PreviewContainer = styled.div`
...@@ -160,7 +165,7 @@ const ActionButtons = styled(Button)` ...@@ -160,7 +165,7 @@ const ActionButtons = styled(Button)`
const LeftDetails = styled.div` const LeftDetails = styled.div`
display: flex; display: flex;
flex: 1; flex: 3;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
padding: 10px 20px; padding: 10px 20px;
...@@ -168,7 +173,7 @@ const LeftDetails = styled.div` ...@@ -168,7 +173,7 @@ const LeftDetails = styled.div`
const RightDetails = styled.div` const RightDetails = styled.div`
display: flex; display: flex;
flex: 1; flex: 2;
flex-direction: column; flex-direction: column;
div { div {
...@@ -340,8 +345,9 @@ const ClickableIconContainer = styled.div` ...@@ -340,8 +345,9 @@ const ClickableIconContainer = styled.div`
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
margin-right: 8px;
& > span { span:last-child {
color: #667080; color: #667080;
font-family: Helvetica; font-family: Helvetica;
font-size: 14px; font-size: 14px;
......
import { get } from 'lodash' import { get } from 'lodash'
import { compose } from 'recompose' import PropTypes from 'prop-types'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { actions } from 'pubsweet-client' import { actions } from 'pubsweet-client'
import { withJournal } from 'xpub-journal'
import { ConnectPage } from 'xpub-connect' import { ConnectPage } from 'xpub-connect'
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import { compose, withContext } from 'recompose'
import { newestFirst, selectCurrentUser } from 'xpub-selectors' import { newestFirst, selectCurrentUser } from 'xpub-selectors'
import { createDraftSubmission } from 'pubsweet-component-wizard/src/redux/conversion' import { createDraftSubmission } from 'pubsweet-component-wizard/src/redux/conversion'
...@@ -48,6 +50,7 @@ export default compose( ...@@ -48,6 +50,7 @@ export default compose(
}), }),
), ),
withRouter, withRouter,
withJournal,
withFilters({ withFilters({
status: { status: {
options: [ options: [
...@@ -82,4 +85,10 @@ export default compose( ...@@ -82,4 +85,10 @@ export default compose(
}, },
}, },
}), }),
withContext(
{
journal: PropTypes.object,
},
({ journal }) => ({ journal }),
),
)(Dashboard) )(Dashboard)
FROM bogdandev/xpub-faraday:21.02
\ No newline at end of file
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
"setupdb": "pubsweet setupdb ./", "setupdb": "pubsweet setupdb ./",
"reset": "pubsweet setupdb --clobber ./", "reset": "pubsweet setupdb --clobber ./",
"start": "pubsweet start", "start": "pubsweet start",
"start-now": "echo $secret > config/local-development.json && npm run start",
"build": "NODE_ENV=production pubsweet build" "build": "NODE_ENV=production pubsweet build"
} }
} }
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