Обсуждение: [pgadmin-hackers] pgAdmin 4 commit: Improve handling of nulls and default values in thed

Поиск
Список
Период
Сортировка
Improve handling of nulls and default values in the data editor. Fixes #2257

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4f9628ed436de53b1ab1a06b123755a86a8f2288
Author: Surinder Kumar <surinder.kumar@enterprisedb.com>

Modified Files
--------------
.../tables/templates/column/sql/9.2_plus/nodes.sql |  3 +-
.../tables/templates/column/sql/default/nodes.sql  |  3 +-
web/pgadmin/static/css/pgadmin.css                 |  2 +-
.../static/js/slickgrid/slick.pgadmin.editors.js   | 39 +++++++++++++++---
.../js/slickgrid/slick.pgadmin.formatters.js       | 46 ++++++++++++++++------
web/pgadmin/tools/sqleditor/__init__.py            | 25 +++++++++++-
web/pgadmin/tools/sqleditor/command.py             | 30 +++++++++++++-
.../tools/sqleditor/static/css/sqleditor.css       | 12 +++++-
.../sqleditor/templates/sqleditor/js/sqleditor.js  | 28 ++++++++++++-
9 files changed, 163 insertions(+), 25 deletions(-)


Re: [pgadmin-hackers] pgAdmin 4 commit: Improve handling of nulls anddefault values in the d

От
Harshal Dhumal
Дата:
Hi,

Below code snippet from above commit assumes that we have to disable last row after saving.

@@ -2320,6 +2340,10 @@ define(
                       grid.setSelectedRows([]);
                     }
 
+                    // Add last row(new row) to keep track of it
+                    if (is_added) {
+                      self.rows_to_disable.push(grid.getDataLength()-1);
+                    }

 However this is not the case all the time

For e.g 
Table has some data already and If user adds new row (do not save) and then copy past few exiting rows (at this point  newly added row no longer remains at last position). And after saving it disable last row which is not the newly added row.



 




-- 
Harshal Dhumal
Sr. Software Engineer

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Fri, May 12, 2017 at 3:24 PM, Dave Page <dpage@pgadmin.org> wrote:
Improve handling of nulls and default values in the data editor. Fixes #2257

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4f9628ed436de53b1ab1a06b123755a86a8f2288
Author: Surinder Kumar <surinder.kumar@enterprisedb.com>

Modified Files
--------------
.../tables/templates/column/sql/9.2_plus/nodes.sql |  3 +-
.../tables/templates/column/sql/default/nodes.sql  |  3 +-
web/pgadmin/static/css/pgadmin.css                 |  2 +-
.../static/js/slickgrid/slick.pgadmin.editors.js   | 39 +++++++++++++++---
.../js/slickgrid/slick.pgadmin.formatters.js       | 46 ++++++++++++++++------
web/pgadmin/tools/sqleditor/__init__.py            | 25 +++++++++++-
web/pgadmin/tools/sqleditor/command.py             | 30 +++++++++++++-
.../tools/sqleditor/static/css/sqleditor.css       | 12 +++++-
.../sqleditor/templates/sqleditor/js/sqleditor.js  | 28 ++++++++++++-
9 files changed, 163 insertions(+), 25 deletions(-)


--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers



On Fri, May 12, 2017 at 12:19 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi,

Below code snippet from above commit assumes that we have to disable last row after saving.

@@ -2320,6 +2340,10 @@ define(
                       grid.setSelectedRows([]);
                     }
 
+                    // Add last row(new row) to keep track of it
+                    if (is_added) {
+                      self.rows_to_disable.push(grid.getDataLength()-1);
+                    }

 However this is not the case all the time

For e.g 
Table has some data already and If user adds new row (do not save) and then copy past few exiting rows (at this point  newly added row no longer remains at last position). And after saving it disable last row which is not the newly added row.

Hmm, good point. Can you/Surinder work up a fix for that in time for the release please? 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgadmin-hackers] pgAdmin 4 commit: Improve handling of nulls anddefault values in the d

От
Surinder Kumar
Дата:
On Fri, May 12, 2017 at 5:00 PM, Dave Page <dpage@pgadmin.org> wrote:


On Fri, May 12, 2017 at 12:19 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi,

Below code snippet from above commit assumes that we have to disable last row after saving.

@@ -2320,6 +2340,10 @@ define(
                       grid.setSelectedRows([]);
                     }
 
+                    // Add last row(new row) to keep track of it
+                    if (is_added) {
+                      self.rows_to_disable.push(grid.getDataLength()-1);
+                    }

 However this is not the case all the time

For e.g 
Table has some data already and If user adds new row (do not save) and then copy past few exiting rows (at this point  newly added row no longer remains at last position). And after saving it disable last row which is not the newly added row.

Hmm, good point. Can you/Surinder work up a fix for that in time for the release please? 
​Sure Dave, I am working on it.​

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgadmin-hackers] pgAdmin 4 commit: Improve handling of nulls anddefault values in the d

От
Surinder Kumar
Дата:
Hi Dave,

Please find attached patch and review.

Also, I found an issue which logged and will work on it.

On Fri, May 12, 2017 at 5:19 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
On Fri, May 12, 2017 at 5:00 PM, Dave Page <dpage@pgadmin.org> wrote:


On Fri, May 12, 2017 at 12:19 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi,

Below code snippet from above commit assumes that we have to disable last row after saving.

@@ -2320,6 +2340,10 @@ define(
                       grid.setSelectedRows([]);
                     }
 
+                    // Add last row(new row) to keep track of it
+                    if (is_added) {
+                      self.rows_to_disable.push(grid.getDataLength()-1);
+                    }

 However this is not the case all the time

For e.g 
Table has some data already and If user adds new row (do not save) and then copy past few exiting rows (at this point  newly added row no longer remains at last position). And after saving it disable last row which is not the newly added row.

Hmm, good point. Can you/Surinder work up a fix for that in time for the release please? 
​Sure Dave, I am working on it.​

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Вложения
Hi

On Fri, May 12, 2017 at 3:20 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
Hi Dave,

Please find attached patch and review.

Thanks, committed.
 

Also, I found an issue which logged and will work on it.

Yes, I also saw that, though I found the colour was lost on paste, not save. I also found another issue - https://redmine.postgresql.org/issues/2400. Can you fix that too please?

Thanks.

 

On Fri, May 12, 2017 at 5:19 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
On Fri, May 12, 2017 at 5:00 PM, Dave Page <dpage@pgadmin.org> wrote:


On Fri, May 12, 2017 at 12:19 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi,

Below code snippet from above commit assumes that we have to disable last row after saving.

@@ -2320,6 +2340,10 @@ define(
                       grid.setSelectedRows([]);
                     }
 
+                    // Add last row(new row) to keep track of it
+                    if (is_added) {
+                      self.rows_to_disable.push(grid.getDataLength()-1);
+                    }

 However this is not the case all the time

For e.g 
Table has some data already and If user adds new row (do not save) and then copy past few exiting rows (at this point  newly added row no longer remains at last position). And after saving it disable last row which is not the newly added row.

Hmm, good point. Can you/Surinder work up a fix for that in time for the release please? 
​Sure Dave, I am working on it.​

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company