Skip to content

Commit

Permalink
Update ui npm deps to latest
Browse files Browse the repository at this point in the history
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
  • Loading branch information
saswatamcode committed Feb 19, 2021
1 parent b30a135 commit 801c25f
Show file tree
Hide file tree
Showing 6 changed files with 2,994 additions and 2,410 deletions.
112 changes: 56 additions & 56 deletions pkg/ui/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,49 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.14",
"@fortawesome/free-solid-svg-icons": "^5.7.1",
"@fortawesome/react-fontawesome": "^0.1.4",
"@reach/router": "^1.2.1",
"@testing-library/react-hooks": "^3.1.1",
"@types/jest": "^24.0.20",
"@types/jquery": "^3.5.1",
"@types/node": "^12.11.1",
"@types/reach__router": "^1.2.6",
"@types/react": "^16.8.2",
"@types/react-copy-to-clipboard": "^4.3.0",
"@types/react-dom": "^16.8.0",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
"@reach/router": "^1.3.4",
"@testing-library/react-hooks": "^5.0.3",
"@types/jest": "^26.0.20",
"@types/jquery": "^3.5.5",
"@types/node": "^14.14.30",
"@types/reach__router": "^1.3.7",
"@types/react": "^17.0.2",
"@types/react-copy-to-clipboard": "^5.0.0",
"@types/react-dom": "^17.0.1",
"@types/react-resize-detector": "^4.0.2",
"@types/react-select": "^3.0.20",
"@types/sanitize-html": "^1.20.2",
"bootstrap": "^4.2.1",
"@types/react-select": "^4.0.13",
"@types/sanitize-html": "^1.27.1",
"bootstrap": "^4.6.0",
"css.escape": "^1.5.1",
"downshift": "^3.2.2",
"enzyme-to-json": "^3.4.3",
"downshift": "^6.1.0",
"enzyme-to-json": "^3.6.1",
"fuzzy": "^0.1.3",
"i": "^0.3.6",
"jest-fetch-mock": "^2.1.2",
"jest-fetch-mock": "^3.0.3",
"jquery": "^3.5.1",
"jquery.flot.tooltip": "^0.9.0",
"jsdom": "^15.2.0",
"moment": "^2.24.0",
"moment-timezone": "^0.5.23",
"popper.js": "^1.14.3",
"query-string": "^6.13.1",
"rc-slider": "^9.3.1",
"react": "^16.7.0",
"react-copy-to-clipboard": "^5.0.1",
"react-dom": "^16.7.0",
"jsdom": "^16.4.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"popper.js": "^1.16.1",
"query-string": "^6.14.0",
"rc-slider": "^9.7.1",
"react": "^16.14.0",
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "^16.14.0",
"react-resize-detector": "^4.2.1",
"react-scripts": "^3.4.0",
"react-select": "^3.1.0",
"react-test-renderer": "^16.9.0",
"reactstrap": "^8.0.1",
"sanitize-html": "^1.20.1",
"tempusdominus-bootstrap-4": "^5.1.2",
"tempusdominus-core": "^5.0.3",
"typescript": "^3.3.3",
"use-query-params": "^1.1.6"
"react-scripts": "^3.4.4",
"react-select": "^4.1.0",
"react-test-renderer": "^16.14.0",
"reactstrap": "^8.9.0",
"sanitize-html": "^2.3.2",
"tempusdominus-bootstrap-4": "^5.39.0",
"tempusdominus-core": "^5.19.0",
"typescript": "^4.1.5",
"use-query-params": "^1.1.9"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -68,29 +68,29 @@
"not op_mini all"
],
"devDependencies": {
"@types/enzyme": "^3.10.3",
"@types/enzyme-adapter-react-16": "^1.0.5",
"@types/flot": "0.0.31",
"@types/moment-timezone": "^0.5.10",
"@types/reactstrap": "^8.0.5",
"@types/sinon": "^7.5.0",
"@typescript-eslint/eslint-plugin": "2.x",
"@typescript-eslint/parser": "2.x",
"@types/enzyme": "^3.10.8",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/flot": "^0.0.31",
"@types/moment-timezone": "^0.5.30",
"@types/reactstrap": "^8.7.2",
"@types/sinon": "^9.0.10",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"babel-eslint": "10.x",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "6.x",
"eslint-config-prettier": "^6.4.0",
"eslint-config-react-app": "^5.0.2",
"eslint-plugin-flowtype": "3.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "7.x",
"eslint-plugin-react-hooks": "1.x",
"eslint-config-prettier": "^7.2.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest-fetch-mock": "^2.1.2",
"prettier": "^1.18.2",
"sinon": "^7.5.0"
"prettier": "^2.2.1",
"sinon": "^9.2.4"
},
"proxy": "http://localhost:10902",
"jest": {
Expand Down
6 changes: 3 additions & 3 deletions pkg/ui/react-app/src/pages/graph/ExpressionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class ExpressionInput extends Component<ExpressionInputProps, ExpressionInputSta
this.setValue(this.exprInputRef.current!.value);
};

setValue = (value: string) => {
setValue = (value: string | null) => {
const { onExpressionChange } = this.props;
onExpressionChange(value);
onExpressionChange(value as string);
this.setState({ height: 'auto' }, this.setHeight);
};

Expand Down Expand Up @@ -130,7 +130,7 @@ class ExpressionInput extends Component<ExpressionInputProps, ExpressionInputSta
const { height } = this.state;
return (
<Downshift onSelect={this.setValue}>
{downshift => (
{(downshift) => (
<div>
<InputGroup className="expression-input">
<InputGroupAddon addonType="prepend">
Expand Down
6 changes: 3 additions & 3 deletions pkg/ui/react-app/src/pages/graph/GraphHelpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatValue, getColors, parseValue, getOptions } from './GraphHelpers';
import moment from 'moment';
import moment from 'moment-timezone';
require('../../vendor/flot/jquery.flot'); // need for $.colors

describe('GraphHelpers', () => {
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('GraphHelpers', () => {
{ input: 2e-24, output: '2.00y' },
{ input: 2e-25, output: '0.20y' },
{ input: 2e-26, output: '0.02y' },
].map(t => {
].map((t) => {
expect(formatValue(t.input)).toBe(t.output);
});
});
Expand All @@ -80,7 +80,7 @@ describe('GraphHelpers', () => {
};
expect(
getColors(data)
.map(c => c.toString())
.map((c) => c.toString())
.join(',')
).toEqual(
'rgb(237,194,64),rgb(175,216,248),rgb(203,75,75),rgb(77,167,77),rgb(148,64,237),rgb(189,155,51),rgb(140,172,198)'
Expand Down
7 changes: 4 additions & 3 deletions pkg/ui/react-app/src/pages/graph/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class Panel extends Component<PanelProps & PathPrefixProps, PanelState> {
});

// Add storeMatches to query params.
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
this.props.options.storeMatches?.forEach((store: Store) =>
params.append('storeMatch[]', `{__address__="${store.name}"}`)
);
Expand Down Expand Up @@ -175,8 +176,8 @@ class Panel extends Component<PanelProps & PathPrefixProps, PanelState> {
credentials: 'same-origin',
signal: abortController.signal,
})
.then(resp => resp.json())
.then(json => {
.then((resp) => resp.json())
.then((json) => {
if (json.status !== 'success') {
throw new Error(json.error || 'invalid response JSON');
}
Expand Down Expand Up @@ -208,7 +209,7 @@ class Panel extends Component<PanelProps & PathPrefixProps, PanelState> {
});
this.abortInFlightFetch = null;
})
.catch(error => {
.catch((error) => {
if (error.name === 'AbortError') {
// Aborts are expected, don't show an error for them.
return;
Expand Down
25 changes: 21 additions & 4 deletions pkg/ui/react-app/src/thanos/pages/blocks/Blocks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { mount, ReactWrapper } from 'enzyme';
import { FetchMock } from 'jest-fetch-mock/types';
import { UncontrolledAlert } from 'reactstrap';
import Blocks from './Blocks';
import { QueryParamProvider } from 'use-query-params';
import { SourceView } from './SourceView';
import { sampleAPIResponse } from './__testdata__/testdata';
import { act } from 'react-dom/test-utils';
Expand All @@ -22,7 +23,11 @@ describe('Blocks', () => {

it('renders sources', async () => {
await act(async () => {
blocks = mount(<Blocks />);
blocks = mount(
<QueryParamProvider>
<Blocks />
</QueryParamProvider>
);
});
blocks.update();
expect(mock).toHaveBeenCalledWith('/api/v1/blocks?view=global', { cache: 'no-store', credentials: 'same-origin' });
Expand All @@ -33,7 +38,11 @@ describe('Blocks', () => {

it('fetched data with different view', async () => {
await act(async () => {
blocks = mount(<Blocks view="loaded" />);
blocks = mount(
<QueryParamProvider>
<Blocks view="loaded" />
</QueryParamProvider>
);
});
blocks.update();
expect(mock).toHaveBeenCalledWith('/api/v1/blocks?view=loaded', { cache: 'no-store', credentials: 'same-origin' });
Expand All @@ -56,7 +65,11 @@ describe('Blocks', () => {

let blocks: any;
await act(async () => {
blocks = mount(<Blocks />);
blocks = mount(
<QueryParamProvider>
<Blocks />
</QueryParamProvider>
);
});
blocks.update();

Expand All @@ -74,7 +87,11 @@ describe('Blocks', () => {

let blocks: any;
await act(async () => {
blocks = mount(<Blocks />);
blocks = mount(
<QueryParamProvider>
<Blocks />
</QueryParamProvider>
);
});
blocks.update();

Expand Down
Loading

0 comments on commit 801c25f

Please sign in to comment.