Commit f62f8940f861d3e55b751913ec34376c7b73cd81
1 parent
64b3dc0e35
Exists in
master
UI changes
Showing
13 changed files
with
68 additions
and
16 deletions
Show diff stats
app/js/app.js
... | ... | @@ -385,8 +385,19 @@ |
385 | 385 | .run(['$rootScope', '$state', 'LoginService', 'AUTH_EVENTS', function($rootScope, $state, LoginService, AUTH_EVENTS) { |
386 | 386 | $rootScope.$on('$stateChangeStart', function (event, next, nextParams, fromState) { |
387 | 387 | //console.log("from",from, "fromState",fromState) |
388 | + $rootScope.isShowEmail = false; | |
389 | + $rootScope.isShowFMA = false; | |
388 | 390 | $rootScope.previousState = fromState.name; |
389 | 391 | $rootScope.currentUser = JSON.parse(window.localStorage.getItem('currentUser')); |
392 | + var EPDAccess = JSON.parse(window.localStorage.getItem('EPDAccess')); | |
393 | + var FMAAccess = JSON.parse(window.localStorage.getItem('FMAAccess')); | |
394 | + if(EPDAccess === true || EPDAccess == null){ | |
395 | + $rootScope.isShowEmail = true; | |
396 | + } | |
397 | + if(FMAAccess === true || FMAAccess == null){ | |
398 | + $rootScope.isShowFMA = true; | |
399 | + } | |
400 | + | |
390 | 401 | // console.log("nextParams",nextParams) |
391 | 402 | /*LoginService.isAuthorized = function (authorizedRoles) { |
392 | 403 | if (!angular.isArray(authorizedRoles)) { | ... | ... |
app/partials/dashboard/dashboard.controller.js
app/partials/dashboard/dashboard.html
... | ... | @@ -158,7 +158,7 @@ table tr:nth-child(even) { |
158 | 158 | <div class="widget-header"> |
159 | 159 | <i class="fa fa-pencil"></i> |
160 | 160 | <h3>Price Manager Active</h3> |
161 | - <select style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="btn btn-primary" class="form-control" ng-model="sendEmail.pricing" ng-click="confirmMail()"> | |
161 | + <select ng-show="isShowEmail" style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="btn btn-primary" class="form-control" ng-model="sendEmail.pricing" ng-click="confirmMail()"> | |
162 | 162 | <option value="" disabled selected="selected">Email All Pricing</option> |
163 | 163 | <option value="JET-A">Email JET-A pricing only</option> |
164 | 164 | <option value="AVGAS">Email AVGAS pricing only</option> | ... | ... |
app/partials/flightDepDashboard/flightDepDashboard.controller.js
... | ... | @@ -22,12 +22,12 @@ |
22 | 22 | } |
23 | 23 | |
24 | 24 | $scope.logout = function () { |
25 | + localStorage.clear(); | |
25 | 26 | localStorage.removeItem("loginStatus"); |
26 | 27 | $rootScope.path = false; |
27 | 28 | $state.reload(); |
28 | 29 | } |
29 | 30 | $scope.getFBOMarginList = function () { |
30 | - console.log('111111111'); | |
31 | 31 | flightDepDashboardService.getFBOs($scope.order.airport).then(function(result) { |
32 | 32 | $scope.marginList = result; |
33 | 33 | }) |
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | $scope.setCost = function(cost){ |
60 | 60 | if(cost != null) { |
61 | 61 | var obj =JSON.parse(cost); |
62 | - console.log('costttttt',obj.cost); | |
62 | + // console.log('costttttt',obj.cost); | |
63 | 63 | $scope.order.fboCost = obj.cost; |
64 | 64 | } |
65 | 65 | } | ... | ... |
app/partials/login/login.controller.js
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | |
7 | 7 | |
8 | 8 | function LoginController($scope, $filter, $rootScope, $state, LoginService) { |
9 | + | |
9 | 10 | $scope.data = {}; |
10 | 11 | $scope.data.username = ''; |
11 | 12 | $scope.data.password = ''; |
... | ... | @@ -22,7 +23,20 @@ |
22 | 23 | if (reqPwdChng && reqPwdChng == "Y") { |
23 | 24 | $state.go('resetPassword'); |
24 | 25 | } else { |
25 | - LoginService.authenticate(); | |
26 | + console.log("else ") | |
27 | + LoginService.authenticate().then(function(result){ | |
28 | + var currentUserDetail = JSON.parse(window.localStorage.getItem("currentUser")); | |
29 | + if(currentUserDetail.type === 'ADDITIONAL'){ | |
30 | + var email = $scope.data.username; | |
31 | + //console.log("hi",email) | |
32 | + LoginService.getAdditionalAccess(email).then(function(result){ | |
33 | + console.log("getaccess",result) | |
34 | + window.localStorage.setItem("EPDAccess", JSON.stringify(result.allowEpd)); | |
35 | + window.localStorage.setItem("FMAAccess", JSON.stringify(result.allowFma)); | |
36 | + }) | |
37 | + } | |
38 | + }) | |
39 | + | |
26 | 40 | } |
27 | 41 | |
28 | 42 | }else{ | ... | ... |
app/partials/login/login.service.js
... | ... | @@ -88,6 +88,21 @@ |
88 | 88 | return deferred.promise; |
89 | 89 | } |
90 | 90 | |
91 | + | |
92 | + authService.getAdditionalAccess = function(email) { | |
93 | + var deferred = $q.defer(); | |
94 | + $http({ | |
95 | + method : 'GET', | |
96 | + url : BASE_URL.url +'/additionalAccount/'+email, | |
97 | + headers : {'Content-Type': 'application/json'}, | |
98 | + }) | |
99 | + .then(function (result){ | |
100 | + deferred.resolve(result.data); | |
101 | + },function (result){ | |
102 | + deferred.resolve(result.data); | |
103 | + }) | |
104 | + return deferred.promise; | |
105 | + } | |
91 | 106 | |
92 | 107 | |
93 | 108 | authService.getUser = function () { | ... | ... |
app/partials/main/main.controller.js
... | ... | @@ -8,12 +8,23 @@ |
8 | 8 | |
9 | 9 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
10 | 10 | $scope.companyName = JSON.parse(localStorage.getItem('companyName')); |
11 | + var User = JSON.parse(localStorage.getItem('currentUser')); | |
11 | 12 | |
13 | + if(User.type === 'ADDITIONAL'){ | |
14 | + $scope.companyName = $scope.currentUserName; | |
15 | + } | |
12 | 16 | |
13 | 17 | $scope.testFunction = function(){ |
14 | 18 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
15 | 19 | $scope.companyName = JSON.parse(localStorage.getItem('companyName')); |
16 | 20 | } |
21 | + | |
22 | + $scope.logout = function(){ | |
23 | + $state.go('login'); | |
24 | + localStorage.clear(); | |
25 | + $rootScope.isAuthenticated = false; | |
26 | + | |
27 | + } | |
17 | 28 | |
18 | 29 | /** |
19 | 30 | Automatic logout session after 2 hours | ... | ... |
app/partials/main/main.html
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 | <li ng-if="!isAuthenticated"><a href="javascript:;">My Profile</a></li> |
26 | 26 | <li ng-if="isAuthenticated"><a ui-sref="app.accountSetting">Account Settings</a></li> |
27 | 27 | <li class="divider"></li> |
28 | - <li><a href="#" ng-click="logout();">Logout</a></li> | |
28 | + <li><a ng-click="logout();">Logout</a></li> | |
29 | 29 | </ul> |
30 | 30 | </li> |
31 | 31 | </ul> |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | <b class="caret"></b> |
57 | 57 | </a> |
58 | 58 | <ul class="dropdown-menu"> |
59 | - <li><a ui-sref="app.updateFuelManager" href="#/updateFuelManager">Update Fuel Manager</a></li> | |
59 | + <li ng-show = 'isShowFMA'><a ui-sref="app.updateFuelManager" href="#/updateFuelManager">Update Fuel Manager</a></li> | |
60 | 60 | <li> |
61 | 61 | <a ui-sref="app.enterFuelOrder">Enter Fuel Order</a> |
62 | 62 | </li> | ... | ... |
app/partials/updateFuelManager/updateFuelManager.html
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | <div class="widget-header"> |
20 | 20 | <i class="fa fa-pencil"></i> |
21 | 21 | <h3>Price Manager Active</h3> |
22 | - <select style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="btn btn-primary" class="form-control" ng-model="sendEmail.pricing" ng-change="confirmMail()"> | |
22 | + <select ng-show="isShowEmail" style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="btn btn-primary" class="form-control" ng-model="sendEmail.pricing" ng-change="confirmMail()"> | |
23 | 23 | <option value="" disabled selected="selected">Email All Pricing</option> |
24 | 24 | <option value="JET-A">Email JET-A pricing only</option> |
25 | 25 | <option value="AVGAS">Email AVGAS pricing only</option> |
... | ... | @@ -167,7 +167,7 @@ |
167 | 167 | <button class="btn btn-success" style="display: none; background-image: none; background-color: #f3f3f3; color: #333; border:0;" ng-click="closeAccordian(jets)">Close</button> |
168 | 168 | <button class="btn btn-success" style="display: none;" ng-click="saveJetAccordian(jets)">Save</button> |
169 | 169 | <button class="btn btn-danger" style="display: none;" ng-click="deleteJetAccordian(jets.id)">Delete</button> |
170 | - <button type="button" class="btn btn-primary" ng-click="emailPricingForJetAMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
170 | + <button type="button" ng-show="isShowEmail" class="btn btn-primary" ng-click="emailPricingForJetAMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
171 | 171 | <button class="btn btn-default" ng-click="toggleJestAccordian(jets.id, $index)" style= "text-align: center; font-size:12px">Edit</button> |
172 | 172 | </div> |
173 | 173 | <div class="clearfix"></div> |
... | ... | @@ -273,7 +273,7 @@ |
273 | 273 | <button class="btn btn-success" style="display: none; background-image: none; background-color: #f3f3f3; color: #333; border:0;" ng-click="closeAccordianVtype(jets)">Close</button> |
274 | 274 | <button class="btn btn-success" style="display: none;" ng-click="saveVtypeJetAccordian(jets)">Save</button> |
275 | 275 | <button class="btn btn-danger" style="display: none;" ng-click="deleteVtypeJetAccordian(jets.id)">Delete</button> |
276 | - <button type="button" class="btn btn-primary" ng-click="emailPricingForAVGASMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
276 | + <button type="button" ng-show="isShowEmail" class="btn btn-primary" ng-click="emailPricingForAVGASMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
277 | 277 | <button class="btn btn-default" ng-click="toggleVtypeJestAccordian(jets.id, $index)" style= "text-align: center; font-size:12px">Edit</button> |
278 | 278 | </div> |
279 | 279 | <div class="clearfix"></div> | ... | ... |
app/partials/viewCompany/viewCompany.html
... | ... | @@ -210,7 +210,7 @@ |
210 | 210 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> |
211 | 211 | </div> |
212 | 212 | <div class="pull-right"> |
213 | - <button type="button" ng-click="sendMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> | |
213 | + <button type="button" ng-show="isShowEmail" ng-click="sendMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> | |
214 | 214 | <button type="button" class="btn btn-info" ng-click="setFuel()">Setup Fuel</button> |
215 | 215 | </div> |
216 | 216 | <div class="clearfix"></div> |
... | ... | @@ -322,7 +322,7 @@ |
322 | 322 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> |
323 | 323 | </div> |
324 | 324 | <div class="pull-right"> |
325 | - <button type="button" ng-click="sendMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> | |
325 | + <button type="button" ng-show="isShowEmail" ng-click="sendMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> | |
326 | 326 | <button type="button" class="btn btn-info" ng-click="setFuel()">Setup Fuel</button> |
327 | 327 | </div> |
328 | 328 | <div class="clearfix"></div> | ... | ... |
app/partials/viewFuelVendor/viewFuelVendor.html
... | ... | @@ -229,7 +229,7 @@ |
229 | 229 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> |
230 | 230 | </div> |
231 | 231 | <div class="pull-right"> |
232 | - <button type="button" ng-click="sendMail()" class="btn btn-primary">Distribute Price to Vendor Contacts</button> | |
232 | + <button ng-show="isShowEmail" type="button" ng-click="sendMail()" class="btn btn-primary">Distribute Price to Vendor Contacts</button> | |
233 | 233 | </div> |
234 | 234 | <div class="clearfix"></div> |
235 | 235 | </div> | ... | ... |
app/partials/viewVendorContact/viewVendorContact.html
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | <div> |
98 | 98 | <button ng-click="updateContact(contactDetail)" ng-show="showUpdateBtn" class="btn btn-success pull-left">Update Contact</button> |
99 | 99 | <button ng-click="cancelContact()" style="margin-left: 5px;" ng-show="showUpdateBtn" class="btn btn-default pull-left">Cancel</button> |
100 | - <button type="button" class="btn btn-primary pull-right">Send Price to This Contacts</button> | |
100 | + <button ng-show="isShowEmail" type="button" class="btn btn-primary pull-right">Send Price to This Contacts</button> | |
101 | 101 | <div class="clearfix"></div> |
102 | 102 | </div> |
103 | 103 | </div> |
... | ... | @@ -129,7 +129,7 @@ |
129 | 129 | </table> |
130 | 130 | </div> |
131 | 131 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
132 | - <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendPrimaryContact(contactDetail.id)">Yes</button> | |
132 | + <button ng-show="isShowEmail" class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendPrimaryContact(contactDetail.id)">Yes</button> | |
133 | 133 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelPrimaryContact()">Cancel</button> |
134 | 134 | </div> |
135 | 135 | </div> | ... | ... |
app/partials/viewcontact/viewcontact.html
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | <h3 style="margin-right: 0px;">Contact Detail</h3> |
38 | 38 | <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteContact(contactDetail.id)" style="color: white;" aria-hidden="true"></i> |
39 | 39 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> |
40 | - <toggle ng-model="contactDetail.priceEmail" style="width: 140px;" ng-change="changePriceEmail(contactDetail.id)" size="customToogle" on="PRICE EMAIL ON" off="PRICE EMAIL OFF"></toggle> | |
40 | + <toggle ng-show="isShowEmail" ng-model="contactDetail.priceEmail" style="width: 140px;" ng-change="changePriceEmail(contactDetail.id)" size="customToogle" on="PRICE EMAIL ON" off="PRICE EMAIL OFF"></toggle> | |
41 | 41 | </div> |
42 | 42 | |
43 | 43 | </div> |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | <div> |
105 | 105 | <button ng-click="updateContact(contactDetail)" ng-show="showUpdateBtn" class="btn btn-success pull-left">Update Contact</button> |
106 | 106 | <button ng-click="cancelContact()" style="margin-left: 5px;" ng-show="showUpdateBtn" class="btn btn-default pull-left">Cancel</button> |
107 | - <button type="button" class="btn btn-primary pull-right" ng-click="confirmMail()">Send Price to This Contacts</button> | |
107 | + <button ng-show="isShowEmail" type="button" class="btn btn-primary pull-right" ng-click="confirmMail()">Send Price to This Contacts</button> | |
108 | 108 | <div class="clearfix"></div> |
109 | 109 | </div> |
110 | 110 | </div> | ... | ... |