diff --git a/packages/component-faraday-ui/src/ManuscriptCard.js b/packages/component-faraday-ui/src/ManuscriptCard.js index ba578a5a82f7471cb91914af0d0a032f72320d67..c0c9117eb40519fbe89598ac1778d3760766bb40 100644 --- a/packages/component-faraday-ui/src/ManuscriptCard.js +++ b/packages/component-faraday-ui/src/ManuscriptCard.js @@ -76,7 +76,7 @@ export default compose( }), withProps(({ fragment: { submitted, metadata }, journal = {} }) => ({ submitDate: submitted - ? `Submitted on ${moment(submitted).format('DD.MM.YYY')}` + ? `Submitted on ${moment(submitted).format('DD.MM.YYYY')}` : '', manuscriptType: get(journal, 'manuscriptTypes', []).find( t => t.value === get(metadata, 'type', ''), diff --git a/packages/components-faraday/src/components/Dashboard/Dashboard.js b/packages/components-faraday/src/components/Dashboard/Dashboard.js index cfb41155d730777d740f3e0452a209e90adddd30..e949271a1dc9bd8817f10a0615fdbf05f18aef98 100644 --- a/packages/components-faraday/src/components/Dashboard/Dashboard.js +++ b/packages/components-faraday/src/components/Dashboard/Dashboard.js @@ -23,7 +23,7 @@ const Dashboard = ({ onClick={createDraftSubmission} primary > - New + Submit </Button> </Row> <DashboardFilters diff --git a/packages/components-faraday/src/components/Dashboard/DashboardFilters.js b/packages/components-faraday/src/components/Dashboard/DashboardFilters.js index 37ae0a03390efaa686bdd62ea6dc66baf308045e..619c63809ec0912d152e1e6a509869bcf414d899 100644 --- a/packages/components-faraday/src/components/Dashboard/DashboardFilters.js +++ b/packages/components-faraday/src/components/Dashboard/DashboardFilters.js @@ -22,7 +22,7 @@ const DashboardFilters = ({ /> </Item> <Item flex={0} vertical> - <Label>Sort</Label> + <Label>Order</Label> <Menu inline onChange={changeFilterValue('order')} diff --git a/packages/components-faraday/src/components/Dashboard/DashboardPage.js b/packages/components-faraday/src/components/Dashboard/DashboardPage.js index dce45132340db9e88b54fd63e0f61dc1fada9446..1e9e2825c054b65a057e624b72cc6e839fb8e5d4 100644 --- a/packages/components-faraday/src/components/Dashboard/DashboardPage.js +++ b/packages/components-faraday/src/components/Dashboard/DashboardPage.js @@ -16,7 +16,7 @@ import { import { Dashboard } from './' import { getHandlingEditors } from '../../redux/editors' -import { priorityFilter, importanceSort, withFiltersHOC } from '../Filters' +import { priorityFilter, orderFilter, withFiltersHOC } from '../Filters' export default compose( ConnectPage(() => [actions.getCollections(), actions.getUsers()]), @@ -69,7 +69,7 @@ export default compose( withJournal, withFiltersHOC({ priority: priorityFilter, - order: importanceSort, + order: orderFilter, }), withContext( { diff --git a/packages/components-faraday/src/components/Filters/index.js b/packages/components-faraday/src/components/Filters/index.js index cec651407a1906360e0be3b88876740fde6ba1aa..35cfe518a5437bbb68dfc6a88ad2cc2bc25cf266 100644 --- a/packages/components-faraday/src/components/Filters/index.js +++ b/packages/components-faraday/src/components/Filters/index.js @@ -4,3 +4,4 @@ export { utils } export { default as withFiltersHOC } from './withFilters' export { default as priorityFilter } from './priorityFilter' export { default as importanceSort } from './importanceSort' +export { default as orderFilter } from './orderFilter' diff --git a/packages/components-faraday/src/components/Filters/orderFilter.js b/packages/components-faraday/src/components/Filters/orderFilter.js new file mode 100644 index 0000000000000000000000000000000000000000..ef98a27d9e7efba8233a27e4496a66b2077bf010 --- /dev/null +++ b/packages/components-faraday/src/components/Filters/orderFilter.js @@ -0,0 +1,17 @@ +const options = [ + { label: 'Newest first', value: 'asc' }, + { label: 'Oldest first', value: 'desc' }, +] + +const sortFn = orderValue => (i1, i2) => { + if (orderValue === 'desc') { + return i1.created - i2.created + } + return i2.created - i1.created +} + +export default { + sortFn, + options, + type: 'order', +} diff --git a/packages/hindawi-theme/src/elements/Menu.js b/packages/hindawi-theme/src/elements/Menu.js index c4ee0b0a4152e02e6ba403eb924be36b08337c11..da76d850844491a0803f43b877a468609bd36143 100644 --- a/packages/hindawi-theme/src/elements/Menu.js +++ b/packages/hindawi-theme/src/elements/Menu.js @@ -18,6 +18,8 @@ export default { `, Placeholder: css` color: ${th('colorText')}; + line-height: ${th('gridUnit')}; + padding: 0 ${th('gridUnit')}; `, Opener: css` border-color: ${props =>