Commit f0315ea9be83baf1a1861abc6b6e8fa1f123ed3a
1 parent
a19001fdd3
Exists in
master
FBO admin and Flight dept admin UI
Showing
7 changed files
with
235 additions
and
29 deletions
Show diff stats
app/index.html
... | ... | @@ -38,6 +38,75 @@ |
38 | 38 | <link rel="stylesheet" type="text/css" href="plugins/dataTables/datatables.min.css"> |
39 | 39 | <!-- endbuild --> |
40 | 40 | |
41 | + <style type="text/css"> | |
42 | + /* my custom modal */ | |
43 | + | |
44 | +.customBackdrop{ | |
45 | + position: fixed; | |
46 | + background-color: rgba(0, 0, 0, 0.15); | |
47 | + top: 0; | |
48 | + left: 0; | |
49 | + width: 100%; | |
50 | + height: 100%; | |
51 | + z-index: 999; | |
52 | +} | |
53 | +.customModalInner{ | |
54 | + width: 100%; | |
55 | + max-width: 500px; | |
56 | + height: 200px; | |
57 | + top: 15%; | |
58 | + position: relative; | |
59 | + margin: auto; | |
60 | +} | |
61 | +.customModelHead, .customModelFooter{ | |
62 | + width: 100%; | |
63 | + background-color: #fafafa; | |
64 | + border-bottom: 1px solid #ccc; | |
65 | + color: #333; | |
66 | + padding: 10px; | |
67 | +} | |
68 | +.customModelFooter{ | |
69 | + border-top: 1px solid #ccc; | |
70 | +} | |
71 | +.customModelBody{ | |
72 | + width: 100%; | |
73 | + height: auto; | |
74 | + background-color: #fff; | |
75 | + color: #333; | |
76 | + padding: 10px; | |
77 | +} | |
78 | +.customModelHead p{ | |
79 | + margin-bottom: 0; | |
80 | + font-size: 14px; | |
81 | +} | |
82 | +.customModelFooter button{ | |
83 | + border: 1px solid #ccc; | |
84 | +} | |
85 | +.customModelFooter input[type="submit"]{ | |
86 | + background-color: #6ad46a; | |
87 | + border: 1px solid #ccc; | |
88 | +} | |
89 | + | |
90 | + | |
91 | +/* custom confirmation model */ | |
92 | + | |
93 | + | |
94 | +.customConfirmPopBackdrop{ | |
95 | + position: fixed; | |
96 | + background-color: rgba(0, 0, 0, 0.3); | |
97 | + top: 0; | |
98 | + left: 0; | |
99 | + width: 100%; | |
100 | + height: 100%; | |
101 | + z-index: 999999999; | |
102 | + display: none; | |
103 | +} | |
104 | +.customConfirmPopBackdrop .customModalInner{ | |
105 | + top: 30%; | |
106 | +} | |
107 | + | |
108 | + </style> | |
109 | + | |
41 | 110 | |
42 | 111 | |
43 | 112 | </head> | ... | ... |
app/views/updateAllFBO/updateAllFBO.controller.js
... | ... | @@ -16,14 +16,14 @@ |
16 | 16 | $scope.feature = {}; |
17 | 17 | var userProfileID = $stateParams.id; |
18 | 18 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { |
19 | - console.log(result) | |
19 | + // console.log(result) | |
20 | 20 | $scope.user = result; |
21 | 21 | $scope.user.userTypeId = result.userType.id; |
22 | 22 | |
23 | 23 | if(result.accountFeatureControl != null){ |
24 | 24 | $scope.feature = result.accountFeatureControl; |
25 | 25 | $scope.feature.accountId = result.account.id; |
26 | - console.log($scope.feature) | |
26 | + // console.log($scope.feature) | |
27 | 27 | if($scope.feature.essintaPosSystem == true){ |
28 | 28 | $scope.essAccountId = false; |
29 | 29 | $("#esAccId").css({ opacity: 1 }); |
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | $scope.user.clientNote = response[0].notes |
41 | 41 | $scope.user.userNoteId = response[0].id; |
42 | 42 | }) |
43 | - console.log($scope.feature,"dsdsdsds") | |
43 | + //console.log($scope.feature,"dsdsdsds") | |
44 | 44 | if($scope.user.account.user.status == 'ACTIVE'){ |
45 | 45 | $scope.status = true; |
46 | 46 | }else { |
... | ... | @@ -61,7 +61,7 @@ |
61 | 61 | |
62 | 62 | $scope.checkUsername = function(){ |
63 | 63 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
64 | - console.log(status) | |
64 | + // console.log(status) | |
65 | 65 | if(status != 200){ |
66 | 66 | toastr.error('This email has alreay taken', { |
67 | 67 | closeButton: true |
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | } |
72 | 72 | |
73 | 73 | $scope.userData = function(){ |
74 | - console.log($scope.user.userTypeId) | |
74 | + // console.log($scope.user.userTypeId) | |
75 | 75 | if($scope.user.email == undefined || $scope.user.email == null){ |
76 | 76 | toastr.error('Please enter your email first', { |
77 | 77 | closeButton: true |
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | } |
97 | 97 | $scope.user.username = $scope.user.email; |
98 | 98 | $scope.user.userType = 'fbo'; |
99 | - console.log($scope.user) | |
99 | + // console.log($scope.user) | |
100 | 100 | // if($scope.user.userNoteId == undefined){ |
101 | 101 | // $scope.user.userNoteId = null; |
102 | 102 | // } |
... | ... | @@ -111,11 +111,42 @@ |
111 | 111 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; |
112 | 112 | |
113 | 113 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { |
114 | - console.log(response) | |
114 | + // console.log(response) | |
115 | 115 | }) |
116 | 116 | $state.go('index.fboAdmin'); |
117 | 117 | }) |
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
121 | + var deleteUserId = ""; | |
122 | + $scope.deleteData = function(userid){ | |
123 | + $('#delete2').css('display', 'block'); | |
124 | + // console.log("kd user id--",userid) | |
125 | + // $state.go('index.fboAdmin') | |
126 | + deleteUserId = userid; | |
127 | + } | |
128 | + | |
129 | + $scope.deleteUserData = function(){ | |
130 | + // console.log("api hit") | |
131 | + UpdateAllFBO.deleteUser(deleteUserId).then(function(result) { | |
132 | + $('#delete2').css('display', 'none'); | |
133 | + if(result.success){ | |
134 | + toastr.success(''+result.success+'', { | |
135 | + closeButton: true | |
136 | + | |
137 | + }) | |
138 | + }else{ | |
139 | + toastr.error(''+result.statusText+'', { | |
140 | + closeButton: true | |
141 | + | |
142 | + }) | |
143 | + } | |
144 | + $state.go('index.fboAdmin') | |
145 | + }) | |
146 | + } | |
147 | + $scope.cancelDelete = function(){ | |
148 | + $('#delete2').css('display', 'none'); | |
149 | + } | |
150 | + | |
151 | + | |
121 | 152 | }); |
122 | 153 | \ No newline at end of file | ... | ... |
app/views/updateAllFBO/updateAllFBO.html
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter ICAO" ng-model="user.icao" class="form-control"></div> |
9 | 9 | </div> |
10 | 10 | <div class="col-lg-3" style="margin-top: 20px;"> |
11 | - <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> | |
11 | + <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData(user.id)">Delete Account</button> | |
12 | 12 | </div> |
13 | 13 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> |
14 | 14 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button> |
... | ... | @@ -154,4 +154,26 @@ |
154 | 154 | </div> |
155 | 155 | </div> |
156 | 156 | </div> |
157 | -</div> | |
158 | 157 | \ No newline at end of file |
158 | + <!--Delete model--> | |
159 | +</div> | |
160 | + <div class="customConfirmPopBackdrop" id="delete2"> | |
161 | + <div class="customModalInner" style="max-width: 400px;"> | |
162 | + <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | |
163 | + <table> | |
164 | + <tr> | |
165 | + <td> | |
166 | + <img src="images/info.png" style="width: 50px;"> | |
167 | + </td> | |
168 | + <td> | |
169 | + <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this User & its related data?</p> | |
170 | + </td> | |
171 | + </tr> | |
172 | + </table> | |
173 | + </div> | |
174 | + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | |
175 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="deleteUserData()">Accept</button> | |
176 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> | |
177 | + </div> | |
178 | + </div> | |
179 | +</div> | |
180 | + | ... | ... |
app/views/updateAllFBO/updateAllFBO.service.js
... | ... | @@ -64,6 +64,20 @@ |
64 | 64 | return deferred.promise; |
65 | 65 | } |
66 | 66 | |
67 | + /* Delete API service for FBO Admin (In AccountResource.java)*/ | |
68 | + this.deleteUser = function(id) { | |
69 | + var deferred = $q.defer(); | |
70 | + $http({ | |
71 | + method : 'DELETE', | |
72 | + url : BE.url +'/account/deleteUser/'+id, | |
73 | + headers : {'Content-Type': 'application/json'}, | |
74 | + }) | |
75 | + .success(function(result) { | |
76 | + deferred.resolve(result); | |
77 | + }) | |
78 | + return deferred.promise; | |
79 | + } | |
80 | + | |
67 | 81 | } |
68 | 82 | |
69 | 83 | })(); |
70 | 84 | \ No newline at end of file | ... | ... |
app/views/updateFBODept/updateFBODept.controller.js
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | $scope.companyId; |
15 | 15 | |
16 | 16 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { |
17 | - console.log(result) | |
17 | + // console.log(result) | |
18 | 18 | $scope.user = result; |
19 | 19 | // $scope.aircraft.accountId = result.account.id; |
20 | 20 | $scope.user.userTypeId = result.userType.id; |
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | }) |
33 | 33 | |
34 | 34 | UpdateAllFBODept.getAssociatedCompany(userProfileID).then(function(result) { |
35 | - console.log('=======q===',result) | |
35 | + // console.log('=======q===',result) | |
36 | 36 | $scope.companyId = result.id; |
37 | 37 | getCrafts(result.id); |
38 | 38 | $scope.aircraft.accountId = result.id; |
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | }) |
56 | 56 | |
57 | 57 | $scope.openCard = function(payment){ |
58 | - console.log(payment) | |
58 | + //console.log(payment) | |
59 | 59 | $scope.showPayments = false; |
60 | 60 | $scope.data = {}; |
61 | 61 | $scope.data.cardNumber = payment.cardNumber; |
... | ... | @@ -68,11 +68,11 @@ |
68 | 68 | var cardData = {} |
69 | 69 | cardData.paymentMethodList = []; |
70 | 70 | $scope.updateCard = function(){ |
71 | - console.log($scope.data) | |
71 | + // console.log($scope.data) | |
72 | 72 | cardData.paymentMethodList.push($scope.data); |
73 | - console.log("cardData", cardData); | |
73 | + // console.log("cardData", cardData); | |
74 | 74 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { |
75 | - console.log(result) | |
75 | + // console.log(result) | |
76 | 76 | toastr.success('Updated Successfully', { |
77 | 77 | closeButton: true |
78 | 78 | }) |
... | ... | @@ -87,7 +87,7 @@ |
87 | 87 | |
88 | 88 | $scope.checkUsername = function(){ |
89 | 89 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
90 | - console.log(status) | |
90 | + // console.log(status) | |
91 | 91 | if(status != 200){ |
92 | 92 | toastr.error('This email has alreay taken', { |
93 | 93 | closeButton: true |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | } |
98 | 98 | |
99 | 99 | $scope.userData = function(){ |
100 | - console.log($scope.user.userTypeId) | |
100 | + // console.log($scope.user.userTypeId) | |
101 | 101 | if($scope.user.email == undefined || $scope.user.email == null){ |
102 | 102 | toastr.error('Please enter your email first', { |
103 | 103 | closeButton: true |
... | ... | @@ -114,7 +114,7 @@ |
114 | 114 | } |
115 | 115 | $scope.user.username = $scope.user.email; |
116 | 116 | $scope.user.userType = 'flightDetp'; |
117 | - console.log($scope.user) | |
117 | + // console.log($scope.user) | |
118 | 118 | // if($scope.user.userNoteId == undefined){ |
119 | 119 | // $scope.user.userNoteId = null; |
120 | 120 | // } |
... | ... | @@ -163,9 +163,9 @@ |
163 | 163 | $scope.getSize = function(){ |
164 | 164 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
165 | 165 | $scope.aircraftSizeList = result; |
166 | - console.log($scope.aircraftSizeList) | |
166 | + // console.log($scope.aircraftSizeList) | |
167 | 167 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
168 | - console.log($scope.aircraft.sizeId) | |
168 | + // console.log($scope.aircraft.sizeId) | |
169 | 169 | }) |
170 | 170 | } |
171 | 171 | |
... | ... | @@ -182,11 +182,11 @@ |
182 | 182 | 'model': $scope.aircraft.model, |
183 | 183 | 'sizeId' : $scope.aircraft.sizeId |
184 | 184 | }); |
185 | - console.log('$scope.addData',$scope.addData); | |
185 | + // console.log('$scope.addData',$scope.addData); | |
186 | 186 | |
187 | 187 | $scope.aircraftListData.aircraftList = $scope.addData; |
188 | 188 | $scope.aircraftListData.accountId = $scope.companyId; |
189 | - console.log($scope.aircraft) | |
189 | + // console.log($scope.aircraft) | |
190 | 190 | //$scope.aircraftData.aircraftList.push($scope.aircraft); |
191 | 191 | |
192 | 192 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { |
... | ... | @@ -201,7 +201,8 @@ |
201 | 201 | closeButton: true |
202 | 202 | }) |
203 | 203 | $('#myModal4').modal('hide'); |
204 | - $scope.getCraftList.splice($scope.aircraft); | |
204 | + // console.log("aircraf---",$scope.aircraft) | |
205 | + // $scope.getCraftList.splice($scope.aircraft); | |
205 | 206 | }); |
206 | 207 | } |
207 | 208 | |
... | ... | @@ -213,14 +214,14 @@ |
213 | 214 | $scope.update = function(airdata){ |
214 | 215 | $("#myModal5").modal('show'); |
215 | 216 | $scope.aircraft = airdata; |
216 | - console.log('--------$scope.companyId---',$scope.companyId); | |
217 | + // console.log('--------$scope.companyId---',$scope.companyId); | |
217 | 218 | $scope.aircraft.accountId = $scope.companyId; |
218 | 219 | |
219 | 220 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
220 | 221 | $scope.aircraftModalList = result; |
221 | 222 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
222 | 223 | $scope.aircraftSizeList = result; |
223 | - console.log($scope.aircraftSizeList) | |
224 | + // console.log($scope.aircraftSizeList) | |
224 | 225 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
225 | 226 | }) |
226 | 227 | }) |
... | ... | @@ -237,10 +238,10 @@ |
237 | 238 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; |
238 | 239 | $scope.updateAircraftData.tail = updateAircraft.tail; |
239 | 240 | $scope.updateAircraftData.accountId = $scope.companyId; |
240 | - console.log($scope.updateAircraftData) | |
241 | + // console.log($scope.updateAircraftData) | |
241 | 242 | |
242 | 243 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); |
243 | - console.log($scope.updatecraftData.aircraftList) | |
244 | + // console.log($scope.updatecraftData.aircraftList) | |
244 | 245 | |
245 | 246 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { |
246 | 247 | $('#myModal5').modal('hide'); |
... | ... | @@ -259,7 +260,7 @@ |
259 | 260 | } |
260 | 261 | |
261 | 262 | $scope.remove = function(data){ |
262 | - console.log(data) | |
263 | + //console.log(data) | |
263 | 264 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { |
264 | 265 | toastr.success(''+result.success+'', { |
265 | 266 | closeButton: true |
... | ... | @@ -275,4 +276,35 @@ |
275 | 276 | getData(); |
276 | 277 | } |
277 | 278 | |
279 | + | |
280 | + var deleteFlightDeptUserId = ""; | |
281 | + $scope.deleteData = function(userid){ | |
282 | + $('#delete2').css('display', 'block'); | |
283 | + //console.log("kd user id--",userid) | |
284 | + deleteFlightDeptUserId = userid; | |
285 | + | |
286 | + } | |
287 | + | |
288 | + $scope.deleteUserData = function(){ | |
289 | + // console.log("api hit") | |
290 | + UpdateAllFBODept.deleteUser(deleteFlightDeptUserId).then(function(result) { | |
291 | + $('#delete2').css('display', 'none'); | |
292 | + if(result.success){ | |
293 | + toastr.success(''+result.success+'', { | |
294 | + closeButton: true | |
295 | + | |
296 | + }) | |
297 | + }else{ | |
298 | + toastr.error(''+result.statusText+'', { | |
299 | + closeButton: true | |
300 | + | |
301 | + }) | |
302 | + } | |
303 | + $state.go('index.flightDept') | |
304 | + }) | |
305 | + } | |
306 | + $scope.cancelDelete = function(){ | |
307 | + $('#delete2').css('display', 'none'); | |
308 | + } | |
309 | + | |
278 | 310 | }); |
279 | 311 | \ No newline at end of file | ... | ... |
app/views/updateFBODept/updateFBODept.html
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
6 | 6 | </div> |
7 | 7 | <div class="col-lg-3" style="margin-top: 20px;"> |
8 | - <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> | |
8 | + <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData(user.id)">Delete Account</button> | |
9 | 9 | </div> |
10 | 10 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> |
11 | 11 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> |
... | ... | @@ -349,4 +349,26 @@ |
349 | 349 | </div> |
350 | 350 | </div> |
351 | 351 | </div> |
352 | + <!--Delete model--> | |
353 | +</div> | |
354 | + <div class="customConfirmPopBackdrop" id="delete2"> | |
355 | + <div class="customModalInner" style="max-width: 400px;"> | |
356 | + <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | |
357 | + <table> | |
358 | + <tr> | |
359 | + <td> | |
360 | + <img src="images/info.png" style="width: 50px;"> | |
361 | + </td> | |
362 | + <td> | |
363 | + <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this User & its related data?</p> | |
364 | + </td> | |
365 | + </tr> | |
366 | + </table> | |
367 | + </div> | |
368 | + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | |
369 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="deleteUserData()">Accept</button> | |
370 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> | |
371 | + </div> | |
372 | + </div> | |
373 | +</div> | |
352 | 374 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> |
353 | 375 | \ No newline at end of file | ... | ... |
app/views/updateFBODept/updateFBODept.service.js
... | ... | @@ -122,6 +122,22 @@ |
122 | 122 | return deferred.promise; |
123 | 123 | } |
124 | 124 | |
125 | + /* Delete API service for Flight Dept Admin (In AccountUserResource.java) */ | |
126 | + this.deleteUser = function(id) { | |
127 | + var deferred = $q.defer(); | |
128 | + $http({ | |
129 | + method : 'DELETE', | |
130 | + url : BE.url +'/account/user/deleteUser/'+id, | |
131 | + headers : {'Content-Type': 'application/json'}, | |
132 | + }) | |
133 | + .success(function(result) { | |
134 | + deferred.resolve(result); | |
135 | + }) | |
136 | + return deferred.promise; | |
137 | + } | |
138 | + | |
139 | + | |
140 | + | |
125 | 141 | } |
126 | 142 | |
127 | 143 | })(); |
128 | 144 | \ No newline at end of file | ... | ... |