Commit Graph

254 Commits

Author SHA1 Message Date
Murtuza Zabuawala
d2f6135a98 [Python 3] Fixed the issue processing the request data (decoding issue)
for UPDATE operation of the server node.
2016-01-21 12:24:20 +05:30
Ashesh Vashi
ba4a6faaa4 Resolved a typo in the frame javscript 2016-01-20 20:23:59 +05:30
Harshal Dhumal
422bad4394 Allow the privileges control to work properly. Resolved few typos and
trivial bugs within the privilige control.

i.e.
- Do not show 'ALL' for only one privilege type.
- Show correct privilege label in PrivilegeEditor.
- Typo in TEMPORARY privilege.
- Added missing toJSON function call, while calling the parent's toJSON
  function.
2016-01-20 20:23:23 +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
Dave Page
7c9347873f Use a custom configuration dialogue and allow the user to specify
the application path as well as the Python path.
2016-01-19 10:26:36 +00:00
Ashesh Vashi
2acba32c86 Moving the data model and collection to separate module for better code
handling.
2016-01-19 10:16:02 +05:30
Dave Page
694506453b Copyright updates for 2016. 2016-01-18 14:48:14 +00:00
Neel Patel
8f146ebb4c Support tabs in the runtime browser.
Added functionality to open different website link and load the
website data to different tab. To achieve this, new customized
QTabWidget and QWebView are added to render the data to WebView
widget. All the widgets (New Tab, WebViewWinodw, and QToolButton)
are added dynamically. QToolButton is used to traverse back and
forward to web document opened in WebViewWindow.

Introduced the New class called WebViewWindow which is derived
from QWebView. Each tab of the QTabWidget contains the instance
of WebViewWindow class. WebViewWindow class is useful to display
the web document.

Introduced New class called TabWindow which is derived from
QTabWidget. This class is useful to achieve following functionality:
  - Customize the close button of tabbar so that it can only be
    visible other then main pgAdmin 4 window.
  - Enable/Disable the toolbutton added left side of tabbar
    depending on the web history traversed by the user in WebViewWindow.
  - Set the tooltip text of the tabbar depending on the title change
    event of WebViewWindow class.

Modified the Qt project file to support the both the version
of python 2 and python 3.

Qt5 is recommended to test pgAdmin4 in dektop mode.
2016-01-18 14:33:28 +00:00
Dave Page
94bed721bd Bump the version requirement for Flask-Gravatar to 0.4.2.
This version has been restructured and plays nicely with our runtime.
2016-01-18 13:27:40 +00:00
Ashesh Vashi
d9f349b60b Chagned the variable control to use the new format of
generateSchemaView(...) output. Also, set the value in proper format
before rendering them using DynamicVariableCell.
2016-01-18 14:49:40 +05:30
Ashesh Vashi
7e621c9d7f Using the new logic after using generateViewSchema(...) function for
generating schema properly for the collection for rendering the grid.
2016-01-17 22:31:54 +05:30
Ashesh Vashi
0edf29b534 Fixed the missing translation in the 'Connetion' group, while defining
the schema.
2016-01-17 22:21:59 +05:30
Ashesh Vashi
6a071292aa Adding two new controls tab and fieldset for better layout management
used in some of the nodes.
2016-01-17 22:21:05 +05:30
Ashesh Vashi
e7bcba0050 Send the consistent data from both menus and context menus. 2016-01-15 19:46:45 +05:30
Murtuza Zabuawala
45240f3850 Use the same schema parameter 'visible' instead of separate one (i.e.
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.
2016-01-15 19:26:03 +05:30
Harshal Dhumal
4e5e7755b5 Make the privilege control to work as expected. Using the
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]
2016-01-15 19:10:49 +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
586b81b162 Data management within the properties dialog in Create/Edit mode is not
done using the Backbone event management.

Emitting 'pgadmin-session:*' for different operations, when we
create/modify the data within the properties dialog.

We will keep track of each child node using the handler object within
the Model, and Collection objects, also - provides them the name of the
attribute, it represents. It will be used to identify the invalid nested
objects within the existing object.

Also, provide the array of modified variables, which were modified in
the validation function to avoid checking each, and every thing in the
validation function. We will need to validate that particular and the
dependent attributes only.

Also - avoid multiple validation operations from the parent object to
improve performance. And, depends on the event based operations for
validation, instead of integrate the data operation and view operation
within one operation. We do maintain the invalid objects, and validate
them only from the collection objects, which also helps improve the
performance during validation.
2016-01-15 16:41:36 +05:30
Dave Page
07fac62bce Improve sizing of Python Path input box. 2016-01-14 15:53:29 +00:00
Dave Page
81405dbe0a Use the modern pgAdmin icon on Mac 2016-01-14 15:22:49 +00:00
Dave Page
e288f9f927 Add notes on server vs. desktop deployment. 2016-01-14 15:22:49 +00:00
Ashesh Vashi
eab12f21af Do proper validation in the server panel. 2016-01-12 22:21:33 +05:30
Ashesh Vashi
4feea580aa Using the events to track the session changes, and enable/disable Save,
Reset buttons.

Also - setting/reseting the error messages on status-bar when data are
not valid.
2016-01-12 22:21:33 +05:30
Dave Page
2354c3e07d Allow multiple Python Path elements to be given in a semi-colon delimited list. 2016-01-12 13:50:49 +00:00
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
f8fd93c207 Update the user and datbaase information everytime, we connect the
server. And, delete them as soon as all connections are released.
2016-01-12 01:06:56 +05:30
Ashesh Vashi
fc926d7200 Resolved an issue of selection in the Select2Cell, when the value is of
type string and not an array.
2016-01-12 00:09:00 +05:30
Ashesh Vashi
3887c84446 Update the server-information, when connected, and added. 2016-01-11 22:52:13 +05:30
Ashesh Vashi
932ed358e8 Adding the current user information in the server information (when
connected).
2016-01-11 22:11:10 +05:30
Ashesh Vashi
c90c673900 Override the updateInvalid function for uniquer-cotrols. 2016-01-11 21:32:09 +05:30
Ashesh Vashi
2bdd449bd0 Changed the way - we saw the title in the panel to allow the node to
decide, what to saw.
2016-01-11 21:30:46 +05:30
Ashesh Vashi
ca2c693ce4 Renamed the macro DROP to RESET for variables (configuration
parameters).
2016-01-11 13:06:45 +05:30
Ashesh Vashi
97cf27c6b0 Added new custom template hasAny to check if the request has one of the
given key in it or not.
2016-01-11 13:05:35 +05:30
Ashesh Vashi
65f70b46ce Remove the objects from the session while JSONify the objects, sent to
the server.

Also - set width of the select2 container to 100% under backgrid.
2016-01-09 21:55:21 +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
8f733aabd0 Added support for select2 control for using select2 instead of simple
select input.
2016-01-09 18:08:48 +05:30
Ashesh Vashi
d2897a334f Using simplejson for jsonify the data of type Decimal, which will used
for numeric type of PostgreSQL, in python using psycopg2.
2016-01-09 18:05:18 +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
Murtuza Zabuawala
b1dbcd0932 [Python 3 compatibility] 'qtLiteral' functions needs to return data in
unicode.
2016-01-07 19:33:51 +05:30
Murtuza Zabuawala
30a316ad09 Use the new functionality to add 'Drop' node in server node, and set
minimum, maximum value for the port.
2016-01-07 18:52:12 +05:30
Murtuza Zabuawala
6062343bf5 Set the value in the model when the value is valid in the
IntegerControl.
2016-01-07 18:50:15 +05:30
Ashesh Vashi
a611f84aad data stringification was not done, when object was not modified, and
passed as it is and that leads to error during fetching the modified
SQL.

Thanks Neel for the point out.
2016-01-07 18:31:13 +05:30
Harshal Dhumal
fe05f2d0c6 Resolved an issue setting proper optionsValues for the Select2Cell. 2016-01-07 13:30:46 +05:30
Harshal Dhumal
df594d56e5 Resolving issue setting proper value for options in Select2Cell 2016-01-07 10:55:22 +05:30