public inbox for [email protected]help / color / mirror / Atom feed
[pgAdmin] RM6098 Manually deleting from table view hangs 5+ messages / 3 participants [nested] [flat]
* [pgAdmin] RM6098 Manually deleting from table view hangs @ 2021-01-18 14:51 Rahul Shirsat <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Rahul Shirsat @ 2021-01-18 14:51 UTC (permalink / raw) To: pgadmin-hackers Hi Hackers, Please find the attached patch which resolves the issue of deleting records when the user tries to delete multiple records step by step. -- *Rahul Shirsat* Senior Software Engineer | EnterpriseDB Corporation. Attachments: [application/octet-stream] RM6098.patch (2.0K, 3-RM6098.patch) download | inline diff: diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index 05deebc41..eb32c06f2 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -3544,17 +3544,33 @@ define('tools.querytool', [ // Remove deleted rows from client as well if (is_deleted) { var rows = _.keys(self.data_store.deleted); + if (data_length == rows.length) { // This means all the rows are selected, clear all data data = []; dataView.setItems(data, self.client_primary_key); } else { dataView.beginUpdate(); - for (var j = 0; j < rows.length; j++) { - var item = grid.getDataItem(rows[j]); - data.push(item); - dataView.deleteItem(item[self.client_primary_key]); + + var selectedRows = RangeSelectionHelper.getIndexesOfCompleteRows(grid, grid.getSelectionModel().getSelectedRanges()); + + var primary_keys = _.values(self.data_store.deleted); + + for (var j = 0; j < selectedRows.length; j++) { + var item = grid.getDataItem(selectedRows[j]); + _.each(primary_keys, function(v) { + + let actual_prim_delete_key = _.keys(v)[0]; + let actual_prim_delete_value = _.values(v)[0]; + let selected_prim_delete_value = item[actual_prim_delete_key]; + + if(actual_prim_delete_value == selected_prim_delete_value) { + data.push(item); + dataView.deleteItem(item[self.client_primary_key]); + } + }); } + dataView.endUpdate(); } self.rows_to_delete.apply(self, [data]); ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin] RM6098 Manually deleting from table view hangs @ 2021-01-19 08:10 Akshay Joshi <[email protected]> parent: Rahul Shirsat <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Akshay Joshi @ 2021-01-19 08:10 UTC (permalink / raw) To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers Hi Nikhil Can you please review it. On Mon, Jan 18, 2021 at 8:21 PM Rahul Shirsat < [email protected]> wrote: > Hi Hackers, > > Please find the attached patch which resolves the issue of deleting > records when the user tries to delete multiple records step by step. > > -- > *Rahul Shirsat* > Senior Software Engineer | EnterpriseDB Corporation. > -- *Thanks & Regards* *Akshay Joshi* *pgAdmin Hacker | Principal Software Architect* *EDB Postgres <http://edbpostgres.com>* *Mobile: +91 976-788-8246* ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin] RM6098 Manually deleting from table view hangs @ 2021-01-19 10:00 Nikhil Mohite <[email protected]> parent: Akshay Joshi <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Nikhil Mohite @ 2021-01-19 10:00 UTC (permalink / raw) To: Rahul Shirsat <[email protected]>; +Cc: pgadmin-hackers; Akshay Joshi <[email protected]> Hi Rahul, While reviewing the patch, found one observation with deleted records. 1. Selected multiple records and click on delete records. [image: Screenshot 2021-01-19 at 3.05.55 PM.png] 2. Now unselect or unmark any record. (click on index column cell to unselect the row) [image: Screenshot 2021-01-19 at 3.06.04 PM.png] 3. Click on the Save data changes button. 4. All selected records get deleted but the unselected records remain in the grid. [image: Screenshot 2021-01-19 at 3.06.13 PM.png] 5. After re-executing the filter query that record gets removed from the grid. Regards, Nikhil Mohite. On Tue, Jan 19, 2021 at 1:41 PM Akshay Joshi <[email protected]> wrote: > Hi Nikhil > > Can you please review it. > > On Mon, Jan 18, 2021 at 8:21 PM Rahul Shirsat < > [email protected]> wrote: > >> Hi Hackers, >> >> Please find the attached patch which resolves the issue of deleting >> records when the user tries to delete multiple records step by step. >> >> -- >> *Rahul Shirsat* >> Senior Software Engineer | EnterpriseDB Corporation. >> > > > -- > *Thanks & Regards* > *Akshay Joshi* > *pgAdmin Hacker | Principal Software Architect* > *EDB Postgres <http://edbpostgres.com>* > > *Mobile: +91 976-788-8246* > Attachments: [image/png] Screenshot 2021-01-19 at 3.05.55 PM.png (118.6K, 3-Screenshot%202021-01-19%20at%203.05.55%20PM.png) download | view image [image/png] Screenshot 2021-01-19 at 3.06.04 PM.png (119.9K, 4-Screenshot%202021-01-19%20at%203.06.04%20PM.png) download | view image [image/png] Screenshot 2021-01-19 at 3.06.13 PM.png (119.0K, 5-Screenshot%202021-01-19%20at%203.06.13%20PM.png) download | view image ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin] RM6098 Manually deleting from table view hangs @ 2021-01-19 15:22 Rahul Shirsat <[email protected]> parent: Nikhil Mohite <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Rahul Shirsat @ 2021-01-19 15:22 UTC (permalink / raw) To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers; Akshay Joshi <[email protected]> Fixed the above observation. Removed unnecessary code for calling slickgrid delete API. On Tue, Jan 19, 2021 at 3:30 PM Nikhil Mohite < [email protected]> wrote: > Hi Rahul, > > While reviewing the patch, found one observation with deleted records. > 1. Selected multiple records and click on delete records. > [image: Screenshot 2021-01-19 at 3.05.55 PM.png] > 2. Now unselect or unmark any record. (click on index column cell to > unselect the row) > [image: Screenshot 2021-01-19 at 3.06.04 PM.png] > 3. Click on the Save data changes button. > 4. All selected records get deleted but the unselected records remain in > the grid. > [image: Screenshot 2021-01-19 at 3.06.13 PM.png] > 5. After re-executing the filter query that record gets removed from the > grid. > > Regards, > Nikhil Mohite. > > > > On Tue, Jan 19, 2021 at 1:41 PM Akshay Joshi < > [email protected]> wrote: > >> Hi Nikhil >> >> Can you please review it. >> >> On Mon, Jan 18, 2021 at 8:21 PM Rahul Shirsat < >> [email protected]> wrote: >> >>> Hi Hackers, >>> >>> Please find the attached patch which resolves the issue of deleting >>> records when the user tries to delete multiple records step by step. >>> >>> -- >>> *Rahul Shirsat* >>> Senior Software Engineer | EnterpriseDB Corporation. >>> >> >> >> -- >> *Thanks & Regards* >> *Akshay Joshi* >> *pgAdmin Hacker | Principal Software Architect* >> *EDB Postgres <http://edbpostgres.com>* >> >> *Mobile: +91 976-788-8246* >> > -- *Rahul Shirsat* Senior Software Engineer | EnterpriseDB Corporation. Attachments: [image/png] Screenshot 2021-01-19 at 3.05.55 PM.png (118.6K, 3-Screenshot%202021-01-19%20at%203.05.55%20PM.png) download | view image [image/png] Screenshot 2021-01-19 at 3.06.04 PM.png (119.9K, 4-Screenshot%202021-01-19%20at%203.06.04%20PM.png) download | view image [image/png] Screenshot 2021-01-19 at 3.06.13 PM.png (119.0K, 5-Screenshot%202021-01-19%20at%203.06.13%20PM.png) download | view image [application/octet-stream] RM6098_v2.patch (703B, 6-RM6098_v2.patch) download | inline diff: diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index 05deebc41..b374a53b0 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -3551,7 +3551,7 @@ define('tools.querytool', [ } else { dataView.beginUpdate(); for (var j = 0; j < rows.length; j++) { - var item = grid.getDataItem(rows[j]); + var item = grid.getData().getItemById(rows[j]); data.push(item); dataView.deleteItem(item[self.client_primary_key]); } ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin] RM6098 Manually deleting from table view hangs @ 2021-01-20 07:10 Akshay Joshi <[email protected]> parent: Rahul Shirsat <[email protected]> 0 siblings, 0 replies; 5+ messages in thread From: Akshay Joshi @ 2021-01-20 07:10 UTC (permalink / raw) To: Rahul Shirsat <[email protected]>; +Cc: Nikhil Mohite <[email protected]>; pgadmin-hackers Thanks, patch applied. On Tue, Jan 19, 2021 at 8:53 PM Rahul Shirsat < [email protected]> wrote: > Fixed the above observation. Removed unnecessary code for calling > slickgrid delete API. > > On Tue, Jan 19, 2021 at 3:30 PM Nikhil Mohite < > [email protected]> wrote: > >> Hi Rahul, >> >> While reviewing the patch, found one observation with deleted records. >> 1. Selected multiple records and click on delete records. >> [image: Screenshot 2021-01-19 at 3.05.55 PM.png] >> 2. Now unselect or unmark any record. (click on index column cell to >> unselect the row) >> [image: Screenshot 2021-01-19 at 3.06.04 PM.png] >> 3. Click on the Save data changes button. >> 4. All selected records get deleted but the unselected records remain in >> the grid. >> [image: Screenshot 2021-01-19 at 3.06.13 PM.png] >> 5. After re-executing the filter query that record gets removed from the >> grid. >> >> Regards, >> Nikhil Mohite. >> >> >> >> On Tue, Jan 19, 2021 at 1:41 PM Akshay Joshi < >> [email protected]> wrote: >> >>> Hi Nikhil >>> >>> Can you please review it. >>> >>> On Mon, Jan 18, 2021 at 8:21 PM Rahul Shirsat < >>> [email protected]> wrote: >>> >>>> Hi Hackers, >>>> >>>> Please find the attached patch which resolves the issue of deleting >>>> records when the user tries to delete multiple records step by step. >>>> >>>> -- >>>> *Rahul Shirsat* >>>> Senior Software Engineer | EnterpriseDB Corporation. >>>> >>> >>> >>> -- >>> *Thanks & Regards* >>> *Akshay Joshi* >>> *pgAdmin Hacker | Principal Software Architect* >>> *EDB Postgres <http://edbpostgres.com>* >>> >>> *Mobile: +91 976-788-8246* >>> >> > > -- > *Rahul Shirsat* > Senior Software Engineer | EnterpriseDB Corporation. > -- *Thanks & Regards* *Akshay Joshi* *pgAdmin Hacker | Principal Software Architect* *EDB Postgres <http://edbpostgres.com>* *Mobile: +91 976-788-8246* Attachments: [image/png] Screenshot 2021-01-19 at 3.05.55 PM.png (118.6K, 3-Screenshot%202021-01-19%20at%203.05.55%20PM.png) download | view image [image/png] Screenshot 2021-01-19 at 3.06.04 PM.png (119.9K, 4-Screenshot%202021-01-19%20at%203.06.04%20PM.png) download | view image [image/png] Screenshot 2021-01-19 at 3.06.13 PM.png (119.0K, 5-Screenshot%202021-01-19%20at%203.06.13%20PM.png) download | view image ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2021-01-20 07:10 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-01-18 14:51 [pgAdmin] RM6098 Manually deleting from table view hangs Rahul Shirsat <[email protected]> 2021-01-19 08:10 ` Akshay Joshi <[email protected]> 2021-01-19 10:00 ` Nikhil Mohite <[email protected]> 2021-01-19 15:22 ` Rahul Shirsat <[email protected]> 2021-01-20 07:10 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox