public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM#1422 - "Move to last page" warning shown unnecessarily
Date: Tue, 5 Jul 2016 15:58:09 +0530
Message-ID: <CAM5-9D_5qMT5BpPFOoua_7s7LE=_9KocFF9iXv1XpO1GAxd+Ew@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

Please find attached patch with fix.

> If last page attribute of collection is null, that means it is first page.
> This check is applied for add new row and paste row as well.


Please review.

Thanks,
Surinder Kumar


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


Attachments:

  [application/octet-stream] RM#1422.patch (1.5K, 3-RM%231422.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 5b08623..8e0c24b 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -1795,7 +1795,9 @@ define(
           }
           else {
             // If current page is not the last page then confirm from the user
-            if (self.collection.state.currentPage != self.collection.state.lastPage) {
+            if (self.collection.state.lastPage != null &&
+                self.collection.state.currentPage != self.collection.state.lastPage
+              ) {
               alertify.confirm('{{ _('Add New Row') }}',
                 '{{ _('The result set display will move to the last page. Do you wish to continue?') }}',
                 function() {
@@ -2296,7 +2298,9 @@ define(
           }
           else {
             // If current page is not the last page then confirm from the user
-            if (self.collection.state.currentPage != self.collection.state.lastPage) {
+            if (self.collection.state.lastPage != null &&
+                self.collection.state.currentPage != self.collection.state.lastPage
+              ) {
               alertify.confirm('{{ _('Paste Row') }}',
                 '{{ _('The result set display will move to the last page. Do you wish to continue?') }}',
                 function() {


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch]: RM#1422 - "Move to last page" warning shown unnecessarily
  In-Reply-To: <CAM5-9D_5qMT5BpPFOoua_7s7LE=_9KocFF9iXv1XpO1GAxd+Ew@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox