Skip to content

Commit d53ca52

Browse files
authored
Merge pull request #50 from huangqun/dev
More Fixes
2 parents 493524c + 0c35976 commit d53ca52

File tree

6 files changed

+31
-4
lines changed

6 files changed

+31
-4
lines changed

src/app/billing_account_resources/billingaccountresources.list.html

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<!-- add client button row -->
33
<div class="row">
44
<div class="col col-md-12 col-lg-12">
5+
<a class="btn btn-primary pull-right m-b" ui-sref="index.billingaccounts.list" style="margin-left: 20px">
6+
<strong>Back</strong>
7+
</a>
58
<a class="btn btn-info pull-right m-b" ui-sref="index.billingaccountresources.new({accountId: billingAccountId})">
69
<strong><i class="fa fa-plus"></i> Add Resource</strong>
710
</a>

src/app/billing_account_resources/billingaccountresources.new.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="row">
88
<div class="form-group col-md-6" ng-class="{'has-error': addResourceForm.name.$touched && addResourceForm.name.$invalid}">
99
<label for="resource-name">TC Handle</label>
10-
<input id="resource-name" type="text" class="form-control" ng-model="newResource.name" name="name" required="required" placeholder="Handle">
10+
<input id="resource-name" type="text" data-find-user class="form-control" ng-model="newResource.name" name="name" required="required" placeholder="Handle">
1111
</div>
1212
<div class="form-group col-md-6" ng-class="{'has-error': addResourceForm.status.$touched && addResourceForm.status.$invalid}">
1313
<label for="resource-status">Status</label>
@@ -21,7 +21,7 @@
2121
<div class="row">
2222
<div class="form-group col-md-12" ng-class="{'has-error': addResourceForm.userId.$touched && addResourceForm.userId.$invalid}">
2323
<label for="resource-user-id">User ID</label>
24-
<input id="resource-user-id" type="text" class="form-control" ng-model="newResource.userId" name="userId" required="required" placeholder="User ID">
24+
<input id="resource-user-id" type="text" class="form-control" ng-model="newResource.userId" name="userId" required="required" placeholder="User ID" disabled="disabled">
2525
</div>
2626
</div>
2727
<div class="row ">

src/app/billing_accounts/billingaccounts.list.controller.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.controller('billingaccount.BillingAccountsListController', ['$scope', '$r
3232
$scope.accounts = [];
3333

3434
$scope.search = function () {
35+
$scope.formSearch.setLoading(true);
3536
BillingAccountService.search({
3637
customer: $scope.formSearch.criteria.customer,
3738
user: $scope.formSearch.criteria.user,

src/app/clients/clients.edit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</div>
1212
<div class="form-group col-md-6" ng-class="{'has-error': editClientForm.codeName.$touched && editClientForm.codeName.$invalid}">
1313
<label for="client-code-name">Code Name</label>
14-
<input id="client-code-name" type="text" class="form-control" ng-model="client.codeName" name="codeName" required="required">
14+
<input id="client-code-name" type="text" class="form-control" ng-model="client.codeName" name="codeName">
1515
</div>
1616
</div>
1717
<div class="row">

src/app/clients/clients.new.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</div>
1212
<div class="form-group col-md-6" ng-class="{'has-error': addClientForm.codeName.$touched && addClientForm.codeName.$invalid}">
1313
<label for="client-code-name">Code Name</label>
14-
<input id="client-code-name" type="text" class="form-control" ng-model="newClient.codeName" name="codeName" required="required">
14+
<input id="client-code-name" type="text" class="form-control" ng-model="newClient.codeName" name="codeName">
1515
</div>
1616
</div>
1717
<div class="row">

src/app/directives.js

+23
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ angular.module('supportAdminApp')
3838
}
3939
};
4040
})
41+
.directive('findUser', function (UserService, Alert, $rootScope) {
42+
return {
43+
restrict: 'A',
44+
link: function (scope, element, attributes) {
45+
element.on('blur', function () {
46+
var handle = $(this).val();
47+
if (handle && handle.length) {
48+
UserService.find({
49+
filter: 'handle=' + handle
50+
}).then(function (data) {
51+
var id = '';
52+
if (data.length) {
53+
id = data[0].id;
54+
} else {
55+
Alert.error('Can not find ID with handle : ' + handle, $rootScope);
56+
}
57+
scope.newResource.userId = id;
58+
})
59+
}
60+
});
61+
}
62+
};
63+
})
4164
// disable keyboard input event on single element
4265
.directive('disableKeyboard', function () {
4366
return {

0 commit comments

Comments
 (0)