Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
Merge branch 'Release-v0.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
TBSliver committed Sep 14, 2017
2 parents 11b59ef + e18dadf commit ea163f0
Show file tree
Hide file tree
Showing 16 changed files with 237 additions and 163 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

# Next Release

# v0.0.4

* UI Tweaks
* Allow for markets in transaction submission
* Refactoring and removing redundant code
* Redirect to trader portal for organisations

# v0.0.3

* Improve Feedback submission
Expand Down
3 changes: 2 additions & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.peartrade.localloop" version="0.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="org.peartrade.localloop" version="0.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>LocalLoop</name>
<description>Tracking Local Money for Local People.</description>
<author email="[email protected]" href="http://github.com/pear-trading">Pear Trading Development Team</author>
Expand Down Expand Up @@ -44,6 +44,7 @@
<plugin name="cordova-plugin-file" spec="^4.3.3" />
<plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
<plugin name="cordova-plugin-filepath" spec="^1.0.2" />
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.1" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@ionic-native/core": "3.4.2",
"@ionic-native/file": "3.4.2",
"@ionic-native/file-path": "3.4.2",
"@ionic-native/in-app-browser": "3.4.2",
"@ionic-native/keyboard": "3.4.2",
"@ionic-native/splash-screen": "3.4.2",
"@ionic-native/status-bar": "3.4.2",
Expand All @@ -42,6 +43,7 @@
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-file-transfer": "^1.6.3",
"cordova-plugin-filepath": "^1.0.2",
"cordova-plugin-inappbrowser": "^1.7.1",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.1",
"cordova-plugin-whitelist": "^1.3.1",
Expand Down Expand Up @@ -85,7 +87,8 @@
"cordova-sqlite-storage": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-app-version": {},
"cordova-plugin-camera": {}
"cordova-plugin-camera": {},
"cordova-plugin-inappbrowser": {}
},
"platforms": [
"android"
Expand Down
1 change: 0 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ReceiptPage } from '../pages/receipt/receipt';
import { LeaderboardPage } from '../pages/leaderboard/leaderboard';
import { SettingPage} from '../pages/setting/setting';
// import { StatPage} from '../pages/stat/stat';
// import { AccountPage } from '../pages/account/account';
import { Platform, MenuController, Nav, Events } from 'ionic-angular';

import { PeopleService } from '../providers/people-service';
Expand Down
5 changes: 2 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Keyboard } from '@ionic-native/keyboard';
import { FilePath } from '@ionic-native/file-path';
import { File } from '@ionic-native/file';
import { AppVersion } from '@ionic-native/app-version';
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { TruncateModule } from 'ng2-truncate';

// import { AppProviders } from './app.providers';
Expand All @@ -29,7 +30,6 @@ import { SettingPage } from '../pages/setting/setting';
import { GamePage } from '../pages/game/game';
import { AchievementPage } from '../pages/achievement/achievement';
import { OverviewPage } from '../pages/overview/overview';
import { AccountPage } from '../pages/account/account';
import { ShopPage } from '../pages/shop/shop';
import { StatPage } from '../pages/stat/stat';
import { IntroPage } from '../pages/intro/intro';
Expand All @@ -46,7 +46,6 @@ import { IntroPage } from '../pages/intro/intro';
UserPage,
LeaderboardPage,
SettingPage,
AccountPage,
OverviewPage,
GamePage,
AchievementPage,
Expand All @@ -73,7 +72,6 @@ import { IntroPage } from '../pages/intro/intro';
UserPage,
LeaderboardPage,
SettingPage,
AccountPage,
OverviewPage,
GamePage,
AchievementPage,
Expand All @@ -89,6 +87,7 @@ import { IntroPage } from '../pages/intro/intro';
File,
Camera,
AppVersion,
InAppBrowser,
{
provide: ErrorHandler,
useClass: IonicErrorHandler
Expand Down
9 changes: 5 additions & 4 deletions src/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ ion-app.md {
}

.item-submit {
font-size: 1.2em;
color: rgba(255, 255, 255, .8);
background: rgba(255, 255, 255, .5);
font-size: 1.4em;
color: rgba(255, 255, 255, 1);
background: rgba(255, 255, 255, .2);
margin: 1px auto 20px;
width: 90%;
border: 3px solid rgba(255, 255, 255, .8);
border-radius: 10px;
padding: 5px 10px 10px 10px;
}

.button-submit {
font-size: 1.1em;
font-size: 1.3em;
color: rgba(255, 255, 255, .8);
margin: 5px auto;
width: 90%;
Expand Down
16 changes: 8 additions & 8 deletions src/pages/about/about.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
page-about {

h2 {
color: rgba(230, 200, 200, 1);
color: rgba(244, 233, 10, .8);
font-size: 1.2em;
}

Expand Down Expand Up @@ -35,29 +35,29 @@ page-about {

.whitecard{
border-radius: 7px;
background-color: rgba(255, 255, 255, .3);
background-color: rgba(255, 255, 255, .2);
}

.redcard{
border-radius: 9px;
background-color: rgba(102, 17, 17, .6);
background-color: rgba(102, 17, 17, 1);
}

.greencard{
border-radius: 9px;
background-color: rgba(102, 102, 0, .6);
background-color: rgba(102, 102, 0, .8);
}

.bluecard{
border-radius: 9px;
background-color: rgba(0, 102, 153, .6);
background-color: rgba(0, 102, 153, .4);
}

.about-cards{
height: 65%;
margin: 20px auto;
height: 85%;
margin: 15px auto;
width: 96%;
border: 3px solid rgba(255, 255, 255, .4);
border: 3px solid rgba(255, 255, 255, .8);
border-radius: 10px;
}

Expand Down
22 changes: 0 additions & 22 deletions src/pages/account/account.html

This file was deleted.

3 changes: 0 additions & 3 deletions src/pages/account/account.scss

This file was deleted.

20 changes: 0 additions & 20 deletions src/pages/account/account.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ <h1>LocalLoop</h1>
<form [formGroup]="login" (ngSubmit)="onSubmit()">
<ion-item class="item-submit">
<ion-label stacked>Email</ion-label>
<ion-input type="text" formControlName="email"></ion-input>
<ion-input type="text" formControlName="email" placeholder="[email protected]"></ion-input>
</ion-item>
<ion-item class="item-submit">
<ion-label stacked>Password</ion-label>
<ion-input type="password" formControlName="password"></ion-input>
<ion-input type="password" formControlName="password" placeholder="Insert Password"></ion-input>
</ion-item>
<!-- The CSS for the buttons needs fixing so color="secondary" is no longer required -->
<button ion-button type="submit" color="secondary" class="button-submit" [disabled]="login.invalid" block>Sign In</button>
Expand Down
89 changes: 67 additions & 22 deletions src/pages/login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import {
NavController,
ToastController,
LoadingController,
Events
Events,
AlertController
} from 'ionic-angular';
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { UserPage } from '../user/user';
import { FeedbackPage } from '../feedback/feedback';
import { SignupPage } from '../signup/signup';
import { PeopleService } from '../../providers/people-service';
import { UserData } from '../../providers/user-data';
Expand All @@ -31,6 +34,8 @@ export class LoginPage {
private events: Events,
private peopleService: PeopleService,
private userData: UserData,
public alertCtrl: AlertController,
private iab: InAppBrowser
) {
this.login = this.formBuilder.group({
email: ['', [Validators.required]],
Expand All @@ -53,28 +58,41 @@ export class LoginPage {
.login(this.login.value)
.subscribe(
result => {
this.userData.setSessionKey( result.session_key );
// this.userData.setEmail( this.login.value.email );
this.userData.setUserInfo(
this.login.value.email,
result.display_name,
);
this.userData.getReturningEntry().subscribe(
result => {
if (result == true) {
console.log('Returning login, do not set');
} else {
console.log('First time login, set returning login');
this.userData.setReturningEntry();
if ( result.user_type == "customer") {
this.userData.setSessionKey( result.session_key );
// this.userData.setEmail( this.login.value.email );
this.userData.setUserInfo(
this.login.value.email,
result.display_name,
);
this.userData.getReturningEntry().subscribe(
result => {
if (result == true) {
console.log('Returning login, do not set');
} else {
console.log('First time login, set returning login');
this.userData.setReturningEntry();
}
},
err => {
console.log('Error checking if returning user');
}
},
err => {
console.log('Error checking if returning user');
}
);
this.events.publish('user:login')
loading.dismiss();
this.navCtrl.setRoot(UserPage);
);
this.events.publish('user:login')
loading.dismiss();
this.navCtrl.setRoot(UserPage);
} else if( result.user_type == "organisation") {
loading.dismiss();
this.loginOrgPrompt();
} else {
let toast = this.toastCtrl.create({
message: 'Your account has no user type, please contact an admin regarding this issue.',
duration: 6000,
position: 'top'
});
toast.present();
this.navCtrl.setRoot(FeedbackPage);
}
},
error => {
loading.dismiss();
Expand All @@ -89,5 +107,32 @@ export class LoginPage {
);
}

private loginOrgPrompt() {
let alert = this.alertCtrl.create({
title: 'Organisation login detected',
message: 'This app is meant for customers, would you like to be sent to the Trader Web Portal?',
buttons: [
{
text: 'No Thanks',
handler: () => {
console.log('Cancel clicked');
this.login.setValue({
email: '',
password: '',
});
}
},
{
text: 'Yes!',
handler: () => {
console.log('Routing clicked');
this.iab.create('http://dev.peartrade.org', '_system');
}
}
]
});
alert.present();
}


}
Loading

0 comments on commit ea163f0

Please sign in to comment.