Commit Graph

143 Commits

Author SHA1 Message Date
Ashesh Vashi
4adea4dc25 Resolved an issue related to no proper valid/invalid event was
generated for the privilege control. Also, made changes in the
PrivilegeRoleModel, to allow to select a grantee only once for the
current user (as grantor), and omit them from other cell objects.

Valid/Invalid event was not properly triggered, whenever the child
attribute is a collection/model within a model (nested mode/collection
within model). This patch tried to take care of all such scenarios in
general.
2016-03-15 19:00:58 +05:30
Ashesh Vashi
b52a5736ff Improvements in the form/properties dialog control generation, and data
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.
2016-03-15 18:58:22 +05:30
Khushboo Vashi
b32496f71a Allow to use the select2 with multiple selection. Changed the formatter
used by NodeAjaxOptions Family controls to takes care the data returns
by these controls.
2016-02-10 13:09:09 +05:30
Khushboo Vashi
637a5838a8 Resolved a typo in variable name 'version_compatible' 2016-02-10 12:12:06 +05:30
Ashesh Vashi
91c0388a47 Adding the Login/Group Role Node.
Also - includes:
* Added 'parent_id' in the 'generate_browser_node' function of the Nodes
  to allow them to move around the parents objects (specially through
  update/save functionality).

* Handles the issue related to adding the older object back to the
  collection (DataModel).

Author: Ashesh Vashi
Reviewed by: Neel Patel, and Akshay Joshi.
2016-02-05 09:48:38 +05:30
Murtuza Zabuawala
359dff0f78 Fixed the NodeAjaxOtionsControl formatter, which was causing malformed
string, when have special character.
2016-02-03 16:41:28 +05:30
Ashesh Vashi
fc676efa30 Do not trigger 'pgadmin-session:invalid' event, when a child object do
not have any validation error, or the validation error message is null.

Thanks Murtuza for find out the root cause.
2016-02-02 19:42:50 +05:30
Harshal Dhumal
7f3c972d06 Resovled a typo in rendering the NodeAjaxOptionsCell about getting the
options from the column schema for the cell.
2016-01-22 13:23:09 +05:30
Harshal Dhumal
720a9c819b Resolved a typo in the datamodel javascript. 2016-01-21 12:25:31 +05:30
Ashesh Vashi
ba4a6faaa4 Resolved a typo in the frame javscript 2016-01-20 20:23:59 +05:30
Ashesh Vashi
3b1bbe55fa Model needs to update the parent collection object, that - it has been
modified, and please do the needful.

This allows us to track down the nested objects within the nested
objects.
2016-01-20 20:17:30 +05:30
Surinder Kumar
4f4ce74518 Setting a missing parameter - 'empty_value' in NodeAjaxOptionsControl 2016-01-19 19:20:14 +05:30
Ashesh Vashi
8120b380bb Introduced a event manager for the browser, which will generate certain
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.
2016-01-19 18:18:47 +05:30
Ashesh Vashi
0cea682e88 Initialize and parse the neseted schema too.
Renamed the type of the nested schema type to 'nested' from 'uiLayout'
to be more relatevant.
2016-01-19 17:54:39 +05:30
Ashesh Vashi
2acba32c86 Moving the data model and collection to separate module for better code
handling.
2016-01-19 10:16:02 +05:30
Ashesh Vashi
e7bcba0050 Send the consistent data from both menus and context menus. 2016-01-15 19:46:45 +05:30
Harshal Dhumal
1ce0db3b58 Introducing NodeAjaxOptionsCell, NodeListByNameCell, NodeListByIdCell
for using them with Backgrid.

It has similar functionality which we have done for fetching node
options for select2 cell using ajax at the time of initialization to use
it with Backgrid.
2016-01-15 18:25:34 +05:30
Ashesh Vashi
3a06758b94 Integrate the new mechanism for the data session management in the
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.
2016-01-15 16:47:22 +05:30
Ashesh Vashi
185ac442fc Fixes few UI issue with the backform controls.
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.
2016-01-12 13:40:36 +05:30
Ashesh Vashi
27040a22a7 Make the select2 control disabled (when required). 2016-01-12 12:08:18 +05:30
Ashesh Vashi
5b9b55ee8e Passing the version_compability information in the controls, and use
them in the custom controls.

This commit also includes the patch from Harshal regarding the broken
updateInvalidate(..) function.
2016-01-12 12:01:47 +05:30
Ashesh Vashi
429f585a62 Resolved an issue found generating the URL for some other node from some
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.
2016-01-09 19:54:53 +05:30
Ashesh Vashi
1ba9067c60 Introduced the VariableControl, which will be used in role(s),
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.
2016-01-09 18:00:02 +05:30
Ashesh Vashi
753793820b Resolved an issue in the sesion tracking, and generating the data
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.
2016-01-06 19:20:55 +05:30
Ashesh Vashi
456f5bc5b7 Making minor changes:
* Start tracking changes immediatedly depends on the handler.
* Attaching control with the filter in the NodeListByNameControl.
* Generating proper data for the NodeListByNameControl.
2016-01-06 02:25:13 +05:30
Ashesh Vashi
d498b473c7 Changing the caching mechanism to allow it to store at particular level.
Some data will be applicable to parent level, even though - it has
been fetched it from a particular node.

i.e.
roles will be applicable to server level (not particular role level).
2016-01-05 14:36:33 +05:30
Ashesh Vashi
84843f8c37 Pass the tree item object to the menu objects, which could be used by
the disabled function to make it enable/disable based on the current
selected item.
2016-01-04 17:22:06 +05:30
Ashesh Vashi
613be3b6fe Resolved a typo introduced in the previous commit. 2016-01-04 12:58:29 +05:30
Ashesh Vashi
aedf970748 Allow to use the url with/without the node id in the node ajax options
control, also - allow to specify the filter function in the nodes-by-id,
and nodes-by-name control.
2016-01-04 12:43:27 +05:30
Surinder Kumar
f451bd0a83 Set options fetched from the server as it is only when transform function is not provided. 2016-01-04 12:19:00 +05:30
Ashesh Vashi
109b367fc3 Allow to specify the options as a function, which returns array in form
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.
2016-01-04 11:34:43 +05:30
Murtuza Zabuawala
cf802cb23f Resolved an issue in the node control related using existing cached data 2016-01-04 11:12:03 +05:30
Ashesh Vashi
eb83d57c5a Introduced new controls to show the list of a node type (by name and id) as properties of other node.
Resolved a typo in privileges control.
Removed duplicate lines in backform.pgadmin.js
2015-12-28 01:00:20 +05:30
Ashesh Vashi
798398dba5 Fixed few bugs and changed the node create/edit view to use the dialog
(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.
2015-08-11 19:19:29 +05:30
Ashesh Vashi
9d372a4555 Updated wcDocker to the latest version 2015-07-20 16:06:17 +05:30
Ashesh Vashi
dee3185bae Resolved a bug with the menu enable/disble logic.
Also, do not generate list disabled menu in the context menu
2015-07-17 10:06:04 +05:30
Ashesh Vashi
aa150030eb Introduced a mechanism to load required javascripts at runtime
(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).
2015-06-30 11:21:57 +05:30
Dave Page
f040efb473 Make the jQuery-contextMenu control globally available as it's used by wcDocker. 2015-03-09 13:14:20 +00:00
Dave Page
83cbe87040 i18n support. 2015-02-25 17:06:00 +00:00
Dave Page
b43580a19e Add a context menu to the treeview, with options to delete and rename server nodes.
TODO: Make the menu items hook in.
2015-02-18 22:06:12 -05:00
Dave Page
89cc11fb80 This is a big one campers; Add initial support for treeview nodes.
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.
2015-02-15 17:10:53 -05:00
Dave Page
2f154bbed4 The previous commit inadvertently added parts of the browser treeview implementation.
This adds the rest (which still requires further work to make it do anything useful).
2015-02-13 13:24:13 +00:00
Dave Page
1b6d7edd01 Add the core of the main browser layout. 2015-02-05 14:06:20 +00:00