Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello !
I was digging into the the frontend code to mockup a feature and noticed there were some improvements that could be made. The biggest issue is the app doesn't use a unidirectional flux like data flow and many of the classes do too much work.
WHAT IS THIS
I've done a refactor of the app details pages. During the refactor a few bugs were fixed here and there but there were a ton of code wins that will help the app moving forward.
WHAT ARE THE WINS?
We can also do nice things like add a dirty flag here since all things updated in the same place. Then notify users if they navigate away without doing a save. Also when we do any actions we know the current state and react to it very cleanly.
Moved the Log Polling into its own service. Now it doesn't live with the component that might need it but there's a global one for all the pages. This makes it easier to coordinate them and maybe combine them all into one call and then spread them down to the components. I've built ( but not part of this pull ) an endpoint that gets the container states and it fits nicely into this service. You also get good insight into the lifecycle of this component.
A lot the classes were very large. I've pulled things out into more logical components for easier maintenance and scoping. This will be much nicer when it's time to add client side unit tests.
No more ! I've typed everything ( well there's 1 left... )
No more "!". All the objects are accessed in a "safe" way.
Adding ESLinting. I've just added linting for my new files. I'm using
@typescript-eslint/recommended
andreact/recommended
. Plus a few rules that seem to follow how you already write code ( double quotes, semicolons, ident, no explicit return type ). All passing super clean.Added a common Log Scrolling view with some nice fixes
Integrated the loading state for saving so it doesn't destroy and recreate the tabs.
Changing tabs now causes a navigation so you can refresh the page or link to a tab