Skip to content

Commit

Permalink
Merge pull request #113 from nzzdev/release-3.1.5
Browse files Browse the repository at this point in the history
Release 3.1.5
  • Loading branch information
philipkueng authored Jul 10, 2019
2 parents d2f07d8 + 3e6fe33 commit 17185f7
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 142 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Minibars are a visual feature to display the difference between numbers in the t
###### Implementation details serverside

- The `option-availability` route will check if there are at least 3 columns and check if at least one if them is `numeric`
- Once the option will be shown, the `dynamic-enum` route will read all `numeric` columns and display them in the option
- Once the option will be shown, the `dynamic-schema` route will read all `numeric` columns and display them in the option
- **Important**: The function `getMinibarContext()` will always return an object, when minibars aren't used the object is empty
- The function `getMinibarContext()` uses a copy of `item.data` since the data will be altered
- If minibars will be used, the function `getMinibarData()` with the parameters `data` and `minibarOptions` will be called
Expand Down
8 changes: 6 additions & 2 deletions helpers/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ function getColumnsType(data) {
const columns = [];
const table = clone(data).slice(1);

Array2D.eachColumn(table, (column, columnIndex) => {
Array2D.eachColumn(table, column => {
let columnEmpty = column.every(cell => {
return cell === null || cell === "" || cell === "-";
});
let isColumnNumeric = column.every(cell => {
return (
isNumeric(cell) === true || cell === null || cell === "" || cell === "-"
!columnEmpty &&
(isNumeric(cell) || cell === null || cell === "" || cell === "-")
);
});
columns.push({ isNumeric: isColumnNumeric });
Expand Down
12 changes: 2 additions & 10 deletions helpers/renderingInfoScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,8 @@ function getCardLayoutScript(context) {
const dataObject = `window.${context.id}Data`;

let renderMinibarsFunction = "";
if (
context.item.options.minibar !== null &&
context.item.options.minibar !== undefined
) {
if (
context.item.options.minibar.selectedColumn !== null &&
context.item.options.minibar.selectedColumn !== undefined
) {
renderMinibarsFunction = `renderMinibars${context.id}()`;
}
if (Object.keys(context.minibar).length !== 0) {
renderMinibarsFunction = `renderMinibars${context.id}()`;
}

return `
Expand Down
122 changes: 77 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "q-table",
"version": "3.1.4",
"version": "3.1.5",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -13,9 +13,9 @@
"dependencies": {
"@hapi/boom": "^7.4.2",
"@hapi/hapi": "^18.3.1",
"@hapi/inert": "^5.2.0",
"@hapi/inert": "^5.2.1",
"@hapi/joi": "^15.1.0",
"ajv": "^6.10.0",
"ajv": "^6.10.1",
"array2d": "0.0.5",
"clone": "^2.1.2",
"d3-format": "^1.3.2",
Expand All @@ -25,12 +25,12 @@
"devDependencies": {
"@hapi/code": "^5.3.1",
"@hapi/lab": "^19.1.0",
"autoprefixer": "^9.6.0",
"autoprefixer": "^9.6.1",
"cssnano": "^4.1.10",
"html-minifier": "^4.0.0",
"jsdom": "^15.1.1",
"postcss": "^7.0.17",
"postcss-import": "^12.0.1",
"sass": "^1.22.0"
"sass": "^1.22.3"
}
}
Loading

0 comments on commit 17185f7

Please sign in to comment.