|
1 | 1 | import React from "react"; |
2 | 2 | import { Query } from '@apollo/client/react/components'; |
3 | 3 | import { Grid, GridColumn } from '@progress/kendo-react-grid'; |
4 | | -import { process } from '@progress/kendo-data-query'; |
5 | 4 | import { ColumnMenu } from './ColumnMenu'; |
6 | 5 | import { DetailComponent } from './DetailComponent'; |
7 | 6 | import { StateCell } from './StateCell'; |
8 | | -import { АssignedTo } from './АssignedTo'; |
| 7 | +import { Author } from './Author'; |
9 | 8 | import { LoadingPanel } from './LoadingPanel'; |
10 | 9 |
|
11 | 10 | import { getQuery } from '../queries/github'; |
12 | 11 | import kendoReactIssues from '../data/fallBackData.json'; |
13 | 12 | import reactIssues from '../data/fallBackDataReact.json'; |
14 | 13 |
|
15 | | - |
16 | | - |
17 | 14 | export class KendoGridContainer extends React.Component { |
18 | | - state = { |
19 | | - skip: 0, |
20 | | - take: 10 |
21 | | - } |
22 | 15 | allLabels = []; |
23 | 16 | uniqueLabels = []; |
24 | 17 | initialLoad = true; |
25 | | - expandChange = (event) => { |
26 | | - event.dataItem.expanded = !event.dataItem.expanded; |
27 | | - this.forceUpdate(); |
28 | | - } |
29 | 18 |
|
30 | 19 | getOccurrence = (array, value) => { |
31 | 20 | var count = 0; |
@@ -106,20 +95,20 @@ export class KendoGridContainer extends React.Component { |
106 | 95 | return ( |
107 | 96 | <React.Fragment> |
108 | 97 | <Grid |
109 | | - data={process(gridData, this.state)} |
| 98 | + data={gridData} |
| 99 | + autoProcessData={true} |
| 100 | + dataItemKey="node.number" |
| 101 | + detail={(props) => <DetailComponent {...props} makeChartData={this.makeChartData} />} |
110 | 102 | sortable |
111 | 103 | pageable |
112 | | - {...this.state} |
113 | | - onDataStateChange={(e) => { this.setState(e.dataState); }} |
114 | | - expandField="expanded" |
115 | | - onExpandChange={this.expandChange} |
| 104 | + defaultSkip={0} |
| 105 | + defaultTake={20} |
116 | 106 | style={{ height: '100%', overflow: 'auto', borderInline: 0 }} |
117 | | - detail={(props) => <DetailComponent {...props} makeChartData={this.makeChartData} />} |
118 | 107 | > |
119 | 108 | <GridColumn field="node.number" title="ID" width={100} /> |
120 | | - <GridColumn field="node.state" title="State" cell={StateCell} width={100} /> |
| 109 | + <GridColumn field="node.state" title="State" cells={{ data: StateCell } } width={100} /> |
121 | 110 | <GridColumn field="node.title" title="Issue" columnMenu={ColumnMenu} /> |
122 | | - <GridColumn field="node.assignees.node" title="Assigned to" width={200} cell={АssignedTo} sortable={false} /> |
| 111 | + <GridColumn field="node.author.login" title="Author" width={200} cells={{ data: Author }} sortable={false} /> |
123 | 112 | <GridColumn field="node.createdAt" title="Created on" width={200} format='{0:yyyy/MM/dd hh:mm a}' filter="date" columnMenu={ColumnMenu} /> |
124 | 113 | </Grid> |
125 | 114 | {loading && <LoadingPanel />} |
|
0 commit comments