workfloworchestrator / orchestrator-ui-library

Component library for the orchestrator-ui (v2) which is published in npm
8 stars 3 forks source link

Rethink structure pages with tables #676

Closed ricardovdheijden closed 2 weeks ago

ricardovdheijden commented 4 months ago

All pages with a FilterableTable have strong similarities:

Try to move reusable parts to hooks

DutchBen commented 1 month ago

My report/Proposal

In general the functionality in the listing pages that use tables like the metadata pages or the tasklist page is divided between a WfoPage and the WfoTableWithFilter component. The page contains datafetching and datamapping functionality and maintains state, the table component takes care of representation. A possible improvement could be to separate this further.

Wfo<Name>Page >> TableLoader >> Table component

Where the page configuries what data to load and what columns to show. This is passed of to the DataLoader which does the actual calling and maintains state like pagination and filtering. The TableLoader could be generalized so it could be reuseable for all pages. This way a lot of functionality could be deduplicated. I have put some example code in the branch 676-refactor-tables

Considerations All in all I'm not very convinced the refactoring will be worth it. It will move some complexity but not necessarily reduce it. We will have a easier and lighter Page component but the TableLoader will be another moving part. Let's discuss.

wouter1975 commented 2 weeks ago

Won't fix now, leave till suitable opportunity