Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single responsibility principle for the SchemaView and DataGridView #7884

Closed
asheshv opened this issue Aug 31, 2024 · 95 comments
Closed

Single responsibility principle for the SchemaView and DataGridView #7884

asheshv opened this issue Aug 31, 2024 · 95 comments
Assignees
Labels
EDB Sprint 177 Housekeeping javascript Pull requests that update Javascript code
Milestone

Comments

@asheshv
Copy link
Contributor

asheshv commented Aug 31, 2024

A class should have one, and only one, reason to change.
-- Robert C. Martin (Uncle Bob)

Single responsibility principle improves the code maintainability, because:

  • Frequency and Effects of Changes - you need to change block for code for a single purpose.
  • Easier to Understand - improves the readability
  • Easy to extend - easy to add new features

Current implementation of the SchemaView and DataGridView is amazing. It is great piece of code, and does the job well.
But - at the same time, it's not easy to understand, and it is not easy to make change in it, as it could result into breaking other places as well.

When working on the 'useSchemaState' custom hook, I realised that - it is not easy or enough to move some piece of the code and introduce it as the custom hook, the current javascript and feature test-suites have definitely informed me about the broken state at a particular point of time. it made me realised that it won't be easy to introduce new features or do modification in future.

As a result - I would like to propose to use the single responsibility principle for them.

Note: There are still some exceptions in the currently proposed patch.

References:

@asheshv asheshv added Housekeeping javascript Pull requests that update Javascript code labels Aug 31, 2024
@akshay-joshi akshay-joshi added this to the 8.12 milestone Sep 9, 2024
@yogeshmahajan-1903
Copy link
Contributor

Issues found -
1.In preferences, try to set default binary path > crash
Screenshot 2024-09-10 at 1 37 31 PM

2.Try adding new row in server properties > connection parameter > crash
Screenshot 2024-09-10 at 1 37 09 PM

3.In connection parameters, values for files parameters like ssl, folder icon is missing also not horizontal scrollable.
Screenshot 2024-09-10 at 1 36 21 PM

asheshv added a commit to asheshv/pgadmin4 that referenced this issue Sep 10, 2024
asheshv added a commit to asheshv/pgadmin4 that referenced this issue Sep 10, 2024
@asheshv
Copy link
Contributor Author

asheshv commented Sep 10, 2024

All issues are fixed in the PR [#7910].

akshay-joshi pushed a commit that referenced this issue Sep 11, 2024
* 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.
@yogeshmahajan-1903
Copy link
Contributor

1.In connection parameters, values for files parameters like ssl, folder icon is missing also not horizontal scrollable.
Screenshot 2024-09-11 at 5 44 19 PM

Expected -
Screenshot 2024-09-11 at 5 46 10 PM

2.Dropdown is not populated for value change.
Screenshot 2024-09-11 at 5 43 57 PM

Expected -
Screenshot 2024-09-11 at 5 45 55 PM

3.Value is missing if value is switch type
Screenshot 2024-09-11 at 5 46 59 PM

Expected -
Screenshot 2024-09-11 at 5 47 47 PM

4.Values in the backup/restore etc dialogue are in single column
Screenshot 2024-09-11 at 5 49 03 PM

Expected -
Screenshot 2024-09-11 at 5 49 56 PM

asheshv added a commit to asheshv/pgadmin4 that referenced this issue Sep 12, 2024
is loaded asynchronously, and variable types data may not be available
while rendering the 'value' cell. (Fixes pgadmin-org#7884)
@yogeshmahajan-1903
Copy link
Contributor

yogeshmahajan-1903 commented Sep 12, 2024

New issues -
1.select database > Navigate to properties panel > Something went wrong.(For any db object)
Screenshot 2024-09-12 at 11 42 55 AM

2.An empty column is added in columns list in nested grid control for the constraints -
Screenshot 2024-09-12 at 11 46 41 AM

3.Unable to create the function
Screenshot 2024-09-12 at 11 50 28 AM

4.Unable to create Azure cloud instance. When auth method is as Azure CLI and user click s on 'Click here to authenticate yourself ..'. Nothing is happening.
Screenshot 2024-09-12 at 11 53 49 AM

@akshay-joshi
Copy link
Contributor

New Connection Dialog: Role list is empty

@anilsahoo20
Copy link
Contributor

Filtered rows for a table don't have the initial focus when it opens.

@anilsahoo20
Copy link
Contributor

Table>Constraints>Foreign key>Columns>Referencing dropdown is empty after selecting References dropdown. This is for Table object and ERD tool table dialog.

@RohitBhati8269
Copy link
Contributor

Select any Server -> Backup Globals
This dialog filename input is missing warning:-
Version 8.10
Screenshot 2024-09-12 at 5 13 09 PM

current version:-
Screenshot 2024-09-12 at 5 12 59 PM

@RohitBhati8269
Copy link
Contributor

RohitBhati8269 commented Sep 18, 2024

While creating the Trigger function unable to edit the code tab section:-

If it is disabled for specific languages then it should not show the error message.

Screenshot 2024-09-18 at 5 18 33 PM

@RohitBhati8269
Copy link
Contributor

current:-
Screenshot 2024-09-18 at 5 31 46 PM

version 8.10:-
Screenshot 2024-09-18 at 5 31 53 PM

@asheshv
Copy link
Contributor Author

asheshv commented Sep 18, 2024

With exclude constraint, if one exclude constraint is added, if we want to create more exclude constraints by adding columns or expression, then the add button is disabled.

Screenshot 2024-09-18 at 3 56 27 PM

Fixed in the PR [7942]

@RohitBhati8269
Copy link
Contributor

RohitBhati8269 commented Sep 18, 2024

Strict? switch/toggle is showing as clickable when hovering the mouse on that but no action is performed when clicking on the switch/toggle.

Screenshot 2024-09-18 at 6 04 23 PM

@asheshv
Copy link
Contributor Author

asheshv commented Sep 18, 2024

While creating the Trigger function unable to edit the code tab section:-

If it is disabled for specific languages then it should not show the error message.

Screenshot 2024-09-18 at 5 18 33 PM

This is an old issue, but - fixed it.

@asheshv
Copy link
Contributor Author

asheshv commented Sep 18, 2024

Strict? switch/toggle is showing as clickable when hovering the mouse on that but no action is performed when clicking on the switch/toggle.

Screenshot 2024-09-18 at 6 04 23 PM

Fixed

@asheshv
Copy link
Contributor Author

asheshv commented Sep 18, 2024

current:- Screenshot 2024-09-18 at 5 31 46 PM

version 8.10:- Screenshot 2024-09-18 at 5 31 53 PM

Fixed

@asheshv
Copy link
Contributor Author

asheshv commented Sep 18, 2024

Found new issue: Open Create table dialog. Add some columns, go to Constraints tab. Columns control is disabled in Primary and Unique key constraints. Screenshot 2024-09-18 at 1 05 26 PM

This issue is also reproducible in ERD tool.

Fixed

@asheshv
Copy link
Contributor Author

asheshv commented Sep 18, 2024

Found new issue:

Columns are not selected in the Publication dialog. Open Publication Dialog. Add any table and try to select the column from the drop-down.

Screenshot 2024-09-18 at 5 02 52 PM

Fixed

@anilsahoo20
Copy link
Contributor

anilsahoo20 commented Sep 19, 2024

Found new issue: Open Create table dialog. Add some columns, go to Constraints tab. Columns control is disabled in Primary and Unique key constraints. Screenshot 2024-09-18 at 1 05 26 PM

This issue is still reproducible in snapshot build.

@anilsahoo20
Copy link
Contributor

On create table>constraints>exclude, When we add 1st constraint, its being added, and when we add another exclude constraint with multiple columns, getting , , ,
Screenshot 2024-09-19 at 11 11 22 AM

@anilsahoo20
Copy link
Contributor

On Create Table>Constraints>Foreign key, when select the local column, references and referencing, and click on add button, it adds a row with empty brackets as per screenshot
Screenshot 2024-09-19 at 11 15 51 AM

@akshay-joshi
Copy link
Contributor

Found new issue:

Columns are not selected in the Publication dialog. Open Publication Dialog. Add any table and try to select the column from the drop-down.

Screenshot 2024-09-18 at 5 02 52 PM

This issue is still reproducible in snapshot build.

@anilsahoo20
Copy link
Contributor

Once we add the exclusion constraints, on enabling the expression switch it holds the old value.
Screenshot 2024-09-19 at 12 54 01 PM

@anilsahoo20
Copy link
Contributor

anilsahoo20 commented Sep 19, 2024

Once we add the initial foreign key in the constraints of create table, the subsequent foreign key constraints are not showing.
Getting error on submitting, errormsg: "'references'"

Screenshot 2024-09-19 at 12 56 10 PM

@anilsahoo20
Copy link
Contributor

Found new issue:
Columns are not selected in the Publication dialog. Open Publication Dialog. Add any table and try to select the column from the drop-down.
Screenshot 2024-09-18 at 5 02 52 PM

This issue is still reproducible in snapshot build.

This issue is fixed in PR, #7944

@anilsahoo20
Copy link
Contributor

Found new issue: Open Create table dialog. Add some columns, go to Constraints tab. Columns control is disabled in Primary and Unique key constraints. Screenshot 2024-09-18 at 1 05 26 PM

This issue is still reproducible in snapshot build.

This issue is fixed in PR, #7944

@anilsahoo20
Copy link
Contributor

anilsahoo20 commented Sep 19, 2024

current:- Screenshot 2024-09-18 at 5 31 46 PM

version 8.10:- Screenshot 2024-09-18 at 5 31 53 PM

This issue is fixed in PR. #7944

@anilsahoo20
Copy link
Contributor

Strict? switch/toggle is showing as clickable when hovering the mouse on that but no action is performed when clicking on the switch/toggle.

Screenshot 2024-09-18 at 6 04 23 PM

This issue is reproducible.

@anilsahoo20
Copy link
Contributor

While creating the Trigger function unable to edit the code tab section:-

If it is disabled for specific languages then it should not show the error message.

Screenshot 2024-09-18 at 5 18 33 PM

When I select other languages than C in Create tigger function>Definition, the error is not showing and code tab is editable, if I select C, the code mirror cursor is not showing and is not editable and error is not showing, but disabled grey color is not showing, attaching the screenshot for reference.
Screenshot 2024-09-19 at 1 35 47 PM

@anilsahoo20
Copy link
Contributor

With exclude constraint, if one exclude constraint is added, if we want to create more exclude constraints by adding columns or expression, then the add button is disabled.

Screenshot 2024-09-18 at 3 56 27 PM

This issue is still reproducible.

@anilsahoo20
Copy link
Contributor

Strict? switch/toggle is showing as clickable when hovering the mouse on that but no action is performed when clicking on the switch/toggle.
Screenshot 2024-09-18 at 6 04 23 PM

This issue is reproducible.

These disabled controls are for EPAS>=9.6 and lanname=edbspl. Tested with EPAS server, controls are working fine.

@asheshv
Copy link
Contributor Author

asheshv commented Sep 19, 2024

While creating the Trigger function unable to edit the code tab section:-
If it is disabled for specific languages then it should not show the error message.
Screenshot 2024-09-18 at 5 18 33 PM

When I select other languages than C in Create tigger function>Definition, the error is not showing and code tab is editable, if I select C, the code mirror cursor is not showing and is not editable and error is not showing, but disabled grey color is not showing, attaching the screenshot for reference. Screenshot 2024-09-19 at 1 35 47 PM

Yes - this expected.
I have marked the code as readonly instead of setting 'visible' option to 'false'.

@anilsahoo20
Copy link
Contributor

While creating the Trigger function unable to edit the code tab section:-
If it is disabled for specific languages then it should not show the error message.
Screenshot 2024-09-18 at 5 18 33 PM

When I select other languages than C in Create tigger function>Definition, the error is not showing and code tab is editable, if I select C, the code mirror cursor is not showing and is not editable and error is not showing, but disabled grey color is not showing, attaching the screenshot for reference. Screenshot 2024-09-19 at 1 35 47 PM

Yes - this expected. I have marked the code as readonly instead of setting 'visible' option to 'false'.

Okay

@anilsahoo20
Copy link
Contributor

With exclude constraint, if one exclude constraint is added, if we want to create more exclude constraints by adding columns or expression, then the add button is disabled.
Screenshot 2024-09-18 at 3 56 27 PM

This issue is still reproducible.

Issue is fixed.

@anilsahoo20
Copy link
Contributor

Issue found in user management dialog,

  1. on adding a new user, the error continues to display, email can not be empty, and the save button is not enabled after entering all the mandatory fields.
  2. Also the search box takes the full width, but it has taken half width.
  3. The search box is not giving any result on searching the users that are still present.
Screenshot 2024-09-19 at 4 01 39 PM Screenshot 2024-09-19 at 4 04 36 PM

@yogeshmahajan-1903
Copy link
Contributor

yogeshmahajan-1903 commented Sep 20, 2024

1.Scroll is added in the parameters - [Sev-3]
Screenshot 2024-09-20 at 9 53 48 AM

Expected -
Screenshot 2024-09-20 at 9 53 53 AM

2.In User management search box still takes the full width, but it has taken half width. [sev-3]

Screenshot 2024-09-20 at 9 58 59 AM

3.The search box is still not giving any result on searching the users that are still present. [sev-3]
Screenshot 2024-09-20 at 9 59 37 AM

@adityatoshniwal
Copy link
Contributor

Note is missing text:
image

@anilsahoo20
Copy link
Contributor

Tested and verified on candidate build: https://developer.pgadmin.org/builds/2024-09-20-1/
Package: arm64
Environment: macOs Ventura 13.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EDB Sprint 177 Housekeeping javascript Pull requests that update Javascript code
Projects
None yet
Development

No branches or pull requests

8 participants