From 12c7ce5fa6c8add39ecbcec3523569a2eee99a27 Mon Sep 17 00:00:00 2001 From: awstin17 Date: Mon, 26 Nov 2018 21:06:13 -0800 Subject: [PATCH] Deleted all requests to databases made in dashboard, history, timeline, login pages, as well as the chart provider and timeline component --- src/components/timeline/timeline.ts | 4 ++-- src/pages/dashboard/dashboard.ts | 6 +++++- src/pages/login/login.ts | 17 +++++++++++++++-- src/providers/chart/chart.ts | 24 +++++++++++++++++++++--- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/components/timeline/timeline.ts b/src/components/timeline/timeline.ts index 7db06522..a6e71b20 100644 --- a/src/components/timeline/timeline.ts +++ b/src/components/timeline/timeline.ts @@ -28,13 +28,13 @@ export class TimelineComponent { { title: 'Find out your separation date', checkmark: true, - completed: false, + completed: true, children: [] }, { title: 'Complete Pre-Separation Counseling', checkmark: true, - completed: false, + completed: true, children: [] } ] diff --git a/src/pages/dashboard/dashboard.ts b/src/pages/dashboard/dashboard.ts index e9aeb1f6..a3982297 100644 --- a/src/pages/dashboard/dashboard.ts +++ b/src/pages/dashboard/dashboard.ts @@ -16,6 +16,8 @@ export class DashboardPage { constructor(public navCtrl: NavController, public navParams: NavParams,public chartProvider: ChartProvider, private toastCtrl: ToastController, private storage: Storage) { } + /* commenting out for demo + ionViewWillLoad() { this.storage.get('userInfo').then((val) => { this.name = val ? `${val.firstName} ${val.lastName}` : ''; @@ -25,13 +27,15 @@ export class DashboardPage { }).then(() => this.lastDate()) } + End of comment for demo */ + toTimeline() { this.navCtrl.setRoot(TimelinePage); } lastDate() { let toast = this.toastCtrl.create({ - message: `Your last assessment was ${this.date}`, + message: `Your last assessment was on 11/17/2018`, duration: 2500, position: 'middle' }); diff --git a/src/pages/login/login.ts b/src/pages/login/login.ts index bb70b7e6..5d0e421f 100644 --- a/src/pages/login/login.ts +++ b/src/pages/login/login.ts @@ -13,6 +13,7 @@ import { ChartProvider } from '../../providers/chart/chart'; }) export class LoginPage { + /* Commenting out for demo dummyChart: any = { Date: "10/29/2018", Data: [8, 2, 5, 10, 3, 5, 6, 8] @@ -21,10 +22,12 @@ export class LoginPage { getDummyChart: any user: any userId: any - - private loginCreds : FormGroup; loginResponse: any; + End comment for demo */ + + private loginCreds : FormGroup; + constructor(public navCtrl: NavController, public navParams: NavParams, public _userService: UserProvider, @@ -46,6 +49,8 @@ export class LoginPage { */ login() { + /* Commenting out for the demo + this._userService.login(this.loginCreds.value) .subscribe( (res) => { @@ -85,12 +90,18 @@ export class LoginPage { toast.present() } ) + + Comment end for demo */ + + this.toDashboard(); } toRegisterPage() { this.navCtrl.push(RegisterPage) } + /*Commenting out for demo + getChartData() { this.chartProvider.getChartHistory() .subscribe((res) => { @@ -104,6 +115,8 @@ export class LoginPage { ); } + End comment for demo */ + toDashboard() { let toast = this.toastCtrl.create({ message: "Login successful!", diff --git a/src/providers/chart/chart.ts b/src/providers/chart/chart.ts index 4813e343..7046966f 100644 --- a/src/providers/chart/chart.ts +++ b/src/providers/chart/chart.ts @@ -6,14 +6,32 @@ import { ENV } from '@app/env'; @Injectable() export class ChartProvider { - chartHistory: any; // Data for the history page - mostRecentChart: any = [0, 0, 0, 0, 0, 0, 0, 0]; // Data for the chart on the dashboard page + chartHistory: any = [ + { date: "11/26/2018", + data: [10, 8, 9, 6, 9, 10, 6, 4] + }, + { + date: "8/26/2018", + data: [9, 8, 8, 6, 7, 10, 8, 5] + }, + { + date: "5/26/2018", + data: [5, 6, 9, 3, 2, 10, 6, 4] + } + ]; // Data for the history page + + mostRecentChart: any = [10, 8, 9, 6, 9, 10, 6, 4]; // Data for the chart on the dashboard page assessmentChartData: any = [0, 0, 0, 0, 0, 0, 0, 0]; // Range sliders on transition page are ngmodeled to this array - requestUrl: string = ENV.url + + //Commenting the variable below out for demo + //requestUrl: string = ENV.url constructor(public http: HttpClient) { } + /* Commenting out for the demo + getChartHistory() { return this.http.get(this.requestUrl + '/appUsers/' + sessionStorage.getItem('userId') + '/charts') } + End of comment for the demo */ }