Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

RAINCATCH-1131 - user list client integration #47

Merged
merged 9 commits into from
Aug 21, 2017

Conversation

wtrocki
Copy link
Member

@wtrocki wtrocki commented Aug 18, 2017

Motivation

Allow to use autocomplete and filter out server side user list.

preview

Progress

  • Ui changes
  • Extraction to service
  • Unit tests
  • Documentation

if (self.model) {
if(self.model.assignee){
$http
.get("http://localhost:8001/api/users/" + self.model.assignee )
Copy link
Member Author

@wtrocki wtrocki Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paolobueno - I left this only here for test purposes, I will need to move this to UserService, but this is currently being implemented by auth providers. I remember we had some code for WFM related user calls.
It will be nice to move that implementation to core.

"banner": "http://web18.streamhoster.com/pentonmedia/beefmagazine.com/TreverStockyards_38371.jpg",
"password": "sha1:10000:b959c88175571352c29e1e5701e587650117e20387711cd73b66366c321d361e001a51ad1c3f8b996aece681564185749f6a959e21ce7d95970dabde8b1ec82b2ace91ba368d463ebe92d1d7ec96b0d748207bbbed88b460c702131d2765de5b19c607892bd176e218c03095956d98881be5d4fe0630654c5289e7b022b6bb487c5fce0d548ac654b071301c88f2505375c110b516e25f7ccf10bc3df1624049e3008bc68ad15827eb841ae2be17855e53c2f9a6e7d575cc2b7534b10583dca3e11f020e979fd0552c76cd2cbead600abd7fb8a6619da2ecdbfbf81e518adef6c94b5521c5c4a41a14c02b9ed5619bd5fcf75c733c318356ccea74a10f9c6a4a:10c2bb710af17f75b73faf35d33874587b44bd3017e02a87a5bff57621d7a019558a660fc4a9ed476745db9812f27199fa0f8ffc3ea2dc3c5bca08913abd967c"
});
return this.auth.getProfile();
};

UserService.prototype.getProfile = function getProfile() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicate function needs to be removed and comment above readUser needs to be removed.

};


// FIXME - Remove and replace with readUser method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove Duplicate function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will also need to update function that assigns $scope.profileData

angular.module('wfm.common.apiservices').service("userService", ['authService', function(authService) {
return new UserService(authService);
angular.module('wfm.common.apiservices').service("userService", ['authService', '$http', function(authService, $http) {
var urlPromise = new Promise(function(resolve, reject) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paolobueno Maybe we should setup url for $http globally?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a way to set a base url for the module globally, we'd still have to concatenate strings around. i.e. $http.defaults.baseUrl + '...', but I was using a promise because I couldn't think of a better way to ensure the fh sdk init had been run.

You can still reuse that code from here and not wrap fh.init again by requiring the baseUrl value from the wfm.http module: https://github.com/feedhenry-raincatcher/raincatcher-angularjs/blob/master/packages/http/baseUrl.js#L19

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it that way. There is this PR for SDK that will allow us to initialize SDK when we need to so we can wrap that into service.

Copy link
Contributor

@paolobueno paolobueno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally

@wtrocki wtrocki merged commit bc77920 into feedhenry-raincatcher:master Aug 21, 2017
@wtrocki wtrocki deleted the RAINCATCH-1131 branch August 21, 2017 16:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants