diff --git a/src/components/chart/chart.ts b/src/components/chart/chart.ts
index ed166e1b..9fb4e2a6 100644
--- a/src/components/chart/chart.ts
+++ b/src/components/chart/chart.ts
@@ -1,83 +1,158 @@
import { ChartProvider } from './../../providers/chart/chart';
-import { Component, ViewChild} from '@angular/core';
+import { Component, ViewChild } from '@angular/core';
import { Chart } from 'chart.js';
// import 'chartjs-plugin-labelsreboot';
/**
+
* Generated class for the ChartComponent component.
+
*
+
* See https://angular.io/api/core/Component for more info on Angular
+
* Components.
+
*/
-@Component({
+
+@Component( {
+
selector: 'chart',
+
templateUrl: 'chart.html'
-})
+
+} )
+
export class ChartComponent {
- @ViewChild('canvas') canvas;
+ @ViewChild( 'canvas' ) canvas;
chart: any;
+
chartValues: any;
- constructor(public chartProvider: ChartProvider) {
+
+ constructor ( public chartProvider: ChartProvider ) {
+
//this subscribes to the provider which gets the data from the DB
- this.chartProvider.mostRecentData().subscribe(res=>{
+
+ this.chartProvider.mostRecentData().subscribe( res => {
+
//calls the function that draws the chart on the canvas within the .html file of the component taking the response from the provider as an argument.
- this.buildChart(res)
- })
+
+ this.buildChart( res )
+
+ } )
+
}
//this builds the chart, it takes one parameter, the parameter needs to be an array with a length of 8 numbers in order for the chart to draw correctly
- buildChart(data){
- if (data.length < 1) return
- this.chart = new Chart(this.canvas.nativeElement, {
+
+ buildChart ( data ) {
+
+ if ( data.length < 1 ) return
+
+ this.chart = new Chart( this.canvas.nativeElement, {
+
type: 'polarArea',
- data: { labels: ["Career", "Finances", "Personal \n Growth", "Health", "Family", "Relationships", "Social life", "Attitude"],
- datasets: [
- {
- backgroundColor: ["rgba(0,0,255, .6)", "rgba(255,0,0, .6)", "rgba(128,0,128, .6)", "rgba(0,128,0, .6)", "rgba(255,165,0, .6)", "rgba(0,128,128, .6)", "rgba(255,0,255, .6)", "rgba(0,255,0, .6)"],
- borderColor: "black",
- //data is the argument passed into the function.
- data: data
- }
- ]
+
+ data: {
+
+ labels: [ "Career", "Finances", "Personal \n Growth", "Health", "Family", "Relationships", "Social life", "Attitude" ],
+
+ datasets: [
+
+ {
+
+ backgroundColor: [ "rgba(0,0,255, .6)", "rgba(255,0,0, .6)", "rgba(128,0,128, .6)", "rgba(0,128,0, .6)", "rgba(255,165,0, .6)", "rgba(0,128,128, .6)", "rgba(255,0,255, .6)", "rgba(0,255,0, .6)" ],
+
+ borderColor: "black",
+
+ //data is the argument passed into the function.
+
+ data: data
+
+ }
+
+ ]
+
},
+
options: {
+
//Set padding of the chart inside of the canvas element.
+
layout: {
+
padding: {
- top: 55,
- bottom: 55
+
+ top: 10,
+
+ bottom: 10
+
}
+
},
+
//Hides the chart legend.
+
legend: {
+
display: false
+
},
+
//Generates an event whenever a section of the chart has been clicked.
- 'onClick' : function(evt, item) {
- let clickedOn = this.chart.getElementAtEvent(evt)
- console.log(clickedOn)
+
+ 'onClick': function ( evt, item ) {
+
+ let clickedOn = this.chart.getElementAtEvent( evt )
+
+ console.log( clickedOn )
+
},
+
plugins: {
+
//labelsReboot is the chartjs-labels plugin that has been revised for this project
+
//to allow the labels to be anchored to the outer radius of the chart regardless of chart value
- labelsReboot: {
+
+ labelsReboot: {
+
render: 'label',
+
fontSize: 18,
+
fontStyle: 'bold',
- fontColor: ["rgba(0,0,255, .6)", "rgba(255,0,0, .6)", "rgba(128,0,128, .6)", "rgba(0,128,0, .6)", "rgba(255,165,0, .6)", "rgba(0,128,128, .6)", "rgba(255,0,255, .6)", "rgba(0,255,0, .6)"],
+
+ fontColor: [ "rgba(0,0,255, .6)", "rgba(255,0,0, .6)", "rgba(128,0,128, .6)", "rgba(0,128,0, .6)", "rgba(255,165,0, .6)", "rgba(0,128,128, .6)", "rgba(255,0,255, .6)", "rgba(0,255,0, .6)" ],
+
arc: true,
+
position: "outside",
+
overlap: true,
+
}
+
},
+
+ aspectRatio: 3,
+
+ maintainAspectRatio: true,
+
}
- });
+
+ } );
+
//This sets the ticks on the chart to always start at 0 and end at 10, utilizing the global API of the local chart.
+
this.chart.config.options.scale.ticks.min = 0;
+
this.chart.config.options.scale.ticks.max = 10;
+
this.chart.update();
+
}
-
+
}
diff --git a/src/components/timeline/timeline.scss b/src/components/timeline/timeline.scss
index 0e6425b1..abed636a 100644
--- a/src/components/timeline/timeline.scss
+++ b/src/components/timeline/timeline.scss
@@ -69,7 +69,8 @@ padding-left: 2em;
}
.item-checkbox {
- margin-left: 12%;
+ margin-left: 8%;
+ // margin-left: 12%;
}
.item-checkbox-checked {
@@ -135,18 +136,21 @@ padding-left: 2em;
}
.item.item-md .checkbox-md {
- margin: -6px 17px 8px -20px !important;
- padding-left: 4%;
- padding-top: 2%;
+ // margin: -6px 17px 8px -20px !important;
+ // padding-left: 4%;
+ // padding-top: 2%;
+ margin-right: 2%;
+ padding-left: 2%;
+ padding-right: 2%;
}
- .item-ios h2:last-child, .item-ios h3:last-child, .item-ios h4:last-child, .item-ios h5:last-child, .item-ios h6:last-child, .item-ios p:last-child {
- padding-left: 5% !important;
- }
+ // .item-ios h2:last-child, .item-ios h3:last-child, .item-ios h4:last-child, .item-ios h5:last-child, .item-ios h6:last-child, .item-ios p:last-child {
+ // padding-left: 5% !important;
+ // }
- h1:first-child,h2:first-child,h3:first-child,h4:first-child, h5:first-child, h6:first-child {
- margin-left: 2%;
- }
+ // h1:first-child,h2:first-child,h3:first-child,h4:first-child, h5:first-child, h6:first-child {
+ // margin-left: 2%;
+ // }
.bulletItem {
// padding-top: 1em;
diff --git a/src/components/timeline/timeline.ts b/src/components/timeline/timeline.ts
index cf403287..588822c4 100644
--- a/src/components/timeline/timeline.ts
+++ b/src/components/timeline/timeline.ts
@@ -82,13 +82,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.html b/src/pages/dashboard/dashboard.html
index f555c2dd..331ea584 100644
--- a/src/pages/dashboard/dashboard.html
+++ b/src/pages/dashboard/dashboard.html
@@ -17,12 +17,13 @@
- Hello, {{ this.name }}!
+ Hello, Peter!
+
-
+
Welcome to the Military and Veteran's "InTransition" Personal Transition Assistant. Your personal guide to
@@ -34,8 +35,8 @@ Hello, {{ this.name }}!
-
-
+
+
@@ -50,22 +51,23 @@ Hello, {{ this.name }}!
Being informed and prepared will make your transition into civilization easier to see what your next steps
are. The next step is:
+
{{ currentActionItem }}
- See what's next
+ See what's next
-
-
+
+
- More news
+ More news
@@ -76,20 +78,28 @@ {{ currentActionItem }}
-
+
-
-
+
+
+ Please complete a Self Assessment
+
+ Complete an assessment
+
+
+
+
+
-
+
- Learn More
+ Learn More
- \
+
diff --git a/src/pages/dashboard/dashboard.scss b/src/pages/dashboard/dashboard.scss
index 4fe04e87..f4ebb87f 100644
--- a/src/pages/dashboard/dashboard.scss
+++ b/src/pages/dashboard/dashboard.scss
@@ -9,8 +9,16 @@ page-dashboard {
font-size: 20px;
}
+ .button1{
+ width: 138px;
+ height:42px;
+ background-color: rgb(26, 39, 71);
+ padding: 0px;
+ }
+
.cards {
- background-color: color($colors, light)
+ background-color: color($colors, light);
+ position: relative;
}
.sep {
@@ -53,6 +61,16 @@ page-dashboard {
padding-left: 5px
}
+ .row2 {
+ min-height: 35vh;
+ }
+
+ .dashboardLinks {
+ position:absolute;
+ bottom:0;
+ right: 1vw;
+ }
+
#networkingContent {
padding: 0px 16px;
display: flex;
@@ -75,11 +93,17 @@ page-dashboard {
padding-left: 20px;
}
- #networkingLink {
- padding-top: 0px;
- position: relative;
- top: -7px;
- font-size: 20px;
+ @media (max-width: 1100px) and (min-width: 700px) {
+ .row2 {
+ min-height: 25vh;
+ }
+ }
+
+ #networkingLink {
+ padding-top: 0px;
+ position: relative;
+ top: -7px;
+ font-size: 20px;
}
}
diff --git a/src/pages/dashboard/dashboard.ts b/src/pages/dashboard/dashboard.ts
index 0f5f3c23..2c38498b 100644
--- a/src/pages/dashboard/dashboard.ts
+++ b/src/pages/dashboard/dashboard.ts
@@ -7,6 +7,7 @@ import { UserProvider } from '../../providers/user/user';
import * as moment from 'moment';
import { NewsPage } from '../news/news';
import { ActionItemProvider } from '../../providers/action-item/action-item';
+import { SelfAssessmentPage } from '../self-assessment/self-assessment';
interface UserData {
firstName: any,
@@ -23,7 +24,8 @@ export class DashboardPage {
assessDate: any
daysTilSep: any
daysTilSepAbs: any
- currentActionItem
+ currentActionItem: String;
+ prevAssess: boolean = false;
constructor(public navCtrl: NavController,
public navParams: NavParams,
@@ -35,6 +37,8 @@ export class DashboardPage {
this.currentActionItem = this.actionItem.currentItem;
}
+ // commenting out for demo
+
ionViewWillLoad() {
// this.storage.get('userInfo').then((val) => {
// this.name = val ? `${val.firstName} ${val.lastName}` : '';
@@ -56,6 +60,7 @@ export class DashboardPage {
this.user.getUserChart(window.sessionStorage.getItem('userId'))
.subscribe( (data: Array) => {
if (!data.length) return
+ this.prevAssess = true;
this.assessDate = moment(data[0].date.substring(0,10), "YYYY-MM-DD").toDate().getTime();
let now = new Date().getTime();
this.assessDate = Math.ceil((this.assessDate - now)/86400000);
@@ -67,6 +72,12 @@ export class DashboardPage {
});
}
+ toSelfAssessment() {
+ this.navCtrl.setRoot(SelfAssessmentPage);
+ }
+
+ // End of comment for demo */
+
toTimeline() {
this.navCtrl.setRoot(TimelinePage);
}
diff --git a/src/pages/history/history.html b/src/pages/history/history.html
index 066bb969..959c226b 100644
--- a/src/pages/history/history.html
+++ b/src/pages/history/history.html
@@ -15,7 +15,7 @@
-
+
Self Assessment History
@@ -27,7 +27,7 @@
-
+
Self Assessments Over Time
diff --git a/src/pages/history/history.scss b/src/pages/history/history.scss
index 8d9ba9db..f0d6efdc 100644
--- a/src/pages/history/history.scss
+++ b/src/pages/history/history.scss
@@ -1,4 +1,5 @@
page-history {
+
ion-card-title {
text-align: center;
}
@@ -17,4 +18,18 @@ page-history {
#self-assessment-table .odd {
background: lightgray;
}
+
+ #rows {
+ border-bottom: 1px solid black;
+ padding: 20px 0px;
+ }
+
+ #date {
+ font-size: 25px;
+ padding-left: 20%;
+ }
+
+ #chart {
+ padding-left: 10%;
+ }
}
diff --git a/src/pages/login/login.html b/src/pages/login/login.html
index 2d9a616b..b37e3c06 100644
--- a/src/pages/login/login.html
+++ b/src/pages/login/login.html
@@ -13,75 +13,75 @@
-
-
-
-
-
-
-
-
-
- SIGN UP
-
-
-
-
+
+
+
+
+
+
+
+
+
+ SIGN UP
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/login/login.scss b/src/pages/login/login.scss
index 58ac5ef3..6b772f55 100644
--- a/src/pages/login/login.scss
+++ b/src/pages/login/login.scss
@@ -75,7 +75,13 @@ page-login {
}
@media screen and (orientation:portrait){
-
+ #title {
+ letter-spacing: 3px;
+ font-weight: bold;
+ font-family: proxima-nova;
+ font-size: 40px;
+ color: white;
+ }
}
@media screen and (orientation:landscape){
diff --git a/src/pages/login/login.ts b/src/pages/login/login.ts
index 28fdbc7d..0df0ed1d 100644
--- a/src/pages/login/login.ts
+++ b/src/pages/login/login.ts
@@ -128,4 +128,4 @@ export class LoginPage {
toast.present();
}
-}
+}
\ No newline at end of file
diff --git a/src/pages/news/news.html b/src/pages/news/news.html
index 303dec0a..83d1f6b4 100644
--- a/src/pages/news/news.html
+++ b/src/pages/news/news.html
@@ -7,9 +7,7 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{data.title}}
+
+
+
+
+
+
+
+ Date Published: {{data.date}}
+
+
+ {{data.sumText}}
+
+
+
+
+
+
+
+
+ Read full article
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/news/news.scss b/src/pages/news/news.scss
index b1e78899..9f52d66e 100644
--- a/src/pages/news/news.scss
+++ b/src/pages/news/news.scss
@@ -3,10 +3,14 @@ page-news {
.social-cards ion-col {
}
- #separationLink {
- padding: 20px;
- font-size: 15px;
- margin-top: 18px;
+ a {
+ cursor: pointer;
+ }
+
+ #newsLink {
+ float: right;
+ padding: 1rem;
+ font-size: 15px;
}
#linkArrow {
@@ -28,6 +32,11 @@ page-news {
padding-bottom: 5%;
}
+ #image {
+ width: 100%;
+ height: 100%;
+ }
+
.timestamp {
font-size: 12px;
// text-indent: 7px;
diff --git a/src/pages/news/news.ts b/src/pages/news/news.ts
index a4e3af0b..7d2c2dae 100644
--- a/src/pages/news/news.ts
+++ b/src/pages/news/news.ts
@@ -10,7 +10,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser';
export class NewsPage {
constructor(public navCtrl: NavController,
- public navParams: NavParams,
+ public navParams: NavParams,
public rss: RssProvider,
private browser: InAppBrowser) {
diff --git a/src/pages/profile/profile.ts b/src/pages/profile/profile.ts
index b38ea48d..116ec420 100644
--- a/src/pages/profile/profile.ts
+++ b/src/pages/profile/profile.ts
@@ -27,11 +27,11 @@ export class ProfilePage {
}
onLogout() {
- this.user.logoutUser(window.sessionStorage.getItem('token'))
- .subscribe( response => {
- console.log('onsubscibe-logout')
- window.sessionStorage.clear()
- })
+ // this.user.logoutUser(window.sessionStorage.getItem('token'))
+ // .subscribe( response => {
+ // console.log('onsubscibe-logout')
+ // window.sessionStorage.clear()
+ // })
}
getUserInfo() {
diff --git a/src/pages/register/register.html b/src/pages/register/register.html
index 2567bb13..4f08149f 100644
--- a/src/pages/register/register.html
+++ b/src/pages/register/register.html
@@ -150,11 +150,12 @@ Login if you already have an account.
-
-
-
+
+
+
+
diff --git a/src/pages/register/register.scss b/src/pages/register/register.scss
index 26fcf60c..c84c5bd4 100644
--- a/src/pages/register/register.scss
+++ b/src/pages/register/register.scss
@@ -187,6 +187,15 @@ page-register {
}
}
+ @media screen and (orientation:portrait){
+ #title {
+ letter-spacing: 3px;
+ font-weight: bold;
+ font-family: proxima-nova;
+ font-size: 40px;
+ color: white;
+ }
+ }
@media screen and (orientation:landscape){
#header {
diff --git a/src/pages/register/register.ts b/src/pages/register/register.ts
index 439e145c..5bdd27b5 100644
--- a/src/pages/register/register.ts
+++ b/src/pages/register/register.ts
@@ -5,7 +5,7 @@ import { PasswordValidator } from '../../validators/password.validator';
import { UserProvider } from '../../providers/user/user';
import { WizardPage } from '../wizard/wizard'
import { LoginPage } from '../login/login';
-import { Storage } from '@ionic/storage';
+// import { Storage } from '@ionic/storage';
@Component({
selector: 'page-register',
diff --git a/src/pages/resources/resources.html b/src/pages/resources/resources.html
index 25bf3c59..ea3b3892 100644
--- a/src/pages/resources/resources.html
+++ b/src/pages/resources/resources.html
@@ -14,23 +14,35 @@
-
+
Hello, {{user.firstName}}!
-
+
- This page will provide helpful resources to aid in your transition. Based on your self assessment, here are some areas which might need more help than others.
+ This page will provide helpful resources to aid you in your transition.
+ Based on your self assessment, here are some areas which might require more focus than others.
+
+
+ Please complete a self assessment in order to assess which resources would help you most.
+
+
+
+
+ Take the Self Assessment
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
- Your lowest score on self assessment is:
+ Your lowest score on the self assessment is:
{{userPro.userData.lowScoreName}}
@@ -38,25 +50,41 @@
{{userPro.userData.lowestScore}}
Maybe you can start there?
- Retake the self assessment test
+ Retake the self assessment
View your self assessment history
Go to the Dashboard
-
-
-
- {{res.title}}
-
-
- {{res.message}}
-
-
- Learn more...
-
-
-
+
+
+
+ {{res.title}}
+
+
+ {{res.message}}
+
+
+ Learn more...
+
+
+
+
+
+
+
+
+ {{res.title}}
+
+
+ {{res.message}}
+
+
+ Learn more...
+
+
+
-
+
+
diff --git a/src/pages/resources/resources.scss b/src/pages/resources/resources.scss
index 542546c8..3f45b209 100644
--- a/src/pages/resources/resources.scss
+++ b/src/pages/resources/resources.scss
@@ -1,42 +1,52 @@
page-resources {
-}
-
-#title {
- font-size: 24px;
- text-align: center;
-}
-
-#score-box {
- margin: auto;
- width: 50px;
- height: 30px;
- font-size: 20px;
- border-radius: 10%;
-
-}
-
-#card-text {
- margin-left: 60px;
- margin-right: 60px;
- font-size: 18px;
-
-}
-
-.red {
- color: red;
-}
-
-.yellow {
- color: yellow;
-}
-
-#resource {
- margin-left: 20px;
- font-size: 100px;
-}
-
-button {
- background-color : rgb(46, 66, 86);
-
+ .linkIcons {
+ font-weight: bold;
+ font-size: 40px;
+ position: relative;
+ top: 10px;
+ padding-left: 5px
+ }
+
+ #title {
+ font-size: 24px;
+ text-align: center;
+ }
+
+ #score-box {
+ margin: auto;
+ width: 50px;
+ height: 30px;
+ font-size: 20px;
+ border-radius: 10%;
+
+ }
+
+ #card-text {
+ margin-left: 60px;
+ margin-right: 60px;
+ font-size: 18px;
+
+ }
+
+ // #chartCard {
+ // max-height: 50vh;
+ // }
+
+ .red {
+ color: red;
+ }
+
+ .yellow {
+ color: yellow;
+ }
+
+ #resource {
+ margin-left: 20px;
+ font-size: 100px;
+ }
+
+ button {
+ background-color : rgb(46, 66, 86);
+ }
}
diff --git a/src/pages/resources/resources.ts b/src/pages/resources/resources.ts
index 8f46d393..03a5462e 100644
--- a/src/pages/resources/resources.ts
+++ b/src/pages/resources/resources.ts
@@ -19,48 +19,58 @@ export class ResourcesPage {
//user model to be pushed to
user: any = {};
values: Array = [];
+ assessmentCompleted: boolean = false;
+ sortedResources: Array = [];
//Resource tempate resources data
resources: any = [
{
title: 'Career',
message: 'How is your career going? We spend a lot of time working so how is it for you? Does it excite you? Have you a clear idea what it is you want to achieve?',
- modalMessage: 'How is your career going? We spend a lot of time working so how is it for you? Does it excite you? Have you a clear idea what it is you want to achieve?'
+ modalMessage: 'How is your career going? We spend a lot of time working so how is it for you? Does it excite you? Have you a clear idea what it is you want to achieve?',
+ score: 0
},
{
title: 'Finances',
message: 'This is not about how much you have but rather how you relate to money. There are some millionaires who worry themselves sick about money so might score very low here and others who have just enough to get by and simply go with the flow.',
- modalMessage: 'This is not about how much you have but rather how you relate to money. There are some millionaires who worry themselves sick about money so might score very low here and others who have just enough to get by and simply go with the flow.'
+ modalMessage: 'This is not about how much you have but rather how you relate to money. There are some millionaires who worry themselves sick about money so might score very low here and others who have just enough to get by and simply go with the flow.',
+ score: 0
},
{
title: 'Personal Growth',
message: 'People who are truly successful commit themselves continually to learning and improving themselves. Are you a 10 – committed to learning as much as you can about life?',
- modalMessage: 'People who are truly successful commit themselves continually to learning and improving themselves. Are you a 10 – committed to learning as much as you can about life?'
+ modalMessage: 'People who are truly successful commit themselves continually to learning and improving themselves. Are you a 10 – committed to learning as much as you can about life?',
+ score: 0
},
{
title: 'Health',
message: 'We all take our health for granted until it lets us down. How is yours? Do you look after yourself? Are you eating well? Do you get regular exercise?',
- modalMessage: 'We all take our health for granted until it lets us down. How is yours? Do you look after yourself? Are you eating well? Do you get regular exercise?'
+ modalMessage: 'We all take our health for granted until it lets us down. How is yours? Do you look after yourself? Are you eating well? Do you get regular exercise?',
+ score: 0
},
{
title: 'Family',
message: 'Family life is very important. Although family life should be loving, caring and supportive it often is not for a variety of reasons such as crying babies, wild teenage sons or daughters or constant arguments and tension.',
- modalMessage: 'Family life is very important. Although family life should be loving, caring and supportive it often is not for a variety of reasons such as crying babies, wild teenage sons or daughters or constant arguments and tension.'
+ modalMessage: 'Family life is very important. Although family life should be loving, caring and supportive it often is not for a variety of reasons such as crying babies, wild teenage sons or daughters or constant arguments and tension.',
+ score: 0
},
{
title: 'Relationships',
message: 'Consider the key relationship you have whether it is with your boyfriend/girlfriend husband/wife/friend or family member.',
- modalMessage: 'Consider the key relationship you have whether it is with your boyfriend/girlfriend husband/wife/friend or family member.'
+ modalMessage: 'Consider the key relationship you have whether it is with your boyfriend/girlfriend husband/wife/friend or family member.',
+ score: 0
},
{
title: 'Social Life',
message: 'This can be about the quality of your social life which can score very low for people with busy careers. However you can also decide to score it based on how you interact with people as how often you get to socialise. A vital component of life is the need to get on and interact with people.',
- modalMessage: 'This can be about the quality of your social life which can score very low for people with busy careers. However you can also decide to score it based on how you interact with people as how often you get to socialise. A vital component of life is the need to get on and interact with people.'
+ modalMessage: 'This can be about the quality of your social life which can score very low for people with busy careers. However you can also decide to score it based on how you interact with people as how often you get to socialise. A vital component of life is the need to get on and interact with people.',
+ score: 0
},
{
title: 'Attitude',
message: 'Attitude is vital and can influence every aspect of your life. Is your glass half full or half empty?',
- modalMessage: 'Attitude is vital and can influence every aspect of your life. Is your glass half full or half empty?'
+ modalMessage: 'Attitude is vital and can influence every aspect of your life. Is your glass half full or half empty?',
+ score: 0
}
];
@@ -75,12 +85,14 @@ export class ResourcesPage {
this.userPro.getUserChart(window.sessionStorage.getItem('userId'))
.subscribe((data: Array) => {
try{
+ this.resources.forEach(x => x.score = data['0'].data[x.title]);
+ this.sortedResources = this.resources.sort((a, b) => a.score - b.score);
console.log(data);
this.values = data[data.length - 1].data;
let lowest = 10;
let lowestProp: any;
console.log("values",this.values);
- console.log(lowest);
+ console.log(lowest);
for (var prop in this.values) {
if (this.values[prop] < lowest) {
lowest = this.values[prop];
@@ -92,6 +104,8 @@ export class ResourcesPage {
this.userPro.userData.lowScoreName = lowestProp;
this.userPro.updateUserModel(this.userPro.userData, window.sessionStorage.getItem('userId'))
console.log(this.values)
+ this.assessmentCompleted = true;
+ console.log(data);
} catch(e) {
console.log('i ran')
return
diff --git a/src/pages/self-assessment/self-assessment.html b/src/pages/self-assessment/self-assessment.html
index 18903a36..85670d3a 100644
--- a/src/pages/self-assessment/self-assessment.html
+++ b/src/pages/self-assessment/self-assessment.html
@@ -16,7 +16,7 @@
-
+
+
+
+ DRAG SLIDER TO RATE FROM 0 - 10 HOW WELL YOU ARE DOING IN EACH CATEGORY
+
+
+
+
+
+
+
+
+
{{area.title}}
+ View
+
+
+
+
+ {{area.intro}}
+ ...
+ {{ area.description }}
+
+
+
+ 0
+ 10
+
+
+
+
+
+
+
+
+
+
+ SUBMIT
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/self-assessment/self-assessment.ts b/src/pages/self-assessment/self-assessment.ts
index 87e1b78f..be8bcfe5 100644
--- a/src/pages/self-assessment/self-assessment.ts
+++ b/src/pages/self-assessment/self-assessment.ts
@@ -137,6 +137,7 @@ export class SelfAssessmentPage {
toSubmit() {
this.chartProvider.addAssessment(this.currentAssessment)
.subscribe(res => {
+ console.log(this.currentAssessment);
console.log('response:', res);
this.navCtrl.setRoot(ResourcesPage);
}, err => {
diff --git a/src/pages/transition/transition.ts b/src/pages/transition/transition.ts
index 05499dea..e7f12c5f 100644
--- a/src/pages/transition/transition.ts
+++ b/src/pages/transition/transition.ts
@@ -2,7 +2,7 @@ import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, ToastController } from 'ionic-angular';
import { ChartComponent } from '../../components/chart/chart';
import { ChartProvider } from '../../providers/chart/chart';
-import { Storage } from '@ionic/storage'
+//import { Storage } from '@ionic/storage'
/**
* Generated class for the TransitionPage page.
@@ -90,10 +90,10 @@ export class TransitionPage {
}
ionViewWillLoad() {
- this.storage.get('chartData').then((val) => {
- this.date = val ? val.Date : '';
- // console.log('this.date:', this.date, 'val.Date:', val.Date)
- }).then(() => this.lastDate())
+ // this.storage.get('chartData').then((val) => {
+ // this.date = val ? val.Date : '';
+ // // console.log('this.date:', this.date, 'val.Date:', val.Date)
+ // }).then(() => this.lastDate())
}
toggleSection(area) {
diff --git a/src/pages/wizard/wizard.html b/src/pages/wizard/wizard.html
index 364fe96e..e1b84af2 100644
--- a/src/pages/wizard/wizard.html
+++ b/src/pages/wizard/wizard.html
@@ -16,36 +16,28 @@
Exit
-
-
-
+
-
+
-
-
-
+
-
-
-
+
-
+
-
+
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
@@ -458,18 +470,11 @@ Thank you for using the Wizard
Dashboard
- Transition
+ Assessment
-
-
- Back
- Next
-
-
-
diff --git a/src/pages/wizard/wizard.scss b/src/pages/wizard/wizard.scss
index 157f0622..85a6dd62 100644
--- a/src/pages/wizard/wizard.scss
+++ b/src/pages/wizard/wizard.scss
@@ -1,10 +1,18 @@
page-wizard {
ion-slide{
- background-color: white;
+ background-color: white;
+ // height: 85%;
}
+
+ // @media (min-width: 1120px) {
+ // .demo-slide {
+ // height:85%;
+ // }
+ // }
+
.slide-zoom{
height:100%;
- }
+ }
.demo-slide {
align-items: flex-start;
}
@@ -14,7 +22,9 @@ page-wizard {
align-items: flex-start;
}
.nav-start {
- position: absolute;
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-end;
background-color: rgb(26, 39, 71);
width: 100%;
height: 4.5vw;
@@ -29,14 +39,14 @@ page-wizard {
width: 10vw;
min-width: 65px;
}
- #end {
- font-size:20px ;
- min-width: 65px;
- width: 10vw;
+ .leave-wizard{
+ font-size: 20px;
height: 85%;
float:right;
color: red;
background-color: aliceblue;
+ width: 10vw;
+ min-width: 65px;
}
#leftArrow {
@@ -54,7 +64,15 @@ page-wizard {
font-size: 75px;
z-index: 2;
}
-
+ #end {
+ font-size:20px ;
+ min-width: 65px;
+ width: 10vw;
+ height: 85%;
+ float:right;
+ color: red;
+ background-color: aliceblue;
+ }
.top-demo {
position: relative;
display: block;
@@ -167,9 +185,9 @@ page-wizard {
width: 168px;
height:42px;
}
- #end-wizard-h{
- white-space: normal
- }
+ // #end-wizard-h{
+ // white-space: normal
+ // }
.buttons {
position: relative;
margin-top: 15vw;
@@ -190,15 +208,18 @@ page-wizard {
}
.start {
font-size:25px ;
-
}
- #end {
- font-size:25px ;
- }
+ .leave-wizard{
+ font-size: 25px;
+ }
+ // #end {
+ // font-size:25px ;
+ // }
.button1{
height: 55px;
width: 180px;
font-size: 25px;
+ white-space: normal;
}
.select-placeholder, .select-text{
font-size: 25px;
@@ -297,6 +318,19 @@ page-wizard {
.h2 {
font-size: 38px;
}
+ .slide-zoom {
+ height: 90%;
+ }
+ .top-question {
+ position: relative;
+ top: 0.5vh;
+ // margin-bottom: 25px;
+ }
+ .demo-img {
+ height: 75vh;
+ width: 30%;
+ }
+
}
@media screen and (max-width: 850px) {
ion-badge{
diff --git a/src/pages/wizard/wizard.ts b/src/pages/wizard/wizard.ts
index 109199c0..4e2f35b5 100644
--- a/src/pages/wizard/wizard.ts
+++ b/src/pages/wizard/wizard.ts
@@ -3,7 +3,7 @@ import { NavController, NavParams, Slides, AlertController, Platform } from 'ion
import { Validators, FormBuilder, FormGroup } from '@angular/forms';
// import { createOfflineCompileUrlResolver, ProviderAst } from '@angular/compiler';
import { DashboardPage } from '../../pages/dashboard/dashboard';
-import { TransitionPage } from '../../pages/transition/transition';
+import { SelfAssessmentPage } from '../../pages/self-assessment/self-assessment';
import { UserProvider } from '../../providers/user/user';
import * as moment from 'moment';
@@ -36,6 +36,9 @@ export class WizardPage {
}
// index: number;
+ leftArrowVisible: boolean = false;
+ rightArrowVisible: boolean = true;
+
@ViewChild(Slides) slides: Slides;
constructor(public alertCtrl: AlertController,
@@ -50,10 +53,10 @@ export class WizardPage {
this.name = data.firstName;
})
- // let required = null;
this.firstFormFunct();
this.secondFormFunct();
this.thirdFormFunct();
+
}
ionViewDidLoad() {
@@ -66,32 +69,35 @@ export class WizardPage {
vetValue: string = "";
SeparationQuestion: string = "";
disabilityQValue: string = "";
- nextButtonDisabled: boolean = false;
- shouldLockSwipeToNext: boolean = false;
- LockSwipeToPrev: boolean = false;
+ LockSwipeToPrev: boolean = true;
employedAnswer: string = "";
codeErrorMessage: string = "";
- disableSwipe() {
- this.nextButtonDisabled = true;
- this.shouldLockSwipeToNext = true;
- }
-
- eneableSwipe() {
- this.nextButtonDisabled = false;
- this.shouldLockSwipeToNext = false;
- }
- //callled when status changes for forms
- statusChangeFunct(valid: boolean) {
- if (valid == true) {
- this.eneableSwipe()
- } else if (valid == false) {
- this.disableSwipe()
+ //the logic that determines if slide should be locked from swiping and in which direction
+ slideChanged() {
+ this.leftOrRightArrow();
+ let index = this.slides.realIndex;
+ if(index == 0) {
+ this.slides.lockSwipeToPrev(true);
+ }
+ else if ((index == 5 && !this.firstForm.valid) || (index == 6 && !this.secondForm.valid) || index == 7) {
+ index == 5 ? this.slides.lockSwipeToPrev(true) : this.slides.lockSwipeToPrev(false);
+ this.slides.lockSwipeToNext(true)
+ }
+ else if(index == 8) {
+ this.slides.lockSwipes(true);
+ }
+ else {
+ if(index == 5) {
+ this.slides.lockSwipeToPrev(true);
+ this.slides.lockSwipeToNext(false);
+ } else {
+ this.slides.lockSwipes(false);
+ }
}
- this.lockNextSlide()
}
- //declare firstForm; set contol names; set validators
+ //declare firstForm; set contol names; set validators
firstFormFunct() {
this.firstForm = this.formBuilder.group({
branch: ['', Validators.compose([Validators.required])],
@@ -100,11 +106,7 @@ export class WizardPage {
disability: ['', Validators.compose([Validators.required])],
percentQuestion: ["",]
});
- //observable called when status of firstForm changes => calls function that enables or disabled swipe if conditions are met
- this.firstForm.statusChanges
- .subscribe(val => {
- this.statusChangeFunct(this.firstForm.valid)
- })
+
//sets requirements depending on the branch that users select:
//1) the observable for branch checks if the vslue changes and runs a function in the parameter
//2) gets the form Control 'MOS' and set it as a local variable
@@ -125,7 +127,7 @@ export class WizardPage {
} else if (val == "Navy") {
codeNumber.setValidators(Validators.compose([Validators.maxLength(3), Validators.required, Validators.pattern('[a-zA-Z ]+$')]));
this.codeErrorMessage = "Enter a maximum of 3 letters"
- } else if (val == 'Coast Guards') {
+ } else if (val == 'Coast Guard') {
codeNumber.setValidators(Validators.compose([Validators.maxLength(9), Validators.required, Validators.pattern('[A-Za-z0-9]+$')]))
this.codeErrorMessage = "Max 9 characters"
}
@@ -136,16 +138,16 @@ export class WizardPage {
//2) sets validators if 'active'; clears validators if 'veteran'
this.firstForm.controls.vetOrActive.valueChanges
.subscribe(val => {
- const enlistedPay = this.thirdForm.get('enlistedPay')
- if (val == "Active") {
+ // const enlistedPay = this.thirdForm.get('enlistedPay')
+ if (val == "Active" || "Guard/Reserve") {
this.SeparationQuestion = "When is your separation date?"
- enlistedPay.setValidators(Validators.compose([Validators.required,]));
+ // enlistedPay.setValidators(Validators.compose([Validators.required,]));
} else if (val == "Veteran") {
- this.SeparationQuestion = "When was your sepatation date?"
- enlistedPay.clearValidators();
+ this.SeparationQuestion = "When was your separation date?"
+ // enlistedPay.clearValidators();
}
this.vetValue = val;
- enlistedPay.updateValueAndValidity()
+ // enlistedPay.updateValueAndValidity()
})
//when value changes for disability question change validator requirements for percentQuestion depending on condition
this.firstForm.controls.disability.valueChanges
@@ -168,11 +170,6 @@ export class WizardPage {
lastEmployed: [''],
marital: ['', Validators.compose([Validators.required])],
});
- //when status changes call function to lock or unlock swipe dependign if form is valid
- this.secondForm.statusChanges
- .subscribe(val => {
- this.statusChangeFunct(this.secondForm.valid)
- })
//if error 'infinite loop' comment out .upadateValueAndValidity()'
//when value changes for employment question, set validators for lastEmployment question and update form depending if marked as unemployed
this.secondForm.controls.employment.valueChanges
@@ -191,9 +188,9 @@ export class WizardPage {
//declare thirdForm; set contol names; set validators
thirdFormFunct() {
this.thirdForm = this.formBuilder.group({
- rank: ["", Validators.compose([Validators.required, Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*')])],
- insignia: ['', Validators.compose([Validators.required])],
- enlistedPay: [''],
+ rank: ["", Validators.compose([Validators.required, Validators.maxLength(30), Validators.pattern('[a-zA-Z0-9 ]*')])],
+ // insignia: ['', Validators.compose([Validators.required])],
+ // enlistedPay: [''],
MOS: ["", Validators.compose([Validators.required])]
});
};
@@ -201,35 +198,35 @@ export class WizardPage {
exit() {
this.navCtrl.setRoot(DashboardPage)
}
- next() {
- this.slides.slideNext(500);
+ // Determines if the left and right arrows should be displayed
+ leftOrRightArrow() {
+ if(this.slides.getActiveIndex() === 0){
+ this.leftArrowVisible = false;
+ }
+ else if (this.slides.getActiveIndex() === 8) {
+ this.leftArrowVisible = false;
+ this.rightArrowVisible = false;
+ }
+ else if (this.slides.getActiveIndex() === 5) {
+ this.leftArrowVisible = false;
+ }
+ else if (this.slides.getActiveIndex() === 7) {
+ this.rightArrowVisible = false;
+ }
+ else {
+ this.leftArrowVisible = true;
+ this.rightArrowVisible = true;
+ }
}
+
+ //Transitions to prev slide
back() {
this.slides.slidePrev(500);
}
- //shouldLockSwipeToNext variable can be either true/false depending on condition
- lockNextSlide() {
- this.slides.lockSwipeToNext(this.shouldLockSwipeToNext);
- }
- lockPrevSlide() {
- this.slides.lockSwipeToPrev(this.LockSwipeToPrev)
- }
- //the logic that determines if slide should be lockSwiped
- slideChanged() {
- let index = this.slides.realIndex;
- if ((index == 6 && !this.firstForm.valid) || (index == 7 && !this.secondForm.valid) || (index == 8) || (index == 9)) {
- this.disableSwipe()
- } else {
- this.eneableSwipe()
- }
- if (index == 6 || index == 9) {
- this.LockSwipeToPrev = true
- this.lockPrevSlide()
- } else {
- this.LockSwipeToPrev = false;
- this.lockPrevSlide()
- }
- this.lockNextSlide();
+
+ //Transitions to next slide
+ next() {
+ this.slides.slideNext(500);
}
customizeSelectOptions(title: string, message: string) {
@@ -244,10 +241,12 @@ export class WizardPage {
branchOption = this.customizeSelectOptions("Military Branch", "Select a branch");
vetOrActiveOptions = this.customizeSelectOptions("Military Status", "Select one");
disabilityOptions = this.customizeSelectOptions("Disability Status", "Select one");
- unemployedOptions = this.customizeSelectOptions("Employement Status", "Select one");
+ unemployedOptions = this.customizeSelectOptions("Employment Status", "Select one");
maritalOptions = this.customizeSelectOptions("Marital Status", "Select one");
- insigniaOptions = this.customizeSelectOptions("Officer Rank Insignia", "Select one")
- enlistedPayOptions = this.customizeSelectOptions("Enlisted Pay Rank", "Select one")
+ rankOptions = this.customizeSelectOptions("Military Rank", "Select one");
+
+ // insigniaOptions = this.customizeSelectOptions("Officer Rank Insignia", "Select one")
+ // enlistedPayOptions = this.customizeSelectOptions("Enlisted Pay Rank", "Select one")
onSubmit() {
this.user.userData = {
@@ -260,8 +259,8 @@ export class WizardPage {
lastEmployed: this.secondForm.value.lastEmployed,
maritalStatus: this.secondForm.value.marital,
militaryRank: this.thirdForm.value.rank,
- officerRank: this.thirdForm.value.insignia,
- enlistingPay: this.thirdForm.value.enlistedPay,
+ // officerRank: this.thirdForm.value.insignia,
+ // enlistingPay: this.thirdForm.value.enlistedPay,
codeIdentifier: this.thirdForm.value.MOS,
}
console.log(this.user.userData, this.LockSwipeToPrev)
@@ -269,18 +268,21 @@ export class WizardPage {
.subscribe(
(data) => {
console.log(data, "YEY!!!!!!")
+ this.slides.lockSwipeToNext(false);
+ this.next();
+ },
+ (err) => {
+ console.log(err);
+ alert("Please try submitting again.")
})
- this.shouldLockSwipeToNext = false;
- this.lockNextSlide()
- this.next();
}
setDashboardPage() {
this.navCtrl.setRoot(DashboardPage)
}
- setAssestmentPage() {
- this.navCtrl.setRoot(TransitionPage)
+ setAssessmentPage() {
+ this.navCtrl.setRoot(SelfAssessmentPage)
}
calcDate() {
@@ -289,6 +291,5 @@ export class WizardPage {
let diff = sepDate - now;
return Math.ceil(diff/86400000);
}
-
}
diff --git a/src/providers/action-item/action-item.ts b/src/providers/action-item/action-item.ts
index 2ba244e5..09a6bcf8 100644
--- a/src/providers/action-item/action-item.ts
+++ b/src/providers/action-item/action-item.ts
@@ -9,6 +9,7 @@ import { Injectable } from '@angular/core';
*/
@Injectable()
export class ActionItemProvider {
+
currentItem;
constructor() {
diff --git a/src/providers/chart/chart.ts b/src/providers/chart/chart.ts
index 8a557eb8..0915e9df 100644
--- a/src/providers/chart/chart.ts
+++ b/src/providers/chart/chart.ts
@@ -55,4 +55,3 @@ export class ChartProvider {
}
-
diff --git a/src/providers/user/user.ts b/src/providers/user/user.ts
index e8642963..1718b3e8 100644
--- a/src/providers/user/user.ts
+++ b/src/providers/user/user.ts
@@ -34,6 +34,7 @@ export class UserProvider {
}
requestUrl: string = ENV.url
+ userName: any = "Maurice";
constructor(public http: HttpClient, private storage: StorageProvider) {
@@ -78,3 +79,4 @@ export class UserProvider {
}
}
+