Skip to content

Commit

Permalink
refs #43, refs #44, refs #45, refs #46, refs #47, refs #48, refs #49
Browse files Browse the repository at this point in the history
refs #50, refs #52
  • Loading branch information
inafact committed Apr 11, 2019
1 parent 29bca84 commit adbb67c
Show file tree
Hide file tree
Showing 40 changed files with 1,175 additions and 289 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package-lock.json

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

6 changes: 6 additions & 0 deletions src/app.android.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@
.btn {
height: 42;
}


PropertyEditor DataFormEditorCore,
PropertyEditor DataFormEditorLabel {
height: 60;
}
1 change: 0 additions & 1 deletion src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
if (event instanceof NavigationEnd) {
if (this.router.url == '/') {
this.rvService.resetData();
// this.siService.resetData();
}
}
});
Expand Down
19 changes: 14 additions & 5 deletions src/app/http.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,21 @@ export class AppHttpInterceptor implements HttpInterceptor {
return next.handle(req).pipe(
tap(evt => {
if (evt instanceof HttpResponse) {
if(evt.body) {
// console.log(
// '[success] process in interceptor', evt.body,
// this.userService.getCurrentUser()
// );
// console.log('[success] process in interceptor', evt.url, evt.body);

if (evt.body && evt.body.pagenation) {

}

if (evt.body && evt.body.pagination) {

}
// if(evt.body) {
// console.log(
// '[success] process in interceptor', evt,
// // this.userService.getCurrentUser()
// );
// }
}
}),
catchError((err: any) => {
Expand Down
4 changes: 4 additions & 0 deletions src/app/register/field/field.component.tns.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<HtmlView *ngIf="field == 'password'"
class="bg-clear"
html="<p style='text-align:center; font-family:NotoSansJP Regular, NotoSansJP-Regular, Noto Sans JP Regular;'>パスワードを設定してください。<br>8文字以上、半角英数と記号(_)が使用できます。</p>"></HtmlView>

<!-- // -->
<GridLayout *ngIf="field == 'password'"
columns="*,48" rows="{{ isIOS ? 48 : 60 }}" style="padding:0;"
Expand All @@ -34,6 +35,7 @@
text="{{ isSecure ? '&#xe95c;' : '&#xe95d;' }}"
(tap)="togglePassword()"></Label>
</GridLayout>

<!-- // -->
<TextField *ngIf="field != 'password'"
#activeInput
Expand All @@ -42,6 +44,7 @@
[class.error]="firstError"
[hint]="title"
[formControlName]="field"></TextField>

<!-- // -->
<GridLayout *ngIf="field == 'password' && needConfirmInput"
columns="*" rows="{{ isIOS ? 48 : 60 }}" style="padding:0;"
Expand All @@ -56,6 +59,7 @@
formControlName="{{ field }}Confirm"
(returnPress)="onValidate()"></TextField>
</GridLayout>

<!-- // -->
<TextField *ngIf="field != 'password' && needConfirmInput"
#activeInputConfirm
Expand Down
21 changes: 17 additions & 4 deletions src/app/shared/navfooter/navfooter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ export class NavfooterComponent implements OnInit, OnDestroy, AfterViewInit {

private _navActive: string;
private rSubscription: Subscription;
private tSubscription: Subscription;
private tShowHideSubscription: Subscription;
private tUnreadSubscription: Subscription;

navMode: string = 'default';
iPoint: number = 0;
whichIndicate = {
point: false,
community: false,
message: false,
profile: false
}

@ViewChild('navPoint') npRef: ElementRef;
npEl: AbsoluteLayout;
Expand Down Expand Up @@ -68,9 +75,14 @@ export class NavfooterComponent implements OnInit, OnDestroy, AfterViewInit {
}
});

this.tSubscription = this.trayService.navShowHide$.subscribe((flag: boolean) => {
this.tShowHideSubscription = this.trayService.navShowHide$.subscribe((flag: boolean) => {
this.navMode = flag ? 'default' : 'dm';
});

this.tUnreadSubscription = this.trayService.unreadMessages$.subscribe((res :any) => {
// TODO:
this.whichIndicate.point = res.count > 0;
});
}

ngOnInit() {
Expand Down Expand Up @@ -112,7 +124,8 @@ export class NavfooterComponent implements OnInit, OnDestroy, AfterViewInit {

ngOnDestroy() {
this.rSubscription.unsubscribe();
this.tSubscription.unsubscribe();
this.tShowHideSubscription.unsubscribe();
this.tUnreadSubscription.unsubscribe();
}

get navActive(): string {
Expand All @@ -121,7 +134,7 @@ export class NavfooterComponent implements OnInit, OnDestroy, AfterViewInit {

indicated(key: string): string {
// TODO: dummy
return (key == 'point') ? 'visible' : 'collapsed';
return this.whichIndicate[key] ? 'visible' : 'collapsed';
}

gotoPoints() {
Expand Down
13 changes: 12 additions & 1 deletion src/app/shared/snackbar-like/snackbar-like.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,19 @@ export class SnackbarLikeComponent implements OnInit, OnDestroy, AfterViewInit {
this.barColor = 'warning';
this.doneMessage = '認証に失敗しました';
} else if (data.status == 468) {
//
this.barColor = 'warning';
this.doneMessage = 'すでに使用されているメールアドレスです';

if (data.error && data.error.key == 'error.notEnoughFunds') {
this.doneMessage = '残高不足です';
} else if (data.error && data.error.key == 'emailAddressTaken') {
this.doneMessage = 'すでに使用されているメールアドレスです';
} else if (data.error && data.error.key == 'usernameTaken') {
this.doneMessage = 'すでに使用されているユーザー名です';
} else {
this.doneMessage = 'アプリケーションエラー';
}
//
} else {
this.barColor = 'error';
this.doneMessage = 'サーバーエラー';
Expand Down
33 changes: 26 additions & 7 deletions src/app/system-tray.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Injectable } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Router } from '@angular/router';

import { Observable, Subject, of, from, timer } from 'rxjs';
import { tap, delay } from "rxjs/operators";
import { tap } from "rxjs/operators";

import { RouterExtensions } from 'nativescript-angular/router';

import { UserService } from './user.service';

Expand All @@ -18,6 +20,7 @@ export class SystemTrayService {
private trayPositionSource = new Subject<any>();
private userpageLockSource = new Subject<boolean>();
private navShowHideSource = new Subject<boolean>();
private unreadMessagesSource = new Subject<any>();

//
errorReport$ = this.errorReportSource.asObservable();
Expand All @@ -30,6 +33,9 @@ export class SystemTrayService {
userpageLock$ = this.userpageLockSource.asObservable();
navShowHide$ = this.navShowHideSource.asObservable();

//
unreadMessages$ = this.unreadMessagesSource.asObservable();

//
trayPosition$ = this.trayPositionSource.asObservable();
lastMeasuredPosition: any;
Expand All @@ -40,6 +46,7 @@ export class SystemTrayService {
constructor(
private userService: UserService,
private router: Router,
private routerExt: RouterExtensions,
) {}

//
Expand All @@ -60,24 +67,32 @@ export class SystemTrayService {
}

showError(errType: any) {
//
console.log(
'[reported error]',
errType,
// this.router.url,
// this.router.routerState.root,
// this.router.routerState.root.component,
// this.router.routerState.root.children
);

// TODO: modify / transform
let errMessage = errType;

// TODO: critcal error handling, variations
if ((errMessage && errMessage.status) && (
errMessage.status == 503 ||
errMessage.status == 504
)) {
timer(5000).subscribe(_ => {
this.userService.logout(false).subscribe(_ => {
if (this.router.url == '/') this.routerExt.navigate(['signin'])
});
});
}

//
if (this._isLocked) {
timer(1000).pipe(
tap(_ => this.unLockUserpageArea()),
).subscribe(_ => {
console.log('report!');
this.errorReportSource.next(errMessage);
})
} else {
Expand Down Expand Up @@ -107,6 +122,10 @@ export class SystemTrayService {
this.navShowHideSource.next(false);
}

unreadCount(data: any) {
this.unreadMessagesSource.next(data);
}

//
set trayPosition(p: any) {
this.lastMeasuredPosition = p;
Expand Down
Loading

0 comments on commit adbb67c

Please sign in to comment.