Skip to content

Commit

Permalink
feat(demo): added reset password component as example in the demo app #…
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Feb 28, 2019
1 parent 265408f commit ec33493
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demo/src/app/examples/examples.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {TabIndexComponent} from './tab-index/tab-index.component';
import {MessagesComponent} from './messages/messages.component';
import { GoBackURLComponent } from './go-back-url/go-back-url.component';
import { RegistrationComponent } from './registration/registration.component';
import { ResetPasswordComponent } from './reset-psasword/reset-password.component';

@NgModule({
imports: [
Expand All @@ -30,7 +31,8 @@ import { RegistrationComponent } from './registration/registration.component';
TabIndexComponent,
MessagesComponent,
GoBackURLComponent,
RegistrationComponent
RegistrationComponent,
ResetPasswordComponent
]
})
export class ExamplesModule {
Expand Down
55 changes: 55 additions & 0 deletions demo/src/app/examples/reset-psasword/reset-password.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1>Disable reset password</h1>
</div>
</div>

<div class="container">

<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center">

<mat-card fxFlexAlign.gt-xs="center">
<mat-card-title>
default - reset password enabled
</mat-card-title>
<mat-card-subtitle>
<div fxLayout="row" fxLayoutAlign="space-between">
<pre><code [highlight]="firstTabHtml"></code></pre>
<button mat-icon-button
ngxClipboard
[cbContent]="firstTabHtml"
matTooltip="copy"
(click)="showCopyMessage(firstTabHtml)">
<mat-icon aria-label="copy content" class="mat-18">content_copy</mat-icon>
</button>
</div>
</mat-card-subtitle>
<mat-card-content>
<ngx-auth-firebaseui [resetPasswordEnabled]="true"></ngx-auth-firebaseui>
</mat-card-content>
</mat-card>

<mat-card fxFlexAlign.gt-xs="center">
<mat-card-title>
reset password disabled
</mat-card-title>
<mat-card-subtitle>
<div fxLayout="row" fxLayoutAlign="space-between">
<pre><code [highlight]="secondTabHtml"></code></pre>
<button mat-icon-button
ngxClipboard
[cbContent]="secondTabHtml"
matTooltip="copy"
(click)="showCopyMessage(secondTabHtml)">
<mat-icon aria-label="copy content" class="mat-18">content_copy</mat-icon>
</button>
</div>
</mat-card-subtitle>
<mat-card-content>
<ngx-auth-firebaseui [resetPasswordEnabled]="false"></ngx-auth-firebaseui>
</mat-card-content>
</mat-card>

</div>

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.mat-card {
max-width: 480px;
cursor: pointer;
margin: 2rem;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ResetPasswordComponent } from './reset-password.component';

describe('ResetPasswordComponent', () => {
let component: ResetPasswordComponent;
let fixture: ComponentFixture<ResetPasswordComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ResetPasswordComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(ResetPasswordComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
18 changes: 18 additions & 0 deletions demo/src/app/examples/reset-psasword/reset-password.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Component} from '@angular/core';
import {ExampleBaseComponent} from '../example.abstract';
import {MatSnackBar} from '@angular/material';

@Component({
selector: 'app-reset-psasword',
templateUrl: './reset-password.component.html',
styleUrls: ['./reset-password.component.scss']
})
export class ResetPasswordComponent extends ExampleBaseComponent {

firstTabHtml = `<ngx-auth-firebaseui [resetPasswordEnabled]="true"></ngx-auth-firebaseui>`;
secondTabHtml = `<ngx-auth-firebaseui [resetPasswordEnabled]="false"></ngx-auth-firebaseui>`;

constructor(public snackBar: MatSnackBar) {
super(snackBar);
}
}

0 comments on commit ec33493

Please sign in to comment.