Commit b251b6d1 authored by Alexandros Georgantas's avatar Alexandros Georgantas

Merge branch 'staging' into 'master'

Staging

See merge request editoria/ucp!2
parents 5c0860cc e6e5282b
{
"linters": {
"*.{js,jsx}": ["prettier --write", "eslint --fix", "stylelint", "git add"]
},
ignore: ["**/CHANGELOG.md"]
}
**/_build
**/node_modules
**/coverage
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
],
"plugins": ["stylelint-order"],
"processors": ["stylelint-processor-styled-components"],
"rules": {
"order/order": ["declarations", "rules", "at-rules"],
"order/properties-alphabetical-order": true
}
}
# Change Log
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="1.1.0"></a>
# 1.1.0 (2018-11-20)
### Features
* conventional commits added ([b98b958](https://gitlab.coko.foundation/editoria/ucp/commit/b98b958))
# Editoria # Editoria
## 1.3.0 ## 1.3.0
...@@ -88,4 +102,3 @@ ...@@ -88,4 +102,3 @@
* React integration * React integration
* Core * Core
* Diacritics work within notes * Diacritics work within notes
...@@ -5,10 +5,11 @@ import ReactDOM from 'react-dom' ...@@ -5,10 +5,11 @@ import ReactDOM from 'react-dom'
import { configureStore, Root } from 'pubsweet-client' import { configureStore, Root } from 'pubsweet-client'
import theme from './theme'
import { AppContainer } from 'react-hot-loader' import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory' import createHistory from 'history/createBrowserHistory'
import theme from './theme'
import routes from './routes' import routes from './routes'
const history = createHistory() const history = createHistory()
......
...@@ -38,8 +38,8 @@ class Navigation extends React.Component { ...@@ -38,8 +38,8 @@ class Navigation extends React.Component {
this.inEditor = pathname.match(/fragments/g) this.inEditor = pathname.match(/fragments/g)
this.inPaged = pathname.match(/pagedPreviewer\/paged/g) this.inPaged = pathname.match(/pagedPreviewer\/paged/g)
if (this.inEditor || this.inPaged) { if (this.inEditor || this.inPaged) {
const pathnameSplited = pathname.split('/') const pathnameSplitted = pathname.split('/')
this.collectionId = pathnameSplited[2] this.collectionId = pathnameSplitted[2] // eslint-disable-line
} }
} }
...@@ -52,8 +52,8 @@ class Navigation extends React.Component { ...@@ -52,8 +52,8 @@ class Navigation extends React.Component {
if (currentUser.isAuthenticated) { if (currentUser.isAuthenticated) {
logoutButtonIfAuthenticated = ( logoutButtonIfAuthenticated = (
<NavbarUser <NavbarUser
user={currentUser.user}
onLogoutClick={() => logoutUser('/login')} onLogoutClick={() => logoutUser('/login')}
user={currentUser.user}
/> />
) )
} }
...@@ -100,8 +100,8 @@ class Navigation extends React.Component { ...@@ -100,8 +100,8 @@ class Navigation extends React.Component {
} }
Navigation.propTypes = { Navigation.propTypes = {
currentUser: PropTypes.any, currentUser: PropTypes.any, // eslint-disable-line
history: PropTypes.any.isRequired, history: PropTypes.any.isRequired, // eslint-disable-line
logoutUser: PropTypes.func.isRequired, logoutUser: PropTypes.func.isRequired,
} }
......
...@@ -72,7 +72,7 @@ PrivateRoute.propTypes = { ...@@ -72,7 +72,7 @@ PrivateRoute.propTypes = {
isFetching: PropTypes.bool.isRequired, isFetching: PropTypes.bool.isRequired,
}).isRequired, }).isRequired,
getCurrentUser: PropTypes.func.isRequired, getCurrentUser: PropTypes.func.isRequired,
location: PropTypes.object.isRequired, location: PropTypes.object.isRequired, // eslint-disable-line
} }
export default withRouter( export default withRouter(
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import 'typeface-fira-sans' import 'typeface-fira-sans'
export default { export default {
/* Text variables */ /* Text variables */
// fonts // fonts
......
module.exports = { extends: ['@commitlint/config-conventional'] }
...@@ -33,7 +33,7 @@ class EditoriaMode { ...@@ -33,7 +33,7 @@ class EditoriaMode {
return operationMap[operation] ? operationMap[operation] : operation return operationMap[operation] ? operationMap[operation] : operation
} }
/* eslint-disable */
static difference(object, base) { static difference(object, base) {
const changes = (object, base) => const changes = (object, base) =>
transform(object, (result, value, key) => { transform(object, (result, value, key) => {
...@@ -46,7 +46,7 @@ class EditoriaMode { ...@@ -46,7 +46,7 @@ class EditoriaMode {
}) })
return changes(object, base) return changes(object, base)
} }
/* eslint-enable */
async isTeamMember(teamType, object) { async isTeamMember(teamType, object) {
let membershipCondition let membershipCondition
if (object) { if (object) {
...@@ -74,7 +74,7 @@ class EditoriaMode { ...@@ -74,7 +74,7 @@ class EditoriaMode {
async hasMembership(object) { async hasMembership(object) {
let collection let collection
if (object.collection) { if (object.collection) {
collection = object.collection collection = object.collection //eslint-disable-line
} else { } else {
collection = object collection = object
} }
...@@ -82,7 +82,7 @@ class EditoriaMode { ...@@ -82,7 +82,7 @@ class EditoriaMode {
const membershipCondition = team => const membershipCondition = team =>
!team.global && team.object.id === collection.id !team.global && team.object.id === collection.id
const memberships = await Promise.all( const memberships = await Promise.all(
this.user.teams.map(async teamId => { this.user.teams.map(async teamId => {
const teamFound = await this.context.models.Team.find(teamId) const teamFound = await this.context.models.Team.find(teamId)
if (teamFound) { if (teamFound) {
...@@ -113,7 +113,7 @@ class EditoriaMode { ...@@ -113,7 +113,7 @@ class EditoriaMode {
async findCollectionByObject(object) { async findCollectionByObject(object) {
let id let id
if (object.collection) { if (object.collection) {
id = object.collection.id id = object.collection.id //eslint-disable-line
} else if (object.bookId && object.type) { } else if (object.bookId && object.type) {
id = object.bookId id = object.bookId
} else { } else {
...@@ -122,10 +122,10 @@ class EditoriaMode { ...@@ -122,10 +122,10 @@ class EditoriaMode {
id = object.book id = object.book
break break
case 'team': case 'team':
id = object.object.id id = object.object.id //eslint-disable-line
break break
default: default:
id = object.id id = object.id //eslint-disable-line
break break
} }
} }
...@@ -218,7 +218,7 @@ class EditoriaMode { ...@@ -218,7 +218,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId) this.user = await this.context.models.User.find(this.userId)
let current let current
if (this.object.current) { if (this.object.current) {
current = this.object.current current = this.object.current //eslint-disable-line
} else { } else {
current = this.object current = this.object
} }
...@@ -236,7 +236,7 @@ class EditoriaMode { ...@@ -236,7 +236,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId) this.user = await this.context.models.User.find(this.userId)
let current let current
if (this.object.current) { if (this.object.current) {
current = this.object.current current = this.object.current //eslint-disable-line
} else { } else {
current = this.object current = this.object
} }
...@@ -621,6 +621,7 @@ class EditoriaMode { ...@@ -621,6 +621,7 @@ class EditoriaMode {
} }
return 'selection' return 'selection'
} }
/* eslint-disable */
async canRemoveTeamMember() { async canRemoveTeamMember() {
// this.user = await this.context.models.User.find(this.userId) // this.user = await this.context.models.User.find(this.userId)
// const collection = await this.findCollectionByObject(this.object) // const collection = await this.findCollectionByObject(this.object)
...@@ -632,6 +633,8 @@ class EditoriaMode { ...@@ -632,6 +633,8 @@ class EditoriaMode {
// } // }
return true return true
} }
/* eslint-enable */
async canGo() { async canGo() {
this.user = await this.context.models.User.find(this.userId) this.user = await this.context.models.User.find(this.userId)
const collection = await this.findCollectionByObject(this.object) const collection = await this.findCollectionByObject(this.object)
...@@ -870,7 +873,7 @@ module.exports = { ...@@ -870,7 +873,7 @@ module.exports = {
'team:create': (userId, operation, object, context) => true, 'team:create': (userId, operation, object, context) => true,
'team:delete': (userId, operation, object, context) => true, 'team:delete': (userId, operation, object, context) => true,
'team:patch': (userId, operation, object, context) => true, 'team:patch': (userId, operation, object, context) => true,
'can view add team memeber': (userId, operation, object, context) => 'can view add team member': (userId, operation, object, context) =>
// if (object === 'Production Editor') { // if (object === 'Production Editor') {
// return false // return false
// } // }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
}, },
"homepage": "https://editoria.pub/", "homepage": "https://editoria.pub/",
"license": "MIT", "license": "MIT",
"version": "1.0.0", "version": "1.1.0",
"dependencies": { "dependencies": {
"@pubsweet/component-polling-client": "^0.0.3", "@pubsweet/component-polling-client": "^0.0.3",
"@pubsweet/component-polling-server": "^0.0.9", "@pubsweet/component-polling-server": "^0.0.9",
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"pubsweet": "^2.2.8", "pubsweet": "^2.2.8",
"pubsweet-client": "^2.5.5", "pubsweet-client": "^2.5.5",
"pubsweet-component-bookbuilder": "^1.1.4", "pubsweet-component-bookbuilder": "^1.1.5",
"pubsweet-component-editoria-dashboard": "^0.1.2", "pubsweet-component-editoria-dashboard": "^0.1.3",
"pubsweet-component-editoria-global-teams": "^0.1.1", "pubsweet-component-editoria-global-teams": "^0.1.2",
"pubsweet-component-epub": "^0.5.2", "pubsweet-component-epub": "^0.5.2",
"pubsweet-component-epub-frontend": "^0.1.3", "pubsweet-component-epub-frontend": "^0.1.3",
"pubsweet-component-ink-backend": "^0.1.1", "pubsweet-component-ink-backend": "^0.1.1",
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
"pubsweet-component-signup": "^0.4.1", "pubsweet-component-signup": "^0.4.1",
"pubsweet-component-theme-editoria": "^0.0.5", "pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "1.0.0", "pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.0", "pubsweet-component-vivliostyle-viewer": "^1.0.1",
"pubsweet-component-wax": "^0.6.15", "pubsweet-component-wax": "^0.6.16",
"pubsweet-server": "^7.2.0", "pubsweet-server": "^7.2.0",
"pubsweet-theme-plugin": "^0.0.3", "pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0", "react": "^16.2.0",
...@@ -136,7 +136,15 @@ ...@@ -136,7 +136,15 @@
"webpack": "^3.8.1", "webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.0", "webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.20.0", "webpack-hot-middleware": "^2.20.0",
"winston-daily-rotate-file": "^3.2.1" "winston-daily-rotate-file": "^3.2.1",
"@commitlint/cli": "^6.0.5",
"@commitlint/config-conventional": "^6.0.4",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.1.0",
"stylelint-config-recommended": "^2.1.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.3.1",
"standard-version": "^4.4.0"
}, },
"jest": { "jest": {
"moduleNameMapper": { "moduleNameMapper": {
...@@ -164,6 +172,18 @@ ...@@ -164,6 +172,18 @@
"test": "NODE_ENV=test jest", "test": "NODE_ENV=test jest",
"test:watch": "NODE_ENV=test jest --watch", "test:watch": "NODE_ENV=test jest --watch",
"test:cover": "NODE_ENV=test jest --coverage", "test:cover": "NODE_ENV=test jest --coverage",
"build": "NODE_ENV=production pubsweet build" "build": "NODE_ENV=production pubsweet build",
"lint": "npm run lint:js && npm run lint:style",
"lint:js": "eslint '**/*.{js,jsx}'",
"lint:style": "stylelint '**/*.{js,jsx}'",
"precommit": "lint-staged",
"cz": "git-cz",
"commitmsg": "commitlint -e $GIT_PARAMS",
"release": "standard-version"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
} }
} }
const book = { const book = {
id: '0', id: '0',
title: 'Test Book' title: 'Test Book',
} }
const chapters = [ const chapters = [
{ {
alignment: { alignment: {
left: false, left: false,
right: false right: false,
}, },
author: '', author: '',
book: book.id, book: book.id,
...@@ -20,18 +20,18 @@ const chapters = [ ...@@ -20,18 +20,18 @@ const chapters = [
style: 0, style: 0,
edit: 0, edit: 0,
review: 0, review: 0,
clean: 0 clean: 0,
}, },
source: '', source: '',
status: 'unpublished', status: 'unpublished',
subCategory: 'component', subCategory: 'component',
title: 'Preface', title: 'Preface',
trackChanges: false trackChanges: false,
}, },
{ {
alignment: { alignment: {
left: false, left: false,
right: false right: false,
}, },
author: '', author: '',
book: book.id, book: book.id,
...@@ -44,18 +44,18 @@ const chapters = [ ...@@ -44,18 +44,18 @@ const chapters = [
style: 0, style: 0,
edit: 0, edit: 0,
review: 0, review: 0,
clean: 0 clean: 0,
}, },
source: '', source: '',
status: 'unpublished', status: 'unpublished',
subCategory: 'component', subCategory: 'component',
title: 'Introduction', title: 'Introduction',
trackChanges: false trackChanges: false,
}, },
{ {
alignment: { alignment: {
left: false, left: false,
right: false right: false,
}, },
author: '', author: '',
book: book.id, book: book.id,
...@@ -68,18 +68,18 @@ const chapters = [ ...@@ -68,18 +68,18 @@ const chapters = [
style: 0, style: 0,
edit: 0, edit: 0,
review: 0, review: 0,
clean: 0 clean: 0,
}, },
source: '', source: '',
status: 'unpublished', status: 'unpublished',
subCategory: 'chapter', subCategory: 'chapter',
title: 'Chapter One', title: 'Chapter One',
trackChanges: false trackChanges: false,
}, },
{ {
alignment: { alignment: {
left: false, left: false,
right: false right: false,
}, },
author: '', author: '',
book: book.id, book: book.id,
...@@ -92,18 +92,18 @@ const chapters = [ ...@@ -92,18 +92,18 @@ const chapters = [
style: 0, style: 0,
edit: 0, edit: 0,
review: 0, review: 0,
clean: 0 clean: 0,
}, },
source: '', source: '',
status: 'unpublished', status: 'unpublished',
subCategory: 'chapter', subCategory: 'chapter',
title: 'Chapter Two', title: 'Chapter Two',
trackChanges: false trackChanges: false,
}, },
{ {
alignment: { alignment: {
left: false, left: false,
right: false right: false,
}, },
author: '', author: '',
book: book.id, book: book.id,
...@@ -116,18 +116,18 @@ const chapters = [ ...@@ -116,18 +116,18 @@ const chapters = [
style: 0, style: 0,
edit: 0, edit: 0,
review: 0, review: 0,
clean: 0 clean: 0,
}, },
source: '', source: '',
status: 'unpublished', status: 'unpublished',
subCategory: 'component', subCategory: 'component',
title: 'Preface', title: 'Preface',
trackChanges: false trackChanges: false,
}, },
{ {
alignment: { alignment: {
left: false, left: false,
right: false right: false,
}, },
author: '', author: '',
book: book.id, book: book.id,
...@@ -140,31 +140,23 @@ const chapters = [ ...@@ -140,31 +140,23 @@ const chapters = [
style: 0, style: 0,
edit: 0, edit: 0,
review: 0, review: 0,
clean: 0 clean: 0,
}, },
source: '', source: '',
status: 'unpublished', status: 'unpublished',
subCategory: 'component', subCategory: 'component',
title: 'Preface', title: 'Preface',
trackChanges: false trackChanges: false,
} },
] ]
const teams = [] const teams = []
const user = { const user = {
teams: [], teams: [],
username: 'test-user' username: 'test-user',
} }
const users = [ const users = [user]
user
]
export { export { book, chapters, teams, user, users }
book,
chapters,
teams,
user,
users
}
/* eslint-disable */
global.CONFIG = { 'pubsweet-server': '' } global.CONFIG = { 'pubsweet-server': '' }
global.PUBSWEET_COMPONENTS = [] global.PUBSWEET_COMPONENTS = []
global.mock = { global.mock = {
data: require('./dataMock'), data: require('./dataMock'),
redux: require('./reduxMock') redux: require('./reduxMock'),
} }
...@@ -9,7 +9,7 @@ const actions = { ...@@ -9,7 +9,7 @@ const actions = {
getTeams: sinon.stub().resolves(teams), getTeams: sinon.stub().resolves(teams),
getUsers: sinon.stub().resolves(users), getUsers: sinon.stub().resolves(users),
ink: sinon.spy(), ink: sinon.spy(),
updateFragment: sinon.spy() updateFragment: sinon.spy(),
} }
module.exports = { actions } module.exports = { actions }
/* eslint-disable global-require */
const include = require('./babel-includes') const include = require('./babel-includes')
const path = require('path') const path = require('path')
const stringReplaceRule = require('./string-replace') const stringReplaceRule = require('./string-replace')
......
/* eslint-disable global-require */
const ExtractTextPlugin = require('extract-text-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin')
const include = require('./babel-includes') const include = require('./babel-includes')
const path = require('path') const path = require('path')
......
/* eslint-disable global-require */
// replace "PUBSWEET_COMPONENTS" string in pubsweet-client // replace "PUBSWEET_COMPONENTS" string in pubsweet-client
const components = require('../config/components.json') const components = require('../config/components.json')
......
This diff is collapsed.
Markdown is supported
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