15 Commits
2.0 ... 2.0.5

Author SHA1 Message Date
fcb35f1e40 Merge branch 'release/2.0.5' 2018-05-29 19:13:49 -04:00
048c2edb9b - Grid fixes 2018-05-29 19:13:26 -04:00
f7096108f0 Merge branch 'release/2.0.4' 2018-05-29 01:32:36 -04:00
de8aa503ba Merge tag '2.0.4' into develop
no message
2018-05-29 01:32:36 -04:00
d5ca679865 - More profile fixes 2018-05-29 01:31:59 -04:00
9362d110a5 Merge branch 'release/2.0.3' 2018-05-29 01:11:46 -04:00
2e94702ec2 Merge tag '2.0.3' into develop
no message
2018-05-29 01:11:46 -04:00
709caf208a - Profiles service mapping 2018-05-29 01:11:27 -04:00
70fe066cdd Merge branch 'release/2.0.2' 2018-05-29 01:08:07 -04:00
73f456ed00 Merge tag '2.0.2' into develop
no message
2018-05-29 01:08:07 -04:00
c9431f62ef - profiles service fixes 2018-05-29 01:07:25 -04:00
b91f7fcfba Merge branch 'release/2.0.1' 2018-05-29 00:37:55 -04:00
58b25b0a44 Merge tag '2.0.1' into develop
no message
2018-05-29 00:37:55 -04:00
01ed427b54 - Fix for verified profiles 2018-05-29 00:37:30 -04:00
8fd37ec556 Merge tag '2.0' into develop
UI Revisions
2018-05-29 00:31:52 -04:00
2 changed files with 20 additions and 20 deletions

View File

@@ -5,7 +5,6 @@ import { NavController } from 'ionic-angular';
import { ChatPage } from '../chat/chat'; import { ChatPage } from '../chat/chat';
import { ProfileService } from '../../services/profiles'; import { ProfileService } from '../../services/profiles';
import { ProfilePage } from '../profile/profile'; import { ProfilePage } from '../profile/profile';
import { TellYourStoryPage } from '../tell/tell';
@Component({ @Component({
selector: 'page-grid', selector: 'page-grid',
@@ -18,8 +17,9 @@ export class GridPage {
tabNavEl: any; tabNavEl: any;
constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) { constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) {
profileService.load().then((data) => { profileService.loadVerified().then((data) => {
this.profiles = data; this.profiles = data;
console.debug('profiles: ', this.profiles);
}); });
this.tabNavEl = document.querySelector('#tab-nav .tabbar'); this.tabNavEl = document.querySelector('#tab-nav .tabbar');
} }

View File

@@ -29,8 +29,8 @@ export class ProfileService {
} }
loadSubmitted() { loadSubmitted() {
if (this.profiles) { if (this.profiles && this.profiles.submitted) {
return Promise.resolve(this.profiles); return Promise.resolve(this.profiles.submitted);
} }
return new Promise(resolve => { return new Promise(resolve => {
@@ -39,8 +39,8 @@ export class ProfileService {
} }
loadVerified() { loadVerified() {
if (this.profiles) { if (this.profiles && this.profiles.verified) {
return Promise.resolve(this.profiles); return Promise.resolve(this.profiles.verified);
} }
return new Promise(resolve => { return new Promise(resolve => {
@@ -53,34 +53,34 @@ export class ProfileService {
.map(res => res.json()) .map(res => res.json())
.subscribe( .subscribe(
data => { data => {
this.profiles = {}; this.profiles = this.profiles || {};
this.profiles[type] = data; this.profiles[type] = data;
this.profiles.reduce((map, profile, i) => { this.profiles[type].reduce((map, profile, i) => {
map[profile._id] = i; map[profile._id] = i;
return map; return map;
}, this.idMap[type]); }, this.idMap[type]);
resolve(this.profiles[type]); resolve(this.profiles[type]);
}, },
error => { error => {
this.doGetRequest(this.fallback, resolve); this.doGetRequest(this.fallback, resolve, type);
} }
) )
} }
getNextProfile(id, type) { getNextProfile(id, type = 'all') {
var nextIdIndex = this.idMap[id] + 1; var nextIdIndex = this.idMap[type][id] + 1;
nextIdIndex = nextIdIndex >= this.profiles.length ? 0 : nextIdIndex; nextIdIndex = nextIdIndex >= this.profiles[type].length ? 0 : nextIdIndex;
return this.profiles[nextIdIndex]; return this.profiles[type][nextIdIndex];
} }
getPreviousProfile(id, type) { getPreviousProfile(id, type = 'all') {
var prevIdIndex = this.idMap[id] + 1; var prevIdIndex = this.idMap[type][id] - 1;
prevIdIndex = prevIdIndex < 0 ? (this.profiles.length - 1) : prevIdIndex; prevIdIndex = prevIdIndex < 0 ? (this.profiles[type].length - 1) : prevIdIndex;
return this.profiles[prevIdIndex]; return this.profiles[type][prevIdIndex];
} }
getProfiles() { getProfiles() {
return this.profiles; return this.profiles.all;
} }
getProfileById(id) { getProfileById(id) {
@@ -88,10 +88,10 @@ export class ProfileService {
} }
getSubmittedProfiles() { getSubmittedProfiles() {
return this.profiles.submitted;
} }
getVerifiedProfiles() { getVerifiedProfiles() {
return this.profiles.verified;
} }
} }