Commit Graph

78 Commits

Author SHA1 Message Date
Surinder Kumar
47d7e24bb9 Add a Help button to the bottom left of the Wizard framework 2016-06-08 14:08:12 +01:00
Murtuza Zabuawala
bf042d46a2 Check valid DOMElement existance before accessing it while updating the
menu updation.
2016-06-02 15:01:16 +05:30
Surinder Kumar
4741992ad7 [Grant Wizard] Added support for Materialized View in the Grant Wizard.
Also - done proper view clean up when the wizard is cancelled.
2016-05-25 17:41:02 +05:30
Ashesh Vashi
cf0f692d00 Dialog default sizing. 2016-05-25 11:18:05 +01:00
Ashesh Vashi
748497916e Honour the node type (if provided) in the menu item, and disable it on
any other nodes.
2016-05-25 01:15:10 +05:30
Neel Patel
aff0d417bb Fixed the issue related to set proper height, width of the div of a frame in
wcFrame. This is only happens only in the Firefox browser.

This was regression of the commit-id:
9a832086c5.
2016-05-23 13:22:40 +05:30
Ashesh Vashi
2c6ca7d82c Changed the Select2Control to work more consistently. 2016-05-21 15:41:38 +05:30
Ashesh Vashi
b2b6d443b5 Do not validate the model unnecessarily (when closing).
Clear the cache of a node, whenever an object has been removed of that
kind, it will allow us to fetch the latest list.
2016-05-21 15:36:41 +05:30
Sanket Mehta
6895da9cbc Added support for FTS configuration node 2016-05-19 21:04:07 +05:30
Neel Patel
9a832086c5 Fixed an issue - not displaying query tool & debugger from the runtime.
In order to resolve the issue, set the height, width of the area (div)
under the wcFrame. wcIFrame consider the height, and width of this
container to determine the height, width & position of the iframe.
2016-05-19 15:55:13 +05:30
Ashesh Vashi
8a7a8eb9aa Check for valid object existence before checking its session changed
flag in the data model.

Thanks Murtuza, and Harshal for reporting it.
2016-05-16 18:29:32 +05:30
Surinder Kumar
938ea21f40 Fixed following issues:
1) Grant wizard close issue.
   2) Moved grant wizard specific css from wizard.css to grant_wizard.css
   3) removed 'ajs_content' css from wizard.css causing padding issue in alertify dialog
2016-05-13 15:04:36 +05:30
Harshal Dhumal
585daddce2 Destroy the existing Select2 object before rerendering the control. 2016-05-12 16:14:06 +05:30
Surinder Kumar
01e83f1807 Adding missing dependency 'underscore.string' in the 'menu.js'. 2016-05-11 12:11:06 +05:30
Ashesh Vashi
b383c67fa5 Treat the Array different from the Object to make sure session tracking
works well with it.
2016-05-08 23:55:57 +05:30
Ashesh Vashi
07e0de5399 Resolved an issue, a copy-paste issue (was using field instead of the
column object) in NodeAjaxOptionsCell.

It was regression of '32e0a0d4b62462d45da88c177ffc6966de3dbcbb' commit.

Thanks Harshal for reporting this.
2016-04-29 17:25:43 +05:30
Ashesh Vashi
9ef7132e83 Set proper context object, when triggering the 'pgadmin-session' events
in order to resolve few corner cases for validation.
2016-04-29 15:56:56 +05:30
Ashesh Vashi
32e0a0d4b6 Clear the node cache, when an node is created/updated to make sure - we
will always have latest data related to that type of node. Also, fixed
the cache_level for different node types.

This commit also contains fixes for the following issue:
* In extension module - use the 'node-list-by-name' instead of using a
  custom 'node-ajax-options' control, and removed redundant template
  schemas from it.
* When we tries to destroy the select2 object from
  Select2Cell/Select2Control while releasing the properties view,
  sometimes select2 can not find the instance related it for some
  unknown reason. Hence - before removing it we will check for manual
  instance existance using $.data('select2').
* When we traverse through the browser tree nodes very quickly, it tries
  to remove the object before it gets created completely, and results
  into an exception.
* Icon in the select2 drop down list was not visible due to some CSS
  issues.

Apart of that, we will generate two new browser events -
'pgadmin-node:created:<NODE-TYPE>', 'pgadmin-node:updated:<NODE-TYPE>'
whenever a new node is created, or an existing node will be updated.
2016-04-29 15:50:38 +05:30
Ashesh Vashi
9aee9794c1 Fix the properties toolbar at the top of the panel so it's always
visible.

This patch also introduce a callback 'onCreate' for each panel, and
frame, which will be called whenever a panel/frame is being created.
2016-04-18 12:38:56 +05:30
Khushboo Vashi
2d8633d4ca Fixed few typos/issues in the datamodel.js 2016-04-18 12:10:19 +05:30
Arun Kollan
ffa348fe5d Fix wizard core styling. 2016-04-17 09:08:03 -04:00
Ashesh Vashi
34ba5bef24 Improvised the data clean up, in some cases, it was calling validation
due to internal 'set' function call from the internal 'reset' function.

We will stop the session management, before doing any clean up for
ignoring such events.
2016-04-15 19:29:30 +05:30
Dave Page
4d7d3bd5e1 Icon and toolbar cleanup/consistency. 2016-04-15 13:32:17 +01:00
Ashesh Vashi
58fcbd943a Deleting the object (model & nested model/collection) during showing
the node properties.
2016-04-15 16:14:22 +05:30
Surinder Kumar
40c592a988 Grant wizard. 2016-04-13 16:11:43 +01:00
Ashesh Vashi
9e2d349591 Improvements to frame management. 2016-04-13 11:25:04 +01:00
Dave Page
62fcfd928d Add context-sensitive SQL help. 2016-04-12 13:36:06 +01:00
Ashesh Vashi
9b9126da15 Improvised Select2Cell, and SwitchCell.
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.
2016-04-12 16:53:21 +05:30
Dave Page
787b35c326 Couple of typo fixes. 2016-04-11 15:41:41 +01:00
Ashesh Vashi
944bdbb96c Improvised the 'transform/options' function usage with the Select2Cell.
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.
2016-04-08 11:10:34 +05:30
Ashesh Vashi
1ba0814377 Added support for 'array' type in the schema of Node model to treat as
an object, and handle it well in the toJSON(..) with session
transformation.
2016-04-06 15:05:39 +05:30
Murtuza Zabuawala
1a5eb0c417 Updated the template for the NodeAjaxOptionsControl, which was not honouring
the disabled attribute due to missing quotes around values.
2016-04-01 15:17:31 +05:30
Harshal Dhumal
ddd4768937 Backform control for selecting multiple columns.
Usage:

{
  id: 'columns', label: '{{ _('Columns') }}',
  type: 'collection', group: '{{ _('Definition') }}', editable:true,
  canDelete: true, canAdd: true, control: Backform.MultiColumnSelectControl,
  deps: ['index'], node: 'column',
  model: pgBrowser.Node.Model.extend({
    keys: ['column'],
    defaults: {
      column: undefined
    }
  })
}

Note: When using this control model should have column attribute. And node property should be column.
2016-03-22 16:52:34 +00:00
Ashesh Vashi
87f9834951 Allow to create sub-menu/menu-group by specify the same category in
multiple menu-items (not just the 'create' menu-group).

Moved all the main menu/context menu generation implementation in the
'menu' javascript menu.

In this implementation, if more than one menu-items specify same type
of categories, they will be created withing that group, otherwise - it
will be created separately (unless 'single' property of that category is
set to true).

We can also provide icon, priority, separator(s) above/below it for the
individual sub-menu too using pgAdmin.Browser.add_menu_category
function(...).
2016-03-21 23:56:08 +05:30
Ashesh Vashi
84c5c29b92 Resolved an issue using wrong variable name for backbone-model, while
triggering events.

Thanks Khushboo Vashi for reporting.
2016-03-18 17:29:52 +05:30
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