Skip to content

Commit b27416b

Browse files
committed
chore: bump versions for redux-undo app
1 parent 56da108 commit b27416b

File tree

6 files changed

+71
-55
lines changed

6 files changed

+71
-55
lines changed

examples/kendo-react-redux-undo/package.json

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@progress/kendo-data-query": "^1.5.0",
7-
"@progress/kendo-drawing": "^1.5.7",
8-
"@progress/kendo-react-dateinputs": "^1.2.0",
9-
"@progress/kendo-react-dropdowns": "^1.2.0",
10-
"@progress/kendo-react-grid": "^1.2.0",
11-
"@progress/kendo-react-inputs": "^1.2.0",
12-
"@progress/kendo-react-intl": "^1.2.0",
13-
"@progress/kendo-react-pdf": "^1.2.0",
14-
"@progress/kendo-theme-default": "^2.55.0",
15-
"react": "^16.4.2",
16-
"react-dom": "^16.4.2",
17-
"react-redux": "^5.0.7",
18-
"react-scripts": "1.1.5",
19-
"redux": "^4.0.0",
20-
"redux-devtools-extension": "^2.13.5",
21-
"redux-thunk": "^2.3.0",
22-
"redux-undo": "^0.6.1",
23-
"prop-types": "15.6.2"
6+
"@progress/kendo-data-query": "^1.7.1",
7+
"@progress/kendo-drawing": "^1.21.2",
8+
"@progress/kendo-react-dateinputs": "^11.0.0",
9+
"@progress/kendo-react-dropdowns": "^11.0.0",
10+
"@progress/kendo-react-grid": "^11.0.0",
11+
"@progress/kendo-react-inputs": "^11.0.0",
12+
"@progress/kendo-react-intl": "^11.0.0",
13+
"@progress/kendo-react-pdf": "^11.0.0",
14+
"@progress/kendo-react-data-tools": "^11.0.0",
15+
"@progress/kendo-theme-default": "^11.0.2",
16+
"react": "^18",
17+
"react-dom": "^18",
18+
"react-redux": "^9.2.0",
19+
"react-scripts": "5.0.1",
20+
"redux": "^5.0.1",
21+
"@redux-devtools/extension": "^3.3.0",
22+
"@reduxjs/toolkit": "^2.8.2",
23+
"redux-thunk": "^3.1.0",
24+
"redux-undo": "^1.1.0",
25+
"prop-types": "15.8.1"
2426
},
2527
"scripts": {
2628
"start": "react-scripts start",
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import ReactDOM from 'react-dom/client';
33
import App from './App';
44

55
it('renders without crashing', () => {
66
const div = document.createElement('div');
7-
ReactDOM.render(<App />, div);
8-
ReactDOM.unmountComponentAtNode(div);
7+
const root = ReactDOM.createRoot(div);
8+
root.render(<App />);
9+
root.unmount();
910
});

examples/kendo-react-redux-undo/src/components/GridContainer.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import React from 'react';
2-
import {connect} from 'react-redux';
3-
import {addProduct, updateProduct, deleteProduct, changeEdit, datastateChange} from '../actions/actions';
4-
import MyCommandCell from './MyCommandCell'
2+
import { connect } from 'react-redux';
53
import { ActionCreators as UndoActionCreators } from 'redux-undo';
6-
import {Grid, GridColumn as Column, GridToolbar} from '@progress/kendo-react-grid';
4+
import { addProduct, updateProduct, deleteProduct, changeEdit, datastateChange } from '../actions/actions';
5+
import { Grid, GridColumn as Column, GridToolbar, GridToolbarSort, GridToolbarFilter } from '@progress/kendo-react-grid';
6+
import { Button } from '@progress/kendo-react-buttons';
7+
import { gearIcon } from '@progress/kendo-svg-icons';
78
import { process } from '@progress/kendo-data-query'
9+
import MyCommandCell from './MyCommandCell'
810

911
class GridContainer extends React.Component {
1012
constructor(props) {
@@ -38,37 +40,39 @@ class GridContainer extends React.Component {
3840
return (
3941
<div className="grid-container">
4042
<Grid
43+
adaptive={true}
44+
dataItemKey="ProductID"
45+
autoProcessData={true}
46+
navigatable={true}
47+
sortable={{ mode: 'multiple' }}
4148
onRowClick={this.rowClick}
4249
onItemChange={this.handleItemChange}
4350
data={processedProducts}
44-
total={this.props.products.length}
45-
pageable={true}
46-
sortable={true}
47-
filterable={true}
4851
onDataStateChange={this.handleStateChange}
49-
editField="inEdit"
5052
{...this.props.dataState}>
5153
<GridToolbar>
52-
<button
54+
<GridToolbarSort icon="gear" />
55+
<GridToolbarFilter svgIcon={gearIcon} />
56+
<Button
5357
title="Add new"
5458
className="k-button k-primary"
5559
onClick={this.addItem}>
5660
Add new
57-
</button>
58-
<button
61+
</Button>
62+
<Button
5963
title="Undo"
6064
className="k-button button-right"
6165
disabled={!this.props.canUndo}
6266
onClick={this.props.onUndo}>
6367
Back
64-
</button>
65-
<button
68+
</Button>
69+
<Button
6670
title="Redo"
6771
className="k-button button-right"
6872
disabled={!this.props.canRedo}
6973
onClick={this.props.onRedo}>
7074
Forward
71-
</button>
75+
</Button>
7276
</GridToolbar>
7377
<Column field="ProductID" title="ID" editable={false} filter="numeric"/>
7478
<Column field="ProductName" title="Name"/>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from 'react';
22
import './index.css';
33
import App from './App';
4-
import { render } from 'react-dom'
5-
import { Provider } from 'react-redux'
6-
import { store } from './reducers/index'
7-
4+
import { Provider } from 'react-redux';
5+
import { store } from './reducers/index';
6+
import { createRoot } from 'react-dom/client';
87

9-
10-
render(
8+
const container = document.getElementById('root');
9+
const root = createRoot(container);
10+
11+
root.render(
1112
<Provider store={store}>
1213
<App />
13-
</Provider>,
14-
document.getElementById('root')
15-
)
14+
</Provider>
15+
);
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import { createStore, applyMiddleware, combineReducers } from 'redux';
1+
import { configureStore } from '@reduxjs/toolkit';
2+
import { combineReducers } from 'redux';
23
import { undoableProducts, undoableDataState } from './reducers';
3-
import { composeWithDevTools } from 'redux-devtools-extension'
4-
import thunk from 'redux-thunk'
54

6-
const rootReducer = combineReducers({products: undoableProducts, dataState: undoableDataState})
7-
export const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)))
5+
const rootReducer = combineReducers({
6+
products: undoableProducts,
7+
dataState: undoableDataState,
8+
});
9+
10+
export const store = configureStore({
11+
reducer: rootReducer
12+
});

examples/kendo-react-redux-undo/src/reducers/reducers.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ export function productsReducer(state = {products: sampleProducts}, action) {
1414
case ADD_PRODUCT:
1515
let makeNewID = Math.random() * new Date().getMilliseconds() * 100
1616
let newProductID = Math.floor(makeNewID)
17-
let productForAdd = {inEdit: true}
18-
productForAdd.ProductID = newProductID;
19-
let productsAfterAdd = state.products.slice()
20-
productsAfterAdd.map(product => product.inEdit = false)
17+
let productForAdd = { inEdit: true, ProductID: newProductID };
18+
let productsAfterAdd = state.products.map(product => ({
19+
...product,
20+
inEdit: false
21+
}));
2122
productsAfterAdd.unshift(productForAdd)
22-
return Object.assign({ products: productsAfterAdd }, {});
23+
return {
24+
...state,
25+
products: productsAfterAdd
26+
};
2327

2428
case UPDATE_PRODUCT:
2529
const newProducts = state.products.map(product => {

0 commit comments

Comments
 (0)