-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added forgot-password page & component #129
- Loading branch information
1 parent
fd7b2c7
commit d55e62f
Showing
9 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
angular/app/components/forgot-password/forgot-password.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<form ng-submit="vm.submit()"> | ||
<div> | ||
<md-input-container> | ||
<label>Email</label> | ||
<input type="email" ng-model="vm.email"> | ||
</md-input-container> | ||
</div> | ||
|
||
<md-button type="submit" class="LoginForm-submit md-primary md-raised">Submit</md-button> | ||
</form> |
27 changes: 27 additions & 0 deletions
27
angular/app/components/forgot-password/forgot-password.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class ForgotPasswordController { | ||
constructor(API, ToastService, $state) { | ||
'ngInject'; | ||
|
||
this.API = API; | ||
this.$state = $state; | ||
this.ToastService = ToastService; | ||
|
||
this.email = ''; | ||
} | ||
|
||
submit() { | ||
this.API.all('auth/forgot').post({ | ||
email: this.email | ||
}).then(() => { | ||
this.ToastService.show(`Please check your email for instructions on how to reset your password.`); | ||
this.$state.go('app.landing'); | ||
}); | ||
} | ||
} | ||
|
||
export const ForgotPasswordComponent = { | ||
templateUrl: './views/app/components/forgot-password/forgot-password.component.html', | ||
controller: ForgotPasswordController, | ||
controllerAs: 'vm', | ||
bindings: {} | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<md-content class="Page-container"> | ||
<div layout="column" layout-align="center center"> | ||
|
||
<h1 class="md-headline">Forgot your password?</h1> | ||
|
||
<forgot-password></forgot-password> | ||
|
||
</div> | ||
</md-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import {ForgotPasswordComponent} from './app/components/forgot-password/forgot-password.component'; | ||
import {LoginFormComponent} from './app/components/login-form/login-form.component'; | ||
import {RegisterFormComponent} from './app/components/register-form/register-form.component'; | ||
|
||
angular.module('app.components') | ||
.component('forgotPassword', ForgotPasswordComponent) | ||
.component('loginForm', LoginFormComponent) | ||
.component('registerForm', RegisterFormComponent); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tests/angular/app/components/forgot-password.component.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ngDescribe({ | ||
name: 'Test forgot-password component', | ||
modules: 'app', | ||
element: '<forgot-password></forgot-password>', | ||
tests: function (deps) { | ||
|
||
it('basic test', () => { | ||
// | ||
}); | ||
} | ||
}); |