-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add restangular for app usage #59
Conversation
Current coverage is 11.70% (diff: 97.22%)
@@ development #59 diff @@
=============================================
Files 90 95 +5
Lines 2539 2606 +67
Methods 0 0
Messages 0 0
Branches 192 192
=============================================
+ Hits 238 305 +67
Misses 2301 2301
Partials 0 0
|
https: false, | ||
changeOrigin: true, | ||
rewrite: { | ||
'^/api/v1': '/grupo1' |
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.
This should be updated for current API build. There was a PR that updated this.
// Some of the following code was taken or adapted from: | ||
// - https://github.com/mgonto/restangular/issues/98 (sanitizeRestangular) | ||
// - http://www.bradoncode.com/blog/2015/07/25/tip-unit-test-promise-angular/ (promises) | ||
|
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.
Please remove the above comments: they are not from this code
You also may be handling authentication as it was added by gibarsin in a PR before. |
.antMatchers("/**").authenticated() | ||
.and() | ||
.addFilterBefore(new StatelessLoginFilter("/login", tokenAuthenticationService, userDetailsService, authenticationManager()), UsernamePasswordAuthenticationFilter.class) | ||
.addFilterBefore(new StatelessLoginFilter("/api/v1/login", tokenAuthenticationService, userDetailsService, authenticationManager()), UsernamePasswordAuthenticationFilter.class) |
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.
@gibarsin please check these changes
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.
WebAuthConfig path changes are ok!
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.
WebAuthConfig path changes are ok!
// only once and before the token is set | ||
// This requests the token each time a request is made | ||
// and in this instance it should already be set | ||
RestangularConfigurer.addFullRequestInterceptor( |
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.
Try to delete this duplication
// only once and before the token is set | ||
// This requests the token each time a request is made | ||
// and in this instance it should already be set | ||
RestangularConfigurer.addFullRequestInterceptor( |
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.
Same
$rootScope = _$rootScope_; | ||
$httpBackend = _$httpBackend_; | ||
$cookies = _$cookies_; | ||
specUtilsService = specUtils; |
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.
Remove this. It's not being used.
- Add grunt-connect-proxy npm dependency - Update Gruntfile to use this dependency. - API must be served at localhost:7070 during development so as to be able to use livereload of angular changes and use a static version (war) of the API. - Solve Cross Origin request problem with browsers - Add Students service extending Restangular - Add Courses service extending Restangular - Add example of Students and Courses services usage on HomeCtrl - Add spec utils service - Add api responses service for testing purposes only (working as cassetes for api calls) - Add all test cases
- Add Authentication service - Add $cookies service to handle user session - Update login endpoint (back) to match the API path - Add token header to services using restangular - Add new spec cases for added components Notes - This functionality should be improved, but was implemented as to be able to deploy and test the app. - Login is served at the /login path and should be completed in order to use the rest of the app's requests.
This avoids the duplication marked in the PR Rename BodyController -> BodyCtrl
0ea53b0
to
2de1df2
Compare
Summary
able to use livereload of angular changes and use a static version
(war) of the API.
cassetes for api calls)
Trello Card
https://trello.com/c/zaZ5yBjv/8-configurar-restangular