From ec1160b87c523b620cc511436f425e5af927c3be Mon Sep 17 00:00:00 2001 From: geek Date: Sat, 10 Mar 2018 21:11:46 +0900 Subject: [PATCH] member totp component added & qrcode print --- package.json | 1 + .../sub-menubar/sub-menubar.component.ts | 1 - src/app/pages/pages-routing.module.ts | 1 + src/app/pages/pages.module.ts | 26 +------------------ .../member/member-page-routing.module.ts | 22 ++++++++++++++++ .../member/member-page.component.html | 5 ++++ .../member/member-page.component.scss | 0 .../member/member-page.component.spec.ts | 25 ++++++++++++++++++ .../settings/member/member-page.component.ts | 15 +++++++++++ .../settings/member/member-page.module.ts | 19 ++++++++++++++ .../settings/member/component/index.ts | 5 ++++ .../member/component/totp/totp.component.html | 3 +++ .../member/component/totp/totp.component.scss | 0 .../component/totp/totp.component.spec.ts | 25 ++++++++++++++++++ .../member/component/totp/totp.component.ts | 15 +++++++++++ src/packages/settings/member/member.module.ts | 23 ++++++++++++++++ 16 files changed, 160 insertions(+), 26 deletions(-) create mode 100644 src/app/pages/settings/member/member-page-routing.module.ts create mode 100644 src/app/pages/settings/member/member-page.component.html create mode 100644 src/app/pages/settings/member/member-page.component.scss create mode 100644 src/app/pages/settings/member/member-page.component.spec.ts create mode 100644 src/app/pages/settings/member/member-page.component.ts create mode 100644 src/app/pages/settings/member/member-page.module.ts create mode 100644 src/packages/settings/member/component/index.ts create mode 100644 src/packages/settings/member/component/totp/totp.component.html create mode 100644 src/packages/settings/member/component/totp/totp.component.scss create mode 100644 src/packages/settings/member/component/totp/totp.component.spec.ts create mode 100644 src/packages/settings/member/component/totp/totp.component.ts create mode 100644 src/packages/settings/member/member.module.ts diff --git a/package.json b/package.json index dc6b74c..6177628 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "ngx-perfect-scrollbar": "^5.3.1", "rxjs": "^5.5.6", "zone.js": "^0.8.20", + "angularx-qrcode": "^1.0.1", "angular-l10n": "^4.1.5" }, "devDependencies": { diff --git a/src/app/commons/component/sub-menubar/sub-menubar.component.ts b/src/app/commons/component/sub-menubar/sub-menubar.component.ts index 43af6f7..81fb233 100644 --- a/src/app/commons/component/sub-menubar/sub-menubar.component.ts +++ b/src/app/commons/component/sub-menubar/sub-menubar.component.ts @@ -9,7 +9,6 @@ import { Language } from 'angular-l10n'; styleUrls: ['./sub-menubar.component.scss'] }) export class SubMenubarComponent implements OnInit { - @Language() lang: string; @Input() tabs: any; constructor(public router: Router) { } diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index 6a579b1..c2da609 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -18,6 +18,7 @@ const routes: Routes = [ { path: 'target', loadChildren: './target/target-page.module#TargetPageModule' }, { path: 'overview', loadChildren: './overview/overview-page.module#OverviewPageModule' }, { path: 'dashboard', loadChildren: './dashboard/dashboard-page.module#DashboardPageModule' }, + { path: 'settings/member', loadChildren: './settings/member/member-page.module#MemberPageModule' }, ] } ]; diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index e9de669..f95f1da 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -1,5 +1,4 @@ import { NgModule, APP_INITIALIZER} from '@angular/core'; -import { Title } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { PagesComponent } from './pages.component'; import { PagesRoutingModule } from './pages-routing.module'; @@ -15,28 +14,10 @@ import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar'; import { NotificationModule } from 'packages/notification/notification.module'; - -// import { -// L10nConfig, -// L10nLoader, -// LocalizationModule, -// ProviderType -// } from 'angular-l10n'; - import { LocalizationModule, } from 'angular-l10n'; -// const l10nConfig: L10nConfig = { -// translation: { -// providers: [ -// { type: ProviderType.Static, prefix: './assets/translations/of-' } -// ], -// composedKeySeparator: '.', -// missingValue: 'No key' -// } -// }; - const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { suppressScrollX: true }; @@ -51,7 +32,6 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { PerfectScrollbarModule, NotificationModule, LocalizationModule, - // LocalizationModule.forChild(l10nConfig) ], declarations: [ PagesComponent, @@ -67,8 +47,4 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { } ], }) -export class PagesModule { - // constructor(public l10nLoader: L10nLoader) { - // this.l10nLoader.load(); - // } -} +export class PagesModule { } diff --git a/src/app/pages/settings/member/member-page-routing.module.ts b/src/app/pages/settings/member/member-page-routing.module.ts new file mode 100644 index 0000000..2352cb6 --- /dev/null +++ b/src/app/pages/settings/member/member-page-routing.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {MemberPageComponent} from './member-page.component'; + +const routes: Routes = [ + { + path: '', + component: MemberPageComponent, + // children: [ + // { path: '', component: ProbeListComponent }, + // { path: 'noauth', component: NoauthListComponent }, + // { path: 'download', component: DownloadComponent }, + // ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class MemberPageRoutingModule { } + diff --git a/src/app/pages/settings/member/member-page.component.html b/src/app/pages/settings/member/member-page.component.html new file mode 100644 index 0000000..54b98eb --- /dev/null +++ b/src/app/pages/settings/member/member-page.component.html @@ -0,0 +1,5 @@ +
+
+ +
+
diff --git a/src/app/pages/settings/member/member-page.component.scss b/src/app/pages/settings/member/member-page.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/settings/member/member-page.component.spec.ts b/src/app/pages/settings/member/member-page.component.spec.ts new file mode 100644 index 0000000..e456600 --- /dev/null +++ b/src/app/pages/settings/member/member-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MemberComponent } from './member-page.component'; + +describe('MemberComponent', () => { + let component: MemberComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MemberComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MemberComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/settings/member/member-page.component.ts b/src/app/pages/settings/member/member-page.component.ts new file mode 100644 index 0000000..87a1e1f --- /dev/null +++ b/src/app/pages/settings/member/member-page.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'of-member', + templateUrl: './member-page.component.html', + styleUrls: ['./member-page.component.scss'] +}) +export class MemberPageComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/pages/settings/member/member-page.module.ts b/src/app/pages/settings/member/member-page.module.ts new file mode 100644 index 0000000..eee5950 --- /dev/null +++ b/src/app/pages/settings/member/member-page.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MaterialModule } from 'app/commons/ui/material/material.module'; +import { MemberPageComponent } from './member-page.component'; +import { MemberPageRoutingModule } from './member-page-routing.module'; +import { MemberModule } from 'packages/settings/member/member.module'; + +@NgModule({ + imports: [ + CommonModule, + MaterialModule, + MemberPageRoutingModule, + MemberModule, + ], + declarations: [ + MemberPageComponent + ] +}) +export class MemberPageModule { } diff --git a/src/packages/settings/member/component/index.ts b/src/packages/settings/member/component/index.ts new file mode 100644 index 0000000..4710813 --- /dev/null +++ b/src/packages/settings/member/component/index.ts @@ -0,0 +1,5 @@ +import { TotpComponent } from './totp/totp.component'; + +export const COMPONENTS = [ + TotpComponent +]; diff --git a/src/packages/settings/member/component/totp/totp.component.html b/src/packages/settings/member/component/totp/totp.component.html new file mode 100644 index 0000000..641b455 --- /dev/null +++ b/src/packages/settings/member/component/totp/totp.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/packages/settings/member/component/totp/totp.component.scss b/src/packages/settings/member/component/totp/totp.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/settings/member/component/totp/totp.component.spec.ts b/src/packages/settings/member/component/totp/totp.component.spec.ts new file mode 100644 index 0000000..61cfca2 --- /dev/null +++ b/src/packages/settings/member/component/totp/totp.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TotpComponent } from './totp.component'; + +describe('TotpComponent', () => { + let component: TotpComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TotpComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TotpComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/packages/settings/member/component/totp/totp.component.ts b/src/packages/settings/member/component/totp/totp.component.ts new file mode 100644 index 0000000..c499a07 --- /dev/null +++ b/src/packages/settings/member/component/totp/totp.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'of-totp', + templateUrl: './totp.component.html', + styleUrls: ['./totp.component.scss'] +}) +export class TotpComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/packages/settings/member/member.module.ts b/src/packages/settings/member/member.module.ts new file mode 100644 index 0000000..f410004 --- /dev/null +++ b/src/packages/settings/member/member.module.ts @@ -0,0 +1,23 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import {FormsModule} from '@angular/forms'; + +import { MaterialModule } from 'app/commons/ui/material/material.module'; +import { QRCodeModule } from 'angularx-qrcode'; + +import { COMPONENTS } from './component'; +@NgModule({ + imports: [ + CommonModule, + FormsModule, + MaterialModule, + QRCodeModule + ], + exports: [ + COMPONENTS, + ], + declarations: [ + COMPONENTS, + ] +}) +export class MemberModule { }