diff --git a/package.json b/package.json index 01025e7a896de2a0ce3f087a03a6566498c6724b..15a835ffd2f18fcbacc82937187f05ff2e185526 100644 --- a/package.json +++ b/package.json @@ -88,4 +88,4 @@ "browser" ] } -} \ No newline at end of file +} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 66e2d1e1854193803d2ad5d09cc4f83ab2c2d65e..11aa6fd16aa66096bb18ebe906846418ce2a53f5 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -35,12 +35,12 @@ const routes: Routes = [ loadChildren: () => import('./ridehistory/ridehistory.module').then( m => m.RidehistoryPageModule) }, { - path: 'feedback', - loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule) + path: 'help-line', + loadChildren: () => import('./help-line/help-line.module').then( m => m.HelpLinePageModule) }, { - path: 'feedback', - loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule) + path: 'reset-password', + loadChildren: () => import('./reset-password/reset-password.module').then( m => m.ResetPasswordPageModule) } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1d2730ed11fb6fbf6e4a5c207215189ee071492b..39fccb2320eb5866961931152d278a765248213f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -27,11 +27,11 @@ export class AppComponent { { title: 'My Reservation', url: '/myreservation', - icon: 'clipboard' + icon: 'cart' }, { title: 'My Rides', url: '/hirebike', - icon: 'clipboard' + icon: 'bicycle' }, { title: 'Ride History', @@ -39,9 +39,9 @@ export class AppComponent { icon: 'clipboard' }, { - title: 'Feedback', - url: '/feedback', - icon: 'clipboard' + title: 'Help', + url: '/help-line', + icon: 'call' }, { title: 'Logout', diff --git a/src/app/auth/login/login.page.html b/src/app/auth/login/login.page.html index 5562a831129cd506a6a8b61a439d8683370414dd..68710322b8eeabb976182fba7506adeb062cd454 100644 --- a/src/app/auth/login/login.page.html +++ b/src/app/auth/login/login.page.html @@ -31,7 +31,10 @@ <div padding> <ion-button size="large" expand="block" (click)="login()">Login</ion-button> + <a href="../../reset-password">Forgot your Password?</a> + </div> + <div padding> <ion-button size="large" expand="block" (click)="register()">Click here to Register</ion-button> </div> diff --git a/src/app/help-line/help-line-routing.module.ts b/src/app/help-line/help-line-routing.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..048c67d0f83404beb0fa6336f0c44b3b3bcd0148 --- /dev/null +++ b/src/app/help-line/help-line-routing.module.ts @@ -0,0 +1,17 @@ +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 {} diff --git a/src/app/help-line/help-line.module.ts b/src/app/help-line/help-line.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cc0b579c2ff90db1b2a3db0a3f7b0424e81d76a --- /dev/null +++ b/src/app/help-line/help-line.module.ts @@ -0,0 +1,20 @@ +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 {} diff --git a/src/app/help-line/help-line.page.html b/src/app/help-line/help-line.page.html new file mode 100644 index 0000000000000000000000000000000000000000..64bdbf7d67da62edc470d0ec53aa23001b1e92b5 --- /dev/null +++ b/src/app/help-line/help-line.page.html @@ -0,0 +1,58 @@ + <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 diff --git a/src/app/help-line/help-line.page.scss b/src/app/help-line/help-line.page.scss new file mode 100644 index 0000000000000000000000000000000000000000..94f1aa687041ecf6c9d7d2171b9ac5b1521960a1 --- /dev/null +++ b/src/app/help-line/help-line.page.scss @@ -0,0 +1,38 @@ +.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%); + } diff --git a/src/app/help-line/help-line.page.spec.ts b/src/app/help-line/help-line.page.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..f9171335714773c0cf02df9af71c1e3d14b8ddb1 --- /dev/null +++ b/src/app/help-line/help-line.page.spec.ts @@ -0,0 +1,24 @@ +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(); + }); +}); diff --git a/src/app/help-line/help-line.page.ts b/src/app/help-line/help-line.page.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8038b784652a4f786e4cdc39901168391f7e9a3 --- /dev/null +++ b/src/app/help-line/help-line.page.ts @@ -0,0 +1,15 @@ +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() { + } + +} diff --git a/src/app/hirebike/hirebike.page.html b/src/app/hirebike/hirebike.page.html index f751de63af63648306a7f490a048a421954c5574..84899f28266f0e0b47b91b7b8098247d71e8557a 100644 --- a/src/app/hirebike/hirebike.page.html +++ b/src/app/hirebike/hirebike.page.html @@ -20,15 +20,20 @@ </div--> <!--div #mapElement style="width: 100%; height: 100%" id="mapContainer"></div--> <!--app-here-map [startRideSubject]="startRideSubject" [gotReservedBikeSubject]="gotReservedBikeSubject"></app-here-map--> - <div #mapElement style="width: 100%; height: 100%" id="mapContainer" *ngIf="!is3DChecked"></div> - <ion-fab class="get-position" vertical="bottom" horizontal="end" (click)="getCurrentPosition()" slot="fixed"> + <ion-card *ngIf="!isBikeReserved"> + <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-icon name="locate"></ion-icon> </ion-fab-button> </ion-fab> </ion-content> <ion-footer> - <div class="bike-details-container"> + <div class="bike-details-container" *ngIf="isBikeReserved"> <div class="inner"> <div class="button-container"> diff --git a/src/app/hirebike/hirebike.page.ts b/src/app/hirebike/hirebike.page.ts index 3e80d7fd92b8519ec410c89e2038590c88028534..0b8f626f6d1099528efe89aaf5c12dfba0369a40 100644 --- a/src/app/hirebike/hirebike.page.ts +++ b/src/app/hirebike/hirebike.page.ts @@ -28,6 +28,8 @@ export class HirebikePage implements OnInit { isBikeHired = false; noReservation = true; + isBikeReserved = true; + currentRoute: any; routeSummary: any; wayPointsInfo:any; @@ -163,7 +165,7 @@ export class HirebikePage implements OnInit { } getReservedBike() { - //this.loadingService.showLoader(); + this.loadingService.showLoader(); this.storage.get('token').then((token) => { const headers = new HttpHeaders().set("Authorization", "Bearer " + token); //call reserved bike api @@ -182,23 +184,32 @@ export class HirebikePage implements OnInit { this.bikeDetails = resp.data; this.noReservation = false; this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon); + this.isBikeReserved = true; //pass reserved bike subject here map this.gotReservedBikeSubject.next(resp.data); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); }, (reservedBikeError) => { console.log(reservedBikeError); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); + this.isBikeReserved = false; }); + } else { + this.loadingService.hideLoader(); + this.isBikeReserved = false; } }, (bikeDetailsError) => { console.log(bikeDetailsError); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); + this.isBikeReserved = false; }); }); } startTrip() { + this.isBikeHired = true; + this.startRideSubject.next('some value'); + this.loadingService.showLoader(); this.storage.get('token').then((token) => { const 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 { let bikeApi = this.httpClient.get(url, { headers }); bikeApi.subscribe((resp) => { console.log('my data: ', resp); - this.feedbackService.setBikeid(this.bikeDetails.id); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); this.toastService.showToast("Trip Started"); this.isBikeHired = true; }, (error) => { console.log(error); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); this.toastService.showToast("This is ongoing Trip"); }); }); @@ -225,19 +235,19 @@ export class HirebikePage implements OnInit { } CancelTrip() { - //this.loadingService.showLoader(); + this.loadingService.showLoader(); this.storage.get('token').then((token) => { let url = 'http://193.196.52.237:8081/rent' + '?bikeId=' + this.bikeDetails.id; const headers = new HttpHeaders().set("Authorization", "Bearer " + token); let bikeApi = this.httpClient.delete(url, { headers }); bikeApi.subscribe((resp) => { console.log('my data: ', resp); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); this.toastService.showToast("Trip Ended!"); this.router.navigateByUrl('/feedback'); }, (error) => { console.log(error); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); this.toastService.showToast("No Ongong Trip to End") }); }); diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 660a59a62ec8315d6a877939b9dae6b3c70f2ea7..454eeeb470653d7104fdb9821ed28f80a03ffd7e 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -145,7 +145,7 @@ export class HomePage implements OnInit, OnDestroy { } getBikesList() { - //this.loadingService.showLoader(); + this.loadingService.showLoader(); this.storage.get('token').then((token) => { 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); @@ -158,9 +158,9 @@ export class HomePage implements OnInit, OnDestroy { this.reverseGeocode(this.platform, this.bikes[i].lat, this.bikes[i].lon, i); } this.showBikesOnMap(); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); }, (error) => {console.log(error) - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); }); }); } @@ -261,7 +261,7 @@ export class HomePage implements OnInit, OnDestroy { reserveBike() { //this.selectedBike=bikeS; - //this.loadingService.showLoader(); + this.loadingService.showLoader(); this.storage.get('token').then((token) => { let url = 'http://193.196.52.237:8081/reservation' + '?bikeId=' + this.selectedBike.id; const headers = new HttpHeaders().set("Authorization", "Bearer " + token); @@ -271,10 +271,10 @@ export class HomePage implements OnInit, OnDestroy { this.isBikeReserved = true; this.toastService.showToast("Reservation Successful!"); this.router.navigateByUrl('/myreservation'); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); }, (error) => { console.log(error); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); this.toastService.showToast("Only one bike may be reserved or rented at a time"); }); }); diff --git a/src/app/myreservation/myreservation.page.html b/src/app/myreservation/myreservation.page.html index dc8c4e3bec0ef53bf1923041f387c15044ed5ada..5ce253d44f9b082ced093b1c6f81be3b7e7b08f6 100644 --- a/src/app/myreservation/myreservation.page.html +++ b/src/app/myreservation/myreservation.page.html @@ -16,7 +16,7 @@ </ion-card-content> </ion-card> <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-icon name="locate"></ion-icon> </ion-fab-button> diff --git a/src/app/myreservation/myreservation.page.ts b/src/app/myreservation/myreservation.page.ts index 20d9b3f718fd273876a150a9b74d8730ee663042..bffb67acdf5245ce645c54d6b73c282f6773c92c 100644 --- a/src/app/myreservation/myreservation.page.ts +++ b/src/app/myreservation/myreservation.page.ts @@ -131,7 +131,7 @@ export class MyreservationPage implements OnInit { } getReservedBike() { - //this.loadingService.showLoader(); + this.loadingService.showLoader(); this.storage.get('token').then((token) => { const headers = new HttpHeaders().set("Authorization", "Bearer " + token); //call reserved bike api @@ -147,7 +147,7 @@ export class MyreservationPage implements OnInit { let bikeDetailsApi = this.httpClient.get(bikeDetailsUrl, { headers }); bikeDetailsApi.subscribe((resp: any) => { console.log('Bike Details', resp); - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); this.bikeDetails = resp.data; this.reverseGeocode(this.platform, this.bikeDetails.lat, this.bikeDetails.lon); this.isBikeReserved = true; @@ -163,13 +163,16 @@ export class MyreservationPage implements OnInit { console.log(error.message); }); }, (reservedBikeError) => { - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); console.log(reservedBikeError); this.isBikeReserved = false; }); + } else { + this.loadingService.hideLoader(); + this.isBikeReserved = false; } }, (bikeDetailsError) => { - //this.loadingService.hideLoader(); + this.loadingService.hideLoader(); console.log(bikeDetailsError) this.isBikeReserved = false; }); diff --git a/src/app/reset-password/reset-password-routing.module.ts b/src/app/reset-password/reset-password-routing.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..335ad7782c9d13b507b11957c05fd623f4763194 --- /dev/null +++ b/src/app/reset-password/reset-password-routing.module.ts @@ -0,0 +1,17 @@ +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 {} diff --git a/src/app/reset-password/reset-password.module.ts b/src/app/reset-password/reset-password.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..30e0cd0b2c4ce8007ab7f512c40435be967ea959 --- /dev/null +++ b/src/app/reset-password/reset-password.module.ts @@ -0,0 +1,20 @@ +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 {} diff --git a/src/app/reset-password/reset-password.page.html b/src/app/reset-password/reset-password.page.html new file mode 100644 index 0000000000000000000000000000000000000000..055104ba0b62d67805c874a03700f729d67ecb34 --- /dev/null +++ b/src/app/reset-password/reset-password.page.html @@ -0,0 +1,42 @@ +<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 diff --git a/src/app/reset-password/reset-password.page.scss b/src/app/reset-password/reset-password.page.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/reset-password/reset-password.page.spec.ts b/src/app/reset-password/reset-password.page.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..5628db6d2b7cef64da8482e0a8764ec079d1c638 --- /dev/null +++ b/src/app/reset-password/reset-password.page.spec.ts @@ -0,0 +1,24 @@ +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(); + }); +}); diff --git a/src/app/reset-password/reset-password.page.ts b/src/app/reset-password/reset-password.page.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0395c2078352ee2408f0e3e13d96c720ce90599 --- /dev/null +++ b/src/app/reset-password/reset-password.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-reset-password', + templateUrl: './reset-password.page.html', + styleUrls: ['./reset-password.page.scss'], +}) +export class ResetPasswordPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/assets/images/Questions.png b/src/assets/images/Questions.png new file mode 100644 index 0000000000000000000000000000000000000000..f71294b2502734281caeb6187f08f7adfd726f73 Binary files /dev/null and b/src/assets/images/Questions.png differ