-
Notifications
You must be signed in to change notification settings - Fork 641
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
Improved the extendability of the SchemaView and DataGridView. #7876
Conversation
Restructured these modules for ease of mainteance and apply the single responsibilty principle (wherever is 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, wheather to rerender the control itself or the whole dialog/view. (single responsibilty principle) - Introduced a new data store with subscription facility. - Moving the field metadata (option) evaluation to separate place for better management, and each option can be defined for a particular kind of field (for example - colleciton, row, cell, general, etc). - Allow to provide custom control for all kind of Schema field. * DataGridView - Same as SchemaView, split the DataGridView call in smaller and manageable chunks. (For example - grid, row, mappedCell, etc). - Use context based approach for providing the row and table data instead of passing them as parameter to each and every component separately. - Have a facility to extend this feature separately in future. (for example - selecatable 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 customisation 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'. Also - Modified the testcases to use separate 'Schema' objects for testing the rendering of create, edit, and properties mode as BaseUISchema instance share the same SchemaState object.
…de will mangled the name of the component function, which would lead to 'View not found' error.
reset the tab only, when reset key is changed.
the data. I never realised that - we were using 'origData' for schema validation to get the initial data, and replaced it with 'sessData' variable by mistake. Changing it back to use 'origData' based on the feedback from Aditya.
jumping issue. It fixes pgadmin-org#7878. Reference: - https://dev.to/kwirke/solving-caret-jumping-in-react-inputs-36ic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js
Outdated
Show resolved
Hide resolved
web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
Outdated
Show resolved
Hide resolved
web/pgadmin/static/js/SchemaView/DataGridView/features/fixedrows.jsx
Outdated
Show resolved
Hide resolved
TODO:: Yet to work on the issues for the partition and table dialog UI.
option for the field having no 'id'. e.g. a field with type 'nested-tab', 'nested-fieldset'.
Hi @asheshv, Trying to add column in existing table/or switch a column to PK where there is no PK. In this, when grantee is changed, the 2 clicks are required to open privileges. |
So - it was failing while creating a table, and not existing table. :)
Looking into it. |
It was failing on new table as well. |
Done! |
@adityatoshniwal All issues are done. Please check now. EDIT: There is one issue remaining - first element selection is not covered. |
I missed in the review last time - SchemaStateContext, SCHEMA_STATE_ACTIONS variables are duplicated in 2 files. Please remove that as well. |
As discussed, this has already been taken care in this PR. |
row details. It fixes the dashboard issue, where activity table was showing same query for all the rows. [pgadmin-org#7895]
…on from the left side object explorer. pgadmin-org#6502
Done. |
Restructured the SchemaView & DataGridView modules for ease of maintenance and applied the single responsibility principle (wherever is applicable).
SchemaView
DataGridView
Also - Modified the test-cases to use separate 'Schema' objects during testing the rendering of create, edit, and properties views as BaseUISchema instance share the same SchemaState object.