Commit db8e1f992cf3bc0f84f64c859751aa2dfc283f99
1 parent
1956e38441
Exists in
master
pending user api, update company name with editable field, size according to mak…
…e modal, and some other ui changes
Showing
16 changed files
with
236 additions
and
104 deletions
Show diff stats
app/scripts/controllers.js
... | ... | @@ -12,6 +12,9 @@ function MainCtrl($scope, $location, $state, $rootScope, LoginService) { |
12 | 12 | $scope.helloText = 'Welcome in SeedProject'; |
13 | 13 | $scope.descriptionText = 'It is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects and dev environment for these projects.'; |
14 | 14 | |
15 | + LoginService.getActiveUser().then(function(result) { | |
16 | + $scope.pendingUser = result; | |
17 | + }) | |
15 | 18 | $scope.logout = function(){ |
16 | 19 | console.log("Called") |
17 | 20 | LoginService.logout(); | ... | ... |
app/scripts/directives.js
... | ... | @@ -12,9 +12,9 @@ function pageTitle($rootScope, $timeout) { |
12 | 12 | link: function(scope, element) { |
13 | 13 | var listener = function(event, toState, toParams, fromState, fromParams) { |
14 | 14 | // Default title - load on Dashboard 1 |
15 | - var title = 'Acuefuel'; | |
15 | + var title = 'Acufuel'; | |
16 | 16 | // Create your own title pattern |
17 | - if (toState.data && toState.data.pageTitle) title = 'INSPINIA | ' + toState.data.pageTitle; | |
17 | + if (toState.data && toState.data.pageTitle) title = 'ACUFUEL | ' + toState.data.pageTitle; | |
18 | 18 | $timeout(function() { |
19 | 19 | element.text(title); |
20 | 20 | }); | ... | ... |
app/views/common/topnavbar.html
... | ... | @@ -81,7 +81,7 @@ |
81 | 81 | </li> |
82 | 82 | <li class="dropdown"> |
83 | 83 | <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> |
84 | - <i class="fa fa-bell"></i> <span class="label label-primary">8</span> | |
84 | + <i class="fa fa-bell"></i> <span class="label label-primary">{{pendingUser}}</span> | |
85 | 85 | </a> |
86 | 86 | <ul class="dropdown-menu dropdown-alerts"> |
87 | 87 | <li> | ... | ... |
app/views/fbo-Clients/fboClient.controller.js
... | ... | @@ -25,33 +25,38 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | function searchClient(searchData, userType){ |
28 | - console.log(searchData) | |
29 | 28 | console.log(userType) |
30 | - var data = { | |
31 | - "query" : searchData, | |
32 | - "userType" : userType | |
33 | - } | |
34 | - FBOClient.getSearchClient(data).then(function(result) { | |
35 | - for(var i=0; i<result.length; i++){ | |
36 | - result[i].user = []; | |
37 | - result[i].user.companyName = result[i].companyName; | |
38 | - result[i].user.firstName = result[i].firstName; | |
39 | - result[i].user.lastName = result[i].lastName; | |
40 | - result[i].user.id = result[i].id; | |
41 | - result[i].user.account = []; | |
42 | - result[i].user.account.user = []; | |
43 | - result[i].user.account.user.status = result[i].account.user.status; | |
44 | - } | |
45 | - if(userType == 'fbo'){ | |
46 | - $scope.fboClient = result; | |
47 | - console.log(result) | |
48 | - $scope.clientLength = result.length; | |
49 | - }else{ | |
50 | - console.log("nai aaya") | |
51 | - $scope.fboDeptList = result; | |
52 | - $scope.clientLength = result.length; | |
29 | + if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | |
30 | + getAllFbo(); | |
31 | + }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | |
32 | + $scope.fboDept(); | |
33 | + }else{ | |
34 | + var data = { | |
35 | + "query" : searchData, | |
36 | + "userType" : userType | |
53 | 37 | } |
54 | - }) | |
38 | + FBOClient.getSearchClient(data).then(function(result) { | |
39 | + for(var i=0; i<result.length; i++){ | |
40 | + result[i].user = []; | |
41 | + result[i].user.companyName = result[i].companyName; | |
42 | + result[i].user.firstName = result[i].firstName; | |
43 | + result[i].user.lastName = result[i].lastName; | |
44 | + result[i].user.id = result[i].id; | |
45 | + result[i].user.account = []; | |
46 | + result[i].user.account.user = []; | |
47 | + result[i].user.account.user.status = result[i].account.user.status; | |
48 | + } | |
49 | + if(userType == 'fbo'){ | |
50 | + $scope.fboClient = result; | |
51 | + console.log(result) | |
52 | + $scope.clientLength = result.length; | |
53 | + }else{ | |
54 | + $scope.fboDeptList = result; | |
55 | + $scope.clientLength = result.length; | |
56 | + } | |
57 | + }) | |
58 | + } | |
59 | + | |
55 | 60 | } |
56 | 61 | |
57 | 62 | $scope.fboAdmin = function(){ | ... | ... |
app/views/fbo-admin/dashboard.controller.js
... | ... | @@ -3,14 +3,14 @@ |
3 | 3 | //Load controller |
4 | 4 | angular.module('acuefuel') |
5 | 5 | |
6 | - .controller('DashboardController', function($scope, FBOAdmin) { | |
6 | + .controller('DashboardController', function($scope, $state, FBOAdmin) { | |
7 | 7 | $(document).ready(function(){ |
8 | 8 | $('.i-checks').iCheck({ |
9 | 9 | checkboxClass: 'icheckbox_square-green', |
10 | 10 | radioClass: 'iradio_square-green', |
11 | 11 | }); |
12 | 12 | }); |
13 | - | |
13 | + $scope.showCompany = true; | |
14 | 14 | $scope.userName = 'Dylan Goodwin'; |
15 | 15 | $scope.essAccountId = true; |
16 | 16 | $("#esAccId").css({ opacity: 0.5 }); |
... | ... | @@ -25,8 +25,15 @@ |
25 | 25 | $scope.feature.posAccountingIntegration = false; |
26 | 26 | $scope.feature.posVeederRootIntegration = false; |
27 | 27 | $scope.userData = function(){ |
28 | - console.log("daadada", $scope.feature) | |
29 | - | |
28 | + if($scope.user.email == undefined || $scope.user.email == null){ | |
29 | + toastr.error('Please enter your email first', { | |
30 | + closeButton: true | |
31 | + }) | |
32 | + }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | |
33 | + toastr.error('Please enter your First Name', { | |
34 | + closeButton: true | |
35 | + }) | |
36 | + }else{ | |
30 | 37 | if($scope.status == true){ |
31 | 38 | $scope.user.status = 'active'; |
32 | 39 | }else{ |
... | ... | @@ -50,11 +57,14 @@ |
50 | 57 | console.log(response) |
51 | 58 | |
52 | 59 | }) |
60 | + $state.go('index.fboAdmin'); | |
53 | 61 | }, function (err) { |
54 | 62 | toastr.error('Error in registering', { |
55 | 63 | closeButton: true |
56 | 64 | }) |
57 | 65 | }); |
66 | + } | |
67 | + | |
58 | 68 | } |
59 | 69 | |
60 | 70 | $scope.enableEssId = function(){ |
... | ... | @@ -68,4 +78,9 @@ |
68 | 78 | } |
69 | 79 | } |
70 | 80 | |
81 | + $scope.editName = function(){ | |
82 | + $scope.showCompany = false; | |
83 | + | |
84 | + } | |
85 | + | |
71 | 86 | }); |
72 | 87 | \ No newline at end of file | ... | ... |
app/views/fbo-admin/dashboard.html
1 | 1 | </div> |
2 | 2 | <div class="row wrapper border-bottom white-bg page-heading"> |
3 | 3 | <div class="col-lg-8"> |
4 | - <h2>Tellus Institute</h2> | |
4 | + <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> | |
5 | + <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | |
5 | 6 | </div> |
6 | 7 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> |
7 | 8 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button> | ... | ... |
app/views/fbo-flight/flight.html
1 | 1 | </div> |
2 | 2 | <div class="row wrapper border-bottom white-bg page-heading"> |
3 | 3 | <div class="col-lg-8"> |
4 | - <h2>Tellus Institute</h2> | |
4 | + <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> | |
5 | + <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | |
5 | 6 | </div> |
6 | 7 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> |
7 | 8 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> |
... | ... | @@ -113,13 +114,13 @@ |
113 | 114 | </select> |
114 | 115 | </td> |
115 | 116 | <td style="width: 30%"> |
116 | - <select class="form-control"> | |
117 | - <option ng-repeat="model in aircraftModalList" ng-model="aircraft.model">{{model}}</option> | |
117 | + <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | |
118 | + <option ng-repeat="model in aircraftModalList">{{model}}</option> | |
118 | 119 | </select> |
119 | 120 | </td> |
120 | 121 | <td style="width: 30%"> |
121 | - <select class="form-control"> | |
122 | - <option ng-repeat="size in aircraftSizeList" ng-model="aircraft.size">{{size}}</option> | |
122 | + <select class="form-control" ng-model="aircraft.size"> | |
123 | + <option ng-repeat="size in aircraftSizeList">{{size}}</option> | |
123 | 124 | </select> |
124 | 125 | </td> |
125 | 126 | </tr> | ... | ... |
app/views/fbo-flight/flightDept.controller.js
... | ... | @@ -4,10 +4,24 @@ |
4 | 4 | angular.module('acuefuel') |
5 | 5 | |
6 | 6 | .controller('FlightDeptController', function ($scope, $uibModal, FBOFlight) { |
7 | + $scope.showCompany = true; | |
8 | + $scope.editName = function(){ | |
9 | + $scope.showCompany = false; | |
10 | + | |
11 | + } | |
7 | 12 | $scope.data = {}; |
8 | 13 | $scope.user = {}; |
9 | 14 | $scope.aircraft = {}; |
10 | 15 | $scope.userData = function(){ |
16 | + if($scope.user.email == undefined || $scope.user.email == null){ | |
17 | + toastr.error('Please enter your email first', { | |
18 | + closeButton: true | |
19 | + }) | |
20 | + }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | |
21 | + toastr.error('Please enter your First Name', { | |
22 | + closeButton: true | |
23 | + }) | |
24 | + }else{ | |
11 | 25 | if($scope.status == true){ |
12 | 26 | $scope.user.status = 'active'; |
13 | 27 | }else{ |
... | ... | @@ -24,11 +38,13 @@ |
24 | 38 | toastr.success('Created Successfully', { |
25 | 39 | closeButton: true |
26 | 40 | }) |
41 | + $state.go('index.flightDept'); | |
27 | 42 | }, function (err) { |
28 | 43 | toastr.error('Error in registering', { |
29 | 44 | closeButton: true |
30 | 45 | }) |
31 | 46 | }); |
47 | + } | |
32 | 48 | } |
33 | 49 | |
34 | 50 | $scope.data.cardType = 'creditCard'; |
... | ... | @@ -60,25 +76,32 @@ |
60 | 76 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
61 | 77 | $scope.aircraftModalList = result; |
62 | 78 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
63 | - | |
79 | + FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
80 | + $scope.aircraftSizeList = result; | |
81 | + $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
82 | + }) | |
64 | 83 | }) |
65 | 84 | |
66 | 85 | }) |
67 | - | |
68 | - FBOFlight.getAircraftSize().then(function(result) { | |
69 | - $scope.aircraftSizeList = result; | |
70 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
71 | - | |
72 | - }) | |
73 | 86 | } |
74 | 87 | |
75 | 88 | |
76 | 89 | $scope.getModal = function(){ |
77 | - var modelId = $scope.aircraft.make | |
78 | - FBOFlight.getModal(modelId).then(function(result) { | |
90 | + var makeId = $scope.aircraft.make; | |
91 | + FBOFlight.getModal(makeId).then(function(result) { | |
79 | 92 | $scope.aircraftModalList = result; |
80 | 93 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
81 | - | |
94 | + FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | |
95 | + $scope.aircraftSizeList = result; | |
96 | + $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
97 | + }) | |
98 | + }) | |
99 | + } | |
100 | + | |
101 | + $scope.getSize = function(){ | |
102 | + FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
103 | + $scope.aircraftSizeList = result; | |
104 | + $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
82 | 105 | }) |
83 | 106 | } |
84 | 107 | |
... | ... | @@ -87,7 +110,7 @@ |
87 | 110 | toastr.error('Please Add Contact Information', { |
88 | 111 | closeButton: true |
89 | 112 | }) |
90 | - $('#myModal4').modal('hide'); | |
113 | + $('#myModal4').modal('show'); | |
91 | 114 | }else{ |
92 | 115 | $('#myModal4').modal('show'); |
93 | 116 | } |
... | ... | @@ -97,12 +120,9 @@ |
97 | 120 | $scope.aircraftData.aircraftList = []; |
98 | 121 | $scope.getCraftList = []; |
99 | 122 | $scope.addAircraft = function(){ |
100 | - console.log($scope.aircraft.accountId) | |
101 | 123 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
102 | - console.log($scope.aircraftData.aircraftList) | |
103 | 124 | if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { |
104 | 125 | $scope.getCraftList.push($scope.aircraft); |
105 | - | |
106 | 126 | } |
107 | 127 | |
108 | 128 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
... | ... | @@ -111,7 +131,13 @@ |
111 | 131 | toastr.success('Created Successfully', { |
112 | 132 | closeButton: true |
113 | 133 | }) |
114 | - }) | |
134 | + }, function (err) { | |
135 | + toastr.error('Error in Adding Aircraft', { | |
136 | + closeButton: true | |
137 | + }) | |
138 | + $('#myModal4').modal('hide'); | |
139 | + $scope.getCraftList.splice($scope.aircraft); | |
140 | + }); | |
115 | 141 | |
116 | 142 | } |
117 | 143 | ... | ... |
app/views/fbo-flight/flightDeptService.js
... | ... | @@ -51,11 +51,11 @@ |
51 | 51 | return deferred.promise; |
52 | 52 | } |
53 | 53 | |
54 | - this.getAircraftSize = function(){ | |
54 | + this.getAircraftSize = function(makeId, modelId){ | |
55 | 55 | var deferred = $q.defer(); |
56 | 56 | $http({ |
57 | 57 | method : 'GET', |
58 | - url : BE.url +'/fuelerlinx/acufuel/getAircraftSize', | |
58 | + url : BE.url +'/fuelerlinx/acufuel/getAircraftSize/' +makeId + '/' +modelId, | |
59 | 59 | headers : {'Content-Type': 'application/json'}, |
60 | 60 | }) |
61 | 61 | .success(function(result) { |
... | ... | @@ -87,6 +87,8 @@ |
87 | 87 | }) |
88 | 88 | .success(function(result) { |
89 | 89 | deferred.resolve(result); |
90 | + }).error(function(error) { | |
91 | + deferred.reject(error); | |
90 | 92 | }) |
91 | 93 | return deferred.promise; |
92 | 94 | } | ... | ... |
app/views/flightDept/flightDeptController.js
... | ... | @@ -32,31 +32,37 @@ |
32 | 32 | function searchClient(searchData, userType){ |
33 | 33 | console.log(searchData) |
34 | 34 | console.log(userType) |
35 | - var data = { | |
36 | - "query" : searchData, | |
37 | - "userType" : userType | |
38 | - } | |
39 | - FBOClient.getSearchClient(data).then(function(result) { | |
40 | - for(var i=0; i<result.length; i++){ | |
41 | - result[i].user = []; | |
42 | - result[i].user.companyName = result[i].companyName; | |
43 | - result[i].user.firstName = result[i].firstName; | |
44 | - result[i].user.lastName = result[i].lastName; | |
45 | - result[i].user.id = result[i].id; | |
46 | - result[i].user.account = []; | |
47 | - result[i].user.account.user = []; | |
48 | - result[i].user.account.user.status = result[i].account.user.status; | |
49 | - } | |
50 | - if(userType == 'fbo'){ | |
51 | - $scope.fboClient = result; | |
52 | - console.log(result) | |
53 | - $scope.clientLength = result.length; | |
54 | - }else{ | |
55 | - console.log("nai aaya") | |
56 | - $scope.fboDeptList = result; | |
57 | - $scope.clientLength = result.length; | |
35 | + if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | |
36 | + $scope.fboAdmin(); | |
37 | + }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | |
38 | + getAllFbo(); | |
39 | + }else{ | |
40 | + var data = { | |
41 | + "query" : searchData, | |
42 | + "userType" : userType | |
58 | 43 | } |
59 | - }) | |
44 | + FBOClient.getSearchClient(data).then(function(result) { | |
45 | + for(var i=0; i<result.length; i++){ | |
46 | + result[i].user = []; | |
47 | + result[i].user.companyName = result[i].companyName; | |
48 | + result[i].user.firstName = result[i].firstName; | |
49 | + result[i].user.lastName = result[i].lastName; | |
50 | + result[i].user.id = result[i].id; | |
51 | + result[i].user.account = []; | |
52 | + result[i].user.account.user = []; | |
53 | + result[i].user.account.user.status = result[i].account.user.status; | |
54 | + } | |
55 | + if(userType == 'fbo'){ | |
56 | + $scope.fboClient = result; | |
57 | + console.log(result) | |
58 | + $scope.clientLength = result.length; | |
59 | + }else{ | |
60 | + console.log("nai aaya") | |
61 | + $scope.fboDeptList = result; | |
62 | + $scope.clientLength = result.length; | |
63 | + } | |
64 | + }) | |
65 | + } | |
60 | 66 | } |
61 | 67 | |
62 | 68 | $scope.fboAdmin = function(){ | ... | ... |
app/views/login/login.service.js
... | ... | @@ -62,6 +62,20 @@ |
62 | 62 | }) |
63 | 63 | return deferred.promise; |
64 | 64 | } |
65 | + | |
66 | + this.getActiveUser = function() { | |
67 | + | |
68 | + var deferred = $q.defer(); | |
69 | + $http({ | |
70 | + method : 'GET', | |
71 | + url : BE.url +'/user/waitingForAuth/', | |
72 | + headers : {'Content-Type': 'application/json'} | |
73 | + }) | |
74 | + .success(function(result) { | |
75 | + deferred.resolve(result); | |
76 | + }) | |
77 | + return deferred.promise; | |
78 | + } | |
65 | 79 | } |
66 | 80 | |
67 | 81 | })(); |
68 | 82 | \ No newline at end of file | ... | ... |
app/views/updateAllFBO/updateAllFBO.controller.js
... | ... | @@ -11,6 +11,11 @@ |
11 | 11 | }); |
12 | 12 | |
13 | 13 | }); |
14 | + $scope.showCompany = true; | |
15 | + $scope.editName = function(){ | |
16 | + $scope.showCompany = false; | |
17 | + | |
18 | + } | |
14 | 19 | $scope.feature = {}; |
15 | 20 | var userProfileID = $stateParams.id; |
16 | 21 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { |
... | ... | @@ -59,7 +64,15 @@ |
59 | 64 | |
60 | 65 | $scope.userData = function(){ |
61 | 66 | console.log($scope.user.userTypeId) |
62 | - | |
67 | + if($scope.user.email == undefined || $scope.user.email == null){ | |
68 | + toastr.error('Please enter your email first', { | |
69 | + closeButton: true | |
70 | + }) | |
71 | + }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | |
72 | + toastr.error('Please enter your First Name', { | |
73 | + closeButton: true | |
74 | + }) | |
75 | + }else{ | |
63 | 76 | if($scope.status == true){ |
64 | 77 | $scope.user.status = 'active'; |
65 | 78 | }else{ |
... | ... | @@ -85,6 +98,7 @@ |
85 | 98 | console.log(response) |
86 | 99 | }) |
87 | 100 | }) |
101 | + } | |
88 | 102 | } |
89 | 103 | |
90 | 104 | }); |
91 | 105 | \ No newline at end of file | ... | ... |
app/views/updateAllFBO/updateAllFBO.html
1 | 1 | </div> |
2 | 2 | <div class="row wrapper border-bottom white-bg page-heading"> |
3 | - <div class="col-lg-2"> | |
4 | - <h2>{{user.companyName}}</h2> | |
3 | + <div class="col-lg-3"> | |
4 | + <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> | |
5 | + <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | |
5 | 6 | </div> |
6 | - <div class="col-lg-4" style="margin-top: 20px;"> | |
7 | + <div class="col-lg-3" style="margin-top: 20px;"> | |
7 | 8 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> |
8 | 9 | </div> |
9 | 10 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> | ... | ... |
app/views/updateFBODept/updateFBODept.controller.js
... | ... | @@ -4,6 +4,11 @@ |
4 | 4 | angular.module('acuefuel') |
5 | 5 | |
6 | 6 | .controller('updateFBODeptController', function($scope, $stateParams, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { |
7 | + $scope.showCompany = true; | |
8 | + $scope.editName = function(){ | |
9 | + $scope.showCompany = false; | |
10 | + | |
11 | + } | |
7 | 12 | $scope.showPayments = true; |
8 | 13 | $scope.aircraft = {}; |
9 | 14 | $scope.updateData = {}; |
... | ... | @@ -71,7 +76,15 @@ |
71 | 76 | |
72 | 77 | $scope.userData = function(){ |
73 | 78 | console.log($scope.user.userTypeId) |
74 | - | |
79 | + if($scope.user.email == undefined || $scope.user.email == null){ | |
80 | + toastr.error('Please enter your email first', { | |
81 | + closeButton: true | |
82 | + }) | |
83 | + }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | |
84 | + toastr.error('Please enter your First Name', { | |
85 | + closeButton: true | |
86 | + }) | |
87 | + }else{ | |
75 | 88 | if($scope.status == true){ |
76 | 89 | $scope.user.status = 'active'; |
77 | 90 | }else{ |
... | ... | @@ -89,6 +102,7 @@ |
89 | 102 | closeButton: true |
90 | 103 | }) |
91 | 104 | }) |
105 | + } | |
92 | 106 | } |
93 | 107 | |
94 | 108 | getData(); |
... | ... | @@ -99,26 +113,37 @@ |
99 | 113 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
100 | 114 | $scope.aircraftModalList = result; |
101 | 115 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
102 | - | |
103 | - }) | |
104 | - | |
105 | - }) | |
106 | 116 | |
107 | - FBOFlight.getAircraftSize().then(function(result) { | |
108 | - $scope.aircraftSizeList = result; | |
109 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
117 | + FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
118 | + $scope.aircraftSizeList = result; | |
119 | + $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
120 | + | |
121 | + }) | |
122 | + }) | |
110 | 123 | |
111 | 124 | }) |
112 | 125 | } |
113 | - | |
114 | 126 | |
115 | 127 | $scope.getModal = function(){ |
116 | - var modelId = $scope.aircraft.make | |
117 | - FBOFlight.getModal(modelId).then(function(result) { | |
128 | + var makeId = $scope.aircraft.make | |
129 | + FBOFlight.getModal(makeId).then(function(result) { | |
118 | 130 | $scope.aircraftModalList = result; |
119 | 131 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
132 | + | |
133 | + FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | |
134 | + $scope.aircraftSizeList = result; | |
135 | + $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
136 | + }) | |
120 | 137 | }) |
121 | 138 | } |
139 | + | |
140 | + $scope.getSize = function(){ | |
141 | + FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
142 | + $scope.aircraftSizeList = result; | |
143 | + $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
144 | + }) | |
145 | + } | |
146 | + | |
122 | 147 | $scope.aircraftData = {}; |
123 | 148 | $scope.aircraftData.aircraftList = []; |
124 | 149 | $scope.addAircraft = function(){ |
... | ... | @@ -131,7 +156,13 @@ |
131 | 156 | toastr.success('Created Successfully', { |
132 | 157 | closeButton: true |
133 | 158 | }) |
134 | - }) | |
159 | + }, function (err) { | |
160 | + toastr.error('Error in Adding Aircraft', { | |
161 | + closeButton: true | |
162 | + }) | |
163 | + $('#myModal4').modal('hide'); | |
164 | + $scope.getCraftList.splice($scope.aircraft); | |
165 | + }); | |
135 | 166 | } |
136 | 167 | |
137 | 168 | $scope.closeModal = function(){ |
... | ... | @@ -140,13 +171,17 @@ |
140 | 171 | } |
141 | 172 | |
142 | 173 | $scope.update = function(airdata){ |
143 | - console.log(airdata) | |
174 | + $("#myModal5").modal('show'); | |
144 | 175 | $scope.aircraft = airdata; |
176 | + console.log($scope.aircraft) | |
145 | 177 | $scope.aircraft.accountId = $scope.user.account.id; |
146 | - $("#myModal5").modal('show'); | |
178 | + | |
147 | 179 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
148 | 180 | $scope.aircraftModalList = result; |
149 | - | |
181 | + FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
182 | + $scope.aircraftSizeList = result; | |
183 | + | |
184 | + }) | |
150 | 185 | }) |
151 | 186 | } |
152 | 187 | |
... | ... | @@ -172,7 +207,13 @@ |
172 | 207 | toastr.success('Updated Successfully', { |
173 | 208 | closeButton: true |
174 | 209 | }) |
175 | - }) | |
210 | + }, function (err) { | |
211 | + toastr.error('Error in Updating Aircraft', { | |
212 | + closeButton: true | |
213 | + }) | |
214 | + $('#myModal5').modal('hide'); | |
215 | + $scope.getCraftList.splice($scope.aircraft); | |
216 | + }); | |
176 | 217 | } |
177 | 218 | |
178 | 219 | $scope.remove = function(data){ | ... | ... |
app/views/updateFBODept/updateFBODept.html
1 | 1 | |
2 | 2 | <div class="row wrapper border-bottom white-bg page-heading"> |
3 | - <div class="col-lg-2"> | |
4 | - <h2>{{user.companyName}}</h2> | |
3 | + <div class="col-lg-3"> | |
4 | + <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> | |
5 | + <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | |
5 | 6 | </div> |
6 | - <div class="col-lg-4" style="margin-top: 20px;"> | |
7 | + <div class="col-lg-3" style="margin-top: 20px;"> | |
7 | 8 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> |
8 | 9 | </div> |
9 | 10 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> |
... | ... | @@ -117,7 +118,7 @@ |
117 | 118 | </select> |
118 | 119 | </td> |
119 | 120 | <td style="width: 30%"> |
120 | - <select class="form-control" ng-model="aircraft.model"> | |
121 | + <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | |
121 | 122 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
122 | 123 | </select> |
123 | 124 | </td> |
... | ... | @@ -212,7 +213,7 @@ |
212 | 213 | </select> |
213 | 214 | </td> |
214 | 215 | <td style="width: 30%"> |
215 | - <select class="form-control" ng-model="aircraft.model"> | |
216 | + <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | |
216 | 217 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
217 | 218 | </select> |
218 | 219 | </td> | ... | ... |