Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b43IN-0001qs-Uo for pgadmin-hackers@arkaria.postgresql.org; Sat, 21 May 2016 09:34:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b43IN-00070d-HI for pgadmin-hackers@arkaria.postgresql.org; Sat, 21 May 2016 09:34:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b43I9-0006mb-KV for pgadmin-hackers@postgresql.org; Sat, 21 May 2016 09:33:54 +0000 Received: from mail-ig0-x232.google.com ([2607:f8b0:4001:c05::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b43I5-0003K2-Vn for pgadmin-hackers@postgresql.org; Sat, 21 May 2016 09:33:52 +0000 Received: by mail-ig0-x232.google.com with SMTP id u5so1047146igk.1 for ; Sat, 21 May 2016 02:33:49 -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:from:date:message-id:subject:to :cc; bh=MvtogGrFWGeiym+nRd/40I++WwJp/oyVBXP2n1OyMAU=; b=mfo7AJp7pr6kx8oICciFTBopaeEnP89WCjfjA+iGZsWPtqK1dbUl/IDGSyOMzKBb0+ iAA7kZBhwtIK5rirsNwnvnOAOE7pISIjLZIbEs1+y3XyTNwlF1mczvhRUoA8COtoFkHE EjSbV0VoZa1RLHY3xhGjCtfNXcJluHbPQdLUh9/MKXEEiNlIgyJEXzGmMfEN04TQ28Og vlCNUSY/5Md26ggY4iAZnR6+PkdqG2e+fWf/dzD3WntBU6/n9AE6twq5NswYhhoMULBM q3P8WyNVsg09aMCYaAhW9/uod0xkFW+f/dVJsX3UTma1DTjQXIxscH6tpchuzNVonF+t 2F/A== 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:from:date :message-id:subject:to:cc; bh=MvtogGrFWGeiym+nRd/40I++WwJp/oyVBXP2n1OyMAU=; b=UXCaSRGEy2siKIl++pwunQE+GzNHjJA375IGw/XgzLs1cL0HDerSNhiSVMHl2VeAR2 XPq6uF2KVBHrPiB7jnREkXPU1pz7NCncgh44iBwedJlgJ8IUoIBYGrwpfJnc5oCS+mLP JFLRRFIHqqC2HDgDH3zyx90V76Hxvb2fGIeOG4C0JbpKSmvqEDyi1wIaQVlSnbbj99zt uJ7q5/FNzEZq9WYrBfArpkwTjGTeQ5gF8rqN3lTlRjC2rm0WODAYlGdwUz6AvCW5cJLJ ZlXMdND/+KSNdUyr5XGIF6RMRSHwh/QeS8Lsv3oWuyHHyYM5xAyTHsxpgHh7me9F5YLo 0Pfw== X-Gm-Message-State: ALyK8tI+Wrjqwhx3jbR97iAVwyDb5XP3TpTmghBc7qntTlUZ1R8kgfK2de0wdZaLQbCcol2UVhYTGy9gYhbT5zk+ X-Received: by 10.50.116.200 with SMTP id jy8mr497523igb.35.1463823229170; Sat, 21 May 2016 02:33:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.31.209 with HTTP; Sat, 21 May 2016 02:33:29 -0700 (PDT) In-Reply-To: References: From: Ashesh Vashi Date: Sat, 21 May 2016 15:03:29 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: File Manager & Backform FileControl To: Surinder Kumar Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=bcaec5069a0096d89f053356e7f3 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 --bcaec5069a0096d89f053356e7f3 Content-Type: text/plain; charset=UTF-8 Thanks - committed with small tweak. -- Thanks & Regards, Ashesh Vashi EnterpriseDB INDIA: Enterprise PostgreSQL Company *http://www.linkedin.com/in/asheshvashi* On Fri, May 20, 2016 at 4:33 PM, Surinder Kumar < surinder.kumar@enterprisedb.com> wrote: > Hi, > > Please find patch with following issues/changes fixed: > > 1. Rename file/folder not working in list view. > 2. Selection folder only should not allow to select file. > 3. Ui changes in *table list* to match with the pgadmin color styles. > 4. Custom *STORAGE_DIR* path don't list files/folders when opened in > window system. > 5. Code cleanup, formatting & did proper commenting. > 6. In file selection mode, the value typed in text box not setting into > backbone model. > 7. Removed create file code, it should be handled on module using it. > 8. Written a common function to make ajax request, instead of writing > individual functions for same task. > > *Issue to be fixed*: When FileControl is used with 'nested' type, it > redirects to some url when it is opened up. > Once it gets fixed. I will send patch for this issue. > > > Thanks > Surinder Kumar > > On Sat, May 14, 2016 at 12:40 AM, Ashesh Vashi < > ashesh.vashi@enterprisedb.com> wrote: > >> Thanks - committed with some tweaks! >> >> -- >> >> Thanks & Regards, >> >> Ashesh Vashi >> EnterpriseDB INDIA: Enterprise PostgreSQL Company >> >> >> >> *http://www.linkedin.com/in/asheshvashi* >> >> >> On Fri, May 13, 2016 at 7:36 PM, Surinder Kumar < >> surinder.kumar@enterprisedb.com> wrote: >> >>> Hi, >>> >>> PFA patch with changes: >>> 1. Line of code shouldn't exceed greater than 80. >>> 2. Can't consider boolean as string while comparing. >>> >>> On Fri, May 13, 2016 at 4:33 PM, Surinder Kumar < >>> surinder.kumar@enterprisedb.com> wrote: >>> >>>> Hi, >>>> >>>> Please find the patch for the following improvements: >>>> 1. FileManager won't show Volumes on Windows when STORAGE_DIR is set to >>>> None. >>>> >>>> >>>> On Fri, May 13, 2016 at 12:24 AM, Ashesh Vashi < >>>> ashesh.vashi@enterprisedb.com> wrote: >>>> >>>>> Hi Surinder, >>>>> >>>>> Thanks - it was committed! >>>>> >>>>> As discussed personally, there are few improvement needed. >>>>> >>>>> * Do not show non applicable buttons, whenever no files/directory >>>>> available in the storage root directory. >>>>> >>>> Done >>>> >>>>> * In crate mode, use dimmer with the overwrite warning, so that - it >>>>> does not allow to deselect the current selection. >>>>> >>>> Done >>>> >>>>> * The default selection for the file type selection combo box should >>>>> be other than 'All Files'. >>>>> >>>> Done >>>> >>>>> * File type selection combo box should support file type description. >>>>> i.e. >>>>> Query/SQL File (*.sql) >>>>> CSV File (*.csv) >>>>> All Files (*.* | *) >>>>> >>>>> Please put that in the TODO file, we will handle that in future. >>>>> >>>> I have added it into TODO file. >>>> >>>>> >>>>> I must apologies for a mistake for not giving you the credit for the >>>>> work, I forgot to set the author while committing it. >>>>> I tried setting it again to set the author without any success. :-( >>>>> >>>>> Thanks for the patch. >>>>> I will be more careful next time. >>>>> >>>>> -- >>>>> >>>>> Thanks & Regards, >>>>> >>>>> Ashesh Vashi >>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company >>>>> >>>>> >>>>> >>>>> *http://www.linkedin.com/in/asheshvashi* >>>>> >>>>> >>>>> On Thu, May 12, 2016 at 12:18 AM, Surinder Kumar < >>>>> surinder.kumar@enterprisedb.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> PFA updated patch with following issues fixed: >>>>>> 1. not listing files based on default file type selected. >>>>>> 2. load css file using 'get_own_stylesheets' method instead of >>>>>> loading from 'base.html'. >>>>>> 3. setting custom dialog title and button not working. >>>>>> >>>>>> On Wed, May 11, 2016 at 3:03 PM, Surinder Kumar < >>>>>> surinder.kumar@enterprisedb.com> wrote: >>>>>> >>>>>>> >>>>>>> ---------- Forwarded message ---------- >>>>>>> From: Surinder Kumar >>>>>>> Date: Tue, May 10, 2016 at 11:43 PM >>>>>>> Subject: Re: [pgadmin-hackers][pgAdmin4][Patch]: File Manager & >>>>>>> Backform FileControl >>>>>>> To: Neel Patel >>>>>>> Cc: pgadmin-hackers >>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Please find updated path with couple of review comments given by >>>>>>> Ashesh Vashi. >>>>>>> 1. Add variable *STORAGE_DIR* in configuration settings which >>>>>>> decides the directory to list when *File manager* is opens, >>>>>>> previously >>>>>>> we have provided this option in preferences which is removed due to >>>>>>> security issues. >>>>>>> 2. List all available Volumes by default when *STORAGE_DIR *is set >>>>>>> to empty for *Windows* platform. >>>>>>> 3. Also, added support to allow user to provide >>>>>>> *Dialog title and custom name for primary(OK) button,* >>>>>>> >>>>>>> Usage: >>>>>>> >>>>>>> 1. Set variable *STORAGE_DIR *to some value in config.py. >>>>>>> 2. Import it in your module as following: >>>>>>> * import config* >>>>>>> * config.**STORAGE_DIR* >>>>>>> >>>>>>> *Usage*: Backform FilleControl >>>>>>> >>>>>>> schema:[{ >>>>>>> id: 'select_file', label: '{{ _('Select File')}}', >>>>>>> type: 'text', *control*: *Backform.FileControl*, >>>>>>> *dialog_type: '*select_file*'*, *supp_types: [*'*', 'pdf', >>>>>>> 'text', 'patch', 'py'*],* >>>>>>> * dialog_title: '*Title to appear on dialog*", * >>>>>>> * btn_primary: '*Save File*'* >>>>>>> }] >>>>>>> >>>>>>> Please review the patch. >>>>>>> >>>>>>> On Wed, May 4, 2016 at 6:35 PM, Surinder Kumar < >>>>>>> surinder.kumar@enterprisedb.com> wrote: >>>>>>> >>>>>>>> Hi >>>>>>>> >>>>>>>> PFA updated patch with resolved review comments. >>>>>>>> >>>>>>>> On Thu, Apr 28, 2016 at 6:39 PM, Neel Patel < >>>>>>>> neel.patel@enterprisedb.com> wrote: >>>>>>>> >>>>>>>>> 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: '//*.*' >>>>>>>>> >>>>>>>>> Now the default path will always be the users directory. I have >>>>>>>> used *os.path.expanduser('~') *which prints user directory. It >>>>>>>> works for all operating systems. >>>>>>>> >>>>>>>>> >>>>>>>>> 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/' >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>> Fixed. It still have issues in very older browsers. I will fix it. >>>>>>>> >>>>>>>>> >>>>>>>>> 4. In Windows OS, file manager dialog have issue with layout. We >>>>>>>>> are getting some margin at top before buttons. >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 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 >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 6. In create_file mode, after giving the filename it should >>>>>>>>> display the name of the file to text control. >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 7. In create_file mode, when user gives the filename and click on >>>>>>>>> the any blank area of dialog then name is getting cleared. >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 9. When we rename the folder in "Table mode" then font-family gets >>>>>>>>> changed. It is not happened in "Grid" mode. >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 10. When we try to download the file then it goes into loop and >>>>>>>>> opens up 20-30 dialogs at the same time. >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 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 >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> 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 >>>>>>>>> >>>>>>>> Fixed. >>>>>>>> >>>>>>>>> >>>>>>>>> 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.com> 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 >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org >>>>>> ) >>>>>> To make changes to your subscription: >>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers >>>>>> >>>>>> >>>>> >>>> >>> >> > > > -- > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > > --bcaec5069a0096d89f053356e7f3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks - committed with small tweak.

--

Th= anks & Regards,

Ashesh Vashi
Enterpri= seDB INDIA: Enterprise PostgreSQL Company

<= br>

<= a href=3D"http://www.linkedin.com/in/asheshvashi" target=3D"_blank">http= ://www.linkedin.com/in/asheshvashi


On Fri, May 20, 2016 at 4:33 PM, Surinder Ku= mar <surinder.kumar@enterprisedb.com> wrote:
Hi,

Pl= ease find patch with following issues/changes fixed:

1. Rename file/folder not working in list view.
2. Selection f= older only should not allow to select file.
3. Ui changes in t= able list to match with the pgadmin color styles.
4. Custom <= b>STORAGE_DIR path don't list files/folders when opened in window s= ystem.
5. Code cleanup, formatting & did proper commenting.
6. In file selection mode, the value typed in text box not setting= into backbone model.
7. Removed create file code, it should be h= andled on module using it.
8. Written a common function to make a= jax request, instead of writing individual functions for same task.

Issue to be fixed: When FileControl is used with &= #39;nested' type, it redirects to some url when it is opened up.
<= div>Once it gets fixed. I will send patch for this issue.


Thanks
Surinder Kumar

On Sat, May 14, 2016 at= 12:40 AM, Ashesh Vashi <ashesh.vashi@enterprisedb.com>= wrote:
Thanks - = committed with some tweaks!

<= p style=3D"margin:0pt">--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<= /p>

<= br>

<= a href=3D"http://www.linkedin.com/in/asheshvashi" target=3D"_blank">http= ://www.linkedin.com/in/asheshvashi


On Fri, May 13, 2016 at 7:3= 6 PM, Surinder Kumar <surinder.kumar@enterprisedb.com>= ; wrote:
Hi,
=
PFA patch with changes:
1. Line of code shouldn= 9;t exceed greater than 80.
2. Can't consider boolean as stri= ng while comparing.

On Fri, May 13, 2016 at 4:33 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
Hi,

Please fi= nd the patch for the following improvements:
1. FileManager won&#= 39;t show Volumes on Windows when STORAGE_DIR is set to None.

On Fri, Ma= y 13, 2016 at 12:24 AM, Ashesh Vashi <ashesh.vashi@enterprised= b.com> wrote:
=
Hi Surinder,

Thanks - it was committed!=

As discussed personally, there are few improvemen= t needed.

* Do not show non applicable buttons, wh= enever no files/directory available in the storage root directory.
Done=C2=A0
* In crate mode, use dimmer with the overwrite = warning, so that - it does not allow to deselect the current selection.
Done=C2=A0
* The default selection for the file type = selection combo box should be other than 'All Files'.
Done=C2=A0
* File type selection combo box should support file = type description.
=C2=A0 i.e.
Query/SQL File (*.sql)
CSV File (*.csv)
All Files (*.* | *)

=
Please put that in the TODO file, we will handle that in future.
=
I have added it into TODO file.=C2=A0
<= div>

I must apologies for a mistake for not giving you the credit for the work= , I forgot to set the author while committing it.
I tried set= ting it again to set the author without any success. :-(

Thanks for the patch.
I will be more careful next time.

=

--=

Thanks &= ; Regards,

Ashesh Vashi
EnterpriseDB INDIA= : Enterpri= se PostgreSQL Company

<= br>

<= a href=3D"http://www.linkedin.com/in/asheshvashi" target=3D"_blank">http= ://www.linkedin.com/in/asheshvashi

<= div>

On Thu, May 12, 2016 at 12:18 AM, Surinder K= umar <surinder.kumar@enterprisedb.com> wrote:<= br>
Hi,

P= FA updated patch with following issues fixed:
1. not listing file= s based on default file type selected.
2. load css file using = 9;get_own_stylesheets' method instead of loading from 'base.html= 9;.
3. setting custom dialog title and button not working.
<= /div>

On= Wed, May 11, 2016 at 3:03 PM, Surinder Kumar <surinder.kuma= r@enterprisedb.com> wrote:
=

---------- Forwar= ded message ----------
From: Surinder Kuma= r <surinder.kumar@enterprisedb.com>
Dat= e: Tue, May 10, 2016 at 11:43 PM
Subject: Re: [pgadmin-hackers][pgAdmin4= ][Patch]: File Manager & Backform FileControl
To: Neel Patel <neel.patel@en= terprisedb.com>
Cc: pgadmin-hackers <pgadmin-hackers@postgresql.org>


Hi,

Please find updat= ed path with couple of review comments given by Ashesh Vashi.
1. = Add variable STORAGE_DIR in configuration settings which decides the= directory to list when File manager is opens, previously
= we have provided this option in preferences which is removed due to securit= y issues.
2. List all available Volumes by default when=C2=A0S= TORAGE_DIR is set to empty for Windows platform.
3. Al= so, added support to allow user to provide
Dialog title and cu= stom name for primary(OK) button,

Usage= :

1. Set variable=C2=A0STORAGE_DIR to some = value=C2=A0in config.py.
2. Import it in your module as following= :
=C2=A0 =C2=A0import config
=C2=A0 =C2=A0con= fig.STORAGE_DIR

Usage: Backform= =C2=A0FilleControl

schema:[{
=C2=A0 id: 'select_fi= le', label: '{{ _('Select File')}}',=C2=A0
=
=C2=A0 type= : 'text',=C2=A0control:=C2=A0Backform.FileControl,
=C2=A0=C2=A0dialog_type: 'select_file',=C2=A0supp_types: ['*', 'pdf', 'text', 'patch= 9;, 'py'],
=C2=A0 dialog_title: 'Title to appear= on dialog",=C2=A0
=C2=A0 btn_primary: 'Save File'
}]

Please review the patch.
<= div>

On Wed, May 4= , 2016 at 6:35 PM, Surinder Kumar <surinder.kumar@enterprise= db.com> wrote:
Hi

PFA updated patch with resolved review comments.=

On Th= u, Apr 28, 2016 at 6:39 PM, Neel Patel <neel.patel@enterprisedb.= com> wrote:
Hi Su= rinder,

Please find additional comments as below.<= /div>

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

2016-04-28 13:07:44,716: ERROR =C2=A0pgadmin: =C2=A0 = =C2=A0 =C2=A0 =C2=A0Exception on /file_manager/filemanager/2530270/ [POST]<= /div>
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_dispatch_request= ()
=C2=A0 File "C:\Projects\venv_python_2_7\Lib\site-package= s\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, i= n handle_user_exception
=C2=A0 =C2=A0 reraise(exc_type, exc_value= , tb)
=C2=A0 File "C:\Projects\venv_python_2_7\Lib\site-pack= ages\flask\app.py", line 1475, in full_dispatch_request
=C2= =A0 =C2=A0 rv =3D self.dispatch_request()
=C2=A0 File "C:\Pr= ojects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1461, in = dispatch_request
=C2=A0 =C2=A0 return self.view_functions[rule.en= dpoint](**req.view_args)
=C2=A0 File "C:\Projects\venv_pytho= n_2_7\Lib\site-packages\flask_login.py", line 758, in decorated_view
=C2=A0 =C2=A0 return func(*args, **kwargs)
=C2=A0 File &= quot;C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", = line 629, in file_manager
=C2=A0 =C2=A0 return getattr(myFilemana= ger, mode)(**kwargs)
=C2=A0 File "C:\Projects\pgadmin4\web\p= gadmin\misc\file_manager\__init__.py", line 421, in getfolder
=C2=A0 =C2=A0 filelist =3D self.list_filesystem(dir, path, trans_data, fi= le_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)):
WindowsError: = [Error 161] The specified path is invalid: '//*.*'

Now the default path will always b= e the users directory. I have used os.path.expanduser('~') w= hich prints user directory.=C2=A0It works for all operating systems.=C2=A0<= /div>

2. Folder having write only permission should not allow to read the d= irectory. Same way read only permission folder should not allow to create t= he folder. =C2=A0 =C2=A0 Currently it gives below error.

=C2=A0 =C2=A0PermissionError: [Errno 13] Permission denied: '/ho= me/neel/Projects/pgadmin4_file_manager/write_only_premission/'
Fixed.=C2=A0
=

3. In Windows OS, when we open th= e file manager dialog, no directories listed though we have directories in = the folder. Due to that we are not able to=C2=A0
=C2=A0 =C2=A0 te= st all the functionality in windows. Once we fix this issue then we test al= l the functionality in windows OS.
=C2=A0 =C2=A0
=C2=A0= =C2=A0We debug the issue and found that issue is with the json response wh= ich includes the HTML tags.
Fixed= . It still have issues in very older browsers. I will fix it.

4. In Windows OS, = file manager dialog have issue with layout. We are getting some margin at t= op before buttons.
Fixed.=C2=A0

5. Whe= n we give any special characters to folder name that it gives error saying = "Folder does not exist".
=C2=A0 =C2=A0 Same is applicab= le when we give dialog_type to create_file
Fixed.=C2=A0
=
=C2=A0 =C2=A0
6. In create_file mode, after giving the filen= ame it should display the name of the file to text control.
Fixed.=C2=A0

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

8. When we uplo= ad the new file through file manager then it is not showing in the list tho= ugh we have selected "All files" options.
Fixed.=C2=A0

9. When we rename the folder in "Table mode= " then font-family gets changed. It is not happened in "Grid"= ; mode.
Fixed.=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pa= dding-left:1ex">

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.
Fixed.=C2=A0

11. "Re= name" button is enabled even though we have not selected the files/fol= der to rename and when we click on the "Rename" button it gives b= elow=C2=A0
=C2=A0 =C2=A0 =C2=A0error.

= =C2=A0 =C2=A0 TypeError: orig_value is undefined
Fixed.=C2=A0
<= div>
12. "= Delete" button is enabled even though we have not selected the files/f= older to delete and when we click on the "Delete" button it gives= below error.
=C2=A0 =C2=A0 =C2=A0TypeError: path is undefined
Fixed.=C2=A0

Do let us know if you h= ave queries.

Thanks,
Neel Patel

On Wed, Apr 27, 2016 at 9:15 PM, Neel Patel <neel.patel@enterp= risedb.com> wrote:
Hi Su= rinder,

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 t= ype 'NoneType' is not iterable
  • I have just = added the new control in "Import" dialog and observed that new co= ntrol is getting added in new tab called "General". I think it sh= ould not create the new "General" tab.
  • "Select"= and "Cancel" buttons font is different then other dialogs.
  • <= /ul>

Thanks,
Neel Patel

On Wed, Apr = 27, 2016 at 6:18 PM, Surinder Kumar <surinder.kumar@enterpri= sedb.com> wrote:
Hi,

The patch is for File Manager and = Backform=C2=A0FileControl.

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

It will be used by various modules of pgAdmin4 such a= s
import data from file, query tool, backup & recovery too= l=C2=A0so on.. It allows user to perform various operations such as:=C2= =A0
  • File deletion
  • File upload
  • Create = new directory
  • File rename
  • File download and=C2=A0
  • <= li>List files & folders in list and grid view.
= FileControl:=C2=A0This control is used with=C2=A0File Mana= ger.=C2=A0It=C2=A0can be used 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 al= l operations listed above).

Usage:

schema:[{
=C2=A0 id: 'select_file', label: '{{ _('Select File')}= }',=C2=A0
=C2=A0 typ= e: 'text',=C2=A0control:=C2=A0Backform.FileControl,
=C2=A0=C2=A0dialog_typ= e: 'select_file',=C2=A0supp_types: ['*', 'pdf= 9;, 'text', 'patch', 'py']
}

Wher= e:
  • control=C2=A0- It should be=C2=A0Backform.FileControl
  • dialog= _type=C2=A0- the type of dialog to use.
  • options can be:=C2= =A0=C2=A0select_file, select_folder, create_file & storage_dialog.
  • supp_types(not mandatory)=C2=A0- the types of = files allowed to show and upload.
Please re= view the patch and let me know for the review comments.


Thanks
Surinde= r Kumar


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









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








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


--bcaec5069a0096d89f053356e7f3--