Skip to content

Commit a270efd

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat/analytical-table-horizontal-virtualization
2 parents 4c4df2d + 07c5b6a commit a270efd

36 files changed

+309
-566
lines changed

.storybook/manager-head.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
<script data-ui5-config type="application/json">
2626
{
27-
"theme": "sap_fiori_3",
28-
"language": "EN"
27+
"theme": "sap_fiori_3"
2928
}
3029
</script>
3130

.storybook/preview-head.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
</style>
1919
<script data-ui5-config type="application/json">
2020
{
21-
"theme": "sap_fiori_3",
22-
"language": "EN"
21+
"theme": "sap_fiori_3"
2322
}
2423
</script>
2524

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.10.9](https://github.com/SAP/ui5-webcomponents-react/compare/v0.10.8...v0.10.9) (2020-09-23)
7+
8+
9+
### Bug Fixes
10+
11+
* **AnalyticalTable:** only apply selectedRowIds prop if its value has changed ([#685](https://github.com/SAP/ui5-webcomponents-react/issues/685)) ([8278f4b](https://github.com/SAP/ui5-webcomponents-react/commit/8278f4b4e9228c0748a68a7464178eadf41fec21))
12+
* **AnalyticalTable:** prevent an error in the storybook if loading prop was toggled ([#679](https://github.com/SAP/ui5-webcomponents-react/issues/679)) ([296d75b](https://github.com/SAP/ui5-webcomponents-react/commit/296d75be01ecdaff5ed4533fa0d0bac897507dc5))
13+
* **AnalyticalTable:** selectedRowIds can contain more than one digit per segment ([#672](https://github.com/SAP/ui5-webcomponents-react/issues/672)) ([6882524](https://github.com/SAP/ui5-webcomponents-react/commit/6882524e57aa66b9d20537458cc1884a34ced3e2))
14+
* **FilterBar:** Add missing onFiltersDialogSave event properties and fix manually controlled visibleInFilterBar prop ([#682](https://github.com/SAP/ui5-webcomponents-react/issues/682)) ([95a1078](https://github.com/SAP/ui5-webcomponents-react/commit/95a10785cd877168f3d7401bb2eae3d4797ac4ad))
15+
* **FilterBar:** after opening the filters-dialog, enable manual control of filters again ([#683](https://github.com/SAP/ui5-webcomponents-react/issues/683)) ([5727165](https://github.com/SAP/ui5-webcomponents-react/commit/5727165e945a1cd2a240cf620a0339513faed519))
16+
17+
18+
19+
20+
621
## [0.10.8](https://github.com/SAP/ui5-webcomponents-react/compare/v0.10.7...v0.10.8) (2020-09-02)
722

823

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.10.8",
5+
"version": "0.10.9",
66
"npmClient": "yarn",
77
"useWorkspaces": true,
88
"command": {

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,14 @@
5252
"@rollup/plugin-replace": "^2.3.2",
5353
"@storybook/storybook-deployer": "^2.8.6",
5454
"@testing-library/jest-dom": "^5.11.4",
55-
"@testing-library/react": "^11.0.0-beta.1",
55+
"@testing-library/react": "^11.0.2",
5656
"@types/enzyme": "^3.10.5",
5757
"@types/jest": "^26.0.8",
5858
"@types/react": "^16.9.34",
5959
"@types/react-dom": "^16.9.6",
60-
"@types/sinon": "^9.0.0",
6160
"@typescript-eslint/eslint-plugin": "^3.7.0",
6261
"@typescript-eslint/parser": "^3.7.0",
6362
"@ui5/webcomponents-tools": "^1.0.0-rc.8",
64-
"babel-jest": "^26.2.2",
6563
"babel-loader": "^8.1.0",
6664
"chalk": "^4.0.0",
6765
"dedent": "^0.7.0",
@@ -94,10 +92,7 @@
9492
"rimraf": "^3.0.1",
9593
"rollup": "^2.23.0",
9694
"rollup-plugin-terser": "^6.1.0",
97-
"shelljs": "^0.8.3",
98-
"sinon": "^9.0.2",
9995
"targz": "^1.0.1",
100-
"tmp": "^0.1.0",
10196
"typescript": "^3.9.7"
10297
},
10398
"resolutions": {

packages/base/src/Device/EventRegistry.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import * as sinon from 'sinon';
21
import { EventRegistry } from './EventRegistry';
32

43
describe('Device - Event Registry', () => {
54
test('Add, fire and remove event', () => {
6-
const callback = sinon.spy();
5+
const callback = jest.fn();
76
EventRegistry.attachEvent('test', callback);
87
expect(EventRegistry.mEventRegistry.hasOwnProperty('test')).toBe(true);
98
EventRegistry.fireEvent('test');
10-
expect(callback.called).toBe(true);
9+
expect(callback).toBeCalled();
1110
EventRegistry.detachEvent('test', callback);
1211
expect(EventRegistry.mEventRegistry.hasOwnProperty('test')).toBe(false);
1312
});
1413

1514
test('Add and remove events with different listeners', () => {
16-
const callback = sinon.spy();
15+
const callback = jest.fn();
1716
const a = {};
1817
const b = {};
1918
EventRegistry.attachEvent('test', callback, a);
@@ -26,7 +25,7 @@ describe('Device - Event Registry', () => {
2625
});
2726

2827
test('Remove not existing event should not crash', () => {
29-
const callback = sinon.spy();
28+
const callback = jest.fn();
3029
expect(() => {
3130
EventRegistry.detachEvent('test', callback);
3231
}).not.toThrow();

packages/base/src/Device/Media.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as sinon from 'sinon';
21
import { setupMatchMedia } from '../../../../config/jestsetup';
32
import { EventRegistry } from './EventRegistry';
43
import { Media, RANGESETS } from './Media';
@@ -45,12 +44,12 @@ describe('Device - Media', () => {
4544

4645
test('Attach, fire and Detach Event', () => {
4746
const media = new Media(defaultSupportInstance);
48-
const callback = sinon.spy();
47+
const callback = jest.fn();
4948
// @ts-ignore
5049
media.attachHandler(callback, this);
5150
expect(EventRegistry.mEventRegistry.hasOwnProperty('media_Std'));
5251
EventRegistry.fireEvent('media_Std');
53-
expect(callback.called).toBe(true);
52+
expect(callback).toBeCalled();
5453
// @ts-ignore
5554
media.detachHandler(callback, this);
5655
expect(EventRegistry.mEventRegistry.hasOwnProperty('media_Std')).toBe(false);

packages/base/src/Device/Orientation.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import * as sinon from 'sinon';
21
import { EventRegistry } from './EventRegistry';
32
import { Orientation } from './Orientation';
43

54
describe('Device - Orientation', () => {
65
test('Add and remove handler', () => {
76
const instance = new Orientation();
8-
const callback = sinon.spy();
7+
const callback = jest.fn();
98
// @ts-ignore
109
instance.attachHandler(callback, this);
1110
// @ts-ignore

packages/base/src/Device/Resize.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import * as sinon from 'sinon';
21
import { EventRegistry } from './EventRegistry';
32
import { Resize } from './Resize';
43

54
describe('Device - Resize', () => {
65
test('Add and remove handler', () => {
76
const instance = new Resize();
8-
const callback = sinon.spy();
7+
const callback = jest.fn();
98
// @ts-ignore
109
instance.attachHandler(callback, this);
1110
// @ts-ignore

packages/base/src/utils/Logger.test.ts

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
import { modifyObjectProperty } from '@shared/tests/utils';
2-
import * as sinon from 'sinon';
32
import { LOG_LEVEL, Logger } from './Logger';
43

54
describe('Logger', () => {
65
test('fatal', () => {
7-
const spy = sinon.spy(console, 'error');
6+
const spy = jest.spyOn(console, 'error').mockImplementation();
87
Logger.log(LOG_LEVEL.FATAL, 'Test');
9-
expect(spy.called).toBe(true);
10-
spy.restore();
8+
expect(spy).toBeCalled();
9+
spy.mockRestore();
1110
});
1211
test('error', () => {
13-
const spy = sinon.spy(console, 'error');
12+
const spy = jest.spyOn(console, 'error').mockImplementation();
1413
Logger.log(LOG_LEVEL.ERROR, 'Test');
15-
expect(spy.called).toBe(true);
16-
spy.restore();
14+
expect(spy).toBeCalled();
15+
spy.mockRestore();
1716
});
1817
test('warning', () => {
19-
const spy = sinon.spy(console, 'warn');
18+
const spy = jest.spyOn(console, 'warn').mockImplementation();
2019
Logger.log(LOG_LEVEL.WARNING, 'Test');
21-
expect(spy.called).toBe(true);
22-
spy.restore();
20+
expect(spy).toBeCalled();
21+
spy.mockRestore();
2322
});
2423
test('info', () => {
25-
const spy = sinon.spy(console, 'info');
24+
const spy = jest.spyOn(console, 'info').mockImplementation();
2625
Logger.log(LOG_LEVEL.INFO, 'Test');
27-
expect(spy.called).toBe(true);
28-
spy.restore();
26+
expect(spy).toBeCalled();
27+
spy.mockRestore();
2928
});
3029
test('debug', () => {
31-
const spy = sinon.spy(console, 'debug');
30+
const spy = jest.spyOn(console, 'debug').mockImplementation();
3231
Logger.log(LOG_LEVEL.DEBUG, 'Test');
33-
expect(spy.called).toBe(true);
34-
spy.restore();
32+
expect(spy).toBeCalled();
33+
spy.mockRestore();
3534
});
3635
test('trace', () => {
37-
const spy = sinon.spy(console, 'trace');
36+
const spy = jest.spyOn(console, 'trace').mockImplementation();
3837
Logger.log(LOG_LEVEL.TRACE, 'Test');
39-
expect(spy.called).toBe(true);
40-
spy.restore();
38+
expect(spy).toBeCalled();
39+
spy.mockRestore();
4140
});
4241

4342
test('Not to crash if no console', () => {
@@ -51,40 +50,40 @@ describe('Logger', () => {
5150
const { debug, trace } = window.console;
5251
modifyObjectProperty(window.console, 'debug', false);
5352
modifyObjectProperty(window.console, 'trace', false);
54-
const spy = sinon.spy(console, 'log');
53+
const spy = jest.spyOn(console, 'log').mockImplementation();
5554
// @ts-ignore
5655
Logger.trace();
57-
expect(spy.called).toBe(true);
56+
expect(spy).toBeCalled();
5857
Logger.debug('debug');
59-
expect(spy.calledTwice).toBe(true);
60-
spy.restore();
58+
expect(spy).toBeCalledTimes(2);
59+
spy.mockRestore();
6160
modifyObjectProperty(window.console, 'debug', debug);
6261
modifyObjectProperty(window.console, 'trace', trace);
6362
});
6463
test('iOS specific', () => {
6564
const { info } = window.console;
6665
modifyObjectProperty(window.console, 'info', false);
67-
const spy = sinon.spy(console, 'log');
66+
const spy = jest.spyOn(console, 'log').mockImplementation();
6867
Logger.info('info');
69-
expect(spy.called).toBe(true);
70-
spy.restore();
68+
expect(spy).toBeCalled();
69+
spy.mockRestore();
7170
modifyObjectProperty(window.console, 'info', info);
7271
});
7372

7473
test('Public API', () => {
75-
const spy = sinon.spy(Logger, 'log');
74+
const spy = jest.spyOn(Logger, 'log').mockImplementation();
7675
Logger.fatal('fatal', 'test');
77-
expect(spy.calledWith(LOG_LEVEL.FATAL, 'fatal', 'test')).toBe(true);
76+
expect(spy).toBeCalledWith(LOG_LEVEL.FATAL, 'fatal', 'test');
7877
Logger.error('error', 'test');
79-
expect(spy.calledWith(LOG_LEVEL.ERROR, 'error', 'test')).toBe(true);
78+
expect(spy).toBeCalledWith(LOG_LEVEL.ERROR, 'error', 'test');
8079
Logger.warning('warning', 'test');
81-
expect(spy.calledWith(LOG_LEVEL.WARNING, 'warning', 'test')).toBe(true);
80+
expect(spy).toBeCalledWith(LOG_LEVEL.WARNING, 'warning', 'test');
8281
Logger.info('info', 'test');
83-
expect(spy.calledWith(LOG_LEVEL.INFO, 'info', 'test')).toBe(true);
82+
expect(spy).toBeCalledWith(LOG_LEVEL.INFO, 'info', 'test');
8483
Logger.debug('debug', 'test');
85-
expect(spy.calledWith(LOG_LEVEL.DEBUG, 'debug', 'test')).toBe(true);
84+
expect(spy).toBeCalledWith(LOG_LEVEL.DEBUG, 'debug', 'test');
8685
Logger.trace('trace', 'test');
87-
expect(spy.calledWith(LOG_LEVEL.TRACE, 'trace', 'test')).toBe(true);
86+
expect(spy).toBeCalledWith(LOG_LEVEL.TRACE, 'trace', 'test');
8887
});
8988

9089
test('Custom Component', () => {

packages/charts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"dependencies": {
2222
"@babel/runtime": "7.11.0",
23-
"lodash.debounce": "^4.0.8",
23+
"lodash": "^4.17.20",
2424
"react-content-loader": "5.1.0",
2525
"recharts": "2.0.0-beta.6"
2626
},

packages/charts/src/hooks/useObserveXAxisHeights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import debounce from 'lodash.debounce';
1+
import debounce from 'lodash/debounce';
22
import { RefObject, useEffect, useRef, useState } from 'react';
33

44
const defaultAxisHeight = 30;

packages/main/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.10.9](https://github.com/SAP/ui5-webcomponents-react/compare/v0.10.8...v0.10.9) (2020-09-23)
7+
8+
9+
### Bug Fixes
10+
11+
* **AnalyticalTable:** only apply selectedRowIds prop if its value has changed ([#685](https://github.com/SAP/ui5-webcomponents-react/issues/685)) ([8278f4b](https://github.com/SAP/ui5-webcomponents-react/commit/8278f4b4e9228c0748a68a7464178eadf41fec21))
12+
* **AnalyticalTable:** prevent an error in the storybook if loading prop was toggled ([#679](https://github.com/SAP/ui5-webcomponents-react/issues/679)) ([296d75b](https://github.com/SAP/ui5-webcomponents-react/commit/296d75be01ecdaff5ed4533fa0d0bac897507dc5))
13+
* **AnalyticalTable:** selectedRowIds can contain more than one digit per segment ([#672](https://github.com/SAP/ui5-webcomponents-react/issues/672)) ([6882524](https://github.com/SAP/ui5-webcomponents-react/commit/6882524e57aa66b9d20537458cc1884a34ced3e2))
14+
* **FilterBar:** Add missing onFiltersDialogSave event properties and fix manually controlled visibleInFilterBar prop ([#682](https://github.com/SAP/ui5-webcomponents-react/issues/682)) ([95a1078](https://github.com/SAP/ui5-webcomponents-react/commit/95a10785cd877168f3d7401bb2eae3d4797ac4ad))
15+
* **FilterBar:** after opening the filters-dialog, enable manual control of filters again ([#683](https://github.com/SAP/ui5-webcomponents-react/issues/683)) ([5727165](https://github.com/SAP/ui5-webcomponents-react/commit/5727165e945a1cd2a240cf620a0339513faed519))
16+
17+
18+
19+
20+
621
## [0.10.8](https://github.com/SAP/ui5-webcomponents-react/compare/v0.10.7...v0.10.8) (2020-09-02)
722

823

packages/main/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ui5/webcomponents-react",
3-
"version": "0.10.8",
3+
"version": "0.10.9",
44
"description": "React Wrapper for UI5 Web Components and additional components",
55
"main": "index.cjs.js",
66
"module": "index.esm.js",
@@ -33,7 +33,7 @@
3333
"dependencies": {
3434
"@babel/runtime": "7.11.0",
3535
"@ui5/webcomponents-react-base": "^0.10.1",
36-
"lodash.debounce": "^4.0.8",
36+
"lodash": "^4.17.20",
3737
"react-content-loader": "5.1.0",
3838
"react-jss": "10.1.1",
3939
"react-table": "7.5.0",

packages/main/src/components/AnalyticalTable/AnalyticalTable.stories.mdx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Title, Subtitle, Primary, Description, Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1+
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
22
import { AnalyticalTable } from '@ui5/webcomponents-react/lib/AnalyticalTable';
33
import { createSelectArgTypes } from '../../../../../shared/stories/createSelectArgTypes';
44
import { TableScaleWidthMode } from '@ui5/webcomponents-react/lib/TableScaleWidthMode';
@@ -10,19 +10,15 @@ import '@ui5/webcomponents-icons/dist/icons/delete';
1010
import '@ui5/webcomponents-icons/dist/icons/edit';
1111
import '@ui5/webcomponents-icons/dist/icons/settings';
1212
import { Button } from '@ui5/webcomponents-react/lib/Button';
13-
import { Text } from '@ui5/webcomponents-react/lib/Text';
1413
import { FlexBox } from '@ui5/webcomponents-react/lib/FlexBox';
1514
import { TextAlign } from '@ui5/webcomponents-react/lib/TextAlign';
16-
import { FlexBoxAlignItems } from '@ui5/webcomponents-react/lib/FlexBoxAlignItems';
17-
import { FlexBoxJustifyContent } from '@ui5/webcomponents-react/lib/FlexBoxJustifyContent';
1815
import { DefaultLoadingComponent } from './defaults/LoadingComponent';
1916
import { DefaultNoDataComponent } from './defaults/NoDataComponent';
2017

2118
<Meta
2219
title="Components / AnalyticalTable"
2320
component={AnalyticalTable}
2421
args={{
25-
dataTree: generateData(20, true),
2622
data: generateData(1000),
2723
columns: [
2824
{
@@ -110,7 +106,6 @@ import { DefaultNoDataComponent } from './defaults/NoDataComponent';
110106
}}
111107
argTypes={{
112108
ref: { type: null },
113-
dataTree: { type: null },
114109
data: { type: null },
115110
columns: { type: null },
116111
reactTableOptions: { type: null },
@@ -277,12 +272,12 @@ This even works if you resize the browser window!
277272
## Tree Table
278273

279274
<Canvas>
280-
<Story name="Tree Table">
275+
<Story name="Tree Table" args={{ data: generateData(20, true) }}>
281276
{(args) => (
282277
<AnalyticalTable
283278
{...args}
284279
title={args.title}
285-
data={args.dataTree}
280+
data={args.data}
286281
columns={args.columns}
287282
loading={args.loading}
288283
sortable={args.sortable}

0 commit comments

Comments
 (0)