When a File Manager is closed by clicking cancel button. Its dom element not destroyed.. So on traversing into directories, when it tries to get currently selected file type, it looks into the dom element but it gets dom of previous dialogs not of currently dialog.
Now whenever an instance of File Manager is closed. its dom elements are also destroyed.
Issues fixed:
1) In Python 3, parameter "cmp" is removed from sorted method. So File Manager won't open.
As we are sorting data on JS side using Natural sort, so on server side sorting is not required.
2) Improvement in Exception handling.
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.
algorithm.
This patch takes care of:
* Consistent behaviour during create, update operation on any node.
- It should return the node data during creating a new object, or
updating the existing one.
* Now that - we have consistent behaviour during these operations, we
can consistently move, update the tree item based the node data from
the server.
* Implemented the methods for each node to get the information about
that particular node only.
* Using the above changes to implement the 'refresh' operation on tree
node properly.
I must thank Surinder, and Harshal for helping me implement the 'node'
method, and also changed the behaviour of create & update methods to
return the node data for most of the nodes.
Fixes#1244
Made backend changes for:
* Taking care of the connection status in the psycopg2 driver. And, when
the connection is lost, it throws a exception with 503 http status
message, and connection lost information in it.
* Allowing the flask application to propagate the exceptions even in the
release mode.
* Utilising the existing password (while reconnection, if not
disconnected explicitly).
* Introduced a new ajax response message 'service_unavailable' (http
status code: 503), which suggests temporary service unavailable.
Client (front-end) changes:
* To handle the connection lost of a database server for different
operations by generating proper events, and handle them properly.
Removed the connection status check code from different nodes, so that
- it generates the proper exception, when accessing the non-alive
connection.
Fixes#1387
- Double click on file/folder icon or name will navigate to the folder/file.
- Selected file/folder can be renamed by Rename button only. Double click rename is removed.
- Filename text box will not hide on smaller screen. Setting minimum width of File Browser fixed it.
- Path at top will only show directory name, not the file name and it is greyed out
1) Unable to select sql file through query tool on windows OS. In file_manager.js, we are stripping initial slash '/' from the path obtained, but we should not strip if it is full path like 'c:/path/to/dir/filename.ext'
2) Handle directory path if STORAGE_DIR is None. Proper checks are added.
are clicked without selecting any tree node. it gives error in browser
console panel.
Because the node passed is undefined. and check is missing. This is now
fixed by adding check for node passed.
* Do not need to translate an empty string. (that results into the
translation header inclusion in the javacript module).
* String.prototype.StartsWith is not an well received function, it has
not been available in the QWebkit for linux.
* Moved the Columns, and Constraint to its repective tabs.
* Ensure all the labels only have a capital letter on the first word
(except for keywords or acronyms).
* Resolve the typo in string - 'System table'.
* Error messages on fields should not be shown unless the field loses
focus and has an error.
* "General" section should have a limited subset of information.
* Variables grids should not be on the Security tab.
* Fixes the field labels that imply a question.
* Privileges controls on the Properties lists should be in a "Security"
group.
Apart from review comments improved few other areas too:
* Used in-place DepsCell functionality for columns in both index, and
type node.
* Improved the error handling in constraint nodes.
* Added create, alert SQL Help for nodes associated with the table node.
- Rename file/folder not working in list view.
- Selection folder only should not allow to select file.
- Ui changes in table list to match with the pgadmin color styles.
- Custom STORAGE_DIR path don't list files/folders when opened in window
system.
- Code cleanup, formatting & did proper commenting.
- In file selection mode, the value typed in text box not setting into
backbone model.
- Removed create file code, it should be handled on module using it.
- Written a common function to make ajax request, instead of writing
individual functions for same task.
Tweaked by Ashesh Vashi to integrate the backgroud process, and also
with some improvements as stated below:
* Resolved an issue loading existing preference.
* Improved the background process observer/executor for supporting
detalied view.
* Added the utility path preferences in the ServerType class.
operation like backup, restore, etc within it.
Also:
* improvised the color combination of the background process logger.
* Removed an unnecessary print statement from the
get_storage_directory(..) function, also return None if STORAGE_DIR
is set to None.
* Do not show the drives on windows, if STORAGE_DIR is set.
* Do not show non-applicable buttons, whenever no files/directory
present in the storage directory.
* Showing dimmer under the warning messages for replace/delete.
* Select file type other than 'All Files' in create/replace mode.
Tweaked a bit by Ashesh.
We will be using the external utilities like pg_dump, pg_dumpall,
pg_restore in background. pgAdmin 4 can be run as a CGI script, hence -
it is not good idea to run those utility in a controlled environment.
The process executor will run them in background, and we will execute
the process executor in detached mode.
Now that - the process executor runs in detached mode, we need an
observer, which will look at the status of the processes. It also reads
output, and error logs on demand.
Thanks - Surinder for helping in some of the UI changes.
selection, creation, upload/download files/directories resides on the
server side.
This will be useful for file selection/creation for different server
side utilites like pg_dump, pg_dumpall, pg_restore.
Also, remove the CodeMirror object for better clean up process.
When a SQL control/tab is rendered in a hidden element, it does not
render really well. Because - it rely on the height, and width of the
container to count the gutten position, and margin, and other elements.
Hence - whenever the tab, panel becomes visible, we will refresh the
control.
known events, when any activity happens on the browser layout.
The following types of events will be triggered through the browser
event manager.
- pgadmin-browser:frame:* [1]
- pgadmin-browser:frame-<name>:* [1]
- pgadmin-browser:panel:* [1]
- pgadmin-browser:panel-<name>:* [1]
- pgadmin-browser:panel
- pgadmin-browser:frame
- pgadmin-browser:tree
- pgadmin-browser:tree:* [2]
[1] The '*' denotes some of the events generated by the wcDocker, which
can be useful to do some operations.
These events are:
+ wcDocker.EVENT.UPDATED
+ wcDocker.EVENT.VISIBILITY_CHANGED
+ wcDocker.EVENT.BEGIN_DOCK
+ wcDocker.EVENT.END_DOCK
+ wcDocker.EVENT.GAIN_FOCUS,
+ wcDocker.EVENT.LOST_FOCUS
+ wcDocker.EVENT.CLOSED
+ wcDocker.EVENT.BUTTON
+ wcDocker.EVENT.ATTACHED
+ wcDocker.EVENT.DETACHED
+ wcDocker.EVENT.MOVE_STARTED
+ wcDocker.EVENT.MOVE_ENDED
+ wcDocker.EVENT.MOVED
+ wcDocker.EVENT.RESIZE_STARTED
+ wcDocker.EVENT.RESIZE_ENDED
+ wcDocker.EVENT.RESIZED
+ wcDocker.EVENT.SCROLLED
[2] The '*' denotes all the events generated by the Browser Tree
(aciTree).
The extension modules can utilize these events to do some operations on
nodes, and panels.
This patch includes showing 'Reversed Engineered Query' for the selected
node (if allowed) using the above approch.
The ShowNodeSQL module looks for two events.
1. SQL Panel Visibility change.
- Based on the visibility of that panel, we start/stop listening the
node selection event.
2. Node Selection in Browser tree
- Based on the selected node type, it will look for 'hasSQL'
parameter of the node, and fetch the Query from the server, and
show it in the SQL editor.
server connection.
The BaseDriver and BaseConnection are two abstract classes, which allows
us to replace the existing driver with the currently used. The current
implementation supports to connect the PostgreSQL and Postgres Plus
Advanced Server using the psycopg2 driver.
submodules inherited from the PgAdminModule instead of regular
Blueprint. This allows us to load the module automatically from the
under the pgadmin directory, and will work to extend the pgAdmin
extension module.
PgAdminModule is inherited from the Blueprint, and bring several
methods:
- get_own_stylesheets, which returns the stylesheets used by the module
(excluding its submodules stylesheets)
- get_own_javascripts
- menu_items, which returns a dictionray mapping the old hook names
(context_items etc) to a list of MenuItem instances
For more specialized modules (as for now, any module that should be part
of the browser tree construction), one can define an abstract base class
defining additional methods.
For example, the BrowserPluginModule abstract base class defines the
following methods:
- jssnippets
- csssnipeets
- node_type
- get_nodes