-
Notifications
You must be signed in to change notification settings - Fork 96
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
Refactor app details #25
Open
solomon23
wants to merge
26
commits into
caprover:master
Choose a base branch
from
solomon23:refactor_app_details
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This includes: Using a unidirectional data flow using context Adding a top levfel provider which changes the state and performs api actions Pulling out files into components to make them more maintainable Adding a service which takes care of the server ping'ing instead of doing it in the ui comonent
add in classnames
cleanup the context not being nullable
add back the redirect to apps if the app can't be found
clean up a bunch of common linting rules add rules for quotes and semicolons that are used through the site add trailing commas
add a safer deep copy with support for undefined
add rootDomain to SingleAppApiData
add an error message for bad json
This lets us remove the componentWillReceiveProps and replace it with componentDidUpdate and remove our react 17 warning
…self pull log views out of applogs and build logs and use a common log
remove another any
LiquidITGuy
pushed a commit
to LiquidITGuy/caprover-frontend
that referenced
this pull request
Feb 17, 2023
Add RabbitMQ template
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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