Commit Graph

3371 Commits

Author SHA1 Message Date
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
Murtuza Zabuawala
fe10994fb9 Update requirements files. 2015-11-13 16:57:22 +00:00
Murtuza Zabuawala
64d74d0819 Login Issue fixed, As encryption/decryption returns output in bytes datatype it fails to authenticate in python3. 2015-11-13 16:54:49 +00:00
Murtuza Zabuawala
209ee78b25 First round of Python 3 compatibility fixes. 2015-11-06 10:23:19 +00:00
Murtuza Zabuawala
da6043e7a5 Include PIP requirements files for both Python 2 and Python 3. 2015-11-03 14:13:49 +00:00
Ashesh Vashi
cbab08aaaf Do not set focus to the properties container, when selected any node.
As discussed with Khushboo, we need a negate function of disabled in the
backgrid cell.
2015-11-03 12:36:34 +05:30
Khushboo Vashi
a1170c4c82 Do not allow to edit data from the properties dialog 2015-11-03 11:31:35 +05:30
Ashesh Vashi
45596dffa0 Resolved few undo action on UI tabs - tabs were not getting activated
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.
2015-10-30 13:07:12 +05:30
Ashesh Vashi
30c560f33b Added undo action on some of the UI changes too.
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.
2015-10-30 02:03:29 +05:30
Prasad Somwanshi
6c62d9eecd sleep api used in pgAdmin4.cpp doesn't seem cross-platform(used from POSIX
specific C header). Either need to be replaced by C++11 equivalent or Qt
one. QThread::sleep seem appropriate to me.
2015-10-29 11:24:07 +01:00
Ashesh Vashi
c1db54b2c2 Allow to save only the partial model changes, undo-redo operation
within the edit/create dialog/panel using the backbone.undo.js.
2015-10-28 22:54:30 +05:30
Khushboo Vashi
c1503ade47 Introducing the infrastructure for colleciton of the subnodes listing,
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.
2015-10-28 22:36:09 +05:30
Ashesh Vashi
c53b57a013 Resolved couple of small bugs introduced during database server
connection management implementation.
2015-10-28 22:34:25 +05:30