From 45466dc940369fac6b751a4927f4524fd15bed15 Mon Sep 17 00:00:00 2001 From: Your NameSajRashid Date: Fri, 23 Jul 2021 07:02:02 +0100 Subject: [PATCH] fixed insertbug --- package.json | 2 +- src/components/react-dj-table/package.json | 2 +- src/components/react-dj-table/reducers/tableReducer.js | 4 +--- src/components/react-dj-table/utils/rowGlobals.js | 6 ------ .../react-dj-table/utils => tests}/utils.test.bk | 0 yarn.lock | 8 ++++---- 6 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 src/components/react-dj-table/utils/rowGlobals.js rename src/{components/react-dj-table/utils => tests}/utils.test.bk (100%) diff --git a/package.json b/package.json index bf7997c..4fb08a4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "pretty": "^2.0.0", "prop-types": "^15.7.2", "react": "^17.0.2", - "react-dj-table": "^1.1.5", + "react-dj-table": "^1.1.7", "react-dom": "^17.0.2", "react-router-dom": "^5.2.0", "react-scripts": "^4.0.3", diff --git a/src/components/react-dj-table/package.json b/src/components/react-dj-table/package.json index 1ab8b32..93b5c7c 100644 --- a/src/components/react-dj-table/package.json +++ b/src/components/react-dj-table/package.json @@ -1,6 +1,6 @@ { "name": "react-dj-table", - "version": "1.1.6", + "version": "1.1.8", "description": "React Dynamic Resposive Json HTML Table", "main": "index.js", "scripts": { diff --git a/src/components/react-dj-table/reducers/tableReducer.js b/src/components/react-dj-table/reducers/tableReducer.js index 0ce8e7e..d389d54 100644 --- a/src/components/react-dj-table/reducers/tableReducer.js +++ b/src/components/react-dj-table/reducers/tableReducer.js @@ -184,6 +184,7 @@ export const TableReducer = (state, action) => { if(state.inserting){ // delete the row state.json.splice(state.pageSize,1); + state.jsonCopy.splice(state.pageSize,1); } state.inserting=false state.editing=true @@ -267,12 +268,9 @@ export const TableReducer = (state, action) => { case ACTIONS.CONFIRMINSERT: const idColIdx = state.options.idCol ? Object.keys(state.json[0]).indexOf(state.options.idCol) : 0 const idColName = [Object.keys(state.json[0])[idColIdx]] - console.log(idColName) if(action!==undefined && action.payload !==undefined){ if(action.payload.id!==undefined) state.selectedRow[idColName]=action.payload.id } - console.log(state.selectedRow[idColIdx]) - state.selectedRowCopy = {} state.crudBtns.btnCancel=true state.crudBtns.btnInsert=true diff --git a/src/components/react-dj-table/utils/rowGlobals.js b/src/components/react-dj-table/utils/rowGlobals.js deleted file mode 100644 index f730b87..0000000 --- a/src/components/react-dj-table/utils/rowGlobals.js +++ /dev/null @@ -1,6 +0,0 @@ -export function rowGlobals() -{ - const selectedRow={} - const previousRow={} - -} \ No newline at end of file diff --git a/src/components/react-dj-table/utils/utils.test.bk b/src/tests/utils.test.bk similarity index 100% rename from src/components/react-dj-table/utils/utils.test.bk rename to src/tests/utils.test.bk diff --git a/yarn.lock b/yarn.lock index cd4f855..1347841 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11137,10 +11137,10 @@ react-dev-utils@^11.0.3: strip-ansi "6.0.0" text-table "0.2.0" -react-dj-table@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/react-dj-table/-/react-dj-table-1.1.5.tgz#370cfb47ab24bcadee9d7a373f4584460c046359" - integrity sha512-mju4pB7FS/s5VOSATmEUffopnJn+bq7fcDwagjC4ZD7it15WboyUQSYBu+4fulUbgQAMxFR6AqNkHVtj2wFD2g== +react-dj-table@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/react-dj-table/-/react-dj-table-1.1.7.tgz#2113c6a4f9f1d1d912ef37bec92c799e3b49c2ff" + integrity sha512-BBQENv3dCZlqEXQxbC7YdLACKtTLGVGv1wS3grV+tUz8gdQBuLi2jVs884KPHEAVf0tojzTepxy3/VSs+3Mh7A== dependencies: core-js "^3.15.1" lodash "^4.17.21"