Commit Graph

175 Commits (b51eef12b7b2a167277c599336afe11e657dfbea)

Author SHA1 Message Date
Aditya Toshniwal c6d7a0a8da
Add missing eslint React rules and fix the linter errors. 2024-10-01 16:32:04 +05:30
Ashesh Vashi 15c37b620e
Fixed issues reported in #7958
* Fixed issues reported in #7954

- Search wasn't working as we were using the wrong row-index, while
  rendering it.
- Fixed the CSS issue with the alignment of the search input box.
- Pass the row object while rendering the 'DataRow' component, to
  improve the performance as it repeatedly calls the filtering function for each row.
- Changed the order of the validators on a field to prioritize the
  'empty' string validator over the unique-id validator in a
  collection.
- Use 'row.index' instead of rowId, while rendering a grid row
2024-10-01 12:06:59 +05:30
Ashesh Vashi 1f53baee8f
Fixed the dynamic column updation in the Unique & Primary Keys while creating a table.
* Updated the columns for the unique and primary keys while creating a table.
Use the 'editable' option for a Cell instead of 'disabled'.

* Don't need to define the hidden member as fields in GridHeaderSchema

* Updated the columns for the exclusion constraints while creating a
 table.

* Signaled the relevant field, when column options have changed, for all
the children of a table.

* Use current snapshot of data for the GrigFormHeadeer

* Fixed the styling for the search input box

* Don't check for the 'colOptions.editable' flag, as it could be
indirect call as well.
2024-09-19 18:57:09 +05:30
Ashesh Vashi b0cd028ff8
Fixed an issue introduced due to reloading of the tree due to changes in particular preferences (#7942)
* Fix an issue - when the object browser tree is being recreated due to reloading for changes in some of the preferences. Tree object returns object from the previous instance as 'selected', but - it does not have the 'treeNodeInfo' available. In this special case - we would consider that there is no node selected at that particular moment, and pass information accordingly.

* Fixed 'New Connection' dialog issue after connecting a disconnected server.

* Disable the 'Add' button in the GridHeader with form, when 'canAdd'
flag is set to false.

* Convert the access path to string array for correct comparision.

* Check the access path type before comparison.
When language is 'c', set the 'code' block read-only.

* Enabled 'Strict' control for EPAS >= 95
2024-09-18 20:55:01 +05:30
Ashesh Vashi 441cc57bb8
Don't show 'Types of objects' for the 'Cluster' operation. Fixes #7884 2024-09-18 07:48:09 +05:30
Ashesh Vashi 315d1a40a4
Fixes issues #7884
* Introduced a 'exclude' option in the 'Field' to exclude it from the
change completely. Use the option 'exclude' to add field
'notNullColumns', which will be excluded from the data, but - can be
used to force rerender the 'Not Null Columns' select control on
change of it.

* Fixed the linter issue

* Rerender the cell as well, when dependent changes values. (#7884)

* Listen for the depenent changes even for the non-visible controls

* Use 'useRef' on every rendering to avoid the React 'Something wrong' page
2024-09-16 17:55:43 +05:30
Ashesh Vashi 92dd13e72a
Introduced a 'exclude' option in the 'Field' to exclude it from the change.
* Introduced a 'exclude' option in the 'Field' to exclude it from the
change completely. Use the option 'exclude' to add field
'notNullColumns', which will be excluded from the data, but - can be
used to force rerender the 'Not Null Columns' select control on
change of it.

* Fixed the linter issue
2024-09-16 15:28:33 +05:30
Ashesh Vashi 5e96f0fd61
Fixes the Variable Schema UI issues and InlineView bug reported in #7884
* Show the icon for the 'Reset' button. (Reference #7884)

* Reload the server list after connecting to a server in the 'New
connection' dialog (QueryTool). (Reference: #7884)

* Pass the grid path during the bulk update (click on a radio action)

* Don't assign the cell value to the 'rowValue' variable.

* Don't rely on the 'optionsLoaded' for setting the variable types as it
is loaded asynchronously, and variable types data may not be available
while rendering the 'value' cell. (Fixes #7884)

* Fixed a type while checking for the 'inline-group'. fixes (#7884)

* 'vnameOptions' can be a Promise function too, hence - taken care accrodingly.

* Introduced a parameter 'reloadOnDepChanges' in the BaseSchemaUI field
to force reload the control on value change for one of the
dependencies.

* Reload on the components in case of dependent value changes.

* Introduced 'useSchemaStateSubscriber', which generates a state
subscriber mananager instance. It helps multiple subscribers in a
single control as we could have multiple subscribe within a control.
(For example - value, options, errors, etc).

* Fixed all the issues reported (#7884)
2024-09-16 00:04:37 +05:30
Ashesh Vashi e21911b1c6
All the issues are fixed reported in #7884
* Show the icon for the 'Reset' button. (Reference #7884)

* Reload the server list after connecting to a server in the 'New
connection' dialog (QueryTool). (Reference: #7884)

* Pass the grid path during the bulk update (click on a radio action)

* Don't assign the cell value to the 'rowValue' variable.
2024-09-11 12:21:41 +05:30
Ashesh Vashi e9af0c3226
Improved the extendability of the SchemaView and DataGridView. (#7876)
Restructured these modules for ease of maintenance and apply the single
responsibility principle (wherever applicable).

* SchemaView

 - Split the code based on the functionality and responsibility.
 - Introduced a new View 'InlineView' instead of using the
   'nextInline' configuration of the fields to have a better, and
   manageable view.
 - Using the separate class 'SchemaState' for managing the data and
   states of the SchemaView (separated from the 'useSchemaState'
   custom hook).
 - Introduced three new custom hooks 'useFieldValue',
   'useFieldOptions', 'useFieldError' for the individual control to
   use for each Schema Field.
 - Don't pass value as the parameter props, and let the
   'useFieldValue' and other custom hooks to decide, whether to
   rerender the control itself or the whole dialog/view. (single
   responsibility principle)
 - Introduced a new data store with a subscription facility.
 - Moving the field metadata (option) evaluation to a separate place
   for better management, and each option can be defined for a
   particular kind of field (for example - collection, row, cell,
   general, etc).
 - Allow to provide custom control for all kind of Schema field.

* DataGridView

 - Same as SchemaView, split the DataGridView call into smaller,
   manageable chunks. (For example - grid, row, mappedCell, etc).
 - Use context based approach for providing the row and table data
   instead of passing them as parameters to every component
   separately.
 - Have a facility to extend this feature separately in future.
   (for example - selectable cell, column grouping, etc.)
 - Separated the features like deletable, editable, reorder,
   expandable etc. cells using the above feature support.
 - Added ability to provide the CustomHeader, and CustomRow through the
   Schema field, which will extend the ability to customize better.
 - Removed the 'DataGridViewWithHeaderForm' as it has been achieved
   through providing 'CustomHeader', and also introduced
   'DataGridFormHeader' (a custom header) to achieve the same feature
   as 'DataGridViewWithHeaderForm'.
2024-09-09 14:27:31 +05:30
Ashesh Vashi 8cf316b853
Fixed some of the issues reported due to introduction of the custom hook 'useSchemaState'. #7776 2024-08-19 09:53:00 +05:30
Ashesh Vashi 52af8d3e49
Introduce custom React Hook useSchemaState to simplify SchemaView component. #7776
Changes include: 
- Simplify current SchemaView code
- Add ability to reuse the schema data & state management implementation outside the SchemaDialogView component.
- Further split components in small and manageable separate files.
- Removed the 'DepListenerContext' context as there was no need for separate context.
- Added a reload functionality in the 'useSchemaState'
- Changes in feature tests.
2024-08-02 09:59:01 +05:30
Pravesh Sharma 10b2e91e29
Update react-diagrams library which is used in ERD to the latest version. #7644
Added patch for DataGridView failing when adding a new row.
2024-07-03 18:19:27 +05:30
Khushboo Vashi 4f415f9768
Added support for viewing PostgreSQL Server Logs in Text, CSV and JSON formats. #3981 2024-07-03 16:17:29 +05:30
Aditya Toshniwal f8fa1cf6d6
- Fix few SonarQube issues.
- Cleanup NW.js related stuff.
2024-07-02 10:34:30 +05:30
Aditya Toshniwal feb3093c6d
Automatically apply virtualization in the DataGridView of SchemaView if the schema contains only one collection. #7607 2024-06-27 13:21:18 +05:30
Aditya Toshniwal 44d40f0785 Fixed an issue where delete button in Users data was enabled for incorrect rows. #7616 2024-06-24 10:31:47 +05:30
Yogesh Mahajan b0e7847962
Fixed bugs found while testing makeStyles JSS changes. #7363 2024-06-17 15:45:40 +05:30
Akshay Joshi 5866da8194 Fixed SonarQube code smells. 2024-06-13 18:48:02 +05:30
Akshay Joshi dea5335ce5 Fixed the following SonarQube code smells:
1) Do not use the Array index in keys.
2) Import from the same module should be merged.
3) Mutable variables should not be exported.
4) Variables should not be initialized to undefined.
5) startswith or endswith method should be used.
6) Unwrap this unnecessarily grouped subpattern.

Additionally, addressed many other SonarQube rules.
2024-06-12 18:09:06 +05:30
Yogesh Mahajan cc999ae5a5
Remove the usage of MUI makeStyles as it doesn't support React 18. #7363 2024-06-06 17:13:12 +05:30
Rohit Bhati 4e3ec91d23
Added support for the 'Add to macros' feature and fixed various usability issues. #4735 2024-05-24 15:30:31 +05:30
Aditya Toshniwal d6a9f8a06c Fixed issues found in testing of react-table upgrade changes. #7419
UI fixes and improvement in System Stats Dashboard.
2024-05-20 10:41:55 +05:30
Aditya Toshniwal 5ec6faff13
Upgrade react-table from v7 to v8. #7419 2024-05-07 16:31:04 +05:30
Yogesh Mahajan f0185fbe7f
Fix issues reported while testing MUI5 library update. 2024-04-17 17:31:55 +05:30
Akshay Joshi 30d2d1b23e Fixed the following code smells:
1) useState call is not destructured into value + setter pair.
2) A fragment with only one child is redundant.
3) Unnecessary '.apply()' and '.call()'.
4) Expected the Promise rejection reason to be an Error.
2024-04-09 19:18:56 +05:30
Yogesh Mahajan 102e0a9839
- Update MUI v4 to v5
- Remove the SCSS dependency completely and use MUI for theming.
- Update - date-fns, @date-io, notistack. Remove - popper.js, sass-loader.
- Cleanup webpack config.
- Port PSQL tool to use MUI themes instead of SCSS theme.
- Theme change will reflect realtime without refreshing pgAdmin.
2024-04-09 08:21:14 +05:30
Pravesh Sharma 1a02d13a28
Bug fixes and improvements in pgAdmin CLI. #7116 2024-03-14 18:12:28 +05:30
Aditya Toshniwal 7374997425
Fix an issue in table dialog where changing column name was not syncing table constraints appropriately. #7229 2024-03-08 11:45:32 +05:30
Aditya Toshniwal a5530f59f7 Fix sonarqube issues for the rule - 'If' statement should not be the only statement in 'else' block 2024-02-26 11:55:36 +05:30
Akshay Joshi 639a28fbfc Fixed code smell 'Prefer using an optional chain expression instead, as it's more concise and easier to read'. 2024-01-25 16:51:40 +05:30
Aditya Toshniwal d26c167c76 Improve auto-focus of editable data grid when adding/editing rows 2024-01-17 18:38:00 +05:30
Akshay Joshi 740ce15bd7 Update copyright notices for 2024 2024-01-01 14:13:48 +05:30
Khushboo Vashi 0d287df6dd
Administer pgAdmin Users and Preferences Using the Command Line Interface (CLI). #2483 2023-12-21 12:07:26 +05:30
Aditya Toshniwal 75a2d880f6 More fixes for UI issues found when testing wcDocker changes. #6479 2023-11-14 16:47:40 +05:30
Aditya Toshniwal ef0b30b1ca Continue fixing multiple UI issues found when testing wcDocker changes. #6479 2023-11-06 18:08:16 +05:30
Aditya Toshniwal b11b2a2f50 Continue fixing multiple UI and SonarQube issues found when testing wcDocker changes. #6479 2023-10-27 15:51:45 +05:30
Aditya Toshniwal 3bcac26ff9 Fix multiple UI and SonarQube issues found when testing wcDocker changes. #6479 2023-10-26 12:06:28 +05:30
Aditya Toshniwal 862f101772
Significant changes to use ReactJS extensively.
1. Replace the current layout library wcDocker with ReactJS based rc-dock. #6479
2. Have close buttons on individual panel tabs instead of common. #2821
3. Changes in the context menu on panel tabs - Add close, close all and close others menu items. #5394
4. Allow closing all the tabs, including SQL and Properties. #4733
5. Changes in docking behaviour of different tabs based on user requests and remove lock layout menu.
6. Fix an issue where the scroll position of panels was not remembered on Firefox. #2986
7. Reset layout now will not require page refresh and is done spontaneously.
8. Use the zustand store for storing preferences instead of plain JS objects. This will help reflecting preferences immediately.
9. The above fix incorrect format (no indent) of SQL stored functions/procedures. #6720
10. New version check is moved to an async request now instead of app start to improve startup performance.
11. Remove jQuery and Bootstrap completely.
12. Replace jasmine and karma test runner with jest. Migrate all the JS test cases to jest. This will save time in writing and debugging JS tests.
13. Other important code improvements and cleanup.
2023-10-23 17:43:17 +05:30
Aditya Toshniwal e22492ad51 Fixed an issue where non-super PostgreSQL users are not able to terminate their own connections from dashboard. #6836 2023-10-11 13:43:31 +05:30
Pravesh Sharma 73430a2062
Fixed an issue where user was not able to assign new/old columns as primary key once column with primary key is deleted. #5749 2023-10-11 13:29:19 +05:30
Aditya Toshniwal fc411bfc49
Allow setting custom username for shared servers, with default as username of server being shared. #6229 2023-10-11 12:56:06 +05:30
Nikhil Mohite 6997d0149e
Fetch database objects after opening the backup dialog. #6799 2023-10-10 15:28:25 +05:30
Nikhil Mohite 9c903f944c
Fixed an issue where the user is unable to select objects on the backup dialog due to tree flickring #6799. 2023-10-04 12:13:21 +05:30
Nikhil Mohite aa973fc8ae
Added support to select/deselect objects in the Backup dialog. #642 2023-09-13 11:07:28 +05:30
Anil Sahoo 7d7b8a71c1
1. Added Expression to CREATE INDEX. #2595
2. Added support for ALTER INDEX column statistics. #6375
2023-08-01 12:37:47 +05:30
Aditya Toshniwal 4676961fc4 Fix multiple Query Tool, ERD title related issues. 2023-07-13 20:06:24 +05:30
Aditya Toshniwal a08714cd65
Allow two controls to be inline in SchemaView. 2023-07-10 17:42:20 +05:30
Akshay Joshi 251bf05692 Fixed the following SonarQube code smells:
1) Do not use Array index in keys.
2) Unnecessary escape character.
3) Rename this local variable to match the regular expression ^[_a-z][a-z0-9_]*$
4) Remove the unused local variable.
2023-06-12 18:44:31 +05:30
Akshay Joshi 6949b41fb9 Ensure that a new row should be added on top in the User Management dialog. Fixes #5817 2023-05-18 13:26:47 +05:30