Commit 9cef86c2 authored by Alexandros Georgantas's avatar Alexandros Georgantas

Merge branch 'wax-component' into 'master'

Wax component

See merge request !109
parents 8bfc2568 61d14b26
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.0.0"></a>
# 1.0.0 (2018-02-23)
### Features
* switch to PostgreSQL ([d459299](https://gitlab.coko.foundation/pubsweet/pubsweet/commit/d459299))
### BREAKING CHANGES
* All data is now persisted in a PostgreSQL database instead of PouchDB
* Database server must be running and have an existing database before running `pubsweet setupdb` (Docker config provided)
`pubsweet start` runs `npm start` script if found and falls back to `pubsweet server`
`pubsweet server` starts the PubSweet server (like the old `pubsweet start`)
`pubsweet-server` model API is unchanged
const NodeEnvironment = require('jest-environment-node')
const pg = require('pg')
require('../editoria-authsome/test/helpers/jest-setup')
const config = require('config')
class DatabaseTestEnvironment extends NodeEnvironment {
async setup() {
await super.setup()
this.db = new pg.Client(
config['pubsweet-server'] && config['pubsweet-server'].db,
)
await this.db.connect()
// pass the test database name into the test environment as a global
this.global.__testDbName = `test_${Math.floor(Math.random() * 9999999)}`
await this.db.query(`CREATE DATABASE ${this.global.__testDbName}`)
}
async teardown() {
// terminate other connections from test before dropping db
await this.db.query(
`REVOKE CONNECT ON DATABASE ${this.global.__testDbName} FROM public`,
)
await this.db.query(`
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = '${this.global.__testDbName}'`)
await this.db.query(`DROP DATABASE ${this.global.__testDbName}`)
await super.teardown()
await this.db.end()
}
}
module.exports = DatabaseTestEnvironment
{
"name": "jest-environment-db",
"version": "1.0.1",
"description": "",
"main": "index.js",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"jest-environment-node": "^22.1.4"
}
}
{
"presets": [
"env",
"react",
"stage-2"
]
}
\ No newline at end of file
**/_build
**/node_modules
**/coverage
module.exports = {
frontend: {
components: [
() => require('./src/WaxPubsweet')
]
}
}
{
"name": "pubsweet-component-wax",
"description": "PubSweet component for the Wax collaborative document editor",
"version": "0.6.14",
"main": "index.js",
"keywords": [
"wax",
"editor",
"pubsweet-component",
"pubsweet-client"
],
"dependencies": {
"lodash": "4.17.4",
"pubsweet-client": "^2.5.5",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "5.0.4",
"redux": "3.6.0",
"wax-editor-react": "^0.2.10"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"prop-types": "^15.6.0"
}
}
This diff is collapsed.
import React from 'react'
const withConfig = (Wrapper, config) => {
const editorWithConfig = (props) => (
<Wrapper {...props} config={config} />
)
return editorWithConfig
}
export default withConfig
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