Commit e40bfdeb authored by Gauri Amol Pande's avatar Gauri Amol Pande
Browse files

Merge branch 'master' into '18-design-feedback-page-2'

# Conflicts:
#   src/app/app-routing.module.ts
#   src/app/app.component.ts
#   src/app/hirebike/hirebike.page.ts
parents d9b44d91 59521fd5
...@@ -88,4 +88,4 @@ ...@@ -88,4 +88,4 @@
"browser" "browser"
] ]
} }
} }
\ No newline at end of file
...@@ -35,12 +35,12 @@ const routes: Routes = [ ...@@ -35,12 +35,12 @@ const routes: Routes = [
loadChildren: () => import('./ridehistory/ridehistory.module').then( m => m.RidehistoryPageModule) loadChildren: () => import('./ridehistory/ridehistory.module').then( m => m.RidehistoryPageModule)
}, },
{ {
path: 'feedback', path: 'help-line',
loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule) loadChildren: () => import('./help-line/help-line.module').then( m => m.HelpLinePageModule)
}, },
{ {
path: 'feedback', path: 'reset-password',
loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule) loadChildren: () => import('./reset-password/reset-password.module').then( m => m.ResetPasswordPageModule)
} }
......
...@@ -27,11 +27,11 @@ export class AppComponent { ...@@ -27,11 +27,11 @@ export class AppComponent {
{ {
title: 'My Reservation', title: 'My Reservation',
url: '/myreservation', url: '/myreservation',
icon: 'clipboard' icon: 'cart'
}, { }, {
title: 'My Rides', title: 'My Rides',
url: '/hirebike', url: '/hirebike',
icon: 'clipboard' icon: 'bicycle'
}, },
{ {
title: 'Ride History', title: 'Ride History',
...@@ -39,9 +39,9 @@ export class AppComponent { ...@@ -39,9 +39,9 @@ export class AppComponent {
icon: 'clipboard' icon: 'clipboard'
}, },
{ {
title: 'Feedback', title: 'Help',
url: '/feedback', url: '/help-line',
icon: 'clipboard' icon: 'call'
}, },
{ {
title: 'Logout', title: 'Logout',
......
...@@ -31,7 +31,10 @@ ...@@ -31,7 +31,10 @@
<div padding> <div padding>
<ion-button size="large" expand="block" (click)="login()">Login</ion-button> <ion-button size="large" expand="block" (click)="login()">Login</ion-button>
<a href="../../reset-password">Forgot your Password?</a>
</div> </div>
<div padding> <div padding>
<ion-button size="large" expand="block" (click)="register()">Click here to Register</ion-button> <ion-button size="large" expand="block" (click)="register()">Click here to Register</ion-button>
</div> </div>
......
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HelpLinePage } from './help-line.page';
const routes: Routes = [
{
path: '',
component: HelpLinePage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HelpLinePageRoutingModule {}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { HelpLinePageRoutingModule } from './help-line-routing.module';
import { HelpLinePage } from './help-line.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HelpLinePageRoutingModule
],
declarations: [HelpLinePage]
})
export class HelpLinePageModule {}
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title slot="start">
Help
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="container">
<div><img src="../../../assets/images/Questions.png"></div>
<div class="help-container">
<ion-grid>
<ion-row>
<ion-col>
<ion-icon name="contact"></ion-icon> Contact Person:
</ion-col>
<ion-col>
Priyanaka Upadhye
</ion-col>
</ion-row>
<ion-row>
</ion-row>
<ion-row>
<ion-col>
<ion-icon name="Mail"></ion-icon> Contact Email:
</ion-col>
<ion-col>
Admin@mail.com
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-icon name="call"></ion-icon> Contact Number:
</ion-col>
<ion-col>
+4917665211145
</ion-col>
</ion-row>
</ion-grid>
</div>
</div >
</ion-content>
<ion-footer>
<ion-button expand="block" (click)="CallHelpLine()">Help</ion-button>
</ion-footer>
\ No newline at end of file
.help-container{
height: 191px;
width: 100%;
border: 1px solid #aaaaaa;
border-radius: 5px;
box-sizing: border-box;
float: left;
width: 100%;
height: 20%;
clear: both;
margin: 0;
position: absolute;
top: 80%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
div {
height: inherit;
float: left;
}
}
.container {
height: 100%;
position: relative;
}
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { HelpLinePage } from './help-line.page';
describe('HelpLinePage', () => {
let component: HelpLinePage;
let fixture: ComponentFixture<HelpLinePage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HelpLinePage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(HelpLinePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-help-line',
templateUrl: './help-line.page.html',
styleUrls: ['./help-line.page.scss'],
})
export class HelpLinePage implements OnInit {
constructor() { }
ngOnInit() {
}
}
...@@ -20,15 +20,20 @@ ...@@ -20,15 +20,20 @@
</div--> </div-->
<!--div #mapElement style="width: 100%; height: 100%" id="mapContainer"></div--> <!--div #mapElement style="width: 100%; height: 100%" id="mapContainer"></div-->
<!--app-here-map [startRideSubject]="startRideSubject" [gotReservedBikeSubject]="gotReservedBikeSubject"></app-here-map--> <!--app-here-map [startRideSubject]="startRideSubject" [gotReservedBikeSubject]="gotReservedBikeSubject"></app-here-map-->
<div #mapElement style="width: 100%; height: 100%" id="mapContainer" *ngIf="!is3DChecked"></div> <ion-card *ngIf="!isBikeReserved">
<ion-fab class="get-position" vertical="bottom" horizontal="end" (click)="getCurrentPosition()" slot="fixed"> <ion-card-content>
No ride found
</ion-card-content>
</ion-card>
<div #mapElement style="width: 100%; height: 100%" id="mapContainer" *ngIf="isBikeReserved"></div>
<ion-fab *ngIf="isBikeReserved" class="get-position" vertical="bottom" horizontal="end" (click)="getCurrentPosition()" slot="fixed">
<ion-fab-button> <ion-fab-button>
<ion-icon name="locate"></ion-icon> <ion-icon name="locate"></ion-icon>
</ion-fab-button> </ion-fab-button>
</ion-fab> </ion-fab>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="bike-details-container"> <div class="bike-details-container" *ngIf="isBikeReserved">
<div class="inner"> <div class="inner">
<div class="button-container"> <div class="button-container">
......
...@@ -28,6 +28,8 @@ export class HirebikePage implements OnInit { ...@@ -28,6 +28,8 @@ export class HirebikePage implements OnInit {
isBikeHired = false; isBikeHired = false;
noReservation = true; noReservation = true;
isBikeReserved = true;
currentRoute: any; currentRoute: any;
routeSummary: any; routeSummary: any;
wayPointsInfo:any; wayPointsInfo:any;
...@@ -163,7 +165,7 @@ export class HirebikePage implements OnInit { ...@@ -163,7 +165,7 @@ export class HirebikePage implements OnInit {
} }
getReservedBike() { getReservedBike() {
//this.loadingService.showLoader(); this.loadingService.showLoader();
this.storage.get('token').then((token) => { this.storage.get('token').then((token) => {
const headers = new HttpHeaders().set("Authorization", "Bearer " + token); const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
//call reserved bike api //call reserved bike api
...@@ -182,23 +184,32 @@ export class HirebikePage implements OnInit { ...@@ -182,23 +184,32 @@ export class HirebikePage implements OnInit {
this.bikeDetails = resp.data; this.bikeDetails = resp.data;
this.noReservation = false; this.noReservation = false;
this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon); this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon);
this.isBikeReserved = true;
//pass reserved bike subject here map //pass reserved bike subject here map
this.gotReservedBikeSubject.next(resp.data); this.gotReservedBikeSubject.next(resp.data);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
}, (reservedBikeError) => { }, (reservedBikeError) => {
console.log(reservedBikeError); console.log(reservedBikeError);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.isBikeReserved = false;
}); });
} else {
this.loadingService.hideLoader();
this.isBikeReserved = false;
} }
}, (bikeDetailsError) => { }, (bikeDetailsError) => {
console.log(bikeDetailsError); console.log(bikeDetailsError);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.isBikeReserved = false;
}); });
}); });
} }
startTrip() { startTrip() {
this.isBikeHired = true;
this.startRideSubject.next('some value');
this.loadingService.showLoader();
this.storage.get('token').then((token) => { this.storage.get('token').then((token) => {
const bikeId=this.bikeDetails.id; const bikeId=this.bikeDetails.id;
let url = 'http://193.196.52.237:8081/rent' + '?bikeId=' + this.bikeDetails.id; let url = 'http://193.196.52.237:8081/rent' + '?bikeId=' + this.bikeDetails.id;
...@@ -206,13 +217,12 @@ export class HirebikePage implements OnInit { ...@@ -206,13 +217,12 @@ export class HirebikePage implements OnInit {
let bikeApi = this.httpClient.get(url, { headers }); let bikeApi = this.httpClient.get(url, { headers });
bikeApi.subscribe((resp) => { bikeApi.subscribe((resp) => {
console.log('my data: ', resp); console.log('my data: ', resp);
this.feedbackService.setBikeid(this.bikeDetails.id); this.loadingService.hideLoader();
//this.loadingService.hideLoader();
this.toastService.showToast("Trip Started"); this.toastService.showToast("Trip Started");
this.isBikeHired = true; this.isBikeHired = true;
}, (error) => { }, (error) => {
console.log(error); console.log(error);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.toastService.showToast("This is ongoing Trip"); this.toastService.showToast("This is ongoing Trip");
}); });
}); });
...@@ -225,19 +235,19 @@ export class HirebikePage implements OnInit { ...@@ -225,19 +235,19 @@ export class HirebikePage implements OnInit {
} }
CancelTrip() { CancelTrip() {
//this.loadingService.showLoader(); this.loadingService.showLoader();
this.storage.get('token').then((token) => { this.storage.get('token').then((token) => {
let url = 'http://193.196.52.237:8081/rent' + '?bikeId=' + this.bikeDetails.id; let url = 'http://193.196.52.237:8081/rent' + '?bikeId=' + this.bikeDetails.id;
const headers = new HttpHeaders().set("Authorization", "Bearer " + token); const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
let bikeApi = this.httpClient.delete(url, { headers }); let bikeApi = this.httpClient.delete(url, { headers });
bikeApi.subscribe((resp) => { bikeApi.subscribe((resp) => {
console.log('my data: ', resp); console.log('my data: ', resp);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.toastService.showToast("Trip Ended!"); this.toastService.showToast("Trip Ended!");
this.router.navigateByUrl('/feedback'); this.router.navigateByUrl('/feedback');
}, (error) => { }, (error) => {
console.log(error); console.log(error);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.toastService.showToast("No Ongong Trip to End") this.toastService.showToast("No Ongong Trip to End")
}); });
}); });
......
...@@ -145,7 +145,7 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -145,7 +145,7 @@ export class HomePage implements OnInit, OnDestroy {
} }
getBikesList() { getBikesList() {
//this.loadingService.showLoader(); this.loadingService.showLoader();
this.storage.get('token').then((token) => { this.storage.get('token').then((token) => {
let url = 'http://193.196.52.237:8081/bikes' + '?lat=' + this.currentUserPosition.lat + '&lng=' + this.currentUserPosition.lng; let url = 'http://193.196.52.237:8081/bikes' + '?lat=' + this.currentUserPosition.lat + '&lng=' + this.currentUserPosition.lng;
const headers = new HttpHeaders().set("Authorization", "Bearer " + token); const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
...@@ -158,9 +158,9 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -158,9 +158,9 @@ export class HomePage implements OnInit, OnDestroy {
this.reverseGeocode(this.platform, this.bikes[i].lat, this.bikes[i].lon, i); this.reverseGeocode(this.platform, this.bikes[i].lat, this.bikes[i].lon, i);
} }
this.showBikesOnMap(); this.showBikesOnMap();
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
}, (error) => {console.log(error) }, (error) => {console.log(error)
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
}); });
}); });
} }
...@@ -261,7 +261,7 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -261,7 +261,7 @@ export class HomePage implements OnInit, OnDestroy {
reserveBike() { reserveBike() {
//this.selectedBike=bikeS; //this.selectedBike=bikeS;
//this.loadingService.showLoader(); this.loadingService.showLoader();
this.storage.get('token').then((token) => { this.storage.get('token').then((token) => {
let url = 'http://193.196.52.237:8081/reservation' + '?bikeId=' + this.selectedBike.id; let url = 'http://193.196.52.237:8081/reservation' + '?bikeId=' + this.selectedBike.id;
const headers = new HttpHeaders().set("Authorization", "Bearer " + token); const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
...@@ -271,10 +271,10 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -271,10 +271,10 @@ export class HomePage implements OnInit, OnDestroy {
this.isBikeReserved = true; this.isBikeReserved = true;
this.toastService.showToast("Reservation Successful!"); this.toastService.showToast("Reservation Successful!");
this.router.navigateByUrl('/myreservation'); this.router.navigateByUrl('/myreservation');
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
}, (error) => { }, (error) => {
console.log(error); console.log(error);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.toastService.showToast("Only one bike may be reserved or rented at a time"); this.toastService.showToast("Only one bike may be reserved or rented at a time");
}); });
}); });
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
<div #mapElement style="width: 100%; height: 100%" id="mapContainer" *ngIf="isBikeReserved"></div> <div #mapElement style="width: 100%; height: 100%" id="mapContainer" *ngIf="isBikeReserved"></div>
<ion-fab class="get-position" vertical="bottom" horizontal="end" (click)="getCurrentPosition()" slot="fixed"> <ion-fab *ngIf="isBikeReserved" class="get-position" vertical="bottom" horizontal="end" (click)="getCurrentPosition()" slot="fixed">
<ion-fab-button> <ion-fab-button>
<ion-icon name="locate"></ion-icon> <ion-icon name="locate"></ion-icon>
</ion-fab-button> </ion-fab-button>
......
...@@ -131,7 +131,7 @@ export class MyreservationPage implements OnInit { ...@@ -131,7 +131,7 @@ export class MyreservationPage implements OnInit {
} }
getReservedBike() { getReservedBike() {
//this.loadingService.showLoader(); this.loadingService.showLoader();
this.storage.get('token').then((token) => { this.storage.get('token').then((token) => {
const headers = new HttpHeaders().set("Authorization", "Bearer " + token); const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
//call reserved bike api //call reserved bike api
...@@ -147,7 +147,7 @@ export class MyreservationPage implements OnInit { ...@@ -147,7 +147,7 @@ export class MyreservationPage implements OnInit {
let bikeDetailsApi = this.httpClient.get(bikeDetailsUrl, { headers }); let bikeDetailsApi = this.httpClient.get(bikeDetailsUrl, { headers });
bikeDetailsApi.subscribe((resp: any) => { bikeDetailsApi.subscribe((resp: any) => {
console.log('Bike Details', resp); console.log('Bike Details', resp);
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
this.bikeDetails = resp.data; this.bikeDetails = resp.data;
this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon); this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon);
this.isBikeReserved = true; this.isBikeReserved = true;
...@@ -163,13 +163,16 @@ export class MyreservationPage implements OnInit { ...@@ -163,13 +163,16 @@ export class MyreservationPage implements OnInit {
console.log(error.message); console.log(error.message);
}); });
}, (reservedBikeError) => { }, (reservedBikeError) => {
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
console.log(reservedBikeError); console.log(reservedBikeError);
this.isBikeReserved = false; this.isBikeReserved = false;
}); });
} else {
this.loadingService.hideLoader();
this.isBikeReserved = false;
} }
}, (bikeDetailsError) => { }, (bikeDetailsError) => {
//this.loadingService.hideLoader(); this.loadingService.hideLoader();
console.log(bikeDetailsError) console.log(bikeDetailsError)
this.isBikeReserved = false; this.isBikeReserved = false;
}); });
......
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ResetPasswordPage } from './reset-password.page';
const routes: Routes = [
{
path: '',
component: ResetPasswordPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ResetPasswordPageRoutingModule {}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ResetPasswordPageRoutingModule } from './reset-password-routing.module';
import { ResetPasswordPage } from './reset-password.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ResetPasswordPageRoutingModule
],
declarations: [ResetPasswordPage]
})
export class ResetPasswordPageModule {}
<ion-header>
<ion-toolbar>
<ion-title>Reset Password</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<form>
<ion-grid>
<ion-row justify-content-center>
<ion-col align-self-center size-md="6" size-lg="5" size-xs="12">
<div padding>
<img src="../../../assets/images/bike2gologo.png">
</div>
<div class="ion-text">
<h3>Reset Password</h3>
</div>
<ion-item ><ion-input type="text" disabled="true" placeholder="Bob@mail.com"></ion-input></ion-item>
<ion-item ><ion-input type="password" placeholder="Old Password"></ion-input></ion-item>
<ion-item ><ion-input type="password" placeholder="New Password"></ion-input></ion-item>
<ion-item ><ion-input type="password" placeholder="Confirm Password"></ion-input></ion-item>
<div padding>
<ion-button size="large" expand="block" (click)="resetPassword()">Reset Password</ion-button>
</div>
<div padding>
<ion-button size="large" expand="block" (click)="login()">Login</ion-button>
</div>
</ion-col>
</ion-row>
</ion-grid>
</form>
</ion-content>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ResetPasswordPage } from './reset-password.page';
describe('ResetPasswordPage', () => {
let component: ResetPasswordPage;
let fixture: ComponentFixture<ResetPasswordPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ResetPasswordPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ResetPasswordPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment