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.
Select2 does not allow to scroll any of the parent container once it was
opened, and if it was not properly closed.
Also, resolved an issue - existing selection was not working, while
re-rendering the Select2Cell.
Removed the use of separate editor for both of these cell types. There
were two instance of select2 were getting created in the Select2Cell,
one in the Select2Cell itself, and another in Select2CellEditor. And,
loosing the focus mysteriously, and making the scrollbar in the property
dialog non-responsive.
Also, modified the NodeAjaxOptionsCell to use the above logic, and
removed its own version of render function to make it consitent across
the system.
This patch [changes sent by Murtuza] also includes improvisation in the
DeleteCell, and ObjectCell, which will honour now 'canRemoveRow', and
''canEditRow' respective properties of Column.
The current implementaton binds the cell/control object, and the ajax
data in the asychronous Cells/Controls with the 'options' functions
extended from the Select2Cell.
The problem starts when we try to fetch the current model from that
options/transform/filter function to do some operation, which does not
require in most of the cases. Except the privileges control - where we
needed the current model for omitting the existing selected object
during transformation, and filtering.
In order resolved the issue, we need a common object, which is shared
among the Cell. In backgrid, the 'Column' object is mong the cell,
hence - implementation logic has been changed to bid the 'Column' object
with the 'options' function and, passed the 'Cell' object as an
arguments.
Because - we do use the common function 'transform' between 'Control'
and 'Cell', we needed make changes in the Select2Control to pass the
Control object as an arguments.
And, make the changes in the privileges control to use the new
implementation. The same logic is also required in some of the
operations, we will be/are working on the table/column nodes.
This allows us to use the Backgrid key navigation as expected.
This has also resulted into an issue - related unresponsive scrollbar
issue in the SubNodeControl.
was not honouring the change events after execution of the function -
'render' more than one time. Change the label of the Add button to make
it consistent with the Unique Collection Control.
order to fix the issue rendering the context menu for longer text.
Needs to do some modification in the existing pgAdmin4 CSS theme to make
it looks like/near the existing look and feel.
Following are the enhancements:
1. Added border to control which was missing earlier.
2. Allows user to provide height to sql-field control by specifying extraClasses field in model schema.
3. Defined new classes for sql-field control height in overrides.css
4. Added scrollbar to the control.
Usage:
{
id: 'definition', label:'{{ _("Definition") }}', cell: 'string',
type: 'text', mode: ['create', 'edit'], group: 'Definition',
control: Backform.SqlFieldControl, extraClasses:['custom_height_css_class']
}
change events.
- In input & textarea control, call the change event on key up (but -
not on every key up events, wait for sometime before trigger that
event, so that - we do not overdo that).
- In unique/subnode control, whenever we create new model object, set
all the required static fields used by pgAdmin form generation logic.
- In NodeAjaxListCell, we don't need to call the list generation
operation (ajax operation) for each and every cell. They use the same
shared column object.
which allows to determine certain group to hide/show the whole
tab/fieldset control in the properties, and create dialog.
Using this functionality in the database for the
'default privileges - types', which is not allowed before PG < 9.2 using
the version check.
1) Unique collection control: we have added 'Edit' button in grid, earlier it was only delete button.
2) Sql field control: We have added control to disabled & visible functionality which were not available.
which will be used by the debugger tool.
Updating the wcDocker from the repository -
'https://github.com/WebCabin/wcDocker' up to commit-id:
0f5690318ce0bf457fdd374dcec7418d22b72e22
This patch also includes an issue related to IntegerControl, which does
not emit any error message, when it has some issues.
In order to fix the issue, it will trigger 'pgadmin-session:invalid'
event, when the input value is not an valid integer.
It will be used by the nodes like view, which require to show the code
inside as one parameter.
Also, override the events for the Backform.TextareaControl in order
handle some cases, which were not handling the change in textarea
properly in all situations.
Also, we need to show the error message around the input control with
name attribute only.
Author: Surinder Kumar (small twicks by me).
Reviewed by: Ashesh Vashi
show) for both control and cell, while generating the columns and field
Schema. And, it was resulting into wrong behaviour because of that.
Also - includes the server changes, which was using 'show' parameter
earlier for showing version, when server was connected.
NodeListByNameCell for selecting the grantee.
This patch includes:
- Change the RolePrivilegesModel schema to allow to use the
NodeListByNameCell for showing grantee, and granter information.
- When setting some value - do not use the silent flag in Select2Cell, which
will allow the session manager to take the value in account, which is
used by the NodeListByNameCell.
- Set the top object in the children of the UniqueControl collections.
[Ashesh Vashi]
- Pass on the node information to the actual data model, so that - we can use
node information by the control itself. [Ashesh Vashi]
- While adding the new privilege, set the granter to the current user.
[Ashesh Vashi]
variable control, privilege control, which specifies the keys - which
helps identify the data from the collection. Also, resolved an version
compatibility issue with the variable control.
1. NodeAjaxOtions needs to check 'version_compability' in field, and not
'ver_in_limit' variable. (Thanks Murtuza for pointing that out.)
2. Override the input control to catch the change properly in it.
3. Updated the UniqueCollectionControl and Variable Control to render
proper template in the header.
other.
i.e.
While fetching the database nodes from the role nodes, it was generating
the wrong URL.
Used the parent_type in each node to identify maximum node URL level
using the priority set in the tree node hearachy information, and
generate URL up to that level only.
database(s), and tablespace(s).
Thanks Harshal Dhumal for sharing the original patch.
I've modified a lot to work by fetching the variables later by giving a
url.
Also,
- Introduced the template macros for SECURITY LABELS and VARIABLES.
- Improvised the Backform.Control with better syntactic approach.
- Introduced a jquery function pgMakeVisible(..) to make it visible
under any obj which can be identified by unique class.
properly.
Also, takes care of setting options to empty array, when it couldn't
fetch the options for the NodeAjaxOptionsControl.
And, generating proper url for 'msql' url in the SQL tab, when creating
new node from the same type of node.
such situation. This has been modified specifically for the children
under the schema, and catalog nodes.
Also, override the Backform.Control.prototype.render function to allow
to provide the control data to the evaluable functions (i.e. disabled,
visible, required).
of (label, value) tuple in the SelectControl.
We will apply the transform function, while rendering the control, and
not during intialization. This will allow us to generate different
options data based on the dependent values.
create/edit mode. It will fetch the modified sql using the 'msql' url
specific to that node.
Also, modified by Ashesh before committing it.
i.e. Added code comments, cleanup code for the control, etc.
- Fixed the server backend version check for any schema object.
- Fixed the switch control, it was not enable to toggle the values properly.
- Fixed the editableCell to work properly in the collection properties.
boolean values. (Modified quite a lot by Ashesh, before committing).
This patch also allow to set the header class in the backgrid through
setting 'cellHeaderClass' property of the schema object for any of the
node. It will allow us to set the different behaviour of the cell in the
list. One of the test case for it is: this will allow us to set the
different width of each column in the list using CSS class(es).
Also, resolved an issue related showing the correct server variant in
properties dialog, it is a regression introduced by the patch server
version check.
connect to the database server. Also, added modified the way, we do
check the node is supported by the server.
Instead of creating separate blueprint for the server types, they will
be independently works. In order to add different variant of the
PostgreSQL, we need to extend the ServerType class, and override the
'instanceOf' function for identification using version string. Please
take a look at the ppas.py for the example.
During checking the back-end support for the node, we will also check
the server type (variant) along with the version within the range of
maximum and minimum version for the node. And, the same support added
for the schema attributes in front-end (JavaScript).
Really thankful to Khushboo Vashi for her initial work in front-end. I
took it further from there.
during undo-redo action. Also, resolved the focus losing issue, which
closing the subnode editor using undo action.
Also, resolved an issue related to 'beforeopen' failed on server node,
due to api changes on tree events.
i.e. Switch between the tabs, opening/closing the subnode in edit mode.
Also, removed the Save, Cancel buttons from the subnode editor, it was
looking very redudant. Ctrl+Z for undo, Ctrl+Shift+Z/Ctrl+Y for Redo
shortcut will be good enough for undoing all the changes in the
properties panel.
creation, and editing within the properties panel infrastructure.
We do use the backgrid.js for listing the subnode collection, and for
editing/creating new object for the subnode, we do use the same
infrastructure using the backform.
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.
(tabbed) UI.
Also, fixed few bugs pointed by Dave:
* Open the URL in separate browser tab/window.
* Fixed few CSS changes for look and feel for the dialog view
* Some of the panels were not listed in the context menu for the
wcDocker.
(lazy loading) using the require.js. This allows us to load the
javascript required for any node, only when it was loaded in the browser
tree. Also, introduced the mechanism to show/edit/create of any node in
a tab panel (wcDocker.Panel).
The File menu now includes a "Create" submenu, and Delete/Rename
options. Nodes can offer Delete/Rename functionality, and the
options on the menu are automatically enabled/disabled based on
the selected node. Each node can also offer Create functionality,
and specify a list of node types (including itself) from which the
option should be made available. The menu is dynamically generated
based on the selected node.
The Context menu on the treeview works in a similar way, except that
nodes can offer any context menu items (we don't allow this on the
top menu, as that should stay consistent to avoid user confusion).
This commit adds the following:
- Storage of server groups in the configuration database
- Creation of a default server group on in the database
- A mechanism for plugging in treeview node types
- A node type for server groups with:
- Treeview display
- Custom per-node javascript implementing a menu option/dialogue to add new groups
- Custom per-node CSS to style the treeview node
- JSON formatted data in response to AJAX requests, including:
- Success/failure indication
- Error message
- Extra info (e.g. stack trace)
- The original request data
- Additional return data, e.g. node ID and label etc.
This adds bootstrap-dialog to help with creation of nice dialogs,
and adds the ability for modules to render Javascript into the
browser, and specify onclick handlers in the menu system.
Also add a basic About dialog, using the new infrastructure and
showing some useful info about the application.
A user authentication module based on flask-security is added, which
allows users to login and change/recover passwords etc. Custom templates
are included for the user/password UIs.
A new setup script will initialise the user (and later settings) DB,
adding the first user and granting them an Administrator role.
A redirects blueprint module is added to handle simple URL redirects.
A browser module is added and currently renders a skeleton page with
a menu bar, gravatar and jumbotron.
NOTE FOR LATER: Currently this code might make the nice basis for any
web app that needs user management and plugins. Hmmm....