Skip to content

Commit

Permalink
Merge pull request #203 from nzzdev/release-7.3.0
Browse files Browse the repository at this point in the history
Release 7.3.0
  • Loading branch information
dnlbln authored Aug 10, 2023
2 parents 429d0b8 + f035546 commit b95a3ae
Show file tree
Hide file tree
Showing 9 changed files with 965 additions and 1,033 deletions.
2 changes: 1 addition & 1 deletion dist/Q-Table.js

Large diffs are not rendered by default.

1,947 changes: 937 additions & 1,010 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "q-table",
"version": "7.2.9",
"version": "7.3.0",
"description": "",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -40,9 +40,9 @@
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.1",
"@swc/core": "^1.3.60",
"@swc/jest": "^0.2.26",
"@testing-library/jest-dom": "^5.16.5",
"@swc/core": "^1.3.76",
"@swc/jest": "^0.2.28",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/svelte": "^3.2.2",
"@testing-library/user-event": "^14.4.3",
"@tsconfig/svelte": "^4.0.1",
Expand All @@ -52,25 +52,25 @@
"@types/jest": "^29.5.1",
"@types/node": "^18.16.14",
"@types/uglify-js": "^3.17.1",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"autoprefixer": "^10.4.14",
"cssnano": "^6.0.1",
"eslint": "^8.41.0",
"eslint-plugin-svelte": "^2.29.0",
"eslint": "^8.46.0",
"eslint-plugin-svelte": "^2.32.4",
"eslint-svelte3-preprocess": "^0.0.5",
"happy-dom": "^9.20.3",
"html-minifier": "^4.0.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"nodemon": "^2.0.22",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.23",
"postcss": "^8.4.27",
"postcss-import": "^15.1.0",
"rollup": "^3.23.0",
"rollup": "^3.28.0",
"rollup-plugin-svelte": "^7.1.4",
"sass": "^1.62.1",
"sass": "^1.65.1",
"svelte-check": "^3.3.2",
"svelte-jester": "^2.3.2",
"svelte-preprocess": "^5.0.3",
Expand Down
2 changes: 1 addition & 1 deletion resources/fixtures/data/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fixture: TableFixture = {
["0", "1", "2", "3", "4", "5", "6", "7", "8"], // Header.
["ch", "9999", "10000", "10", "1", "1", "1", "1", "1"],
["de", "9999", "9999", "10", "1", "1", "1", "1", "-1"],
["at", "9999", "1000", "10", "1", "1", "1", "1", "0"],
["no flag", "9999", "1000", "10", "1", "1", "1", "1", "0"],
],
"metaData": {
"cells": []
Expand Down
4 changes: 3 additions & 1 deletion src/components/table/cell/Cell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export let cell: Cell;

<Td type={cell.type} classes={cell.classes}>
{#if cell.type === 'country-flag-emoji'}
<img src={cell.label} alt="country flag {cell.value}" />
{#if cell.label !== ''}
<img src={cell.label} alt="country flag {cell.value}" />
{/if}
{:else}
<CellLabel label={cell.label} footnote={cell.footnote} />
{/if}
Expand Down
2 changes: 1 addition & 1 deletion src/migration-scripts/to-v2.0.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function migrate(uncastedItem: unknown): ReturnPayload {

interface ReturnPayload {
isChanged: boolean;
item: null | unknown;
item: unknown;
}

interface Item {
Expand Down
2 changes: 1 addition & 1 deletion src/migration-scripts/to-v3.0.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ interface Data {

interface ReturnPayload {
isChanged: boolean;
item: null | unknown;
item: unknown;
}
8 changes: 4 additions & 4 deletions src/routes/option-availability.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Boom from '@hapi/boom';
import Joi from 'joi';
import { getNumericColumns } from '../helpers/data.js';
import { getMinibarNumbersWithType } from '../helpers/minibars.js';
import { MINIBAR_TYPE, getMinibarNumbersWithType } from '../helpers/minibars.js';
import { hasCustomBuckets } from '../helpers/colorColumn.js';
import type { AvailabilityResponseObject, WebPayload } from '../interfaces';
import type { Request } from '@hapi/hapi';
Expand Down Expand Up @@ -58,7 +58,7 @@ export default {
const type = getMinibarNumbersWithType(item.data.table, item.options.minibar.selectedColumn).type;

return {
available: type === 'mixed' || type === 'positive',
available: type === MINIBAR_TYPE.MIXED || type === MINIBAR_TYPE.POSITIVE,
};
}
}
Expand All @@ -68,7 +68,7 @@ export default {
const type = getMinibarNumbersWithType(item.data.table, item.options.minibar.selectedColumn).type;

return {
available: type === 'mixed' || type === 'negative',
available: type === MINIBAR_TYPE.MIXED || type === MINIBAR_TYPE.NEGATIVE,
};
}
}
Expand All @@ -78,7 +78,7 @@ export default {
const type = getMinibarNumbersWithType(item.data.table, item.options.minibar.selectedColumn).type;

return {
available: type === 'mixed',
available: type === MINIBAR_TYPE.MIXED,
};
}
}
Expand Down
5 changes: 4 additions & 1 deletion tests/dom/formatting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ describe('formatting', () => {
// Countryflag tests.
// Flags are not in a label element therefore a diff selection.
elements(response, 'img').then(els => {
// There should be only 2 because one flag is incorrect and
// therefore not rendered.
expect(els.length).toBe(2);

expect(els[0].getAttribute('src')).toBe("https://q-server.st-cdn.nzz.ch/file/countryflags/svg/CH.svg");
expect(els[1].getAttribute('src')).toBe("https://q-server.st-cdn.nzz.ch/file/countryflags/svg/DE.svg");
expect(els[2].getAttribute('src')).toBe("https://q-server.st-cdn.nzz.ch/file/countryflags/svg/AT.svg");
});


Expand Down

0 comments on commit b95a3ae

Please sign in to comment.