Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

Commit 2142567

Browse files
feat: add migrations snippets (#3688)
* DataGrid: Fundamentals migration Add migration scripts for DataGrid: Fundamentals page * Add DataGrid React migration (partial) Add migration for: 1. Controlled Modes 2. Data Accessors 3. Formatting 4. Sorting 5. Paging 6. Filtering * Add migration snippets for editing, grouping, selection and searching * Add final migration snippets for Grid documentation * Add migration snippets for Scheduler and Chart components * fix Charts and Scheduler sections (#3687) * Downgrade ubuntu for tests --------- Co-authored-by: Vasily Strelyaev <[email protected]>
1 parent f5f79cf commit 2142567

File tree

150 files changed

+5655
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+5655
-6
lines changed

.github/workflows/ci_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414
name: Build, Lint & Jest Test
1515
steps:
1616
- name: Get sources
@@ -47,7 +47,7 @@ jobs:
4747
retention-days: 1
4848

4949
test_cafe:
50-
runs-on: ubuntu-latest
50+
runs-on: ubuntu-22.04
5151
needs: build
5252
strategy:
5353
matrix:
@@ -79,7 +79,7 @@ jobs:
7979
run: yarn testcafe:ci:${{ matrix.component }}
8080

8181
site:
82-
runs-on: ubuntu-latest
82+
runs-on: ubuntu-22.04
8383
needs: build
8484
name: Site
8585
steps:

.github/workflows/lint-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
main:
1212
name: Validate PR title
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- uses: amannn/action-semantic-pull-request@v4
1616
env:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
export default () => {
2+
const [currentData, setCurrentData] = useState(data[2017]);
3+
4+
const changeData = useCallback(e => {
5+
setCurrentData(data[e.target.value]);
6+
};
7+
8+
return (
9+
<React.Fragment>
10+
<Chart dataSource={currentData}>
11+
<ValueAxis
12+
name="total"
13+
/>
14+
<ValueAxis
15+
name="sale"
16+
position="right"
17+
>
18+
<Label format="currency" />
19+
</ValueAxis>
20+
<CommonSeriesSettings
21+
argumentField="month"
22+
/>
23+
<Series
24+
name="Units Sold"
25+
valueField="sale"
26+
type="bar"
27+
axis="sale"
28+
/>
29+
<Series
30+
name="Total Transactions"
31+
valueField="total"
32+
type="spline"
33+
axis="total"
34+
/>
35+
<Animation
36+
duration={2000}
37+
easing='easeOutCubic'
38+
/>
39+
</Chart>
40+
<select
41+
style={{ width: '100px', margin: '10px' }}
42+
onChange={changeData}
43+
>
44+
<option>2017</option>
45+
<option>2018</option>
46+
<option>2019</option>
47+
</select>
48+
</React.Fragment>
49+
);
50+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export default () => {
2+
return (
3+
<React.Fragment>
4+
<Chart dataSource={chartData}>
5+
<ValueAxis
6+
name="total"
7+
position="right"
8+
/>
9+
<ValueAxis
10+
name="sale"
11+
/>
12+
<CommonSeriesSettings
13+
argumentField="month"
14+
/>
15+
<Series
16+
name="Units Sold"
17+
valueField="sale"
18+
type="bar"
19+
axis="sale"
20+
/>
21+
<Series
22+
name="Total Transactions"
23+
valueField="total"
24+
type="spline"
25+
axis="total"
26+
/>
27+
</Chart>
28+
</React.Fragment>
29+
);
30+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
const option = [2017, 2018, 2019];
2+
3+
export default () => {
4+
const [currentData, setCurrentData] = useState(data[2017]);
5+
const id = useRef(undefined);
6+
const index = useRef(1);
7+
const selectRef = useRef(null);
8+
9+
useEffect(() => {
10+
id.current = setInterval(() => {
11+
selectRef.selectedIndex = index.current;
12+
setCurrentData(data[option[index.current]]);
13+
14+
if (index.current === 2) {
15+
index.current = 0;
16+
} else {
17+
index.current += 1;
18+
}
19+
}, 4000);
20+
21+
return () => clearTimeout(id.current);
22+
}, []);
23+
24+
const changeData = useCallback(e => {
25+
setCurrentData(data[e.target.value]);
26+
};
27+
28+
return (
29+
<React.Fragment>
30+
<Chart dataSource={currentData}>
31+
<ValueAxis
32+
name="total"
33+
/>
34+
<ValueAxis
35+
name="sale"
36+
position="right"
37+
>
38+
<Label format="currency" />
39+
</ValueAxis>
40+
<CommonSeriesSettings
41+
argumentField="month"
42+
/>
43+
<Series
44+
name="Units Sold"
45+
valueField="sale"
46+
type="bar"
47+
axis="sale"
48+
/>
49+
<Series
50+
name="Total Transactions"
51+
valueField="total"
52+
type="spline"
53+
axis="total"
54+
/>
55+
</Chart>
56+
<select
57+
ref={selectRef}
58+
style={{ width: '100px', margin: '10px' }}
59+
onChange={changeData}
60+
>
61+
<option>{ option[0] }</option>
62+
<option>{ option[1] }</option>
63+
<option>{ option[2] }</option>
64+
</select>
65+
</React.Fragment>
66+
);
67+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default () => {
2+
return (
3+
<React.Fragment>
4+
<Chart
5+
dataSource={chartData}
6+
rotated={true}
7+
>
8+
<Series
9+
type="bar"
10+
valueField="population"
11+
argumentField="year"
12+
/>
13+
<Title text="World population" />
14+
</Chart>
15+
</React.Fragment>
16+
);
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default () => {
2+
return (
3+
<React.Fragment>
4+
<Chart dataSource={chartData}>
5+
<CommonSeriesSettings argumentField="year" type="area" />
6+
<Series valueField="ru"/>
7+
<Series valueField="ch"/>
8+
<Series valueField="us"/>
9+
</Chart>
10+
</React.Fragment>
11+
);
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default () => {
2+
return (
3+
<React.Fragment>
4+
<Chart dataSource={chartData}>
5+
<CommonSeriesSettings argumentField="state" type="bar" />
6+
<Series valueField="young" name="Young" />
7+
<Series valueField="middle" name="Middle" />
8+
<Series valueField="older" name="Older" />
9+
</Chart>
10+
</React.Fragment>
11+
);
12+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
export default () => {
2+
return (
3+
<React.Fragment>
4+
<Chart dataSource={chartData}>
5+
<ValueAxis
6+
name="oil"
7+
/>
8+
<ValueAxis
9+
name="price"
10+
position="right"
11+
>
12+
<Label format="currency" />
13+
</ValueAxis>
14+
<CommonSeriesSettings
15+
argumentField="year"
16+
axis="oil"
17+
type="stackedbar"
18+
/>
19+
<Title
20+
text="Oil production vs Oil price"
21+
/>
22+
<Series
23+
name="USA"
24+
valueField="usa"
25+
/>
26+
<Series
27+
name="Saudi Arabia"
28+
valueField="saudiArabia"
29+
/>
30+
<Series
31+
name="Iran"
32+
valueField="iran"
33+
/>
34+
<Series
35+
name="Mexico"
36+
valueField="mexico"
37+
/>
38+
<Series
39+
name="Russia"
40+
valueField="russia"
41+
/>
42+
<Series
43+
name="Oil Price"
44+
valueField="price"
45+
axis="price"
46+
type="line"
47+
/>
48+
</Chart>
49+
</React.Fragment>
50+
);
51+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default () => {
2+
return (
3+
<React.Fragment>
4+
<Chart dataSource={chartData}>
5+
<Series
6+
type="bar"
7+
valueField="population"
8+
argumentField="year"
9+
/>
10+
</Chart>
11+
</React.Fragment>
12+
);
13+
}

0 commit comments

Comments
 (0)