Commit Graph

7383 Commits

Author SHA1 Message Date
Murtuza Zabuawala
b309b1ffb8 [Python 3 compability] decode function used in 'needsQuoting' function
is not available on Python 3.
2016-01-04 17:09:15 +05:30
Harshal Dhumal
eed1590a51 Do not close the privilege cell editor, when clicked one of its own
children.

Also, resolved an issue related showing 'unknown' instead of privileges,
when loading existing privileges.
2016-01-04 16:59:47 +05:30
Harshal Dhumal
9d9f17c163 Clear the status-bar on the 'on-status-clear' event of the model 2016-01-04 16:54:06 +05:30
Ashesh Vashi
7358549524 Allow to specify the number of arguments in the qtTypeIdent to make it work
with schema specified object name.

You can use the qtTypeIdent template filter as:
conn|qtTypeIdent(name)
or,
conn|qtTypeIdent(schema_name, name)
2016-01-04 13:41:57 +05:30
Harshal Dhumal
6057259bdc Create the status-bar in the properties dialog, and it will listen for
on-status event from the model.
2016-01-04 13:35:11 +05:30
Ashesh Vashi
1ba5d79978 Allow to specify the number of arguments in the qtIdent to make it work
with schema specified object name. This will also works with
EntepriseDB's package too.

Also, added dependency on the current connection object, it will allow
us to use the keywords list specific to the database server in futuer.

You can use the qtIdent template filter as:
conn|qtIdent(name)
or,
conn|qtIdent(schema_name, name)
2016-01-04 13:13:46 +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
49373df02d Resolved issues regarding the rows, and column description not return by
the given query in the execute_dict and execute_2darray function in the
psycopg2 driver.
2016-01-04 12:11:52 +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
574105ce5e Resolved an issue related to logging the error message.
Also, fetch the datlastsysoid when making the connection.
2016-01-04 11:18:04 +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
ef3f54378c Introduced an ajax response 'not_implemented' with HTTP status code 501. 2016-01-02 14:55:13 +05:30
Ashesh Vashi
2aeae06882 Added support for qtIdent, qtTypeIdent, qtLiteral for quoting the
inputs.

In order to do the proper quoting around the identifier, different type,
and literal, we introduced respective functions qtIdent, qtTypeIdent,
qtLiteral in psycopg2 driver. Also, introduced them as the Jinja's
custom filter for using it directly inside the templates.

Also, created an utility - generate_keywords.py in order to generate
keyword lists from the latest PostgreSQL installation.
2016-01-02 14:54:05 +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
Murtuza Zabuawala
d56ddb9fa4 Adding the SQL tab for the nodes, with 'hasSQL' property set to true, in
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.
2015-12-26 16:15:40 +05:30
Ashesh Vashi
402e89e535 Keep all the information in the tree node data in the
getTreeNodeHierarchy(..) function, and make changes to make the
generate_url function to work with it.
2015-12-26 14:22:29 +05:30
Ashesh Vashi
15daf44e19 Moving children function within the PGChildNodeView itself, instead of
putting it in separate class PGChildNode, because - it has not been used
anywhere else.
2015-12-26 11:29:12 +05:30
Ashesh Vashi
d55b02aeab Resolved a typo in collection.js, which leads to not adding the
properties of a node in backgrid list with mode parameter.

Thanks Akshay Joshi for reporting the issue.
2015-12-23 18:11:30 +05:30
Ashesh Vashi
c51ecc69e4 Resolved few intialization issue with Node model data, moved the
privileges functionality out of the backform.pgadmin.js to make it more
modular. Now - privileges will expect the privileges data in following
format:
<name_of_the_property> : [{
    "privileges": [{
        "privilege_type": <privilege_type>,
        "privilege": true,
        "with_grant": false
    },
    ...
    ],
    "grantee": <grantee>,
    "grantor": <grantor>
    },
   ...
]

Example:
acl": [{
    "privileges": [{
        "privilege_type": "CONNECT",
        "privilege": true,
        "with_grant": false
     	}],
    "grantee": '',
    "grantor": 'ashesh'
},{
    "privileges": [{
        "privilege_type": "CREATE",
        "privilege": true,
        "with_grant": false
    },{
        "privilege": true,
        "privilege_type": "TEMPORARY",
        "with_grant": false
    }],
    "grantee": test,
    "grantor": ashesh
}]
2015-12-23 12:10:23 +05:30
Ashesh Vashi
bf5170bc89 Changed the server properties a little bit to in-corporate suggestions
from Dave. Also - remove unwanted round cornor from the menu item.
2015-12-22 10:50:33 +05:30
Murtuza Zabuawala
5f890dadc9 Remove any unwanted white-spaces while renderting any template in template code 2015-12-22 10:43:24 +05:30
Ashesh Vashi
1391003e03 Added the backgrid cell for bootstrap switch for representing the
boolean properties.
2015-12-17 19:19:59 +05:30
Ashesh Vashi
cd34ee6dd7 Switch Control was not honouring the user's options for bootstrap switch 2015-12-17 18:41:36 +05:30
Ashesh Vashi
0273c29283 Introduction of the privilege support for database object (Patch:
Murtuza Zabuawala), and Unique column control for backform (Harshal
Dhumal).

Also, includes some fixes for the model, & collection handling.
2015-12-17 18:30:42 +05:30
Ashesh Vashi
ca0b1f20df Fixed the issue while parsing, and assigning the data properly in the Node. 2015-12-17 16:13:36 +05:30
Ashesh Vashi
c796eee2a7 Do not show the properties in property windows, when they're not
applicable. i.e. not supported by that version.
2015-12-16 16:02:17 +05:30
Ashesh Vashi
54d4cdcd51 Fixed few issues with the backform custom controls.
- 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.
2015-12-16 13:43:04 +05:30
Ashesh Vashi
2f1eac1243 Removed the undo manager from the node implementation, as it is causing some issue, which rendering some code, which requires detailed attention. 2015-12-16 13:37:49 +05:30
Ashesh Vashi
d891a9d4d7 Log the executing SQL stataments and error propertly from the psycopg2 driver 2015-12-16 13:34:12 +05:30
Ashesh Vashi
8611e29c60 Pass on the browser tree events by generating node specific 'browser-node' events.
Added a test event in test.js
2015-12-16 13:27:08 +05:30
Murtuza Zabuawala
c3b517cb91 Using bootstrap-swtich for creating a custom backform control for
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).
2015-12-04 17:16:49 +05:30
Murtuza Zabuawala
a04ef2de43 Fixed an issue related taking input as raw_input on Python 2.
This is regression, introduced in the commit-id:
209ee78b25
2015-12-04 15:37:06 +05:30
Ashesh Vashi
57d6c3b406 Do validation before enabling the Save button. 2015-12-04 15:33:16 +05:30
Ashesh Vashi
537df154fe Fixing few issues with context menu icon missing.
Introduced a new ajax function to return the HTTP Status code 410 (GONE).
Changed the location of the javascript from each modules, it loads.

Added .swp, .swo files in the .gitignore file
2015-12-04 14:47:18 +05:30
Ashesh Vashi
b36e264fd3 Load collection.js along with the node.js from browser.js 2015-11-28 20:19:29 +05:30
Ashesh Vashi
6d46dfbfba Added new url rules for each node by change NodeView class:
- Renamed the URL 'nodes' to 'children', because - we'll return the
  children for the current node.
- Using the URL 'nodes' to fetch all nodes of its type, when not
  specified the node-id, otherwise regenerate that node info using the
  node-id (it will be used by the refresh function).

- Added the URL 'msql' for fetching modified SQL for the modified
  objects.
- Separated the URL 'deps' (GET/POST methods) to 'dependency' and
  'dependent', because - it will be used to fetch the properties of the
  object, not manipulate it. (as suggested by Dave).

This commit includes the changes related to it in the specific nodes.
(i.e. server-group, and server).

Also, includes a javascript change to ask the user (if they really want
to leave the page, and it is not an accidental navigation by keyboard
shortcuts).
2015-11-23 13:57:43 +05:30
Ashesh Vashi
9bc9025075 Issues resolved related to connection management and collection nodes:
- Allow to release connection using the database OID (did).
- Generate correct url for the collection nodes.
- Removed the server-type from the collection node module, from the
  generate_browser_collection_node(...) function.
- Show version string, and not version integer in the server properties
  (when connected).
2015-11-20 14:55:55 +05:30
Murtuza Zabuawala
e52fd0d349 Resolved an issue related Python 3.x compability regarding setting
property name was same as variable.
2015-11-20 11:34:27 +05:30
Ashesh Vashi
d753374977 Resolved a typo in the version check condition during schema generation.
Also, resolved an issue related showing the correct server variant in
properties dialog, it is a regression introduced by the patch server
version check.
2015-11-20 10:45:35 +05:30
Ashesh Vashi
5ff09223a2 Allow to generate events from the nodes, whenever some any events.
i.e.
'server-connect' and 'server-disconnected' events will be generated
while server gets connected and disconnected respectively.

For demo purpose - listening to the server connection from the test
script.
2015-11-19 23:42:01 +05:30
Ashesh Vashi
77834ccdda Changed the logic to identify the PostgreSQL server variant, when we
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.
2015-11-19 23:18:00 +05:30
Khushboo Vashi
3323543b5a Resolved few issues in connection creation in the psycopg2 (pgAdmin
driver)

1. Update correct variable for database information in the connection
   manager.
2. Raise exception, when database not found, instead of return the
   (boolean, error message) tupple.
2015-11-19 14:42:37 +05:30
Ashesh Vashi
80314a9aa3 Allow to connect any of the database using its OID using the connection
manager, once the connection to the maintenance database has been made,
because - we will have did (i.e. Database OID) most of the time for the
any node, and not its name as identifier.

This will allow us to work directly with OID, and we will not need to
bother about renaming of the database name.
2015-11-17 19:14:09 +05:30
Ashesh Vashi
cc3a262de0 Adding pgadmin4.log, and runtime/.qmake.stash to .gitignore, so that -
it does not show up in git status.
2015-11-17 18:22:01 +05:30
Ashesh Vashi
9e67000e7b Removed debug code added in the commit:
ed8600ef89
2015-11-17 12:05:03 +05:30
Ashesh Vashi
3077da0062 Resolved an issue when refreshing any browser node 2015-11-17 11:54:32 +05:30
Khushboo Vashi
ed8600ef89 Adding support for collection browser node. 2015-11-17 11:53:14 +05:30
Murtuza Zabuawala
52b86b6fb4 Added NoneType exception handling in settings & server modules while returning json response. 2015-11-13 16:59:16 +00:00