Преглед изворни кода

angular-stormpath 0.1.5 has pages for Ionic!

Matt Raible пре 7 година
родитељ
комит
e9d26f0aa1

+ 1
- 2
client/src/app/app.component.ts Прегледај датотеку

@@ -2,8 +2,7 @@ import { Component } from '@angular/core';
2 2
 import { Platform } from 'ionic-angular';
3 3
 import { StatusBar, Splashscreen } from 'ionic-native';
4 4
 import { TabsPage } from '../pages/tabs/tabs';
5
-import { Stormpath } from 'angular-stormpath';
6
-import { LoginPage } from '../pages/auth/login/login';
5
+import { Stormpath, LoginPage } from 'angular-stormpath';
7 6
 
8 7
 @Component({
9 8
   templateUrl: 'app.html'

+ 6
- 8
client/src/app/app.module.ts Прегледај датотеку

@@ -5,10 +5,10 @@ import { AboutPage } from '../pages/about/about';
5 5
 import { ContactPage } from '../pages/contact/contact';
6 6
 import { HomePage } from '../pages/home/home';
7 7
 import { TabsPage } from '../pages/tabs/tabs';
8
-import { StormpathConfiguration, StormpathModule } from 'angular-stormpath';
9
-import { LoginPage } from '../pages/auth/login/login';
10
-import { ForgotPasswordPage } from '../pages/auth/forgot/forgot';
11
-import { RegisterPage } from '../pages/auth/register/register';
8
+import {
9
+  StormpathConfiguration, StormpathModule, StormpathIonicModule, LoginPage,
10
+  RegisterPage, ForgotPasswordPage
11
+} from 'angular-stormpath';
12 12
 import { BeerPage } from '../pages/beer/beer';
13 13
 import { BeerService } from '../providers/beer-service';
14 14
 import { GiphyService } from '../providers/giphy-service';
@@ -28,15 +28,13 @@ export function stormpathConfig(): StormpathConfiguration {
28 28
     ContactPage,
29 29
     HomePage,
30 30
     TabsPage,
31
-    LoginPage,
32
-    ForgotPasswordPage,
33
-    RegisterPage,
34 31
     BeerPage,
35 32
     BeerModalPage
36 33
   ],
37 34
   imports: [
38 35
     IonicModule.forRoot(MyApp),
39
-    StormpathModule
36
+    StormpathModule,
37
+    StormpathIonicModule
40 38
   ],
41 39
   bootstrap: [IonicApp],
42 40
   entryComponents: [

+ 0
- 32
client/src/pages/auth/forgot/forgot.html Прегледај датотеку

@@ -1,32 +0,0 @@
1
-<ion-header>
2
-  <ion-navbar>
3
-    <ion-title>
4
-      Forgot Password
5
-    </ion-title>
6
-  </ion-navbar>
7
-</ion-header>
8
-<ion-content padding>
9
-  <p *ngIf="sent">
10
-    We have sent a password reset link to the email address of the account that you specified.
11
-    Please check your email for this message, then click on the link.<br>
12
-    <button ion-button type="button" (click)="showLogin()">Back to Login</button>
13
-  </p>
14
-  <ion-row>
15
-    <ion-col>
16
-      <form *ngIf="!sent" #registerForm="ngForm" (ngSubmit)="onSubmit(registerForm.value)" autocomplete="off">
17
-        <ion-list inset>
18
-          <ion-item>
19
-            <ion-input name="email" type="email" id="spEmail" [(ngModel)]="forgotPasswordFormModel.email"
20
-                       placeholder="Your Email Address" [disabled]="posting" required></ion-input>
21
-          </ion-item>
22
-        </ion-list>
23
-        <ion-row>
24
-          <ion-col>
25
-            <p class="text-danger" *ngIf="error">{{error}}</p>
26
-            <button ion-button type="submit" full [disabled]="!registerForm.form.valid || posting">Request Password Reset</button>
27
-          </ion-col>
28
-        </ion-row>
29
-      </form>
30
-    </ion-col>
31
-  </ion-row>
32
-</ion-content>

+ 0
- 8
client/src/pages/auth/forgot/forgot.ts Прегледај датотеку

@@ -1,8 +0,0 @@
1
-import { ForgotPasswordComponent } from 'angular-stormpath';
2
-import { Component } from '@angular/core';
3
-
4
-@Component({
5
-  selector: 'page-forgot-password',
6
-  templateUrl: './forgot.html'
7
-})
8
-export class ForgotPasswordPage extends ForgotPasswordComponent {}

+ 0
- 33
client/src/pages/auth/login/login.html Прегледај датотеку

@@ -1,33 +0,0 @@
1
-<ion-header>
2
-  <ion-navbar>
3
-    <ion-title>
4
-      Login
5
-    </ion-title>
6
-  </ion-navbar>
7
-</ion-header>
8
-<ion-content padding>
9
-  <form #loginForm="ngForm" (ngSubmit)="login(loginForm.value)" autocomplete="off">
10
-    <ion-row>
11
-      <ion-col>
12
-        <ion-list inset>
13
-          <ion-item>
14
-            <ion-input placeholder="Email" name="login" id="loginField" type="text"
15
-                       required [(ngModel)]="loginFormModel.login" #email></ion-input>
16
-          </ion-item>
17
-          <ion-item>
18
-            <ion-input placeholder="Password" name="password" id="passwordField"
19
-                       type="password" required [(ngModel)]="loginFormModel.password"></ion-input>
20
-          </ion-item>
21
-        </ion-list>
22
-      </ion-col>
23
-    </ion-row>
24
-    <ion-row>
25
-      <ion-col>
26
-        <div *ngIf="error" class="alert alert-danger">{{error}}</div>
27
-        <button ion-button class="submit-btn" full type="submit" [disabled]="!loginForm.form.valid">Login</button>
28
-        <button ion-button class="forgot-btn" type="button" block clear (click)="forgot()">Forgot Password?</button>
29
-        <button ion-button class="create-btn" type="button" block clear (click)="register()">Create Account</button>
30
-      </ion-col>
31
-    </ion-row>
32
-  </form>
33
-</ion-content>

+ 0
- 32
client/src/pages/auth/login/login.ts Прегледај датотеку

@@ -1,32 +0,0 @@
1
-import { Component, ViewChild } from '@angular/core';
2
-import { LoginComponent} from 'angular-stormpath';
3
-import { NavController } from 'ionic-angular';
4
-import { Stormpath, LoginService } from 'angular-stormpath';
5
-import { ForgotPasswordPage } from '../forgot/forgot';
6
-import { RegisterPage } from '../register/register';
7
-
8
-@Component({
9
-  selector: 'page-login',
10
-  templateUrl: './login.html'
11
-})
12
-export class LoginPage extends LoginComponent {
13
-  @ViewChild('email') email;
14
-
15
-  constructor(stormpath: Stormpath, loginService: LoginService, private nav: NavController) {
16
-    super(stormpath, loginService);
17
-  }
18
-
19
-  forgot() {
20
-    this.nav.push(ForgotPasswordPage);
21
-  }
22
-
23
-  register() {
24
-    this.nav.push(RegisterPage);
25
-  }
26
-
27
-  ionViewDidLoad() {
28
-    setTimeout(() => {
29
-      this.email.setFocus();
30
-    },150);
31
-  }
32
-}

+ 0
- 35
client/src/pages/auth/register/register.html Прегледај датотеку

@@ -1,35 +0,0 @@
1
-<ion-header>
2
-  <ion-navbar>
3
-    <ion-title>
4
-      Create Account
5
-    </ion-title>
6
-  </ion-navbar>
7
-</ion-header>
8
-<ion-content padding>
9
-  <form *ngIf="!registered" (ngSubmit)="onSubmit()" autocomplete="off" #registerForm="ngForm">
10
-    <ion-row>
11
-      <ion-col>
12
-        <ion-list inset>
13
-          <ion-item *ngFor="let field of model?.form?.fields">
14
-            <ion-input [name]="field.name" [id]="field.name" [type]="field.type"
15
-                       [(ngModel)]="formModel[field.name]" [placeholder]="field.placeholder"
16
-                       [disabled]="creating" [required]="field.required"></ion-input>
17
-          </ion-item>
18
-        </ion-list>
19
-      </ion-col>
20
-    </ion-row>
21
-    <ion-row>
22
-      <ion-col>
23
-        <div *ngIf="error" class="alert alert-danger">{{error}}</div>
24
-        <button ion-button type="submit" full [disabled]="!registerForm.form.valid">Register</button>
25
-      </ion-col>
26
-    </ion-row>
27
-  </form>
28
-  <p *ngIf="unverified" class="alert alert-success">
29
-    Your account has been created and requires verification.
30
-    Please check your email for a verification link.
31
-  </p>
32
-  <p class="alert alert-success" *ngIf="canLogin">
33
-    Your account has been created, you may now log in.
34
-  </p>
35
-</ion-content>

+ 0
- 14
client/src/pages/auth/register/register.ts Прегледај датотеку

@@ -1,14 +0,0 @@
1
-import { Component } from '@angular/core';
2
-import { RegisterComponent } from 'angular-stormpath';
3
-
4
-@Component({
5
-  selector: 'page-register',
6
-  templateUrl: './register.html'
7
-})
8
-export class RegisterPage extends RegisterComponent {
9
-
10
-  // fix for view model not always loading
11
-  ionViewDidLoad(): void {
12
-    super.ngOnInit();
13
-  }
14
-}

+ 0
- 1
client/src/pages/beer/beer-modal.ts Прегледај датотеку

@@ -3,7 +3,6 @@ import { Component, ViewChild } from '@angular/core';
3 3
 import { GiphyService } from '../../providers/giphy-service';
4 4
 import { NavParams, ViewController, ToastController, NavController } from 'ionic-angular';
5 5
 import { NgForm } from '@angular/forms';
6
-import { BeerPage } from './beer';
7 6
 
8 7
 @Component({
9 8
   templateUrl: './beer-modal.html'

+ 8
- 2
client/yarn.lock Прегледај датотеку

@@ -2038,11 +2038,11 @@ punycode@^1.2.4, punycode@^1.4.1:
2038 2038
   version "1.4.1"
2039 2039
   resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
2040 2040
 
2041
-qs@6.2.0:
2041
+qs@6.2.0, qs@^6.2.0:
2042 2042
   version "6.2.0"
2043 2043
   resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.0.tgz#3b7848c03c2dece69a9522b0fae8c4126d745f3b"
2044 2044
 
2045
-qs@^6.2.0, qs@~6.3.0:
2045
+qs@~6.3.0:
2046 2046
   version "6.3.0"
2047 2047
   resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442"
2048 2048
 
@@ -2302,6 +2302,12 @@ rxjs@5.0.0-beta.12:
2302 2302
   dependencies:
2303 2303
     symbol-observable "^1.0.1"
2304 2304
 
2305
+rxjs@5.0.3:
2306
+  version "5.0.3"
2307
+  resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.0.3.tgz#fc8bdf464ebf938812748e4196788f392fef9754"
2308
+  dependencies:
2309
+    symbol-observable "^1.0.1"
2310
+
2305 2311
 safe-json-parse@~1.0.1:
2306 2312
   version "1.0.1"
2307 2313
   resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57"