Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avlh2-0002bx-C9 for pgadmin-hackers@arkaria.postgresql.org; Thu, 28 Apr 2016 13:09:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1avlh1-0004bQ-ML for pgadmin-hackers@arkaria.postgresql.org; Thu, 28 Apr 2016 13:09:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1avlh1-0004bK-3t for pgadmin-hackers@postgresql.org; Thu, 28 Apr 2016 13:09:19 +0000 Received: from mail-yw0-x235.google.com ([2607:f8b0:4002:c05::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1avlgs-0000zM-Se for pgadmin-hackers@postgresql.org; Thu, 28 Apr 2016 13:09:18 +0000 Received: by mail-yw0-x235.google.com with SMTP id g133so106177327ywb.2 for ; Thu, 28 Apr 2016 06:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=SnpiacCTwn0FCumCqwMWilImMCr9uYlcoQGItxSLBvY=; b=GGRBDuUZHY5xDznZcv36VHJJICPpkVJVex0IgWdfrM0pa0/2ImobamDKcJI86/Sn9U tTO1M6nvY9WBWX0W0bRTtB0nm5dohhVEyBMSV9OzTFIaU+sS3zR0gTMM6NCHc7VTNKFm Bj5aznIAKMyvCKzFTJ7SMCODMfOV0+pXJoZx9sPdNluZgfm0/iSa6ZMaKp+z8fyIYcdB r+r3U2MxVO51UY0TeUgnIdc6QhX2ouuPQgB608zVoO4TDtTuNFkWJHT0iF6qpm7wvIzO tSZqvMgDAdd5UAqn5gRdGfJKOK0/1bijBlqDuB2oE///XzpNFWOS5JNYmy5yHc6dehn/ 0ItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=SnpiacCTwn0FCumCqwMWilImMCr9uYlcoQGItxSLBvY=; b=lVvdnk8WIB5qa2ujrTfHWzcCNTh9rqDQYcFZ3v6mlQtZNA2Z9hfqsDohEXKsBGF17A jXzBm7KYIMY4bFlYRtMx4glRAQ1TJZoQx286YZyj9xzex/InMrmCjP0sz10ooh3KCFnS cO6khOZ9RBcFeZpuvd89Th/n+BMGUEygumgmtcJYM+5bA7Aqj/MAATKBZZ9xlZHr8SZV bAPXqP74FqMA7gTTNmvGNz5OLdrAnnqMmD9GxEQNhiOrZq2wMbrGU+4i8oZ7LlTRmSKZ pq2KQbgEBnM5y5GR7gmPG/i94BeKaYw+JMd1/ND17aLLG9sH6E66/IMMr03Tf6OuJ9DF u+Bw== X-Gm-Message-State: AOPr4FWh1/5UBSf8uuudvh6opwF2Vbf3pdZdSgrFY+yRaWd83M+/bC4uUNump597djTRZg6pSIRvftu2yB+ko1lS MIME-Version: 1.0 X-Received: by 10.129.83.213 with SMTP id h204mr7937205ywb.276.1461848948232; Thu, 28 Apr 2016 06:09:08 -0700 (PDT) Received: by 10.37.203.134 with HTTP; Thu, 28 Apr 2016 06:09:08 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Apr 2016 18:39:08 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: File Manager & Backform FileControl From: Neel Patel To: Surinder Kumar Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a114d8e164681c905318b3bcf X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a114d8e164681c905318b3bcf Content-Type: text/plain; charset=UTF-8 Hi Surinder, Please find additional comments as below. 1. In Windows OS, when we try to open the dialog with default preference value then it gives error as below. 2016-04-28 13:07:44,716: ERROR pgadmin: Exception on /file_manager/filemanager/2530270/ [POST] Traceback (most recent call last): File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "C:\Projects\venv_python_2_7\Lib\site-packages\flask_login.py", line 758, in decorated_view return func(*args, **kwargs) File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", line 629, in file_manager return getattr(myFilemanager, mode)(**kwargs) File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", line 421, in getfolder filelist = self.list_filesystem(dir, path, trans_data, file_type) File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", line 331, in list_filesystem for f in sorted(os.listdir(orig_path)): WindowsError: [Error 161] The specified path is invalid: '//*.*' 2. Folder having write only permission should not allow to read the directory. Same way read only permission folder should not allow to create the folder. Currently it gives below error. PermissionError: [Errno 13] Permission denied: '/home/neel/Projects/pgadmin4_file_manager/write_only_premission/' 3. In Windows OS, when we open the file manager dialog, no directories listed though we have directories in the folder. Due to that we are not able to test all the functionality in windows. Once we fix this issue then we test all the functionality in windows OS. We debug the issue and found that issue is with the json response which includes the HTML tags. 4. In Windows OS, file manager dialog have issue with layout. We are getting some margin at top before buttons. 5. When we give any special characters to folder name that it gives error saying "Folder does not exist". Same is applicable when we give dialog_type to create_file 6. In create_file mode, after giving the filename it should display the name of the file to text control. 7. In create_file mode, when user gives the filename and click on the any blank area of dialog then name is getting cleared. 8. When we upload the new file through file manager then it is not showing in the list though we have selected "All files" options. 9. When we rename the folder in "Table mode" then font-family gets changed. It is not happened in "Grid" mode. 10. When we try to download the file then it goes into loop and opens up 20-30 dialogs at the same time. 11. "Rename" button is enabled even though we have not selected the files/folder to rename and when we click on the "Rename" button it gives below error. TypeError: orig_value is undefined 12. "Delete" button is enabled even though we have not selected the files/folder to delete and when we click on the "Delete" button it gives below error. TypeError: path is undefined Do let us know if you have queries. Thanks, Neel Patel On Wed, Apr 27, 2016 at 9:15 PM, Neel Patel wrote: > Hi Surinder, > > I have applied the patch file and below are some observations. > > - When we create the new folder and hit the enter then we are getting > the below error. > > TypeError: argument of type 'NoneType' is not iterable > > - I have just added the new control in "Import" dialog and observed > that new control is getting added in new tab called "General". I think it > should not create the new "General" tab. > - "Select" and "Cancel" buttons font is different then other dialogs. > > > Thanks, > Neel Patel > > On Wed, Apr 27, 2016 at 6:18 PM, Surinder Kumar < > surinder.kumar@enterprisedb.com> wrote: > >> Hi, >> >> The patch is for *File Manager and Backform FileControl*. >> >> *File Manager:* It allows user to store their files at one place. The >> user can set path to this directory in preferences which file manger will >> use. >> >> It will be used by various modules of pgAdmin4 such as >> *import data from file, query tool, backup & recovery tool* so on.. It >> allows user to perform various operations such as: >> >> - File deletion >> - File upload >> - Create new directory >> - File rename >> - File download and >> - List files & folders in list and grid view. >> >> *FileControl: *This control is used with *File Manager. *It can be used >> for: >> >> - File Selection >> - Folder Selection >> - File Creation >> - Storage Manager Dialog.( it supports all operations listed above). >> >> >> Usage*:* >> >> schema:[{ >> id: 'select_file', label: '{{ _('Select File')}}', >> type: 'text', *control*: *Backform.FileControl*, >> *dialog_type: 'select_file'*, *supp_types: ['*', 'pdf', 'text', >> 'patch', 'py']* >> } >> >> Where: >> >> - *control* - It should be *Backform.FileControl* >> - *dialog_type *- the type of dialog to use. >> - options can be: *select_file, select_folder, create_file & >> storage_dialog*. >> - *supp_types(*not mandatory) - the types of files allowed to show >> and upload. >> >> Please review the patch and let me know for the review comments. >> >> >> Thanks >> Surinder Kumar >> >> >> -- >> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgadmin-hackers >> >> > --001a114d8e164681c905318b3bcf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Surinder,

Please find additional com= ments as below.

1.=C2=A0 In Windows OS, when = we try to open the dialog with default preference value then it gives error= as below.

2016-04-28 13:07:44,716: ERROR =C2=A0pg= admin: =C2=A0 =C2=A0 =C2=A0 =C2=A0Exception on /file_manager/filemanager/25= 30270/ [POST]
Traceback (most recent call last):
=C2=A0= File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py"= ;, line 1817, in wsgi_app
=C2=A0 =C2=A0 response =3D self.full_di= spatch_request()
=C2=A0 File "C:\Projects\venv_python_2_7\Li= b\site-packages\flask\app.py", line 1477, in full_dispatch_request
=C2=A0 =C2=A0 rv =3D self.handle_user_exception(e)
=C2=A0 = File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py"= , line 1381, in handle_user_exception
=C2=A0 =C2=A0 reraise(exc_t= ype, exc_value, tb)
=C2=A0 File "C:\Projects\venv_python_2_7= \Lib\site-packages\flask\app.py", line 1475, in full_dispatch_request<= /div>
=C2=A0 =C2=A0 rv =3D self.dispatch_request()
=C2=A0 Fil= e "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", l= ine 1461, in dispatch_request
=C2=A0 =C2=A0 return self.view_func= tions[rule.endpoint](**req.view_args)
=C2=A0 File "C:\Projec= ts\venv_python_2_7\Lib\site-packages\flask_login.py", line 758, in dec= orated_view
=C2=A0 =C2=A0 return func(*args, **kwargs)
= =C2=A0 File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init= __.py", line 629, in file_manager
=C2=A0 =C2=A0 return getat= tr(myFilemanager, mode)(**kwargs)
=C2=A0 File "C:\Projects\p= gadmin4\web\pgadmin\misc\file_manager\__init__.py", line 421, in getfo= lder
=C2=A0 =C2=A0 filelist =3D self.list_filesystem(dir, path, t= rans_data, file_type)
=C2=A0 File "C:\Projects\pgadmin4\web\= pgadmin\misc\file_manager\__init__.py", line 331, in list_filesystem
=C2=A0 =C2=A0 for f in sorted(os.listdir(orig_path)):
Wi= ndowsError: [Error 161] The specified path is invalid: '//*.*'


2. Folder having write only permission = should not allow to read the directory. Same way read only permission folde= r should not allow to create the folder. =C2=A0 =C2=A0 Currently it gives b= elow error.

=C2=A0 =C2=A0PermissionError: [Errno 1= 3] Permission denied: '/home/neel/Projects/pgadmin4_file_manager/write_= only_premission/'

3. In Windows OS, when we op= en the file manager dialog, no directories listed though we have directorie= s in the folder. Due to that we are not able to=C2=A0
=C2=A0 =C2= =A0 test all the functionality in windows. Once we fix this issue then we t= est all the functionality in windows OS.
=C2=A0 =C2=A0
= =C2=A0 =C2=A0We debug the issue and found that issue is with the json respo= nse which includes the HTML tags.

4. In Windows OS= , file manager dialog have issue with layout. We are getting some margin at= top before buttons.

5. When we give any special c= haracters to folder name that it gives error saying "Folder does not e= xist".
=C2=A0 =C2=A0 Same is applicable when we give dialog_= type to create_file
=C2=A0 =C2=A0
6. In create_file mod= e, after giving the filename it should display the name of the file to text= control.

7. In create_file mode, when user gives = the filename and click on the any blank area of dialog then name is getting= cleared.

8. When we upload the new file through f= ile manager then it is not showing in the list though we have selected &quo= t;All files" options.

9. When we rename the f= older in "Table mode" then font-family gets changed. It is not ha= ppened in "Grid" mode.

10. When we try t= o download the file then it goes into loop and opens up 20-30 dialogs at th= e same time.

11. "Rename" button is enab= led even though we have not selected the files/folder to rename and when we= click on the "Rename" button it gives below=C2=A0
=C2= =A0 =C2=A0 =C2=A0error.

=C2=A0 =C2=A0 TypeError: o= rig_value is undefined
12. "Delete" button is enabled even though we= have not selected the files/folder to delete and when we click on the &quo= t;Delete" button it gives below error.
=C2=A0 =C2=A0 =C2=A0T= ypeError: path is undefined

Do let us know if you = have queries.

Thanks,
Neel Patel

On Wed,= Apr 27, 2016 at 9:15 PM, Neel Patel <neel.patel@enterprisedb.co= m> wrote:
= Hi Surinder,

I have applied the patch file and below are= some observations.
  • When we create the new folder and hit= the enter then we are getting the below error.
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0TypeError: argument = of type 'NoneType' is not iterable
  • I have j= ust added the new control in "Import" dialog and observed that ne= w control is getting added in new tab called "General". I think i= t should not create the new "General" tab.
  • "Select&q= uot; and "Cancel" buttons font is different then other dialogs.

Thanks,
Neel Patel
<= div class=3D"gmail_extra">
On Wed, Apr 27, 2016 at 6:18 PM, Surinder Kumar <= surind= er.kumar@enterprisedb.com> wrote:
Hi,

The patch is for File Manager and Backform=C2=A0FileControl.<= /div>

File Manager:=C2=A0It allows user to= store their files at one place. The user can set path to this directory in= preferences which file manger will use.

It will b= e used by various modules of pgAdmin4 such as
import data from= file, query tool, backup & recovery tool=C2=A0so on.. It allows us= er to perform various operations such as:=C2=A0
  • File dele= tion
  • File upload
  • Create new directory
  • File rena= me
  • File download and=C2=A0
  • List files & folders in = list and grid view.
FileControl:=C2=A0This control is used with=C2=A0File Manager.=C2=A0It=C2=A0can be us= ed for:
  • File Selection =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0
  • Folder=C2=A0Selection=C2=A0 =C2=A0 =C2=A0=C2=A0
  • File Creation =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
  • =
  • Storage Manager Dialog.( it supports all operations listed above).
    <= /li>

= Usage:

schema:[{<= /div>
=C2=A0 id: 'select_file'= ;, label: '{{ _('Select File')}}',=C2=A0
<= font face=3D"tahoma, sans-serif">=C2=A0 type: 'text',=C2=A0contr= ol:=C2=A0Backform.FileControl,
=C2=A0=C2=A0dialog_type: 'select_file',=C2= =A0supp_types: ['*', 'pdf', 'text', 'patch&#= 39;, 'py']
}=

Where:
  • control<= /b>=C2=A0- It should be=C2=A0Bac= kform.FileControl
  • dialog_type=C2=A0- the type of dia= log to use.
  • options can be:=C2=A0=C2=A0select_file, select_f= older, create_file & storage_dialog.
  • supp_types(= not mandatory)=C2=A0- the types of files allowed to show and upload.=
Please review the patch and let me know fo= r the review comments.


Thanks
=
Surinder Kumar


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



--001a114d8e164681c905318b3bcf--