Skip to content

Commit 1be775e

Browse files
authored
Merge pull request #4 from skbkontur/update-react
update react
2 parents 53ae14f + cb16649 commit 1be775e

File tree

15 files changed

+3432
-4709
lines changed

15 files changed

+3432
-4709
lines changed

Cassandra.DistributedTaskQueue.TestApi/Cassandra.DistributedTaskQueue.TestApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="GroboContainer" Version="1.2.45" />
13+
<PackageReference Include="GroboContainer" Version="1.2.52" />
1414
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.7" />
1515
<PackageReference Include="SkbKontur.TypeScript.ContractGenerator" Version="2.0.81" />
1616
</ItemGroup>

Cassandra.DistributedTaskQueue.Tests/Cassandra.DistributedTaskQueue.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="FluentAssertions" Version="5.10.3" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
13-
<PackageReference Include="NUnit" Version="3.12.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
13+
<PackageReference Include="NUnit" Version="3.13.0" />
1414
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1515
</ItemGroup>
1616

Cassandra.DistributedTaskQueue/Cassandra.DistributedTaskQueue.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageReference Include="GroBuf" Version="1.5.5" />
1212
<PackageReference Include="SkbKontur.Cassandra.DistributedLock" Version="2.2.8" />
1313
<PackageReference Include="SkbKontur.Cassandra.GlobalTimestamp" Version="1.0.8" />
14-
<PackageReference Include="SkbKontur.Cassandra.ThriftClient" Version="2.4.9" />
14+
<PackageReference Include="SkbKontur.Cassandra.ThriftClient" Version="2.4.23" />
1515
<PackageReference Include="SkbKontur.Graphite.Client" Version="1.3.16" />
1616
</ItemGroup>
1717

cassandra-distributed-task-queue-ui/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
],
4343
"@typescript-eslint/explicit-member-accessibility": "error",
4444
"@typescript-eslint/explicit-function-return-type": "off",
45-
"react/no-deprecated": "warn"
45+
"react/no-deprecated": "warn",
46+
"react/prop-types": "off"
4647
},
4748
"ignorePatterns": ["dist/", "react-selenium-testing.js"],
4849
"settings": {

cassandra-distributed-task-queue-ui/package.json

Lines changed: 59 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"build:copy:meta": "copyfiles --flat package.json \"../*.md\" ../LICENSE dist",
2828
"build:pack": "cd dist && npm pack",
2929
"build:types": "dotnet ts-gen --assembly ./../Cassandra.DistributedTaskQueue.TestApi/bin/netcoreapp3.1/win-x64/SkbKontur.Cassandra.DistributedTaskQueue.TestApi.dll --outputDir ./src/Domain/Api --nullabilityMode Pessimistic",
30-
"start": "webpack-dev-server --env.api=fake",
31-
"start:prod": "webpack-dev-server --env.api=real",
30+
"start": "webpack serve --env api=fake",
31+
"start:prod": "webpack serve --env api=real",
3232
"storybook": "start-storybook -p 6006 -s .",
3333
"lint": "run-s \"lint:*\"",
3434
"lint:tsc": "tsc --noEmit",
@@ -39,79 +39,78 @@
3939
"peerDependencies": {
4040
"@skbkontur/react-icons": ">=3 <=4",
4141
"@skbkontur/react-ui": ">=2 <3",
42-
"react": ">=15 <=16",
43-
"react-dom": ">=15 <=16",
42+
"react": ">=16 <=17",
43+
"react-dom": ">=16 <=17",
4444
"react-router": ">=4 <=5",
4545
"react-router-dom": ">=4 <=5"
4646
},
4747
"dependencies": {
4848
"@skbkontur/react-stack-layout": "^1.0.3",
49-
"@skbkontur/react-ui-validations": "^1.1.4",
49+
"@skbkontur/react-ui-validations": "^1.4.0",
5050
"copy-to-clipboard": "^3.3.1",
51-
"decimal.js": "^10.2.0",
52-
"lodash": "^4.17.15",
53-
"moment": "^2.24.0",
54-
"qs": "^6.9.3",
55-
"whatwg-fetch": "^3.0.0"
51+
"decimal.js": "^10.2.1",
52+
"lodash": "^4.17.20",
53+
"moment": "^2.29.1",
54+
"qs": "^6.9.6",
55+
"whatwg-fetch": "^3.5.0"
5656
},
5757
"devDependencies": {
58-
"@babel/core": "^7.9.0",
59-
"@babel/plugin-proposal-class-properties": "^7.8.3",
60-
"@babel/plugin-proposal-object-rest-spread": "^7.9.5",
61-
"@babel/plugin-transform-runtime": "^7.9.0",
62-
"@babel/preset-env": "^7.9.5",
63-
"@babel/preset-react": "^7.9.4",
64-
"@babel/preset-typescript": "^7.9.0",
65-
"@babel/runtime": "^7.9.2",
66-
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.2",
67-
"@skbkontur/react-icons": "^4.3.0",
68-
"@skbkontur/react-ui": "2.0.0",
69-
"@storybook/addon-actions": "^6.0.0-beta.32",
70-
"@storybook/addons": "^6.0.0-beta.32",
71-
"@storybook/react": "^6.0.0-beta.32",
72-
"@types/chai": "^4.2.11",
73-
"@types/lodash": "^4.14.150",
74-
"@types/mocha": "^7.0.2",
75-
"@types/qs": "^6.9.1",
76-
"@types/react": "^16.9.34",
77-
"@types/react-dom": "^16.9.7",
78-
"@types/react-router": "^5.1.7",
79-
"@types/react-router-dom": "^5.1.5",
58+
"@babel/core": "^7.12.10",
59+
"@babel/plugin-proposal-class-properties": "^7.12.1",
60+
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
61+
"@babel/plugin-transform-runtime": "^7.12.10",
62+
"@babel/preset-env": "^7.12.11",
63+
"@babel/preset-react": "^7.12.10",
64+
"@babel/preset-typescript": "^7.12.7",
65+
"@babel/runtime": "^7.12.5",
66+
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
67+
"@skbkontur/react-icons": "^4.4.0",
68+
"@skbkontur/react-ui": "^2.13.0",
69+
"@storybook/addon-actions": "^6.1.15",
70+
"@storybook/addons": "^6.1.15",
71+
"@storybook/react": "^6.1.15",
72+
"@types/chai": "^4.2.14",
73+
"@types/lodash": "^4.14.168",
74+
"@types/mocha": "^8.2.0",
75+
"@types/qs": "^6.9.5",
76+
"@types/react": "^17.0.0",
77+
"@types/react-dom": "^17.0.0",
78+
"@types/react-router": "^5.1.11",
79+
"@types/react-router-dom": "^5.1.7",
8080
"@types/storybook-react-router": "^1.0.1",
81-
"@typescript-eslint/eslint-plugin": "^3.3.0",
82-
"@typescript-eslint/parser": "^3.3.0",
83-
"babel-loader": "^8.1.0",
81+
"@typescript-eslint/eslint-plugin": "^4.14.1",
82+
"@typescript-eslint/parser": "^4.14.1",
83+
"babel-loader": "^8.2.2",
8484
"chai": "^4.2.0",
85-
"copyfiles": "^2.2.0",
86-
"css-loader": "^3.5.3",
87-
"eslint": "^7.3.0",
88-
"eslint-config-prettier": "^6.11.0",
85+
"copyfiles": "^2.4.1",
86+
"css-loader": "^5.0.1",
87+
"eslint": "^7.18.0",
88+
"eslint-config-prettier": "^7.2.0",
8989
"eslint-import-resolver-node": "^0.3.4",
90-
"eslint-plugin-import": "^2.21.2",
91-
"eslint-plugin-prettier": "^3.1.4",
92-
"eslint-plugin-react": "^7.20.0",
93-
"less": "^3.11.1",
94-
"less-loader": "^6.0.0",
95-
"mocha": "^7.1.2",
96-
"nerdbank-gitversioning": "^3.1.74",
90+
"eslint-plugin-import": "^2.22.1",
91+
"eslint-plugin-prettier": "^3.3.1",
92+
"eslint-plugin-react": "^7.22.0",
93+
"less": "^4.1.0",
94+
"less-loader": "^7.3.0",
95+
"mocha": "^8.2.1",
9796
"npm-run-all": "^4.1.5",
98-
"prettier": "^2.0.5",
99-
"react": "^16.13.1",
100-
"react-dom": "^16.13.1",
101-
"react-refresh": "^0.8.3",
102-
"react-router": "^5.1.2",
103-
"react-router-dom": "^5.1.2",
97+
"prettier": "^2.2.1",
98+
"react": "^17.0.1",
99+
"react-dom": "^17.0.1",
100+
"react-refresh": "^0.9.0",
101+
"react-router": "^5.2.0",
102+
"react-router-dom": "^5.2.0",
104103
"rimraf": "^3.0.2",
105104
"storybook-react-router": "^1.0.8",
106-
"style-loader": "^1.2.0",
107-
"stylelint": "^13.6.1",
105+
"style-loader": "^2.0.0",
106+
"stylelint": "^13.9.0",
108107
"stylelint-config-css-modules": "^2.2.0",
109108
"stylelint-config-standard": "^20.0.0",
110-
"tslib": "^2.0.0",
111-
"typescript": "^3.9.5",
112-
"url-loader": "^4.1.0",
113-
"webpack": "^4.43.0",
114-
"webpack-cli": "^3.3.11",
115-
"webpack-dev-server": "^3.10.3"
109+
"tslib": "^2.1.0",
110+
"typescript": "^4.1.3",
111+
"url-loader": "^4.1.1",
112+
"webpack": "^4.46.0",
113+
"webpack-cli": "^4.4.0",
114+
"webpack-dev-server": "^3.11.2"
116115
}
117116
}

cassandra-distributed-task-queue-ui/src/Domain/DataTypes/DateTimeRange.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@ export interface DateTimeRange {
44
lowerBound: Nullable<Date>;
55
upperBound: Nullable<Date>;
66
}
7-
8-
export interface ICanBeValidated {
9-
focus: () => void;
10-
}

cassandra-distributed-task-queue-ui/src/components/Accordion/Accordion.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,27 @@ export class Accordion extends React.Component<TaskAccordionProps, TaskAccordion
5555
}
5656
}
5757

58-
public shouldComponentUpdate(
59-
nextProps: Readonly<TaskAccordionProps>,
60-
nextState: Readonly<TaskAccordionState>,
61-
nextContext: any
62-
): boolean {
58+
public shouldComponentUpdate(nextProps: TaskAccordionProps, nextState: TaskAccordionState): boolean {
6359
const isValueChanged = !isEqual(this.props.value, nextProps.value);
6460
const isForceCollapsedChanged = this.props._internalForceCollapsed !== nextProps._internalForceCollapsed;
6561
const isDefaultCollapsedChanged = this.props.defaultCollapsed !== nextProps.defaultCollapsed;
6662
const isStateChanged = !isEqual(this.state, nextState);
6763
return isValueChanged || isForceCollapsedChanged || isDefaultCollapsedChanged || isStateChanged;
6864
}
6965

70-
public componentWillReceiveProps(nextProps: Readonly<TaskAccordionProps>, nextContext: any): void {
71-
const isForcedRecursively = nextProps._internalForceCollapsed !== undefined;
72-
if (isForcedRecursively && nextProps._internalForceCollapsed !== this.props._internalForceCollapsed) {
66+
public componentDidUpdate(prevProps: TaskAccordionProps): void {
67+
const isForcedRecursively = this.props._internalForceCollapsed !== undefined;
68+
if (isForcedRecursively && this.props._internalForceCollapsed !== prevProps._internalForceCollapsed) {
7369
this.setState({
74-
collapsedSelf: nextProps._internalForceCollapsed as boolean,
75-
collapsedRecursive: nextProps._internalForceCollapsed as boolean,
70+
collapsedSelf: this.props._internalForceCollapsed as boolean,
71+
collapsedRecursive: this.props._internalForceCollapsed as boolean,
7672
isForced: true,
7773
});
7874
}
79-
if (nextProps.defaultCollapsed !== this.props.defaultCollapsed) {
75+
if (prevProps.defaultCollapsed !== this.props.defaultCollapsed) {
8076
this.setState({
81-
collapsedSelf: nextProps.defaultCollapsed as boolean,
82-
collapsedRecursive: nextProps.defaultCollapsed as boolean,
77+
collapsedSelf: this.props.defaultCollapsed as boolean,
78+
collapsedRecursive: this.props.defaultCollapsed as boolean,
8379
isForced: true,
8480
});
8581
}

cassandra-distributed-task-queue-ui/src/components/DateTimeRangePicker/DatePicker.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DatePicker as DefaultDatePicker } from "@skbkontur/react-ui";
22
import moment from "moment";
33
import React from "react";
44

5-
import { ICanBeValidated, RussianDateFormat } from "../../Domain/DataTypes/DateTimeRange";
5+
import { RussianDateFormat } from "../../Domain/DataTypes/DateTimeRange";
66
import { Time, TimeZone } from "../../Domain/DataTypes/Time";
77
import { DateUtils } from "../../Domain/Utils/DateUtils";
88
import { StringUtils } from "../../Domain/Utils/StringUtils";
@@ -34,7 +34,7 @@ const DatePickerDefaultProps = {
3434

3535
const defaultTime = "00:00";
3636

37-
export class DatePicker extends React.Component<DatePickerProps, DatePickerState> implements ICanBeValidated {
37+
export class DatePicker extends React.Component<DatePickerProps, DatePickerState> {
3838
public state = {
3939
date: "",
4040
};
@@ -43,15 +43,13 @@ export class DatePicker extends React.Component<DatePickerProps, DatePickerState
4343
timeZone: TimeUtils.TimeZones.UTC,
4444
};
4545

46-
private datePicker: Nullable<DefaultDatePicker>;
47-
48-
public componentDidMount() {
46+
public componentDidMount(): void {
4947
const { value, timeZone } = this.props;
5048
const stringifiedDate = this.convertDateToStringWithTimezone(value, timeZone);
5149
this.setState({ date: stringifiedDate });
5250
}
5351

54-
public componentDidUpdate(prevProps: DatePickerProps, prevState: DatePickerState) {
52+
public componentDidUpdate(prevProps: DatePickerProps): void {
5553
const { value, timeZone } = this.props;
5654
if (prevProps.value !== this.props.value) {
5755
const stringifiedDate = this.convertDateToStringWithTimezone(value, timeZone);
@@ -68,19 +66,12 @@ export class DatePicker extends React.Component<DatePickerProps, DatePickerState
6866
{...this.props}
6967
maxDate={this.convertDateToStringWithTimezone(maxDate, timeZone)}
7068
minDate={this.convertDateToStringWithTimezone(minDate, timeZone)}
71-
ref={el => (this.datePicker = el)}
7269
value={this.state.date}
7370
onValueChange={this.handleChange}
7471
/>
7572
);
7673
}
7774

78-
public focus = (): void => {
79-
if (this.datePicker != null) {
80-
this.datePicker.focus();
81-
}
82-
};
83-
8475
private readonly handleChange = (newStringifiedDate: RussianDateFormat): void => {
8576
this.setState({ date: newStringifiedDate });
8677
if (StringUtils.isNullOrWhitespace(newStringifiedDate)) {

cassandra-distributed-task-queue-ui/src/components/DateTimeRangePicker/DateTimePicker.tsx

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)