public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM1739 - Don't show Upload File icon unless it is not in capabilities [Storage Manager]
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM1739 - Don't show Upload File icon unless it is not in capabilities [Storage Manager]
@ 2016-10-07 06:03  Surinder Kumar <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Surinder Kumar @ 2016-10-07 06:03 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

*Issue:*
When clicked on upload icon while saving a file prompt user to leave page.
It is because the icon is a button and its type is set to submit which
makes it to prompt, instead it should be 'button'

Storage Manager's menu items depends on capabilities list set by the module
using it. If capabilities doesn't have 'upload' in it, It won't work.
Upload button is bound to click event only when it is in capabilities.

*Solution:*
As upload button is being added only when it is in capabilities, so upload
button html is removed from html file. It will not shown on UI untill it is
in capabilities list.

Please find attached patch and 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] RM1739.patch (1.7K, 3-RM1739.patch)
  download | inline diff:
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/index.html b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
index 396e950..197386f 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/index.html
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
@@ -18,8 +18,6 @@
             <input class="mode" name="mode" type="hidden" value="add"/>
             <input class="currentpath" name="currentpath" type="hidden"/>
             <button type="button" title="Refresh" class="btn fa fa-refresh refresh"></button>
-            <button type="submit" title="Upload File" value="Upload" class="btn fa fa-upload upload"><span></span>
-            </button>
             <button type="button" title="Download File" class="btn fa fa-download download" disabled><span></span>
             </button>
             <button name="delete" type="button" title="Delete File/Folder" class="btn fa fa-trash delete" disabled>
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
index 8d891fd..1bf7cd6 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
@@ -1418,7 +1418,7 @@ if (has_capability(data, 'upload')) {
   $('.upload').remove();
   $( ".create" ).before( '<button value="Upload" type="button" title="Upload File" name="upload" id="upload" class="btn fa fa-upload upload"><span></span></button> ' );

-  $('.upload').unbind().click(function() {
+  $('#uploader .upload').unbind().click(function() {
     // we create prompt
     var msg  = '<div id="dropzone-container">' +
           '<button class="fa fa-times dz_cross_btn"></button>' +


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][Patch]: RM1739 - Don't show Upload File icon unless it is not in capabilities [Storage Manager]
@ 2016-10-07 11:31  Dave Page <[email protected]>
  parent: Surinder Kumar <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-10-07 11:31 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Fri, Oct 7, 2016 at 7:03 AM, Surinder Kumar
<[email protected]> wrote:
> Hi,
>
> Issue:
> When clicked on upload icon while saving a file prompt user to leave page.
> It is because the icon is a button and its type is set to submit which makes
> it to prompt, instead it should be 'button'
>
> Storage Manager's menu items depends on capabilities list set by the module
> using it. If capabilities doesn't have 'upload' in it, It won't work. Upload
> button is bound to click event only when it is in capabilities.
>
> Solution:
> As upload button is being added only when it is in capabilities, so upload
> button html is removed from html file. It will not shown on UI untill it is
> in capabilities list.
>
> Please find attached patch and 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
>



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

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


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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-10-07 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 06:03 [pgAdmin4][Patch]: RM1739 - Don't show Upload File icon unless it is not in capabilities [Storage Manager] Surinder Kumar <[email protected]>
2016-10-07 11:31 ` Dave Page <[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