pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Simplify the BaseSchemUI state management

Open asheshv opened this issue 1 year ago • 1 comments

Use a separate custom hook for the Schema state management for:

  • Simplify the SchemaView code
  • Split the state management code in mode manageable & testable
  • Make the state management reusable.
  • Simplify the dependency management

asheshv avatar Aug 02 '24 04:08 asheshv

In the latest snapshot, import export server dialog showing the loading icon and no error is in logs. But locally getting this error.

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
    at SchemaDialogView (webpack:///./pgadmin/static/js/SchemaView/SchemaDialogView.jsx?:48:7)
    at ErrorBoundary (webpack:///./pgadmin/static/js/helpers/ErrorBoundary.jsx?:23:5)
    at SchemaView (webpack:///./pgadmin/static/js/SchemaView/SchemaView.jsx?:24:7)

anilsahoo20 avatar Aug 08 '24 06:08 anilsahoo20

Tested and verified on snapshot build: https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2024-08-13/ Package: arm64 Environment: macOs Ventura 13.5.1

anilsahoo20 avatar Aug 13 '24 05:08 anilsahoo20

Hi @asheshv Facing some issues with the below dialogs

  1. Filtered rows: When we open the dialog for any table and write the condition and click Ok, it does not open View/Edit Data tool.
  2. New Connection Dialog: In query tool, if we open new connection dialog, and it should by default load the server, database, role, also when selecting the server from the dropdown not able to show the selected server.
  3. Macro dialog: In query tool, If we open Manage macros and add a new macro or update any existing macro, the Save button is not enabled.
  4. User management dialog: In server mode, on adding a new user or updating a user does not enable the Save button.

anilsahoo20 avatar Aug 14 '24 11:08 anilsahoo20

Hi @asheshv Here are some more issues I found.

  1. Sort/Filter Options dialog: In view/edit data tool, Click on the Sort/Filter icon, write condition or sort, save button is disabled.
  2. Debugger tool: Go to any function with arguments right click Debugging->Debug enter arguments the debug button remains disabled.
  3. Table>Index: create any index, by adding columns, giving something went wrong
  4. Table>Exclusion constraint: Create an exclusion constraint, and then add some columns/expressions, after adding the controls are not getting empty.
  5. Table>Foreign key: Create a foreign key, then add columns and references, once added the controls are not getting empty.
  6. Change password: After entering the details, Change is enabled but not working.

anilsahoo20 avatar Aug 14 '24 13:08 anilsahoo20

Hi @asheshv Here are some more issues I found.

  1. subscription dialog: after entering password, click on save, password is not going empty in API call.
  2. publication dialog: after entering tables, the dialog says Something went wrong .
  3. table dialog: constraints sections not working properly.

anilsahoo20 avatar Aug 16 '24 10:08 anilsahoo20

Tested and verified on candidate build: https://developer.pgadmin.org/builds/2024-08-19-1/ Package: arm64, pip wheel Environment: macOs Ventura 13.5.1

anilsahoo20 avatar Aug 20 '24 05:08 anilsahoo20