Commit Graph

164 Commits

Author SHA1 Message Date
Nikhil Mohite
275d13d40f Following issues have been resolved for the new connection feature:
1. Show servers with server groups in the dropdown.
  2. Highlighted current selected connection in the new connection dropdown.
  3. Notify the user before changing the connection.

refs #3794
2020-10-21 17:14:59 +05:30
Nikhil Mohite
18cad32bd4 Added tab title placeholder for Query Tool, View/Edit Data, and Debugger. Fixes #4232 2020-10-20 15:41:54 +05:30
Pradip Parkale
8e132eab08 Fixed some accessibility issues. Fixes #5732 2020-09-15 13:03:18 +05:30
Cyril Jouve
5a253f9053 Change the following to replace Python 2 code with Python 3:
1) Replace the deprecated unit test method.
2) Wraps filter usage in a list call.
3) Converts the old metaclass syntax to new.
4) Use range instead of xrange method.
5) Change Unicode to str.
6) Several other transformations.
7) Fixed change password test cases.
8) Use simplejson instead of plain JSON.
2020-08-31 16:45:31 +05:30
Yogesh Mahajan
3984544bdb Fixed code smell 'String literals should not be duplicated'. 2020-08-28 18:17:27 +05:30
Pradip Parkale
7f947f146c Fixed cognitive complexity issues reported by SonarQube. 2020-08-25 12:28:55 +05:30
Akshay Joshi
fbbbc36221 Fixed code smell 'Define a constant instead of duplicating this literal' reported by SonarQube. 2020-08-20 20:26:51 +05:30
Akshay Joshi
103b08c9c5 Define constants for preferences label to fix SonarQube issues. 2020-08-20 17:58:37 +05:30
Aditya Toshniwal
7dd313f5fc Fixed an issue where debugger doesn't work if the search path is set other than 'public'. Fixes #4123 2020-08-12 14:24:40 +05:30
Aditya Toshniwal
536593bf8a Fixed following SonarQube issues:
- Remove this assignment to the local variable, the value is never used.
  - Rename local variables to match the regular expression
  - Add logic to this except clause or eliminate it and rethrow the exception automatically.
  - Rename fields to match the regular expression
  - Extract this nested conditional expression into an independent statement.
  - Change this default value to "None" and initialize this parameter inside the function/method.
  - Update this function so that its implementation is not identical to __repr__
  - Refactor this method to not always return the same value
  - Reraise this exception to stop the application as the user expects
  - Add missing parameters _w _PY3. This method overrides simplejson.decoder.JSONDecoder.decode.
  - Remove this redundant continue.
  - Remove this unused function declaration
  - Remove this identity check; it will always be False.
2020-08-03 12:59:51 +05:30
Akshay Joshi
fb0bc65ced Fixed following SonarQube issues:
1) Define a constant instead of duplicating this literal.
  2) Reduce cognitive complexity (Patch by Aditya)
2020-07-27 16:31:03 +05:30
Aditya Toshniwal
505a3ac960 1) Fixed cognitive complexity issues reported by SonarQube.
2) Fixed code smell 'Add a nested comment explaining why this method is
   empty, or complete the implementation'.
2020-07-24 11:46:30 +05:30
Aditya Toshniwal
9d0f3ce90b Fixed code smell 'potential hiding of variables declared in an outer scope'. 2020-07-16 19:53:39 +05:30
Yogesh Mahajan
2cefa9afca Fixed code smell 'Variables should not be shadowed'. 2020-07-09 18:44:58 +05:30
Aditya Toshniwal
45a03dd663 Fixed 'convention' related code smell reported by SonarQube. 2020-07-06 11:48:23 +05:30
Yogesh Mahajan
707ff450b5 Fixed following SonarQube issues:
1. Boolean checks should not be inverted.
2. The comma operator should not be used.
3. Arguments to built-in functions should match documented types.
4. Redundant pairs of parentheses should be removed.
5. A conditionally executed single line should be denoted by indentation, 
6. A while loop should be used instead of a 'for' loop.
2020-06-26 13:12:07 +05:30
Akshay Joshi
15c621b1d8 Fixed following SonarQube issues:
1) TypeError can be thrown as <variable_name> might be null or undefined here.
2) Unexpected duplicate "white-space".
3) Unexpected missing generic font family.
4) Unexpected shorthand "padding" after "padding-left".
2020-06-24 15:57:01 +05:30
Akshay Joshi
bc24e3643f More code cleanup for SonarQube. 2020-06-18 16:20:34 +01:00
Aditya Toshniwal
f0490a54b7 Fixed redundant tagged issue reported by SonarQube. 2020-06-18 11:14:56 +05:30
Aditya Toshniwal
df05efd7d9 Fixed vulnerabilities and few design suspicions where two conditional structures are having the same implementation. 2020-06-17 17:15:09 +05:30
Aditya Toshniwal
641f7bbe9d Some clumsy coding related fixes reported by SonarQube. 2020-06-15 16:50:07 +05:30
Aditya Toshniwal
eb971a0320 Update Codemirror version to the latest which allows us to set screen reader labels on Codemirror editor.
refs #5197
2020-06-08 12:26:12 +05:30
Satish V
d22e276586 Ensure that proper error should be displayed for the deleted node. Fixes #3669 2020-06-03 11:26:26 +05:30
Ashesh Vashi
e73e2d2502 Fixed the errors, and warnings reported by pylama.
TODO::
- Don't use unicode in Python 3 for removing the support of Python 2 (
  psycopg2 driver - __init__.py, server_manager.py).
- Merge the lastest pgcli (version: 3.0.0) for SQL autocompletion.
2020-05-08 14:13:38 +05:30
Libor M
6a9af07f7a Fixed gettext usage:
- fixed gettext usage with .format() only for original text with %s
  - fixed typos
  - fixed translation yes/no buttons in the dialog.
  - improved translating sentences without "connecting" words (eg. see web/pgadmin/dashboard/static/js/dashboard.js,
     word 'cancel' needs to be translated in the Czech language as 'zrušit' but in another sentence as 'zrušení')
  - added gettext for text translations.
2020-04-10 14:52:41 +05:30
Ashesh Vashi
d9f6baac72 Various misc fixes:
- Using the 'gettext' as oppose to '_', which is not defined
- Define missing variables
- Fixed escape character in string with double quote
- Removed some dead code in a test case
- Removed unnecessary self assignment

Includes some fixes for Accessibility improvements
- Use semantic markup to mark emphasized or special text
- Added hidden legend in <fieldset> for better screen reader support
2020-04-08 14:14:25 +05:30
Libor M
94864104e4 Added and fixed gettext usage for better translation coverage. Fixes #5284
1) Fixed usage gettext('') instead of _('') in javascript files.
  2) Fixed usage gettext('') instead of `${gettext('')}` in javascript files,
     because "pybabel extract" not support extracting from this syntax.
2020-03-24 11:14:05 +05:30
Aditya Toshniwal
4db0a6524d Fix an issue where debugger not showing all arguments anymore after hitting SQL error while debugging. Fixes #5101
Added a "Clear All" button to the argument dialog which will clear all the saved arguments values from SQLite DB.
2020-02-28 15:27:01 +05:30
Akshay Joshi
02f9de5bdb Improve wordings. 2020-01-28 18:36:42 +05:30
Nagesh Dhope
f167d77b61 Allow screen-reader to read label & description of non-textable elements. Fixes #4762.
Allow screen-reader to identify the alert errors. Fixes #4763

  Added role alertdialog for confirm and alert dialog.
  Added role status for all status bars/banners.
  Added role alert for error bars.
  Added aria-labelledby for charts on each dashboard.
  Added tabindex for each chart so that it is navigable using tab key.
2020-01-28 11:32:11 +05:30
Aditya Toshniwal
8c3bba65e5 Logout the pgAdmin session when no user activity of mouse move, click or keypress. Fixes #5000.
Introduced two config params:
1. USER_INACTIVITY_TIMEOUT - Interval in seconds for the timeout. Default is 0-Zero which means disabled.
2. OVERRIDE_USER_INACTIVITY_TIMEOUT - If set to true, tools like query tool or debugger will override USER_INACTIVITY_TIMEOUT
   and will not allow the application to timeout if a query is running for a long time.
2020-01-15 18:07:46 +05:30
Dave Page
01c7636c75 Update copyright notices for 2020. 2020-01-02 14:43:50 +00:00
Nagesh Dhope
8c4dff057f Added aria-label attribute wherever missing for accessibility. 2020-01-01 10:37:17 +05:30
Aditya Toshniwal
9bda583d5b Added aria-label to the buttons in the debugger. 2019-12-11 14:52:15 +05:30
Aditya Toshniwal
f16498a8a7 Optimize Webpack to improve overall performance.
Changes include:
1) Remove underscore-string and sprintf-js packages as we were using only %s. Instead, added a function to do the same. Also changed gettext to behave like sprintf directly.
2) backgrid.sizeable.columns was not used anywhere, removed. @babel/polyfill is deprecated, replaced it with core-js.
3) Moved few css to make sure they get minified and bundled.
4) Added Flask-Compress to send static files as compressed gzip. This will reduce network traffic and improve initial load time for pgAdmin.
5) Split few JS files to make code reusable.
6) Lazy load few modules like leaflet, wkx is required only if geometry viewer is opened. snapsvg loaded only when explain plan is executed. This will improve sqleditor initial opening time.

Reviewed By: Khushboo Vashi
Fixes #4701
2019-10-10 12:05:28 +05:30
Aditya Toshniwal
73dc130908 Fix issue where pgAdmin does not load completely if loaded in an iframe. Fixes #4756 2019-09-23 12:55:02 +05:30
Aditya Toshniwal
1c2ba72f02 Add editor options for plain text mode and to disable block folding to
workaround rendering speed issues in CodeMirror with very large scripts.
Fixes #4631.

Re-arrange editor options in the Preferences dialogue to tidy things up.
2019-09-04 15:46:08 +01:00
Aditya Toshniwal
3dadb8989b Fix a debugger error when using Python 2.7. Fixes #4419
Also fixes a minor bug where a reload warning was unnecessarily given when closing the debugger.
2019-08-23 09:43:51 +01:00
Aditya Toshniwal
ce7679c4bd Added missing __init__.py file in debugger utils which is required for Python 2.7 2019-06-19 13:31:48 +05:30
Akshay Joshi
b36d5d153b Ensure the debugger control buttons are only enabled once initialisation is complete. Fixes #4360 2019-06-18 14:46:28 +01:00
Aditya Toshniwal
2894c6cd14 Add minor change missed in previous commit. Fixes #4329 2019-06-14 12:46:48 +01:00
Aditya Toshniwal
5437a8adab Fix an initialisation error when two functions with parameters are debugged in parallel. Fixes #4329 2019-06-10 14:58:07 +01:00
Aditya Toshniwal
f561c0cee6 Fix keyboard navigation in "inner" tabsets such as the Query Tool and Debugger. Fixes #4195 2019-06-10 11:10:49 +01:00
Khushboo Vashi
6f0eafb223 Fixed CSRF security vulnerability issue. per Alvin Lindstam. Fixes #4217
Initial patch by: Khushboo Vashi
Modified by: Ashesh Vashi and Murtuza Zabuawala
2019-05-28 10:59:51 +05:30
Aditya Toshniwal
05ae330030 Improvement for 'beforeunload' event, bind the event only from where it is required. 2019-04-22 11:30:33 +05:30
Aditya Toshniwal
49b318c39e Ensure that confirmation dialog should be popped up before reload of query tool or debugger
if it is opened in a new browser tab. Fixes #4101
2019-04-18 15:39:36 +05:30
Aditya Toshniwal
6fb35f2649 Overhaul the layout saving code so it includes the Query Tool and Debugger, and stores the layout when change events are detected rather than (unreliably) on exit. Fixes #4084 2019-03-26 11:08:45 -04:00
Khushboo Vashi
e4417229aa Update all Python and JS dependencies. Fixes #4019 2019-03-14 15:11:16 +00:00
Dave Page
d7bf6ec69f String review and subsequent cleanup
Ashesh Vashi
Abhilasha Narendra
Karen Blatchley
Susan Douglas
Dave Page
2019-03-05 14:08:16 +00:00
Akshay Joshi
22d458b01e Close connections gracefully when the user logs out of pgAdmin. Fixes #3942 2019-02-06 13:17:52 +00:00