From 42d44618fd670776607027ce4c9d3481e596a71e Mon Sep 17 00:00:00 2001 From: byung eun park Date: Wed, 11 Sep 2019 15:29:50 +0900 Subject: [PATCH] site bank info rename and route edit --- src/app/navigation/navigation.ts | 12 ++++---- .../pages/sites/bank-info/component/index.ts | 3 -- .../component/bank-info-list.component.html} | 0 .../component/bank-info-list.component.scss} | 0 .../component/bank-info-list.component.ts} | 30 ++++++------------- .../component/bank-info-list.data-source.ts} | 20 +++---------- src/app/pages/sites/site/component/index.ts | 3 ++ .../site-routing.module.ts} | 8 ++--- .../site.module.ts} | 7 ++--- src/app/pages/sites/sites-routing.module.ts | 4 +-- 10 files changed, 31 insertions(+), 56 deletions(-) delete mode 100644 src/app/pages/sites/bank-info/component/index.ts rename src/app/pages/sites/{bank-info/component/list.component.html => site/component/bank-info-list.component.html} (100%) rename src/app/pages/sites/{bank-info/component/list.component.scss => site/component/bank-info-list.component.scss} (100%) rename src/app/pages/sites/{bank-info/component/list.component.ts => site/component/bank-info-list.component.ts} (62%) rename src/app/pages/sites/{bank-info/component/list.data-source.ts => site/component/bank-info-list.data-source.ts} (80%) create mode 100644 src/app/pages/sites/site/component/index.ts rename src/app/pages/sites/{bank-info/bank-info-routing.module.ts => site/site-routing.module.ts} (56%) rename src/app/pages/sites/{bank-info/bank-info.module.ts => site/site.module.ts} (86%) diff --git a/src/app/navigation/navigation.ts b/src/app/navigation/navigation.ts index 64e3fdf..bdd947a 100644 --- a/src/app/navigation/navigation.ts +++ b/src/app/navigation/navigation.ts @@ -287,7 +287,7 @@ export const navigation: FuseNavigation[] = [ translate: 'NAV.SITE.DEFAULT_SET.TITLE', type: 'item', icon: 'email', - url: '/pages/sites/configs' + url: '/pages/sites/management/configs' }, { id: 'account_separate', @@ -295,7 +295,7 @@ export const navigation: FuseNavigation[] = [ translate: 'NAV.SITE.ACCOUNT_SEPARATE.TITLE', type: 'item', icon: 'email', - url: '/pages/sites/bank-info' + url: '/pages/sites/management/bank-info' }, { id: 'set_bet_amount', @@ -303,7 +303,7 @@ export const navigation: FuseNavigation[] = [ translate: 'NAV.SITE.SET_BET_AMOUNT.TITLE', type: 'item', icon: 'email', - url: '/pages/sites/bet-amount' + url: '/pages/sites/management/bet-amount' }, { id: 'block_ip', @@ -311,7 +311,7 @@ export const navigation: FuseNavigation[] = [ translate: 'NAV.SITE.BLOCK_IP.TITLE', type: 'item', icon: 'email', - url: '/pages/sites/block-ip' + url: '/pages/sites/management/block-ip' }, { id: 'admin_ip', @@ -319,7 +319,7 @@ export const navigation: FuseNavigation[] = [ translate: 'NAV.SITE.ADMIN_IP.TITLE', type: 'item', icon: 'email', - url: '/pages/sites/admin-ip' + url: '/pages/sites/management/admin-ip' }, { id: 'set_level', @@ -327,7 +327,7 @@ export const navigation: FuseNavigation[] = [ translate: 'NAV.SITE.SET_LEVEL.TITLE', type: 'item', icon: 'email', - url: '/pages/sites/level' + url: '/pages/sites/management/level' } ] }, diff --git a/src/app/pages/sites/bank-info/component/index.ts b/src/app/pages/sites/bank-info/component/index.ts deleted file mode 100644 index 04759eb..0000000 --- a/src/app/pages/sites/bank-info/component/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ListComponent } from './list.component'; - -export const COMPONENTS = [ListComponent]; diff --git a/src/app/pages/sites/bank-info/component/list.component.html b/src/app/pages/sites/site/component/bank-info-list.component.html similarity index 100% rename from src/app/pages/sites/bank-info/component/list.component.html rename to src/app/pages/sites/site/component/bank-info-list.component.html diff --git a/src/app/pages/sites/bank-info/component/list.component.scss b/src/app/pages/sites/site/component/bank-info-list.component.scss similarity index 100% rename from src/app/pages/sites/bank-info/component/list.component.scss rename to src/app/pages/sites/site/component/bank-info-list.component.scss diff --git a/src/app/pages/sites/bank-info/component/list.component.ts b/src/app/pages/sites/site/component/bank-info-list.component.ts similarity index 62% rename from src/app/pages/sites/bank-info/component/list.component.ts rename to src/app/pages/sites/site/component/bank-info-list.component.ts index 7aa3556..e767325 100644 --- a/src/app/pages/sites/bank-info/component/list.component.ts +++ b/src/app/pages/sites/site/component/bank-info-list.component.ts @@ -7,22 +7,10 @@ import { ViewEncapsulation, AfterViewInit } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { fromEvent, Subject } from 'rxjs'; -import { - debounceTime, - distinctUntilChanged, - map, - switchMap -} from 'rxjs/operators'; -import { takeUntil } from 'rxjs/internal/operators'; - -import { MatTableDataSource } from '@angular/material/table'; +import { Subject } from 'rxjs'; import { fuseAnimations } from 'src/@fuse/animations'; -import { FuseUtils } from 'src/@fuse/utils'; -import { BankInfoDataSource } from './list.data-source'; +import { BankInfoListDataSource } from './bank-info-list.data-source'; import { BankInfoService } from 'src/modules/sites/bank-info/service/bank-info.service'; import { FormGroup, @@ -32,18 +20,18 @@ import { FormControl } from '@angular/forms'; -import { BankInfo } from 'src/modules/sites/bank-info/model/bank-info.model'; - @Component({ selector: 'app-page-sites-bank-info-list', - templateUrl: './list.component.html', - styleUrls: ['./list.component.scss'], + templateUrl: './bank-info-list.component.html', + styleUrls: ['./bank-info-list.component.scss'], animations: fuseAnimations, encapsulation: ViewEncapsulation.None }) -export class ListComponent implements OnInit, OnDestroy, AfterViewInit { - dataSource: BankInfoDataSource = new BankInfoDataSource(this.bankInfoService); - // dataSource: MatTableDataSource; +export class BankInfoListComponent implements OnInit, OnDestroy, AfterViewInit { + dataSource: BankInfoListDataSource = new BankInfoListDataSource( + this.bankInfoService + ); + displayedColumns = ['id', 'name', 'number', 'holder', 'description']; public bankInfoFormGroup: FormGroup; public bankInfoFormArray: FormArray; diff --git a/src/app/pages/sites/bank-info/component/list.data-source.ts b/src/app/pages/sites/site/component/bank-info-list.data-source.ts similarity index 80% rename from src/app/pages/sites/bank-info/component/list.data-source.ts rename to src/app/pages/sites/site/component/bank-info-list.data-source.ts index 3cc9aee..4cedb6f 100644 --- a/src/app/pages/sites/bank-info/component/list.data-source.ts +++ b/src/app/pages/sites/site/component/bank-info-list.data-source.ts @@ -1,28 +1,16 @@ import { DataSource } from '@angular/cdk/table'; import { BehaviorSubject, Observable, merge } from 'rxjs'; -import { switchMap, map, tap } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; import { CollectionViewer } from '@angular/cdk/collections'; import { BankInfo } from 'src/modules/sites/bank-info/model/bank-info.model'; import { BankInfoService } from 'src/modules/sites/bank-info/service/bank-info.service'; -import { Page } from 'src/modules/common/data/model/page'; -import { - FormControl, - FormsModule, - ReactiveFormsModule, - FormGroup, - FormBuilder, - Validators, - NgControl, - NgForm, - FormArray -} from '@angular/forms'; -export class BankInfoDataSource extends DataSource { +import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms'; + +export class BankInfoListDataSource extends DataSource { private _objectStore: BankInfo[] = []; private _ObjectsSubject$ = new BehaviorSubject([]); private _loadingSubject$ = new BehaviorSubject(false); diff --git a/src/app/pages/sites/site/component/index.ts b/src/app/pages/sites/site/component/index.ts new file mode 100644 index 0000000..c0d1f90 --- /dev/null +++ b/src/app/pages/sites/site/component/index.ts @@ -0,0 +1,3 @@ +import { BankInfoListComponent } from './bank-info-list.component'; + +export const COMPONENTS = [BankInfoListComponent]; diff --git a/src/app/pages/sites/bank-info/bank-info-routing.module.ts b/src/app/pages/sites/site/site-routing.module.ts similarity index 56% rename from src/app/pages/sites/bank-info/bank-info-routing.module.ts rename to src/app/pages/sites/site/site-routing.module.ts index 65c72cd..6e1f933 100644 --- a/src/app/pages/sites/bank-info/bank-info-routing.module.ts +++ b/src/app/pages/sites/site/site-routing.module.ts @@ -1,11 +1,11 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { ListComponent } from './component/list.component'; +import { BankInfoListComponent } from './component/bank-info-list.component'; const routes: Routes = [ { - path: '', - component: ListComponent + path: 'bank-info', + component: BankInfoListComponent } ]; @@ -13,4 +13,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) -export class BankInfoRoutingModule {} +export class SiteRoutingModule {} diff --git a/src/app/pages/sites/bank-info/bank-info.module.ts b/src/app/pages/sites/site/site.module.ts similarity index 86% rename from src/app/pages/sites/bank-info/bank-info.module.ts rename to src/app/pages/sites/site/site.module.ts index 539395e..32c2cc8 100644 --- a/src/app/pages/sites/bank-info/bank-info.module.ts +++ b/src/app/pages/sites/site/site.module.ts @@ -14,8 +14,7 @@ import { MatPaginatorModule } from '@angular/material/paginator'; import { FuseSharedModule } from 'src/@fuse/shared.module'; import { FuseWidgetModule } from 'src/@fuse/components/widget/widget.module'; -import { BankInfoRoutingModule } from './bank-info-routing.module'; -import { ListComponent } from './component/list.component'; +import { SiteRoutingModule } from './site-routing.module'; import { COMPONENTS } from './component'; // import { RESOLVERS } from './resolver'; @@ -36,10 +35,10 @@ import { COMPONENTS } from './component'; FuseSharedModule, FuseWidgetModule, - BankInfoRoutingModule + SiteRoutingModule ], declarations: [...COMPONENTS] // providers: [...RESOLVERS] }) -export class BankInfoModule {} +export class SiteModule {} diff --git a/src/app/pages/sites/sites-routing.module.ts b/src/app/pages/sites/sites-routing.module.ts index bcfbbdc..8180a97 100644 --- a/src/app/pages/sites/sites-routing.module.ts +++ b/src/app/pages/sites/sites-routing.module.ts @@ -3,8 +3,8 @@ import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { - path: 'bank-info', - loadChildren: './bank-info/bank-info.module#BankInfoModule' + path: 'management', + loadChildren: './site/site.module#SiteModule' } ];