Skip to content

Commit

Permalink
Merge pull request #103 from nzzdev/release-3.1.4
Browse files Browse the repository at this point in the history
Release v3.1.4
  • Loading branch information
manuelroth authored Jun 25, 2019
2 parents 50c41c4 + 9442395 commit d2f07d8
Show file tree
Hide file tree
Showing 18 changed files with 1,215 additions and 1,668 deletions.
Binary file removed .README.md.swp
Binary file not shown.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ install:
- npm install
before_script:
- DOCKER_IMAGE_NAME="q-table"
- DOCKER_TAG=${TRAVIS_BRANCH/\//_}
- DOCKER_TAG=${TRAVIS_BRANCH//[^a-zA-Z0-9\_\-\.]/_}
script:
- npm run build
- npm run test
- docker build -t $DOCKER_IMAGE_NAME:$DOCKER_TAG .
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker build -t $DOCKER_IMAGE_NAME:$DOCKER_TAG .; fi'
after_success:
- echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin; docker
tag $DOCKER_IMAGE_NAME:$DOCKER_TAG nzzonline/$DOCKER_IMAGE_NAME:$DOCKER_TAG; docker
push nzzonline/$DOCKER_IMAGE_NAME:$DOCKER_TAG;
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin; docker tag $DOCKER_IMAGE_NAME:$DOCKER_TAG nzzonline/$DOCKER_IMAGE_NAME:$DOCKER_TAG; docker push nzzonline/$DOCKER_IMAGE_NAME:$DOCKER_TAG; fi'
notifications:
slack:
secure: s6YBkURJyas8GOTp4AVYI5uhg8RW9lCslJhX+mvaLCqzFXYmGTF4fKR8YYsYyR9pvyiU3dbGTt6Ds+WkLUCbI2DVuYbZ4DUHpAUezm2UekdwCI2XncYrtp4o/Auo+rWKdKuIsAh9vl3Ga4BF1wrvSqJiICoGt+uT3BNWNR/6rc8/JAK19u53V4mmkd5wnwLUcl08iZjtIOjsBRbv5PpUL2z/bLXuxOWBbzX/bumnwEP5ez3Gp8peaDM68zRWTBhIqeHpT8xPdZ4IH1Uy2YA7FfgUC8SKs4ANp/tYEZcLC95yMMW/awWMSvVBpTVCb7oVBBwSTQwlkZf/3yrrjEPGokIQ2U7qyTC7+ATD1UTeevP1yO+A+O7J1yBx9Q0df4fQc4fswBFgasNVFL968jUttCqNIxOMXDrPeLHfMrsWCGXbVij/T//d3BoRJ95xNe9WSseZfywP8qg5eB/swzCXsLaQvsVwBSzXgAxnqC6isr7IzdIVHqfpRkTpWIf0S3cgptA7sxKyQ6l5xyxyRBgWtcyTZpfodnzvSPeHXvgMzXGP3hhVegaPXFlX51kf+8Y2OUBntkfa9kIkFhu3GrCaEcgmboVJiIu+4+lBrrLO5EBPebJNmFeAhQTl+FxSKXwLmYX3t86M96driB7cf0viYOgi+owicOtm17O93hOOtJI=
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) NZZ Management AG

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.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Test it in the [demo](https://editor.q.tools).
- [Testing](#testing)
- [Deployment](#deployment)
- [Functionality](#functionality)
- [License](#license)

## Installation

Expand Down Expand Up @@ -265,3 +266,11 @@ Display options can be set before embedding the graphic in the article.
Allows to hide the title

[to the top](#table-of-contents)

## License

Copyright (c) Neue Zürcher Zeitung. All rights reserved.

This software is published under the [MIT](LICENSE) license.

[to the top](#table-of-contents)
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const Hapi = require('hapi');
const fs = require("fs");
const Hapi = require("@hapi/hapi");

const server = Hapi.server({
port: process.env.PORT || 3000,
Expand All @@ -8,24 +8,24 @@ const server = Hapi.server({
}
});

const routes = require('./routes/routes.js');
const routes = require("./routes/routes.js");

async function init() {
await server.register(require('inert'));
await server.register(require("@hapi/inert"));

server.route(routes);

await server.start();
console.log('server running ', server.info.uri)
console.log("server running ", server.info.uri);
}

init();

async function gracefullyStop() {
console.log('stopping hapi server');
console.log("stopping hapi server");
try {
await server.stop({ timeout: 10000 });
console.log('hapi server stopped');
console.log("hapi server stopped");
} catch (err) {
console.log(err);
process.exit(1);
Expand All @@ -34,5 +34,5 @@ async function gracefullyStop() {
}

// listen on SIGINT and SIGTERM signal and gracefully stop the server
process.on('SIGINT', gracefullyStop);
process.on('SIGTERM', gracefullyStop);
process.on("SIGINT", gracefullyStop);
process.on("SIGTERM", gracefullyStop);
44 changes: 23 additions & 21 deletions migration-scripts/to-v2.0.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@ module.exports.migrate = function(item) {
let result = {
isChanged: false
};

if (!Number.isNaN(parseInt(item.options.minibarOptions))) {
let minibars = {
selectedColumn: item.options.minibarOptions + 1,
barColor: {
positive: {
className: "",
colorCode: ""
if (item.options.minibar === undefined) {
if (!Number.isNaN(parseInt(item.options.minibarOptions))) {
let minibars = {
selectedColumn: item.options.minibarOptions + 1,
barColor: {
positive: {
className: "",
colorCode: ""
},
negative: {
className: "",
colorCode: ""
}
},
negative: {
className: "",
colorCode: ""
}
},
invertColors: false
};
item.options["minibar"] = minibars;
delete item.options.minibarOptions;
result.isChanged = true;
} else {
delete item.options.minibarOptions;
result.isChanged = true;
invertColors: false
};
item.options["minibar"] = minibars;
delete item.options.minibarOptions;
result.isChanged = true;
} else {
delete item.options.minibarOptions;
result.isChanged = true;
}
}

result.item = item;
return result;
};
Loading

0 comments on commit d2f07d8

Please sign in to comment.