Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/pages/dashboard/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,4 @@ export class DashboardPage {
toNews() {
this.navCtrl.push(NewsPage);
}

}
5 changes: 4 additions & 1 deletion src/pages/login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ export class LoginPage {

logInCheck() {
let activeId = window.sessionStorage.getItem('userId');

console.log('%c Checking for existing user credentials.', 'background: yellow; color: black; display: block;')
if (activeId != null) {
this.menuCtrl.enable(true);
this.menuCtrl.swipeEnable(true);
this.firstTimeUserCheck()
console.log('%c User credentials found.', 'background: blue; color: white; display: block;')
} else {
console.log('%c User credentials not found.', 'background: red; color: white; display: block;')
}
}
}
41 changes: 20 additions & 21 deletions src/pages/timeline/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,31 @@
</ion-header>


<ion-content >
<ion-content>
<ion-grid>
<div id='outter'>
<ion-row id='row'>
<ion-segment mode="md">
<ion-segment-button (click)="slide(0)" value='null'>
<span>Getting Out</span>
</ion-segment-button>
<ion-segment-button (click)="slide(1)" value='null'>
<span>Starting Up</span>
</ion-segment-button>
<ion-segment-button (click)="slide(2)" value='null'>
<span>Self Care</span>
</ion-segment-button>
<ion-segment-button (click)="slide(3)" value='null'>
<span>Reinventing Myself</span>
</ion-segment-button>
<ion-segment-button (click)="slide(4)" value='null'>
<span>Settling Down</span>
</ion-segment-button>
</ion-segment>
</ion-row>
<ion-row id='row'>
<ion-segment mode="md">
<ion-segment-button id='seg0' (click)="slide(0)" value='1'>
<span>Getting Out</span>
</ion-segment-button>
<ion-segment-button id='seg1' (click)="slide(1)" value='2'>
<span>Starting Up</span>
</ion-segment-button>
<ion-segment-button id='seg2' (click)="slide(2)" value='3'>
<span>Self Care</span>
</ion-segment-button>
<ion-segment-button id='seg3' (click)="slide(3)" value='4'>
<span>Reinventing Myself</span>
</ion-segment-button>
<ion-segment-button id='seg4' (click)="slide(4)" value='5'>
<span>Settling Down</span>
</ion-segment-button>
</ion-segment>
</ion-row>
</div>
</ion-grid>

<div><div></div></div>
<ion-slides #slides>
<div *ngFor="let goal of goals; let i = index">
<ion-slide style='overflow-x: scroll; padding-bottom: 60px'>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/timeline/timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ page-timeline {
}

}

::-webkit-scrollbar {
display: none;
}
}


11 changes: 9 additions & 2 deletions src/pages/timeline/timeline.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { NavController, NavParams, Slides } from 'ionic-angular';
import { NavController, NavParams, Slides, Content } from 'ionic-angular';
import { ViewChild } from '@angular/core';
import { TimelineProvider } from '../../providers/timeline/timeline';

Expand All @@ -9,7 +9,8 @@ import { TimelineProvider } from '../../providers/timeline/timeline';
})
export class TimelinePage {
@ViewChild('slides') slides: Slides;

// @ViewChild(Content) content: Content;

constructor(public navCtrl: NavController,
public navParams: NavParams,
public timelineProvider: TimelineProvider) {}
Expand Down Expand Up @@ -348,6 +349,7 @@ public goals:any = [
this.slides.lockSwipes(false);
this.slides.slideTo(x);
this.slides.lockSwipes(true);
this.scrollTo(x);
}

updateProgress() {
Expand Down Expand Up @@ -388,4 +390,9 @@ public goals:any = [
}
}

scrollTo(x) {
var elmnt = document.getElementById('seg' + x);
elmnt.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
}

}
19 changes: 15 additions & 4 deletions src/providers/timeline/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,20 @@ export class TimelineProvider {
this.getExisitingTimelineInstance()
.subscribe(response => {
this.timelineObj = response;
console.log('%c Timeline instance data loaded.', 'background: green; color: white; display: block;')
console.log('%c Timeline instance data loaded.', 'background: blue; color: white; display: block;')
this.updatedTimelineObj.id = this.timelineObj.id
this.checkbox = this.timelineObj.content;
},
error => {
console.log('%c Timeline instance not found.', 'background: red; color: white; display: block;')
this.setUserId()
this.postTimeline()
if(error.status == '404') {
console.log('%c Error ' + error.status + ' ' + error.statusText + ' ', 'background: red; color: white; display: block;')
this.setUserId()
this.postTimeline()
} else {
console.log('%c Error ' + error.status + ' ' + error.statusText + ' ', 'background: red; color: white; display: block;')
}

})
}

Expand All @@ -72,12 +78,17 @@ export class TimelineProvider {
this.updatedTimelineObj.content = obj
this.updateExisitingTimelineInstace()
.subscribe(response => {
console.log('%c Timeline instance updated.', 'background: blue; color: white; display: block;')
console.log('%c Timeline instance updated.', 'background: green; color: white; display: block;')
},
error => {
console.log('%c Error updating timeline instance.', 'background: red; color: white; display: block;')
console.log('%c Error ' + error.status + ' ' + error.statusText + ' ', 'background: red; color: white; display: block;')
})
}

setUserId() {
this.newTimelineObj.appUserId = window.sessionStorage.getItem("userId")
this.updatedTimelineObj.appUserId = window.sessionStorage.getItem("userId")
}

}