Re: [pgAdmin4][Patch]: File Manager & Backform FileControl - Mailing list pgadmin-hackers
From | Surinder Kumar |
---|---|
Subject | Re: [pgAdmin4][Patch]: File Manager & Backform FileControl |
Date | |
Msg-id | CAM5-9D9jr0E9bsE-_exx-XGrmRq9LZSeA+emm8Sbc-jJR_Ny3Q@mail.gmail.com Whole thread Raw |
In response to | [pgAdmin4][Patch]: File Manager & Backform FileControl (Surinder Kumar <surinder.kumar@enterprisedb.com>) |
Responses |
Re: [pgAdmin4][Patch]: File Manager & Backform FileControl
|
List | pgadmin-hackers |
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 <surinder.kumar@enterprisedb.com>
Date: Tue, May 10, 2016 at 11:43 PM
Subject: Re: [pgadmin-hackers][pgAdmin4][Patch]: File Manager & Backform FileControl
To: Neel Patel <neel.patel@enterprisedb.com>
Cc: pgadmin-hackers <pgadmin-hackers@postgresql.org>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, previouslywe 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 provideDialog 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 configconfig.STORAGE_DIRUsage: Backform FilleControlschema:[{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:HiPFA 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_appresponse = self.full_dispatch_request()File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1477, in full_dispatch_requestrv = self.handle_user_exception(e)File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1381, in handle_user_exceptionreraise(exc_type, exc_value, tb)File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1475, in full_dispatch_requestrv = self.dispatch_request()File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line 1461, in dispatch_requestreturn 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_viewreturn func(*args, **kwargs)File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", line 629, in file_managerreturn getattr(myFilemanager, mode)(**kwargs)File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", line 421, in getfolderfilelist = self.list_filesystem(dir, path, trans_data, file_type)File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py", line 331, in list_filesystemfor 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 totest 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_fileFixed.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 belowerror.TypeError: orig_value is undefinedFixed.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 undefinedFixed.Do let us know if you have queries.Thanks,Neel PatelOn 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 PatelOn 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 asimport 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.ThanksSurinder Kumar
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachment
pgadmin-hackers by date: