Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
HAWKULAR-140 - Consuming the provider from ui-services for accounts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkrohling committed May 21, 2015
1 parent cbccf99 commit 151f790
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ui/console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"d3": "3.4.8",
"event-drops": "0.1.1",
"hawkular-charts": "^0.2.4",
"hawkular-ui-services": "^0.2.0",
"hawkular-ui-services": "^0.2.4",
"hawtio-core-navigation": "2.0.39",
"hawtio-core": "2.0.16",
"hawtio-template-cache": "2.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module HawkularAccounts {
}]);

_module.run(['$rootScope', '$log', '$modal', '$document', 'userDetails', 'HawtioNav', 'HawkularInventory', ($rootScope, $log, $modal, $document, userDetails, HawtioNav:HawtioMainNav.Registry, hawkularInventory) => {
//HawtioNav.add(accountsTab);
HawtioNav.add(accountsTab);
$rootScope.userDetails = userDetails;

$rootScope.$on('IdleStart', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
module HawkularAccounts {

export var OrganizationsController = _module.controller("HawkularAccounts.OrganizationsController", [
'$rootScope', '$scope', 'HawkularAccounts.OrganizationService', '$log', '$location',
($rootScope, $scope, OrganizationService, $log, $location) => {
'$rootScope', '$scope', '$log', '$location', 'HawkularAccount',
($rootScope, $scope, $log, $location, HawkularAccount) => {

$scope.organizations = [];
$scope.loading = true;
Expand All @@ -32,7 +32,7 @@ module HawkularAccounts {
$scope.loadOrganizations = () => {
$scope.organizations = [];
$scope.loading = true;
$scope.organizations = OrganizationService.query({},
$scope.organizations = HawkularAccount.Organization.query({},
()=> {
$scope.loading = false;
},
Expand Down Expand Up @@ -62,10 +62,10 @@ module HawkularAccounts {
}]);

export var OrganizationNewController = _module.controller("HawkularAccounts.OrganizationNewController", [
'$scope', 'HawkularAccounts.OrganizationService', '$log', '$location',
($scope, OrganizationService, $log, $location) => {
'$scope', '$log', '$location', 'HawkularAccount',
($scope, $log, $location, HawkularAccount) => {

$scope.organizationNew = new OrganizationService({});
$scope.organizationNew = new HawkularAccount.Organization({});
$scope.persist = () => {
$scope.organizationNew.$save({},
() => {
Expand All @@ -80,10 +80,4 @@ module HawkularAccounts {
$log.debug("Trying to persist the organization");
};
}]);

export var OrganizationService = _module.service("HawkularAccounts.OrganizationService", ["$resource", ($resource) => {
return $resource('http://localhost:8080/hawkular-accounts/organizations/:id', {id:'@id'});
}]);

_module.requires.push("ngResource");
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
module HawkularAccounts {

export var PersonaController = _module.controller("HawkularAccounts.PersonaController", [
'$rootScope', '$scope', 'HawkularAccounts.PersonaService', '$log',
($rootScope, $scope, PersonaService, $log) => {
'$rootScope', '$scope', '$log', 'HawkularAccount',
($rootScope, $scope, $log, HawkularAccount) => {
$scope.personas = [];
$scope.currentPersona = null;

Expand All @@ -29,7 +29,7 @@ module HawkularAccounts {
};

$scope.loadCurrentPersona = () => {
$scope.currentPersona = PersonaService.get({id: "current"},
$scope.currentPersona = HawkularAccount.Persona.get({id: "current"},
() => {
$scope.$emit("CurrentPersonaLoaded", $scope.currentPersona);
},
Expand All @@ -40,7 +40,7 @@ module HawkularAccounts {
};

$scope.loadPersonas = () => {
$scope.personas = PersonaService.query({},
$scope.personas = HawkularAccount.Persona.query({},
() => {
$scope.personas = $scope.personas.filter((persona) => {
return persona.id !== $scope.currentPersona.id;
Expand Down Expand Up @@ -77,10 +77,4 @@ module HawkularAccounts {

$scope.load();
}]);

export var PersonaService = _module.service("HawkularAccounts.PersonaService", ["$resource", ($resource) => {
return $resource('http://localhost:8080/hawkular-accounts/personas/:id', {id:'@id'});
}]);

_module.requires.push("ngResource");
}

0 comments on commit 151f790

Please sign in to comment.