Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved plotlycharts; This requires volto-datablocks@3.x #33

Merged
merged 19 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 20 additions & 58 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,63 +1,25 @@
# Logs
.vscode/
.history
.eslintrc.js
project
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.DS_Store
*.swp
yarn-error.log
yarn.lock
package-lock.json

# next.js build output
.next
node_modules
build
dist
cypress/videos
cypress/reports
screenshots
videos
.env.local
.env.development.local
.env.test.local
.env.production.local
*~
package-lock.json
96 changes: 96 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# https://docs.npmjs.com/using-npm/developers.html#keeping-files-out-of-your-package

# Directories
api/
bin/
build/
lib/
g-api/
tests/

# Docs
docs/

# Cypress
cypress/

# Tests
__tests__/
*.snap

# Files
.travis.yml
requirements-docs.txt
requirements-tests.txt
yarn.lock
.dockerignore
.gitattributes
.yarnrc
.nvmrc
changelogupdater.js
pip-selfcheck.json
Dockerfile
CNAME
entrypoint.sh
Jenkinsfile
Makefile

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

styleguide.config
.vscode
packages
46 changes: 46 additions & 0 deletions .project.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const fs = require('fs');
const path = require('path');

const projectRootPath = fs.realpathSync('./project'); // __dirname
const packageJson = require(path.join(projectRootPath, 'package.json'));
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;

const pathsConfig = jsConfig.paths;

let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');

Object.keys(pathsConfig).forEach(pkg => {
if (pkg === '@plone/volto') {
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
}
});
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
const reg = new AddonConfigurationRegistry(projectRootPath);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(reg.packages).map(o => [
o,
reg.packages[o].modulePath,
]);


module.exports = {
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
settings: {
'import/resolver': {
alias: {
map: [
['@plone/volto', '@plone/volto/src'],
...addonAliases,
['@package', `${__dirname}/src`],
['~', `${__dirname}/src`],
],
extensions: ['.js', '.jsx', '.json'],
},
'babel-plugin-root-import': {
rootPathSuffix: 'src',
},
},
},
};

8 changes: 4 additions & 4 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"publish": false
},
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit true -u --template https://github.com/raw/release-it/release-it/master/templates/changelog-compact.hbs",
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://github.com/raw/release-it/release-it/master/templates/changelog-compact.hbs",
"tagName": "${version}"
},
"github": {
"release": true,
"releaseName": "${version}",
"releaseNotes": "npx auto-changelog --stdout --commit-limit true -u --template https://github.com/raw/release-it/release-it/master/templates/changelog-compact.hbs"
"releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://github.com/raw/release-it/release-it/master/templates/changelog-compact.hbs"
},
"hooks": {
"after:bump": "npx auto-changelog --commit-limit true -p"
"after:bump": "npx auto-changelog --commit-limit false -p"
}
}
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,36 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [3.0.0](https://github.com/eea/volto-plotlycharts/compare/3.0.0-beta.0...3.0.0)

- pin plotly to 2.5.1 as in master [`57b6ff2`](https://github.com/eea/volto-plotlycharts/commit/57b6ff2e087746f32a8f54e1639f5866886c592e)

#### [3.0.0-beta.0](https://github.com/eea/volto-plotlycharts/compare/2.0.11...3.0.0-beta.0)

> 3 February 2022

- Refactor plotlycharts [`#32`](https://github.com/eea/volto-plotlycharts/pull/32)
- Release 3.0.0-beta.0 [`91dd06d`](https://github.com/eea/volto-plotlycharts/commit/91dd06d4f7cacdc916c4aabe8642e1436be32209)
- Stylelint [`50df0a7`](https://github.com/eea/volto-plotlycharts/commit/50df0a70ef93a1d23f12e2b916f61c372eb8627b)
- Update [`a235134`](https://github.com/eea/volto-plotlycharts/commit/a235134d3b186ddcdeb18c28ba686e83aec48381)
- Update [`ee98eaa`](https://github.com/eea/volto-plotlycharts/commit/ee98eaa8ee2e7120921943f090e7d1aa65d6a78e)
- Fix hoc. [`8a8ceeb`](https://github.com/eea/volto-plotlycharts/commit/8a8ceebe2c28a3e3a0d0428527a7e6b4322c6d77)
- fix hoc [`24ab45d`](https://github.com/eea/volto-plotlycharts/commit/24ab45d31037455b45b7760b7801866eee29117c)
- fix import path in hocs [`edb62e1`](https://github.com/eea/volto-plotlycharts/commit/edb62e16eba85dfa3e9fd5767bde9de71dc2e765)
- fix import path [`94643c7`](https://github.com/eea/volto-plotlycharts/commit/94643c7dc9a108e298162e938ccf3c0d63ff1266)
- use absolute import path [`8fd0e65`](https://github.com/eea/volto-plotlycharts/commit/8fd0e65149bf3d64a2217bf9c75ba6e3fbc31278)
- Merge develop into this branch [`8d7fb65`](https://github.com/eea/volto-plotlycharts/commit/8d7fb65c66099e2c53cb467ee281b3c61cf280b2)
- Lint fix [`3256648`](https://github.com/eea/volto-plotlycharts/commit/325664803e3a62dc2c70dca73670cff0c047b057)
- Improvments [`9bb1716`](https://github.com/eea/volto-plotlycharts/commit/9bb171694ef5f3a42cc1f71e0fb1cca8026682df)
- Merge master into this branch [`3554ca3`](https://github.com/eea/volto-plotlycharts/commit/3554ca36561ab69e798444fb9322185e684a92b7)
- Improved plotlycharts; This requires volto-datablocks@3.x [`e6b01ec`](https://github.com/eea/volto-plotlycharts/commit/e6b01ec2cdf15cf2d8c13af710b66ee84b796dfe)
- Better update trigger on plot [`4ce1c99`](https://github.com/eea/volto-plotlycharts/commit/4ce1c9910466cd2ff586f0dc81858c3dd8491cb8)

#### [2.0.11](https://github.com/eea/volto-plotlycharts/compare/2.0.10...2.0.11)

> 28 December 2021

- Develop [`#30`](https://github.com/eea/volto-plotlycharts/pull/30)
- Lint fix 4 [`c78ad77`](https://github.com/eea/volto-plotlycharts/commit/c78ad77796692a68254bf7243d162b663acb9298)
- Lint fix 3 [`91c388c`](https://github.com/eea/volto-plotlycharts/commit/91c388cd90bbd5cfe9d7b29c552f77fb1d1c724e)
- Lint fix 2 [`754bef6`](https://github.com/eea/volto-plotlycharts/commit/754bef68ad0fcd735b3a1252a1cf18847cf0961e)
Expand Down
2 changes: 1 addition & 1 deletion DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ Before starting make sure your development environment is properly set. See [Vol

1. Happy hacking!

$ cd src/addons/volto-plotlycharts/
$ cd src/addons/volto-plotlycharts/
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pipeline {
node(label: 'docker') {
script {
try {
sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
} finally {
try {
Expand All @@ -142,7 +142,8 @@ pipeline {
reportName: 'CypressCoverage',
reportTitles: 'Integration Tests Code Coverage'])
}
archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true
sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
}
finally {
Expand Down
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2020 European Environment Agency

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SHELL=/bin/bash

DIR=$(shell basename $$(pwd))
ADDON ?= "@eeacms/volto-plotlycharts"

# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`

project:
npm install -g yo
npm install -g @plone/generator-volto
npm install -g mrs-developer
yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive
ln -sf $$(pwd) project/src/addons/
cp .project.eslintrc.js .eslintrc.js
cd project && yarn
@echo "-------------------"
@echo "$(GREEN)Volto project is ready!$(RESET)"
@echo "$(RED)Now run: cd project && yarn start$(RESET)"

all: project

.PHONY: start-test-backend
start-test-backend: ## Start Test Plone Backend
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e SITE=plone -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING

.PHONY: start-backend-docker
start-backend-docker: ## Starts a Docker-based backend
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone

.PHONY: test
test:
docker pull plone/volto-addon-ci
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" plone/volto-addon-ci yarn test --watchAll=false

.PHONY: test-update
test-update:
docker pull plone/volto-addon-ci
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" plone/volto-addon-ci yarn test --watchAll=false -u

.PHONY: help
help: ## Show this help.
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
Loading