Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
bc8992ec
Commit
bc8992ec
authored
5 years ago
by
Ratnadeep Rajendra Kharade
Browse files
Options
Download
Email Patches
Plain Diff
Removed all console statements.
parent
e44f29f9
master
72-feedback-toast-message
73-removal-here-maps-api-key
No related merge requests found
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
src/app/auth/login/login.page.ts
+1
-1
src/app/auth/login/login.page.ts
src/app/auth/register/register.page.ts
+1
-1
src/app/auth/register/register.page.ts
src/app/auth/reset-password/reset-password.page.ts
+1
-1
src/app/auth/reset-password/reset-password.page.ts
src/app/components/here-map/here-map.component.ts
+8
-8
src/app/components/here-map/here-map.component.ts
src/app/feedback/feedback.page.ts
+1
-1
src/app/feedback/feedback.page.ts
src/app/hirebike/hirebike.page.ts
+31
-31
src/app/hirebike/hirebike.page.ts
src/app/home/home.page.ts
+5
-5
src/app/home/home.page.ts
src/app/myreservation/myreservation.page.ts
+8
-8
src/app/myreservation/myreservation.page.ts
src/app/rest.service.ts
+1
-1
src/app/rest.service.ts
src/app/ridehistory/ridehistory.page.ts
+1
-1
src/app/ridehistory/ridehistory.page.ts
src/app/services/loading.service.ts
+1
-1
src/app/services/loading.service.ts
src/app/services/location.service.ts
+5
-5
src/app/services/location.service.ts
src/app/settings/settings.page.ts
+3
-3
src/app/settings/settings.page.ts
with
67 additions
and
67 deletions
+67
-67
src/app/auth/login/login.page.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -52,7 +52,7 @@ export class LoginPage implements OnInit {
this
.
router
.
navigateByUrl
(
'
/home
'
);
//this.loadingService.hideLoader();
},
(
error
)
=>
{
console
.
log
(
JSON
.
stringify
(
error
));
//
console.log(JSON.stringify(error));
this
.
correctCredentials
=
true
;
//this.loadingService.hideLoader();
});
...
...
This diff is collapsed.
Click to expand it.
src/app/auth/register/register.page.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -51,7 +51,7 @@ export class RegisterPage implements OnInit {
this
.
registerApi
=
this
.
httpClient
.
post
(
'
http://193.196.52.237:8081/register
'
,
Form
,{
headers
});
this
.
registerApi
.
subscribe
((
data
)
=>
{
console
.
log
(
'
my data:
'
,
data
);
//
console.log('my data: ', data);
this
.
restService
.
setToken
(
data
.
token
);
this
.
toastService
.
showToast
(
"
Registration Successful!
"
)
this
.
router
.
navigateByUrl
(
'
/login
'
);
...
...
This diff is collapsed.
Click to expand it.
src/app/auth/reset-password/reset-password.page.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -45,7 +45,7 @@ export class ResetPasswordPage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
ResetPasswordApi
=
this
.
httpClient
.
post
<
any
>
(
url
,
{
"
oldPassword
"
:
this
.
oldPassword
,
"
newPassword
"
:
this
.
newPassword
},{
headers
});
this
.
ResetPasswordApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
"
PasswordChanged
"
,
resp
);
//
console.log("PasswordChanged", resp);
this
.
toastService
.
showToast
(
"
Password Changed Sucessfully!Login Again
"
);
this
.
router
.
navigateByUrl
(
'
/login
'
);
...
...
This diff is collapsed.
Click to expand it.
src/app/components/here-map/here-map.component.ts
+
8
-
8
View file @
bc8992ec
...
...
@@ -52,22 +52,22 @@ export class HereMapComponent implements OnInit {
let
watch
=
this
.
geolocation
.
watchPosition
({
enableHighAccuracy
:
true
,
maximumAge
:
10000
});
watch
.
subscribe
((
position
)
=>
{
console
.
log
(
position
.
coords
.
latitude
);
console
.
log
(
position
.
coords
.
longitude
);
//
console.log(position.coords.latitude);
//
console.log(position.coords.longitude);
this
.
currentUserPosition
.
lat
=
position
.
coords
.
latitude
;
this
.
currentUserPosition
.
lng
=
position
.
coords
.
longitude
;
if
(
this
.
currentLocationMarker
)
{
this
.
currentLocationMarker
.
setGeometry
({
lat
:
position
.
coords
.
latitude
,
lng
:
position
.
coords
.
longitude
});
}
},
(
errorObj
)
=>
{
console
.
log
(
errorObj
.
code
+
"
:
"
+
errorObj
.
message
);
//
console.log(errorObj.code + ": " + errorObj.message);
});
}
ngOnInit
()
{
this
.
gotReservedBikeSubject
.
subscribe
(
bikeDetails
=>
{
console
.
log
(
'
Got Bike in map
'
);
console
.
log
(
bikeDetails
);
//
console.log('Got Bike in map');
//
console.log(bikeDetails);
this
.
bikePosition
.
lat
=
bikeDetails
.
lat
;
this
.
bikePosition
.
lng
=
bikeDetails
.
lon
;
var
img
=
[
'
../../../assets/images/100_percent.png
'
,
'
../../../assets/images/75_percent.png
'
,
'
../../../assets/images/50_percent.png
'
,
'
../../../assets/images/25_percent.png
'
,
'
../../../assets/images/0_percent.png
'
];
...
...
@@ -85,7 +85,7 @@ export class HereMapComponent implements OnInit {
});
this
.
startRideSubject
.
subscribe
(
event
=>
{
console
.
log
(
'
start ride
'
);
//
console.log('start ride');
//remove event listener
this
.
rideStarted
=
true
;
this
.
calculateRoute
();
...
...
@@ -312,7 +312,7 @@ export class HereMapComponent implements OnInit {
//console.log(event.type, event.currentPointer.type);
var
coord
=
this
.
map
.
screenToGeo
(
event
.
currentPointer
.
viewportX
,
event
.
currentPointer
.
viewportY
);
console
.
log
(
coord
.
lat
+
'
,
'
+
coord
.
lng
);
//
console.log(coord.lat + ', ' + coord.lng);
this
.
destinationPosition
=
{
lat
:
coord
.
lat
,
lng
:
coord
.
lng
};
...
...
@@ -333,7 +333,7 @@ export class HereMapComponent implements OnInit {
//TODO change this logic
getCurrentPosition
()
{
console
.
log
(
this
.
currentLocationMarker
);
//
console.log(this.currentLocationMarker);
if
(
!
this
.
currentLocationMarker
)
{
this
.
showUserLocationOnMap
(
this
.
currentUserPosition
.
lat
,
this
.
currentUserPosition
.
lng
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/feedback/feedback.page.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -64,7 +64,7 @@ export class FeedbackPage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
feedbackApi
=
this
.
httpClient
.
post
<
any
>
(
url
,
{
"
content
"
:
Form
,
"
bikeId
"
:
this
.
feedbackService
.
getBikeid
()},{
headers
});
this
.
feedbackApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
"
rides response
"
,
resp
);
//
console.log("rides response", resp);
this
.
isDetailsVisible
=
false
;
this
.
router
.
navigateByUrl
(
'
/ridehistory
'
);
//this.loadingService.hideLoader();
...
...
This diff is collapsed.
Click to expand it.
src/app/hirebike/hirebike.page.ts
+
31
-
31
View file @
bc8992ec
...
...
@@ -97,8 +97,8 @@ export class HirebikePage implements OnInit {
}
this
.
locationService
.
liveLocationSubject
.
subscribe
((
position
)
=>
{
console
.
log
(
'
got location inside my ride subscription
'
);
console
.
log
(
position
);
//
console.log('got location inside my ride subscription');
//
console.log(position);
this
.
currentUserPosition
.
lat
=
position
.
lat
;
this
.
currentUserPosition
.
lng
=
position
.
lng
;
this
.
currentUserPosition
.
altitude
=
position
.
altitude
;
...
...
@@ -115,8 +115,8 @@ export class HirebikePage implements OnInit {
this
.
getReservedBike
();
this
.
mapDataService
.
mapDataSubject
.
subscribe
(
receiveddata
=>
{
console
.
log
(
'
data received
'
);
console
.
log
(
receiveddata
);
//
console.log('data received ');
//
console.log(receiveddata);
this
.
currentRoute
=
receiveddata
;
let
content
=
''
;
content
+=
'
Total distance:
'
+
receiveddata
.
summary
.
distance
+
'
m.
'
;
...
...
@@ -131,8 +131,8 @@ export class HirebikePage implements OnInit {
});
this
.
gotReservedBikeSubject
.
subscribe
(
bikeDetails
=>
{
console
.
log
(
'
Got Bike in map
'
);
console
.
log
(
bikeDetails
);
//
console.log('Got Bike in map');
//
console.log(bikeDetails);
this
.
bikePosition
.
lat
=
bikeDetails
.
lat
;
this
.
bikePosition
.
lng
=
bikeDetails
.
lon
;
var
img
=
[
'
../../../assets/images/100_percent.png
'
,
'
../../../assets/images/75_percent.png
'
,
'
../../../assets/images/50_percent.png
'
,
'
../../../assets/images/25_percent.png
'
,
'
../../../assets/images/0_percent.png
'
];
...
...
@@ -152,7 +152,7 @@ export class HirebikePage implements OnInit {
});
this
.
startRideSubject
.
subscribe
(
event
=>
{
console
.
log
(
'
start ride
'
);
//
console.log('start ride');
//remove event listener
this
.
rideStarted
=
true
;
this
.
calculateRoute
();
...
...
@@ -181,7 +181,7 @@ export class HirebikePage implements OnInit {
let
reserveUrl
=
'
http://193.196.52.237:8081/active-rent
'
;
let
bikeReservationStatusApi
=
this
.
httpClient
.
get
(
reserveUrl
,
{
headers
});
bikeReservationStatusApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
Reserved Bike
'
,
resp
);
//
console.log('Reserved Bike', resp);
if
(
resp
.
data
)
{
this
.
reservedBike
=
resp
.
data
;
this
.
isBikeHired
=
this
.
reservedBike
.
rented
;
...
...
@@ -189,7 +189,7 @@ export class HirebikePage implements OnInit {
let
bikeDetailsUrl
=
'
http://193.196.52.237:8081/bikes/
'
+
this
.
reservedBike
.
bikeId
;
let
bikeDetailsApi
=
this
.
httpClient
.
get
(
bikeDetailsUrl
,
{
headers
});
bikeDetailsApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
Bike Details
'
,
resp
);
//
console.log('Bike Details', resp);
this
.
bikeDetails
=
resp
.
data
;
this
.
noReservation
=
false
;
//this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon);
...
...
@@ -199,7 +199,7 @@ export class HirebikePage implements OnInit {
this
.
gotReservedBikeSubject
.
next
(
resp
.
data
);
this
.
loadingService
.
hideLoader
();
},
(
reservedBikeError
)
=>
{
console
.
log
(
reservedBikeError
);
//
console.log(reservedBikeError);
this
.
loadingService
.
hideLoader
();
this
.
isBikeReserved
=
false
;
});
...
...
@@ -208,7 +208,7 @@ export class HirebikePage implements OnInit {
this
.
isBikeReserved
=
false
;
}
},
(
bikeDetailsError
)
=>
{
console
.
log
(
bikeDetailsError
);
//
console.log(bikeDetailsError);
this
.
loadingService
.
hideLoader
();
this
.
isBikeReserved
=
false
;
});
...
...
@@ -227,7 +227,7 @@ export class HirebikePage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
bikeApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
bikeApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
//
console.log('my data: ', resp);
this
.
loadingService
.
hideLoader
();
this
.
isBikeHired
=
true
;
this
.
routesResponse
=
resp
;
...
...
@@ -240,7 +240,7 @@ export class HirebikePage implements OnInit {
this
.
gotRouteOptions
=
true
;
this
.
displayNoGoAreas
(
resp
);
},
(
error
)
=>
{
console
.
log
(
error
);
//
console.log(error);
this
.
loadingService
.
hideLoader
();
});
});
...
...
@@ -342,7 +342,7 @@ export class HirebikePage implements OnInit {
displayRouteSummaryAtTop
(
resp
)
{
let
firstRoute
=
JSON
.
parse
(
resp
.
data
.
routes
[
0
].
route
).
response
.
route
[
0
];
console
.
log
(
firstRoute
);
//
console.log(firstRoute);
let
waypointLabels
=
[];
for
(
let
i
=
0
;
i
<
firstRoute
.
waypoint
.
length
;
i
+=
1
)
{
waypointLabels
.
push
(
firstRoute
.
waypoint
[
i
].
label
)
...
...
@@ -461,7 +461,7 @@ export class HirebikePage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
bikeApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
Trip Started:
'
,
resp
);
//
console.log('Trip Started: ', resp);
this
.
loadingService
.
hideLoader
();
this
.
toastService
.
showToast
(
"
Trip Started
"
);
this
.
isBikeHired
=
true
;
...
...
@@ -481,7 +481,7 @@ export class HirebikePage implements OnInit {
},
20000
);
}
},
(
error
)
=>
{
console
.
log
(
error
);
//
console.log(error);
this
.
loadingService
.
hideLoader
();
this
.
toastService
.
showToast
(
"
This is ongoing Trip
"
);
});
...
...
@@ -511,7 +511,7 @@ export class HirebikePage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
batteryLevelApi
=
this
.
httpClient
.
get
<
any
>
(
url
,{
headers
});
batteryLevelApi
.
subscribe
((
batteryResp
)
=>
{
console
.
log
(
"
Battery Level Response
"
,
batteryResp
);
//
console.log("Battery Level Response", batteryResp);
let
url
=
'
http://193.196.52.237:8081/segment
'
;
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
currentPositionObj
.
batteryLevel
=
batteryResp
.
data
;
...
...
@@ -522,7 +522,7 @@ export class HirebikePage implements OnInit {
}
let
usageDataApi
=
this
.
httpClient
.
post
<
any
>
(
url
,
{
requestObject
},
{
headers
});
usageDataApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
"
Usage api response
"
,
resp
);
//
console.log("Usage api response", resp);
this
.
previousPositionObj
=
this
.
currentPositionObj
;
this
.
batteryLevelSentCount
++
;
this
.
locationList
.
push
(
this
.
currentPositionObj
);
...
...
@@ -539,7 +539,7 @@ export class HirebikePage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
bikeApi
=
this
.
httpClient
.
delete
(
url
,
{
headers
});
bikeApi
.
subscribe
(
async
(
resp
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
//
console.log('my data: ', resp);
this
.
loadingService
.
hideLoader
();
this
.
toastService
.
showToast
(
"
Trip Ended!
"
);
//this.router.navigateByUrl('/feedback');
...
...
@@ -552,13 +552,13 @@ export class HirebikePage implements OnInit {
role
:
'
cancel
'
,
cssClass
:
'
secondary
'
,
handler
:
(
blah
)
=>
{
console
.
log
(
'
Confirm Cancel: blah
'
);
//
console.log('Confirm Cancel: blah');
this
.
router
.
navigateByUrl
(
'
/home
'
);
}
},
{
text
:
'
Okay
'
,
handler
:
()
=>
{
console
.
log
(
'
Confirm Okay
'
);
//
console.log('Confirm Okay');
this
.
router
.
navigateByUrl
(
'
/feedback
'
);
}
}
...
...
@@ -567,7 +567,7 @@ export class HirebikePage implements OnInit {
await
alert
.
present
();
},
(
error
)
=>
{
console
.
log
(
error
);
//
console.log(error);
this
.
loadingService
.
hideLoader
();
this
.
toastService
.
showToast
(
"
No Ongong Trip to End
"
)
});
...
...
@@ -790,7 +790,7 @@ export class HirebikePage implements OnInit {
//console.log(event.type, event.currentPointer.type);
var
coord
=
this
.
map
.
screenToGeo
(
event
.
currentPointer
.
viewportX
,
event
.
currentPointer
.
viewportY
);
console
.
log
(
coord
);
//
console.log(coord);
this
.
reverseGeocode
(
this
.
platform
,
coord
.
lat
,
coord
.
lng
);
this
.
destinationPosition
=
{
lat
:
coord
.
lat
,
lng
:
coord
.
lng
};
...
...
@@ -899,7 +899,7 @@ export class HirebikePage implements OnInit {
}
click_item
(
item
)
{
console
.
log
(
item
);
//
console.log(item);
var
geocoder
=
this
.
platform
.
getGeocodingService
(),
parameters
=
{
locationid
:
item
.
locationId
,
...
...
@@ -914,7 +914,7 @@ export class HirebikePage implements OnInit {
lng
:
result
.
Response
.
View
[
0
].
Result
[
0
].
Location
.
DisplayPosition
.
Longitude
}
this
.
destinationPosition
=
{
lat
:
coord
.
lat
,
lng
:
coord
.
lng
};
console
.
log
(
result
.
Response
.
View
[
0
].
Result
[
0
].
Location
.
DisplayPosition
);
//
console.log(result.Response.View[0].Result[0].Location.DisplayPosition);
if
(
this
.
destinationMarker
)
{
this
.
destinationMarker
.
setGeometry
({
lat
:
coord
.
lat
,
lng
:
coord
.
lng
})
}
else
{
...
...
@@ -929,7 +929,7 @@ export class HirebikePage implements OnInit {
this
.
setZoomLevelToPointersGroup
();
}
},
function
(
error
)
{
console
.
log
(
error
);
//
console.log(error);
});
}
...
...
@@ -972,11 +972,11 @@ export class HirebikePage implements OnInit {
'
&app_code=
'
+
'
mQFi1FqoEypbfQDJjMENPg
'
;
let
bikeReservationStatusApi
=
this
.
httpClient
.
get
(
this
.
AUTOCOMPLETION_URL
+
params
);
bikeReservationStatusApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
Search Results
'
,
resp
);
//
('Search Results', resp);
this
.
list_to_show
=
resp
.
suggestions
;
this
.
isSearched
=
true
;
},
(
bikeDetailsError
)
=>
{
console
.
log
(
bikeDetailsError
);
//
console.log(bikeDetailsError);
});
}
}
...
...
@@ -984,7 +984,7 @@ export class HirebikePage implements OnInit {
list_to_show
=
[];
searchValue
=
''
;
searchValueChanged
()
{
console
.
log
(
this
.
searchValue
);
//
console.log(this.searchValue);
// var geocodingParams = {
// searchText: this.searchValue
// };
...
...
@@ -1002,7 +1002,7 @@ export class HirebikePage implements OnInit {
position
,
marker
;
console
.
log
(
result
);
//
console.log(result);
// Add a marker for each location found
// for (let i = 0; i < locations.length; i++) {
// position = {
...
...
@@ -1015,7 +1015,7 @@ export class HirebikePage implements OnInit {
}
ionViewDidLeave
()
{
console
.
log
(
"
Route: Ion View Left.
"
)
//
console.log("Route: Ion View Left.")
if
(
this
.
mapElement
)
{
//this.mapElement.nativeElement.remove();
}
...
...
This diff is collapsed.
Click to expand it.
src/app/home/home.page.ts
+
5
-
5
View file @
bc8992ec
...
...
@@ -74,7 +74,7 @@ export class HomePage implements OnInit, OnDestroy {
this
.
getBikesList
();
this
.
locationService
.
liveLocationSubject
.
subscribe
((
position
)
=>
{
console
.
log
(
'
got location inside home subscription
'
);
//
console.log('got location inside home subscription');
this
.
currentUserPosition
.
lat
=
position
.
lat
;
this
.
currentUserPosition
.
lng
=
position
.
lng
;
if
(
this
.
currentLocationMarker
)
{
...
...
@@ -143,7 +143,7 @@ export class HomePage implements OnInit, OnDestroy {
// listen for map click event
this
.
map
.
addEventListener
(
'
tap
'
,
(
event
)
=>
{
console
.
log
(
event
.
type
,
event
.
currentPointer
.
type
);
//
console.log(event.type, event.currentPointer.type);
});
this
.
locationsGroup
=
new
H
.
map
.
Group
();
...
...
@@ -156,7 +156,7 @@ export class HomePage implements OnInit, OnDestroy {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
bikeApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
this
.
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
"
bikes response
"
,
resp
);
//
console.log("bikes response", resp);
this
.
bikes
=
resp
;
for
(
let
i
=
0
;
i
<
this
.
bikes
.
length
;
i
++
)
{
this
.
bikes
[
i
].
distance
=
this
.
bikes
[
i
].
distance
.
toFixed
(
2
);;
...
...
@@ -278,14 +278,14 @@ export class HomePage implements OnInit, OnDestroy {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
bikeApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
this
.
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
//
console.log('my data: ', resp);
this
.
isBikeReserved
=
true
;
this
.
toastService
.
showToast
(
"
Reservation Successful!
"
);
this
.
router
.
navigateByUrl
(
'
/myreservation
'
);
this
.
loadingService
.
hideLoader
();
this
.
isDetailsVisible
=
false
;
},
(
error
)
=>
{
console
.
log
(
error
);
//
console.log(error);
this
.
loadingService
.
hideLoader
();
this
.
toastService
.
showToast
(
"
Only one bike may be reserved or rented at a time
"
);
this
.
isDetailsVisible
=
false
;
...
...
This diff is collapsed.
Click to expand it.
src/app/myreservation/myreservation.page.ts
+
8
-
8
View file @
bc8992ec
...
...
@@ -91,7 +91,7 @@ export class MyreservationPage implements OnInit {
this
.
getReservedBike
();
this
.
locationService
.
liveLocationSubject
.
subscribe
((
position
)
=>
{
console
.
log
(
'
got location inside home subscription
'
);
//
console.log('got location inside home subscription');
this
.
currentUserPosition
.
lat
=
position
.
lat
;
this
.
currentUserPosition
.
lng
=
position
.
lng
;
if
(
this
.
currentLocationMarker
)
{
...
...
@@ -141,7 +141,7 @@ export class MyreservationPage implements OnInit {
let
reserveUrl
=
'
http://193.196.52.237:8081/active-rent
'
;
let
bikeReservationStatusApi
=
this
.
httpClient
.
get
(
reserveUrl
,
{
headers
});
bikeReservationStatusApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
Reserved Bike
'
,
resp
);
//
console.log('Reserved Bike', resp);
if
(
resp
.
data
)
{
this
.
reservedBike
=
resp
.
data
;
this
.
isBikeHired
=
this
.
reservedBike
.
rented
;
...
...
@@ -149,7 +149,7 @@ export class MyreservationPage implements OnInit {
let
bikeDetailsUrl
=
'
http://193.196.52.237:8081/bikes/
'
+
this
.
reservedBike
.
bikeId
;
let
bikeDetailsApi
=
this
.
httpClient
.
get
(
bikeDetailsUrl
,
{
headers
});
bikeDetailsApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
Bike Details
'
,
resp
);
//
console.log('Bike Details', resp);
this
.
loadingService
.
hideLoader
();
this
.
bikeDetails
=
resp
.
data
;
this
.
distance
=
this
.
distanceService
.
getDistance
();
...
...
@@ -164,11 +164,11 @@ export class MyreservationPage implements OnInit {
// show route on map
this
.
mapRouter
.
calculateRoute
(
this
.
routingParameters
,
this
.
onResult
.
bind
(
this
),
(
error
)
=>
{
console
.
log
(
error
.
message
);
//
console.log(error.message);
});
},
(
reservedBikeError
)
=>
{
this
.
loadingService
.
hideLoader
();
console
.
log
(
reservedBikeError
);
//
console.log(reservedBikeError);
this
.
isBikeReserved
=
false
;
});
}
else
{
...
...
@@ -177,7 +177,7 @@ export class MyreservationPage implements OnInit {
}
},
(
bikeDetailsError
)
=>
{
this
.
loadingService
.
hideLoader
();
console
.
log
(
bikeDetailsError
)
//
console.log(bikeDetailsError)
this
.
isBikeReserved
=
false
;
});
});
...
...
@@ -189,7 +189,7 @@ export class MyreservationPage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
bikeApi
=
this
.
httpClient
.
delete
(
url
,
{
headers
});
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
Reservation Cancelled:
'
,
resp
);
//
console.log('Reservation Cancelled: ', resp);
this
.
toastService
.
showToast
(
"
Bike Reservation successfully cancelled.
"
);
this
.
router
.
navigateByUrl
(
'
/home
'
);
},
(
error
)
=>
console
.
log
(
error
));
...
...
@@ -278,7 +278,7 @@ export class MyreservationPage implements OnInit {
};
geocoder
.
reverseGeocode
(
parameters
,
result
=>
{
console
.
log
(
result
);
//
console.log(result);
var
streets
=
result
.
Response
.
View
[
0
].
Result
[
0
].
Location
.
Address
.
Street
;
var
houseNumber
=
result
.
Response
.
View
[
0
].
Result
[
0
].
Location
.
Address
.
HouseNumber
;
var
zipcode
=
result
.
Response
.
View
[
0
].
Result
[
0
].
Location
.
Address
.
PostalCode
;
...
...
This diff is collapsed.
Click to expand it.
src/app/rest.service.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -18,7 +18,7 @@ export class RestService {
getToken
()
{
this
.
storage
.
get
(
'
token
'
).
then
((
val
)
=>
{
console
.
log
(
'
token
'
,
val
);
//
console.log('token', val);
return
val
;
});
}
...
...
This diff is collapsed.
Click to expand it.
src/app/ridehistory/ridehistory.page.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -33,7 +33,7 @@ export class RidehistoryPage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
rideApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
this
.
rideApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
"
rides response
"
,
resp
);
//
console.log("rides response", resp);
this
.
rides
=
resp
.
data
;
for
(
let
i
=
0
;
i
<
this
.
rides
.
length
;
i
++
)
{
this
.
rides
[
i
]
=
this
.
rides
[
i
];
...
...
This diff is collapsed.
Click to expand it.
src/app/services/loading.service.ts
+
1
-
1
View file @
bc8992ec
...
...
@@ -19,7 +19,7 @@ export class LoadingService {
res
.
present
();
res
.
onDidDismiss
().
then
((
dis
)
=>
{
console
.
log
(
'
Loading dismissed!
'
);
//
console.log('Loading dismissed!');
});
});
}
...
...
This diff is collapsed.
Click to expand it.
src/app/services/location.service.ts
+
5
-
5
View file @
bc8992ec
...
...
@@ -13,7 +13,7 @@ export class LocationService {
constructor
(
private
geolocation
:
Geolocation
)
{
let
watch
=
this
.
geolocation
.
watchPosition
({
enableHighAccuracy
:
true
,
maximumAge
:
10000
});
watch
.
subscribe
((
position
)
=>
{
console
.
log
(
position
);
//
console.log(position);
let
altitude
=
position
.
coords
.
altitude
;
if
(
!
altitude
)
{
altitude
=
250
;
...
...
@@ -28,7 +28,7 @@ export class LocationService {
this
.
getUserLiveLocation
(
this
.
currentUserPosition
);
},
(
errorObj
)
=>
{
console
.
log
(
'
Error getting live location, setting to previous location
'
);
//
console.log('Error getting live location, setting to previous location');
this
.
getUserLiveLocation
(
this
.
preiousUserPosition
);
});
}
...
...
@@ -37,7 +37,7 @@ export class LocationService {
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
console
.
log
(
resp
);
//
console.log(resp);
let
lat
=
resp
.
coords
.
latitude
;
let
lng
=
resp
.
coords
.
longitude
;
let
altitude
=
resp
.
coords
.
altitude
;
...
...
@@ -54,10 +54,10 @@ export class LocationService {
this
.
preiousUserPosition
.
altitude
=
altitude
;
resolve
(
this
.
currentUserPosition
);
},
er
=>
{
console
.
log
(
'
error getting location setting to previous location
'
);
//
console.log('error getting location setting to previous location');
resolve
(
this
.
preiousUserPosition
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
error getting location setting to previous location
'
);
//
console.log('error getting location setting to previous location');
resolve
(
this
.
preiousUserPosition
);
});
});
...
...
This diff is collapsed.
Click to expand it.
src/app/settings/settings.page.ts
+
3
-
3
View file @
bc8992ec
...
...
@@ -33,7 +33,7 @@ export class SettingsPage implements OnInit {
role
:
'
cancel
'
,
cssClass
:
'
secondary
'
,
handler
:
(
blah
)
=>
{
console
.
log
(
'
Confirm Cancel: blah
'
);
//
console.log('Confirm Cancel: blah');
this
.
router
.
navigateByUrl
(
'
/settings
'
);
}
},
{
...
...
@@ -45,12 +45,12 @@ export class SettingsPage implements OnInit {
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
deactivateApi
=
this
.
httpClient
.
delete
(
url
,
{
headers
});
deactivateApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
//
console.log('my data: ', resp);
this
.
router
.
navigateByUrl
(
'
/login
'
);
this
.
toastService
.
showToast
(
"
User account has been deactivated!
"
);
},
(
error
)
=>
{
console
.
log
(
error
);
//
console.log(error);
});
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets