ral-facilities / inventory-management-system

Apache License 2.0
1 stars 0 forks source link

Combine dialogue open states in catalogue #227

Open joelvdavies opened 8 months ago

joelvdavies commented 8 months ago

I think we can combine the deleteCategoryDialogOpen, saveAs, edit react states and use a single one e.g. https://github.com/ral-facilities/inventory-management-system/blob/94d9ff67eb418659c64590155c7f8f4c4c054f07/src/systems/systems.component.tsx#L239-L242. (May also be able to use a single instance of the dialog as well https://github.com/ral-facilities/inventory-management-system/blob/94d9ff67eb418659c64590155c7f8f4c4c054f07/src/systems/systems.component.tsx#L392-L407)

joshuadkitenge commented 8 months ago

This is fine however it makes the code less readable.

joelvdavies commented 8 months ago

This is fine however it makes the code less readable.

Yeah I can see that as well, although it does also reduce the number of react components it tries to render. Perhaps just combining the save as and edit would work nicer, at least then you don't have the nasty line above getting the type passed to the dialog to ignore the delete one.

joshuadkitenge commented 8 months ago

Yeah it something to think about after MVP has been delivered