-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Replace $http with axios #4497
Merged
Merged
Replace $http with axios #4497
Changes from 12 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
05117ed
Add axios dependency
gabrieldutra 18e8bc5
Update plain usage of $http to axios
gabrieldutra 52098b5
Temporarily use $q in AlertDestinations
gabrieldutra a9e581c
Abstract axios with default interceptor
gabrieldutra 2d8d163
AlertDestination service
gabrieldutra e26df5b
DataSource service
gabrieldutra 90d36ef
AlertSubscription service
gabrieldutra 89b29ed
Allow non-angular requests in ItemsSource
gabrieldutra b934add
Alert service
gabrieldutra ddf40e3
getTags service
gabrieldutra 8e548a9
recordEvent/Event service
gabrieldutra 7fe15b7
QuerySnippet service (with class example)
gabrieldutra 823daa0
Group service
gabrieldutra 7c3355d
Conver missing Alert mute and unmute
gabrieldutra e7f60da
Update UserShow jest test
gabrieldutra b888e18
OrganizationSettings service
gabrieldutra 4fa6a04
OrganizationStatus service
gabrieldutra 7393b55
Add getResponse to axios error interceptor
gabrieldutra ac1e047
User service
gabrieldutra 9d38114
Use plain axios usages to import from service
gabrieldutra 7a9409f
Query service
gabrieldutra 410feb1
Temp add $applyAsync to query pages
gabrieldutra 7a0f47d
Widget service
gabrieldutra 2c6d895
Inject apiKey in axios (tmp with $injector)
gabrieldutra 8cf00f3
Fix associatedDropdown
gabrieldutra 9fdc33e
Map query results
gabrieldutra 34b7ef0
Fix axios call in widget service
gabrieldutra 3a89092
QueryResult service
gabrieldutra 20ab4cd
Temp add $applyAsync to axios
gabrieldutra aa7cb1f
Address comments
gabrieldutra 4ca22d7
Visualization service
gabrieldutra 702bf63
Dashboard service
gabrieldutra 5cbbaf3
Update $favorite and $unfavorite
gabrieldutra 95b3585
Add dashboard delete
gabrieldutra dc7a4bb
Auth service
gabrieldutra fadd78b
Update dashboard after archive it
gabrieldutra 89b4e4c
Updates for GH comments
gabrieldutra acd7974
Remove angular-resource
gabrieldutra 261715f
Merge branch 'master' into axios
gabrieldutra b589be5
Remove events service
gabrieldutra b3e12c8
Remove temp $promise handlers
gabrieldutra 0ed6dc2
Fix AddToDashboardDialog
gabrieldutra 131aabc
Use save to create Alerts
gabrieldutra 0ac577d
Remove $applyAsync for query angular pages
gabrieldutra 1f949a9
Remove unnecessary import
gabrieldutra 6d27c39
Keep refresh in getSchema
gabrieldutra aad39dc
Add $applyAsync for Param url update
gabrieldutra 484e248
Merge branch 'master' into axios
gabrieldutra a2ae12b
Merge branch 'master' into axios
gabrieldutra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.
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.
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.
I think that things like this should be moved to services (e.g. have a method called
updateDashboard
of whatever) - there should be no direct HTTP calls in components. There are a lot of similar places in other components as wellThere 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.
You're right. It was wrong to use
$http
all over. But wherever things are just working, we should keep things as they were (except for adoptingaxios
so we can drop$http
). In parallel, let's decide on a pattern we want to use for our API calls/resources, that will be more inline with how React works (returning immutable objects for example). Any suggestions for such pattern? Let's discuss in the issue.Wherever things are not working as is or we have to jump through hoops to make it work, we can start adopting the new pattern. The rest we will update when we are done with the React migration.