Commit Graph

246 Commits

Author SHA1 Message Date
Aditya Toshniwal
45a03dd663 Fixed 'convention' related code smell reported by SonarQube. 2020-07-06 11:48:23 +05:30
Satish V
4c05287677 Fixed SonarQube code smell 'Variables should not be shadowed'. 2020-06-30 17:26:18 +05:30
Satish V
830ac1cc91 Fixed following SonarQube issues:
1. Method/Field names should comply with a naming convention.
 2. Conditionals should start on new lines
2020-06-26 13:32:45 +05:30
Khushboo Vashi
c7a16a4bd5 Fixed code smells having rule 'Nested blocks of code should not be left empty'. 2020-06-26 13:18:27 +05:30
Aditya Toshniwal
d3b3d07f2e Fixed SonarQube issues with the tag unused. All the unused variables, assignments, code comments are fixed. 2020-06-25 11:09:43 +05:30
Satish V
a1fd9ea3ce Fixed issue related to extra semicolons and function naming convention reported by SonarQube. 2020-06-24 16:16:12 +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
Yogesh Mahajan
6d3f13076f Fixed 'Comma operator should not be used' issue reported by SonarQube. 2020-06-18 16:17:55 +05:30
Aditya Toshniwal
f0490a54b7 Fixed redundant tagged issue reported by SonarQube. 2020-06-18 11:14:56 +05:30
Akshay Joshi
5ed1e1e5b6 Fixed some sonarqube issues. 2020-06-17 19:30:56 +05:30
Nikhil Mohite
023a1f222f Remove duplicate properties in CSS and few js standard fixes reported by SonarQube. 2020-06-15 17:15:15 +05:30
Aditya Toshniwal
641f7bbe9d Some clumsy coding related fixes reported by SonarQube. 2020-06-15 16:50:07 +05:30
Akshay Joshi
ac4b5ab7fa 1) Correct the typo 'pythonw.exe' should be 'python.exe' for Windows if 'pythonw.exe' not found.
2) Added logging to identify the interpreter command for Windows.
2020-06-09 19:05:20 +05:30
Nagesh Dhope
c932213abd Disabled the Stop process button after clicking it and added a message 'Terminating the process...' to notify the user. Fixes #3787 2020-06-02 11:23:52 +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
Nagesh Dhope
f61448eea2 Fixed an issue where the background job creation fails if there is only a version-specific python binary available in PATH. Fixes #5480 2020-05-06 12:38:06 +05:30
Yogesh Jain
cc2e3ece7a Ensure that file browse home button should point to /Users/akshayjoshi rather than /. Fixes #4279 2020-05-04 12:40:19 +05:30
Akshay Joshi
ad80217593 Remove Python2 references from the source code.
refs #5443

Initial patch: Neel Patel
2020-04-30 17:22:48 +05:30
Yogesh Jain
553eeb034d Fixed tooltip crop issue for the large complex query with zoom factor. Fixes #5352 2020-04-22 18:47:13 +05:30
Yogesh Jain
7e30a99937 Fixed the rightmost and bottom tooltip crop issues in the explain query plan. Fixes #5352 2020-04-21 13:14:26 +05:30
Libor M
36a3d4e53b Some more gettext() usage fixes:
- fixed `%` vs. `.format()`
  - unified texts and usage `%s` vs. `{}`/`{0}`
  - improved text sentences for translate
  - added gettext for next texts
2020-04-20 11:19:09 +05:30
Murtuza Zabuawala
d35433d0b8 Fixed an issue where the query tool unable to load the file which contains the BOM marker. Fixes #3495 2020-04-17 12:40:09 +05:30
Libor M
8254e9f030 Some minor gettext and format fixes. 2020-04-16 12:55:19 +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
Ashesh Vashi
073e310a5a [Accessibility] Use semantic markup to mark emphasized or special text.
Reference: https://www.w3.org/TR/WCAG20-TECHS/H49.html
2020-04-08 12:27:18 +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
9bad590e9e Improvements in the UI for both default and dark themes. Fixes #5133
Improve the style of the highlighted code after query execution for Dark mode. Fixes #4996.
Changed background pattern for geometry viewer to use #fff for all themes. Fixes #5077
Changed the color of selected and hovered item for Select2 dropdown, also tweak the appearance of the tags in multi-select boxes. Fixes #4955
Fixed Firefox monospaced issue by updating the font to the latest version. Fixes #5184
2020-02-24 14:11:00 +05:30
Aditya Toshniwal
019932c323 Enhance logging by tracking stdout and stderr of subprocess when log level set to DEBUG.
If the process terminates abnormally then the error is not logged which makes it very
difficult to find the reason for failure.

Fixes #5176
2020-02-11 14:28:57 +05:30
Murtuza Zabuawala
c9500a5122 Set proper focus on tab navigation for file manager dialog. Fixes #5107
- Show focus when the Tab key is pressed
 - Pressing the Enter key on C:\ drive does not open it on Windows
2020-02-07 11:13:41 +05:30
Murtuza Zabuawala
989aa462f7 Set proper focus on tab navigation for file manager dialog. Fixes #5107.
Initial patch sent by Ganesh Jaybhay
2020-01-31 11:43:30 +05:30
Simon Wimmesberger
9dccd20bb3 Fix an issue where setting STORAGE_DIR to empty should show all the volumes on Windows in server mode. Fixes #5025. 2020-01-13 13:20:37 +05:30
Aditya Toshniwal
8b99a33e6e 1) Ensure that path file name should not disappear when changing ext from the dropdown in file explorer dialog. Fixes #3812.
2) Fix column resizable issue in the file explorer dialog. Fixes #4827.

Used tablesorter's resizable widget.
2020-01-10 12:53:32 +05:30
Dave Page
01c7636c75 Update copyright notices for 2020. 2020-01-02 14:43:50 +00:00
Ganesh Jaybhay
fc5287bd9f Added tab navigation for tabs under explain panel in query tool. Fixes #5047. 2020-01-01 10:51:45 +05:30
Nagesh Dhope
37f76142fb 1) Added aria-label to buttons used in graphical explain plan.
2) Fixed minor issue where we use dialog tab navigator keyboard shortcut only on visible tabs.
3) Fixed an issue where Zoom in, Zoom out, Zoom to original and Download button should not blur the focus after a click on them.

Initial patch sent by Murtuza Zabuawala.
2019-12-31 13:05:46 +05:30
Aditya Toshniwal
f1a18749f6 1) Allow screen-reader to read relationship attributes for tab, tabpanels and tables under it. Similar changes are done for subnode controls.
2) Add role="img" for font icons.

Fixes #4764
2019-12-17 13:22:36 +05:30
Khushboo Vashi
cb26ca0e46 Fix XSS issue in explain and explain analyze for table and type which contain HTML. Fixes #4947. 2019-12-09 18:00:56 +05:30
Aditya Toshniwal
5316a28e6c Fixed issue where Dark Theme is unavailable in python wheel distro.
pgAdmin wheel distro is not having pgadmin.themes.json file in 'web/pgadmin/misc/themes' directory,
so it's better to refer this file from the generated directory.
2019-11-20 15:05:20 +05:30
Aditya Toshniwal
00ce130286 Shown some text on process watcher till the initial logs are loaded. Fixes #4925 2019-11-15 12:12:19 +05:30
Aditya Toshniwal
c1c682402a 1) Further styling tweaks for Dark Theme.
2) Theme related code changes are removed from config.py and moved to miscellaneous under a new package - "themes".
2019-11-11 18:47:43 +05:30
Aditya Toshniwal
8180403f97 1) Added support for custom theme creation and selection. Fixes #4348.
2) Added Dark(Beta) UI Theme option. Fixes #3741.
3) Fix an issue where a black arrow-kind image is displaying at the background of browser tree images. Fixes #4171

Changes include:
  1) New theme option in preferences - Miscellaneous -> Themes. You can select the theme from the dropdown.
     It also has a preview of the theme just below the dropdown. Note that, a page refresh is needed to apply changes.
     On saving, a dialog appears to ask for refresh.
  2) You can create your own theme and submit to hackers. README is updated to help you create a theme. Theme will be available only after the bundle.
  3) Correction of SASS variables at few places and few other CSS corrections.
  4) Added iconfont-webpack-plugin, which will convert all the SVG files(monochrome) used as icons for buttons to font icons.
     This will allow us to change the color of the icon by using CSS color property.
  5) All the .css files will bundle into a separate file now- pgadmin.style.css. This will help reduce the size of
     theme CSS files as CSS in .css files will not change with the change of SASS variables.
2019-11-07 18:51:03 +05:30
Aditya Toshniwal
a7d8b9de8c Ensure that units are respected when sorting by file size in the File dialog. Fixes #4647 2019-11-01 15:00:34 +00:00
Akshay Joshi
7c271d21ae Fix 'placeholders are incompatible' issue in the message catalog.
Replace % with %% used in the explain module.
2019-10-14 12:51:34 +05:30
Aditya Toshniwal
d056a94f0c popen() function strips the quotes from the arguments, so backup fails
for the schema name that needs quoting.

Code is changed to add escapers.

Fixes #4590
2019-10-10 17:58:32 +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
Ashesh Vashi
6e4923d762 Fixes # 4778 - Implement the query plan analyzer
Look 'n' Feel and implementation logic are inspired from
'http://explain.depsez.com'.

It now creates three tabs under the 'Explain' panel when executing a
query using the Explain Analyze/Explain button from the toolbar of the
Query tool.

Graphical
---------
-> Graphical Explain Plan

Analysis
--------
-> Table to show details of the explain plan analyse.
-> Each row represents the statistics per Explain Plan Node
-> It may contains columns like node information, exclusive timing
   (time spent for this explain node excluding the child nodes),
   inclusive timing, actual rows, plan rows,
   rowsx (misestimation between planned vs actual rows), loop.
-> Background color of exclusive, inclusive, rows changes based on
   their values.
i.e.
If Percentage of exclusive, and inclusive timings of total query time
is:
> 90 - Red Color
> 50 - Orange (Between Red & Yellow Color)
> 10 - Yellow color

If planner misestimation for the rows is
> 1000 times - Red Color
> 100 times - Orange (Between Red & Yellow Color)
> 10 times - Yellow Color
Also - if actual rows <= planned rows then it shows up arrow, else it
shows down arrow.

Statistics
----------
-> It contains a HTML table for the statistics per Node Type, and
   a HTML table for the statistics per table.

Reviewed by: Akshay Joshi
2019-10-08 16:44:24 +05:30
Aditya Toshniwal
9a69d27009 Fix webpack issue where multiple assets emit to the same file. 2019-09-13 11:08:08 +05:30
Akshay Joshi
bdff046c57 1) Added ProjectSet icon for explain module. Fixes #2706
2) Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module. Fixes #2828
2019-08-20 16:47:53 +05:30