Skip to content

Commit

Permalink
Merge branch 'master' into autologin-as
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto committed Oct 3, 2018
2 parents 263e6ce + 7c3c15c commit 2739db0
Show file tree
Hide file tree
Showing 209 changed files with 3,991 additions and 8,707 deletions.
36 changes: 1 addition & 35 deletions .babelrc
@@ -1,37 +1,3 @@
{
"presets": ["flow", "react", "env", "stage-0"],
"plugins": [
"transform-runtime",
"add-module-exports",
"transform-decorators-legacy",
"transform-class-properties",
"add-react-displayname",
["babel-plugin-root-import", {
"rootPathSuffix": "src"
}]
],
"env": {
"development": {
"plugins": [
"typecheck",
[
"react-transform",
{
"transforms": [
{
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}
]
}
],
[
"react-intl",
{
"messagesDir": "./dist/messages/"
}
]
]
}
}
"presets": ["./babel"]
}
4 changes: 3 additions & 1 deletion .eslintrc
Expand Up @@ -27,7 +27,9 @@
],
"jsx-a11y/anchor-is-valid": [ "error", { "components": [ "Link" ], "specialLink": [ "to" ] } ],
"import/prefer-default-export": "off",
"react/prefer-stateless-function": 0
"react/prefer-stateless-function": 0,
"import/no-unresolved": 0,
"import/extensions": 0
},
"settings": {
"import/resolver": {
Expand Down
12 changes: 0 additions & 12 deletions .flowconfig

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -9,6 +9,7 @@ dist
junit.xml
eslint.xml
yarn-error.log
build

# Other
.DS_Store
Expand All @@ -30,6 +31,8 @@ api/.Python
api/include
api/lib
api/pip-selfcheck.json
/bin
/lib

# Tests
/tests/bin
Expand All @@ -42,3 +45,4 @@ log.html
output.xml
report.html
selenium-screenshot-*.png
/selenium/
114 changes: 57 additions & 57 deletions .travis.yml
@@ -1,76 +1,76 @@
language: python
matrix:
include:
- name: "Plone Tests"
python: 2.7.14
env: TEST_SUITE=plone
- name: "Guillotina Tests"
python: 3.7
dist: xenial
env: TEST_SUITE=guillotina
- name: "Unit Tests"
env: TEST_SUITE=unit
- name: 'Plone Tests'
python: 2.7.14
env: TEST_SUITE=plone
- name: 'Guillotina Tests'
python: 3.7
dist: xenial
env: TEST_SUITE=guillotina
- name: 'Unit Tests'
env: TEST_SUITE=unit
cache:
pip: true
directories:
- node_modules
- node_modules
sudo: required
services:
- docker
addons:
apt:
sources:
- google-chrome
- google-chrome
packages:
- google-chrome-stable
- google-chrome-stable
before_install:
- nvm install 8.11.3;
- docker build -t plone/plone-react:testing .
- if [ "$TEST_SUITE" != "unit" ]; then
mkdir webdriver;
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz;
tar -xzf geckodriver-v0.20.0-linux64.tar.gz -C webdriver;
wget https://chromedriver.storage.googleapis.com/2.42/chromedriver_linux64.zip;
unzip chromedriver_linux64.zip -d webdriver;
export PATH=$PATH:$(pwd)/webdriver;
npm install -g surge;
fi
- nvm install 8.11.3;
- docker build -t plone/plone-react:testing .
- if [ "$TEST_SUITE" != "unit" ]; then
mkdir webdriver;
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz;
tar -xzf geckodriver-v0.20.0-linux64.tar.gz -C webdriver;
wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip;
unzip chromedriver_linux64.zip -d webdriver;
export PATH=$PATH:$(pwd)/webdriver;
npm install -g surge;
fi
install:
- if [ "$TEST_SUITE" == "plone" ]; then
virtualenv env --python=$(which python) --no-site-packages;
env/bin/pip install zc.recipe.egg==2.0.4 --no-cache-dir;
env/bin/pip install -r api/docker/requirements.txt;
env/bin/pip install -U https://github.com/zopefoundation/z3c.autoinclude/archive/pip.tar.gz#egg=z3c.autoinclude;
fi
- pip install -r test-requirements.txt;
- yarn
- yarn build
- if [ "$TEST_SUITE" == "plone" ]; then
virtualenv env --python=$(which python) --no-site-packages;
env/bin/pip install zc.recipe.egg==2.0.4 --no-cache-dir;
env/bin/pip install -r api/docker/requirements.txt;
env/bin/pip install -U https://github.com/zopefoundation/z3c.autoinclude/archive/pip.tar.gz#egg=z3c.autoinclude;
fi
- pip install -r test-requirements.txt;
- yarn
- yarn build
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
- 'export DISPLAY=:99.0'
- 'sh -e /etc/init.d/xvfb start'
- sleep 3
script:
- if [ "$TEST_SUITE" == "unit" ]; then
docker run --name coverage_front -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" plone/plone-react:testing -- yarn test;
docker cp coverage_front:/opt/app/coverage/lcov.info .;
cat lcov.info | ./node_modules/coveralls/bin/coveralls.js;
fi
- if [ "$TEST_SUITE" == "guillotina" ]; then
PYTHONPATH=$(pwd)/tests pybot -v BROWSER:headlesschrome -v API:Guillotina tests;
fi
- if [ "$TEST_SUITE" == "plone" ]; then
PYTHONPATH=$(pwd)/tests env/bin/pybot -v BROWSER:headlesschrome -v API:Plone tests;
fi
- if [ "$TEST_SUITE" == "unit" ]; then
docker run --name coverage_front -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" plone/plone-react:testing -- yarn test --coverage;
docker cp coverage_front:/opt/app/coverage/lcov.info .;
cat lcov.info | ./node_modules/coveralls/bin/coveralls.js;
fi
# - if [ "$TEST_SUITE" == "guillotina" ]; then
# PYTHONPATH=$(pwd)/tests pybot -v BROWSER:headlesschrome -v API:Guillotina tests;
# fi
# - if [ "$TEST_SUITE" == "plone" ]; then
# PYTHONPATH=$(pwd)/tests env/bin/pybot -v BROWSER:headlesschrome -v API:Plone tests;
# fi
after_script:
- mkdir robot-results
- mv log.html output.xml report.html selenium-screenshot-*.png robot-results
- ls -al robot-results
- surge robot-results plone-react.surge.sh
- mkdir robot-results
- mv log.html output.xml report.html selenium-screenshot-*.png robot-results
- ls -al robot-results
- surge robot-results plone-react.surge.sh
after_success:
- if [ "$TEST_SUITE" == "guillotina" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
docker tag plone/plone-react:testing plone/plone-react:$TRAVIS_BRANCH.$TRAVIS_COMMIT;
docker push plone/plone-react:$TRAVIS_BRANCH.$TRAVIS_COMMIT;
docker tag plone/plone-react:testing plone/plone-react:$TRAVIS_BRANCH.latest;
docker push plone/plone-react:$TRAVIS_BRANCH.latest;
fi
- if [ "$TEST_SUITE" == "guillotina" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
docker tag plone/plone-react:testing plone/plone-react:$TRAVIS_BRANCH.$TRAVIS_COMMIT;
docker push plone/plone-react:$TRAVIS_BRANCH.$TRAVIS_COMMIT;
docker tag plone/plone-react:testing plone/plone-react:$TRAVIS_BRANCH.latest;
docker push plone/plone-react:$TRAVIS_BRANCH.latest;
fi
22 changes: 21 additions & 1 deletion CHANGELOG.md
@@ -1,11 +1,31 @@
# Change Log

## 0.8.0 (unreleased)
## 0.8.3 (2018-08-03)

### Changes

- Fix i18n script for dependency @robgietema

## 0.8.2 (2018-08-03)

### Changes

- Move all dev dependencies to dependencies @robgietema

## 0.8.1 (2018-08-03)

### Changes

- Fix compiling when used as a library @robgietema

## 0.8.0 (2018-08-03)

### Added

- Move the webpack config to Razzle @sneridagh @robgietema
- Upgrade React to 16.5 @tisto
- Upgrade React to 16.4.2 to fix a server-side vulnerability @tisto
- Support for base url @bloodbare

### Changes

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
@@ -1,6 +1,6 @@
FROM node:8.11.4-slim

RUN apt-get update -y
RUN apt-get update -y
RUN apt-get install -y libpng12-dev

WORKDIR /opt/app/
Expand All @@ -16,7 +16,7 @@ RUN yarn build
ENV API_PATH http://api/db/web
ENV PUBLIC_URL /

EXPOSE 4300
EXPOSE 3000

ENTRYPOINT ["/opt/app/entrypoint.sh"]
CMD yarn run:prod:server
CMD yarn start:prod
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -5,7 +5,7 @@ dist:
yarn build

start: dist
yarn start
yarn start:prod

start-api-docker:
docker-compose -f api/docker-compose.yml up
Expand All @@ -20,7 +20,7 @@ test-acceptance-start-backend:
docker-compose -f api/docker-compose.yml up

test-acceptance-start-frontend:
yarn && yarn build && API_PATH=http://localhost:55001/plone yarn start
yarn && yarn build && API_PATH=http://localhost:55001/plone yarn start:prod

test-acceptance-build:
api/bin/pip install -r api/requirements-robot-framework.txt
Expand Down
12 changes: 5 additions & 7 deletions README.md
Expand Up @@ -10,8 +10,8 @@

### Prerequisites

* [Node.js==8.11.3](https://nodejs.org/)
* [Python==2.7.x](https://python.org/)
- [Node.js==8.11.3](https://nodejs.org/)
- [Python==2.7.x](https://python.org/)

### Install dependencies

Expand All @@ -35,11 +35,11 @@

### Run frontend

$ yarn dev
$ yarn start

### Browsing

Go to [http://localhost:4300](http://localhost:4300) in your browser.
Go to [http://localhost:3000](http://localhost:3000) in your browser.

### Testing

Expand All @@ -52,7 +52,7 @@ Go to [http://localhost:4300](http://localhost:4300) in your browser.
Alternatively individual acceptances test case files can be run with a pure Robot Framework virtual environment, assuming that backend and frontend is running

$ docker-compose -f api/docker-compose.yml up
$ yarn && yarn build && API_PATH=http://localhost:55001/plone yarn start
$ yarn && yarn build && API_PATH=http://localhost:55001/plone yarn start:prod

$ virtualenv robotenv --no-site-packages
$ robotenv/bin/pip install robotframework robotframework-seleniumlibrary robotframework-webpack
Expand Down Expand Up @@ -138,7 +138,6 @@ More Precommit hooks can be found [here](https://prettier.io/docs/en/precommit.h
MIT License. Copyrights hold the Plone Foundation.
See [LICENSE.md](LICENSE.md) for details.


### Running Guillotina Tests

First, start up Guillotina:
Expand All @@ -149,7 +148,6 @@ docker-compose -f g-api/docker-compose.yml up -d

Then, run the tests:


```
PYTHONPATH=$(pwd)/tests_guillotina env/bin/pybot -v BROWSER:headlesschrome tests_guillotina;
```
4 changes: 2 additions & 2 deletions api/buildout.cfg
Expand Up @@ -25,7 +25,7 @@ zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
allow_origin="http://localhost:4300,http://127.0.0.1:4300"
allow_origin="http://localhost:3000,http://127.0.0.1:3000"
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT"
allow_credentials="true"
expose_headers="Content-Length,X-My-Header"
Expand Down Expand Up @@ -53,7 +53,7 @@ zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
allow_origin="http://localhost:4300,http://127.0.0.1:4300"
allow_origin="http://localhost:3000,http://127.0.0.1:3000"
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT"
allow_credentials="true"
expose_headers="Content-Length,X-My-Header"
Expand Down
1 change: 0 additions & 1 deletion api/docker/requirements.txt
Expand Up @@ -211,7 +211,6 @@ robotframework-react==1.0.0a2
robotframework-requests==0.4.7
robotframework-selenium2library==3.0.0
robotframework-seleniumlibrary==3.1.1
robotframework-webpack==1.1.3
robotsuite==2.0.0
roman==1.4.0
selenium==3.14.0
Expand Down
18 changes: 18 additions & 0 deletions babel.js
@@ -0,0 +1,18 @@
module.exports = {
presets: ['razzle/babel', 'stage-0'],
plugins: [
'transform-decorators-legacy',
[
'babel-plugin-root-import',
{
rootPathSuffix: 'src',
},
],
[
'react-intl',
{
messagesDir: './build/messages/',
},
],
],
};

0 comments on commit 2739db0

Please sign in to comment.