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
## 1.3.0
......@@ -88,4 +102,3 @@
* React integration
* Core
* Diacritics work within notes
......@@ -5,10 +5,11 @@ import ReactDOM from 'react-dom'
import { configureStore, Root } from 'pubsweet-client'
import theme from './theme'
import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory'
import theme from './theme'
import routes from './routes'
const history = createHistory()
......
......@@ -38,8 +38,8 @@ class Navigation extends React.Component {
this.inEditor = pathname.match(/fragments/g)
this.inPaged = pathname.match(/pagedPreviewer\/paged/g)
if (this.inEditor || this.inPaged) {
const pathnameSplited = pathname.split('/')
this.collectionId = pathnameSplited[2]
const pathnameSplitted = pathname.split('/')
this.collectionId = pathnameSplitted[2] // eslint-disable-line
}
}
......@@ -52,8 +52,8 @@ class Navigation extends React.Component {
if (currentUser.isAuthenticated) {
logoutButtonIfAuthenticated = (
<NavbarUser
user={currentUser.user}
onLogoutClick={() => logoutUser('/login')}
user={currentUser.user}
/>
)
}
......@@ -100,8 +100,8 @@ class Navigation extends React.Component {
}
Navigation.propTypes = {
currentUser: PropTypes.any,
history: PropTypes.any.isRequired,
currentUser: PropTypes.any, // eslint-disable-line
history: PropTypes.any.isRequired, // eslint-disable-line
logoutUser: PropTypes.func.isRequired,
}
......
......@@ -72,7 +72,7 @@ PrivateRoute.propTypes = {
isFetching: PropTypes.bool.isRequired,
}).isRequired,
getCurrentUser: PropTypes.func.isRequired,
location: PropTypes.object.isRequired,
location: PropTypes.object.isRequired, // eslint-disable-line
}
export default withRouter(
......
......@@ -3,7 +3,6 @@
import 'typeface-fira-sans'
export default {
/* Text variables */
// fonts
......
module.exports = { extends: ['@commitlint/config-conventional'] }
......@@ -33,7 +33,7 @@ class EditoriaMode {
return operationMap[operation] ? operationMap[operation] : operation
}
/* eslint-disable */
static difference(object, base) {
const changes = (object, base) =>
transform(object, (result, value, key) => {
......@@ -46,7 +46,7 @@ class EditoriaMode {
})
return changes(object, base)
}
/* eslint-enable */
async isTeamMember(teamType, object) {
let membershipCondition
if (object) {
......@@ -74,7 +74,7 @@ class EditoriaMode {
async hasMembership(object) {
let collection
if (object.collection) {
collection = object.collection
collection = object.collection //eslint-disable-line
} else {
collection = object
}
......@@ -82,7 +82,7 @@ class EditoriaMode {
const membershipCondition = team =>
!team.global && team.object.id === collection.id
const memberships = await Promise.all(
const memberships = await Promise.all(
this.user.teams.map(async teamId => {
const teamFound = await this.context.models.Team.find(teamId)
if (teamFound) {
......@@ -113,7 +113,7 @@ class EditoriaMode {
async findCollectionByObject(object) {
let id
if (object.collection) {
id = object.collection.id
id = object.collection.id //eslint-disable-line
} else if (object.bookId && object.type) {
id = object.bookId
} else {
......@@ -122,10 +122,10 @@ class EditoriaMode {
id = object.book
break
case 'team':
id = object.object.id
id = object.object.id //eslint-disable-line
break
default:
id = object.id
id = object.id //eslint-disable-line
break
}
}
......@@ -218,7 +218,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId)
let current
if (this.object.current) {
current = this.object.current
current = this.object.current //eslint-disable-line
} else {
current = this.object
}
......@@ -236,7 +236,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId)
let current
if (this.object.current) {
current = this.object.current
current = this.object.current //eslint-disable-line
} else {
current = this.object
}
......@@ -621,6 +621,7 @@ class EditoriaMode {
}
return 'selection'
}
/* eslint-disable */
async canRemoveTeamMember() {
// this.user = await this.context.models.User.find(this.userId)
// const collection = await this.findCollectionByObject(this.object)
......@@ -632,6 +633,8 @@ class EditoriaMode {
// }
return true
}
/* eslint-enable */
async canGo() {
this.user = await this.context.models.User.find(this.userId)
const collection = await this.findCollectionByObject(this.object)
......@@ -870,7 +873,7 @@ module.exports = {
'team:create': (userId, operation, object, context) => true,
'team:delete': (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') {
// return false
// }
......
......@@ -17,7 +17,7 @@
},
"homepage": "https://editoria.pub/",
"license": "MIT",
"version": "1.0.0",
"version": "1.1.0",
"dependencies": {
"@pubsweet/component-polling-client": "^0.0.3",
"@pubsweet/component-polling-server": "^0.0.9",
......@@ -34,9 +34,9 @@
"prop-types": "^15.6.0",
"pubsweet": "^2.2.8",
"pubsweet-client": "^2.5.5",
"pubsweet-component-bookbuilder": "^1.1.4",
"pubsweet-component-editoria-dashboard": "^0.1.2",
"pubsweet-component-editoria-global-teams": "^0.1.1",
"pubsweet-component-bookbuilder": "^1.1.5",
"pubsweet-component-editoria-dashboard": "^0.1.3",
"pubsweet-component-editoria-global-teams": "^0.1.2",
"pubsweet-component-epub": "^0.5.2",
"pubsweet-component-epub-frontend": "^0.1.3",
"pubsweet-component-ink-backend": "^0.1.1",
......@@ -50,8 +50,8 @@
"pubsweet-component-signup": "^0.4.1",
"pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.0",
"pubsweet-component-wax": "^0.6.15",
"pubsweet-component-vivliostyle-viewer": "^1.0.1",
"pubsweet-component-wax": "^0.6.16",
"pubsweet-server": "^7.2.0",
"pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0",
......@@ -136,7 +136,15 @@
"webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.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": {
"moduleNameMapper": {
......@@ -164,6 +172,18 @@
"test": "NODE_ENV=test jest",
"test:watch": "NODE_ENV=test jest --watch",
"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 = {
id: '0',
title: 'Test Book'
title: 'Test Book',
}
const chapters = [
{
alignment: {
left: false,
right: false
right: false,
},
author: '',
book: book.id,
......@@ -20,18 +20,18 @@ const chapters = [
style: 0,
edit: 0,
review: 0,
clean: 0
clean: 0,
},
source: '',
status: 'unpublished',
subCategory: 'component',
title: 'Preface',
trackChanges: false
trackChanges: false,
},
{
alignment: {
left: false,
right: false
right: false,
},
author: '',
book: book.id,
......@@ -44,18 +44,18 @@ const chapters = [
style: 0,
edit: 0,
review: 0,
clean: 0
clean: 0,
},
source: '',
status: 'unpublished',
subCategory: 'component',
title: 'Introduction',
trackChanges: false
trackChanges: false,
},
{
alignment: {
left: false,
right: false
right: false,
},
author: '',
book: book.id,
......@@ -68,18 +68,18 @@ const chapters = [
style: 0,
edit: 0,
review: 0,
clean: 0
clean: 0,
},
source: '',
status: 'unpublished',
subCategory: 'chapter',
title: 'Chapter One',
trackChanges: false
trackChanges: false,
},
{
alignment: {
left: false,
right: false
right: false,
},
author: '',
book: book.id,
......@@ -92,18 +92,18 @@ const chapters = [
style: 0,
edit: 0,
review: 0,
clean: 0
clean: 0,
},
source: '',
status: 'unpublished',
subCategory: 'chapter',
title: 'Chapter Two',
trackChanges: false
trackChanges: false,
},
{
alignment: {
left: false,
right: false
right: false,
},
author: '',
book: book.id,
......@@ -116,18 +116,18 @@ const chapters = [
style: 0,
edit: 0,
review: 0,
clean: 0
clean: 0,
},
source: '',
status: 'unpublished',
subCategory: 'component',
title: 'Preface',
trackChanges: false
trackChanges: false,
},
{
alignment: {
left: false,
right: false
right: false,
},
author: '',
book: book.id,
......@@ -140,31 +140,23 @@ const chapters = [
style: 0,
edit: 0,
review: 0,
clean: 0
clean: 0,
},
source: '',
status: 'unpublished',
subCategory: 'component',
title: 'Preface',
trackChanges: false
}
trackChanges: false,
},
]
const teams = []
const user = {
teams: [],
username: 'test-user'
username: 'test-user',
}
const users = [
user
]
const users = [user]
export {
book,
chapters,
teams,
user,
users
}
export { book, chapters, teams, user, users }
/* eslint-disable */
global.CONFIG = { 'pubsweet-server': '' }
global.PUBSWEET_COMPONENTS = []
global.mock = {
data: require('./dataMock'),
redux: require('./reduxMock')
redux: require('./reduxMock'),
}
......@@ -9,7 +9,7 @@ const actions = {
getTeams: sinon.stub().resolves(teams),
getUsers: sinon.stub().resolves(users),
ink: sinon.spy(),
updateFragment: sinon.spy()
updateFragment: sinon.spy(),
}
module.exports = { actions }
/* eslint-disable global-require */
const include = require('./babel-includes')
const path = require('path')
const stringReplaceRule = require('./string-replace')
......
/* eslint-disable global-require */
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const include = require('./babel-includes')
const path = require('path')
......
/* eslint-disable global-require */
// replace "PUBSWEET_COMPONENTS" string in pubsweet-client
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