Commit 67044e31e32e868722038abbc1ad79831c84a626

Authored by Rishav Singla
1 parent 9732e9b36a
Exists in master

modify changes and implement new apis

app/partials/ContactView/ContactView.controller.js
... ... @@ -19,15 +19,15 @@
19 19  
20 20 $scope.changePriceEmail = function(id, index){
21 21 event.stopPropagation();
22   - var contactId = id;
23   - var statusData = "status=" + $scope.contactList[index].priceEmail;
24   - ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) {
25   - if(result.success){
26   - toastr.success(''+result.success+'', {
27   - closeButton: true
28   - })
29   - }
30   - })
  22 + // var contactId = id;
  23 + // var statusData = "status=" + $scope.contactList[index].priceEmail;
  24 + // ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) {
  25 + // if(result.success){
  26 + // toastr.success(''+result.success+'', {
  27 + // closeButton: true
  28 + // })
  29 + // }
  30 + // })
31 31 }
32 32  
33 33 ContactViewService.getCompanies().then(function(result) {
... ...
app/partials/ContactView/ContactView.html
... ... @@ -70,10 +70,6 @@
70 70 <input type="text" class="form-control" style="height:31px;" name="name" id="name">
71 71 <label class="font-company">Username<i class="fa fa-sort" aria-hidden="true"></i></label>
72 72 </th>
73   - <th>
74   - <input type="text" class="form-control" style="height:31px;" name="name" id="name">
75   - <label class="font-company">Password<i class="fa fa-sort" aria-hidden="true"></i></label>
76   - </th>
77 73 </tr>
78 74 </thead>
79 75 <tbody>
... ... @@ -88,7 +84,6 @@
88 84 <toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle>
89 85 </td>
90 86 <td>{{contact.userName}}</td>
91   - <td>{{contact.password}}</td>
92 87 </tr>
93 88 </tbody>
94 89 </table>
... ...
app/partials/customers/customers.controller.js
... ... @@ -2,9 +2,9 @@
2 2  
3 3 //Load controller
4 4 angular.module('acufuel')
5   - .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'CustomersService', 'ViewCompanyService', customersController]);
  5 + .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', customersController]);
6 6  
7   - function customersController($scope, $rootScope, $uibModal, $filter, $http, CustomersService, ViewCompanyService) {
  7 + function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService) {
8 8 $(document).ready(function() {
9 9 $('#example').DataTable();
10 10 });
... ... @@ -176,5 +176,10 @@
176 176 // $('table.addRow').append(newRow);
177 177 // }
178 178  
  179 + $scope.setFuel = function(){
  180 + event.stopPropagation();
  181 + $state.go('app.updateFuelManager');
  182 + }
  183 +
179 184  
180 185 }
181 186 \ No newline at end of file
... ...
app/partials/customers/customers.html
... ... @@ -147,8 +147,8 @@
147 147 {{customer.companyName}}
148 148 </td>
149 149 <td class="font-company">{{customer.companyAircraftSize}}</td>
150   - <td class="font-company">{{customer.phone}}</td>
151   - <td class="font-company">{{customer.contact}}</td>
  150 + <td class="font-company">{{customer.companyCustomContacts[0].contactNumber}}</td>
  151 + <td class="font-company">{{customer.companyPrimaryContacts[0].firstName}} {{customer.companyPrimaryContacts[0].lastName}}</td>
152 152 <td class="font-company">{{customer.baseIcao}}</td>
153 153 <td class="font-company">
154 154 <button type="button" ng-if="customer.activate == true" class="btn btn-success btn-xs">Active</button>
... ... @@ -163,7 +163,7 @@
163 163 </td>
164 164 <td class="font-company">{{customer.allIn}}</td>
165 165 <td>
166   - <button type="button" class="btn btn-info btn-xs">Setup Fuel</button>
  166 + <button type="button" class="btn btn-info btn-xs" ng-click="setFuel()">Setup Fuel</button>
167 167 </td>
168 168 </tr>
169 169 </tbody>
... ...
app/partials/viewCompany/viewCompany.controller.js
... ... @@ -390,5 +390,12 @@
390 390 }
391 391 }
392 392 })
  393 +
  394 + $scope.deleteAircraft = function(id){
  395 + ViewCompanyService.deleteAircraft(id).then(function(result) {
  396 + console.log(result)
  397 + getAircraftList();
  398 + })
  399 + }
393 400  
394 401 }]);
395 402 \ No newline at end of file
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -242,7 +242,7 @@
242 242 </div>
243 243 <div class="pull-right">
244 244 <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button>
245   - <button type="button" class="btn btn-info">Setup Fuel</button>
  245 + <button type="button" class="btn btn-info" ui-sref="app.updateFuelManager">Setup Fuel</button>
246 246 </div>
247 247 <div class="clearfix"></div>
248 248 </div>
... ... @@ -291,7 +291,9 @@
291 291 </select>
292 292 </td>
293 293 <td style="color:#55AF8B;">$3659</td>
294   - <td></td>
  294 + <td>
  295 + <!-- <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteAircraft(aircraft.id)" aria-hidden="true"></i> -->
  296 + </td>
295 297 </tr>
296 298 </tbody>
297 299 </table>
... ...
app/partials/viewCompany/viewCompany.service.js
... ... @@ -181,6 +181,21 @@
181 181 })
182 182 return deferred.promise;
183 183 }
  184 +
  185 + this.deleteAircraft = function(id){
  186 + var deferred = $q.defer();
  187 + $http({
  188 + method : 'DELETE',
  189 + url : BASE_URL.url +'/company/aircraft/'+id,
  190 + headers : {'Content-Type': 'application/json'},
  191 + })
  192 + .then(function (result){
  193 + deferred.resolve(result);
  194 + },function (result){
  195 + deferred.resolve(result);
  196 + })
  197 + return deferred.promise;
  198 + }
184 199  
185 200 }
186 201  
... ...