From 5097d841903df21be86a55b897db07d130974666 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Wed, 9 May 2018 18:24:03 +0100 Subject: [PATCH] mgr/dashboard: Rename cephfs component to 'cephfs-detail' Signed-off-by: Tiago Melo --- .../cephfs-detail.component.html} | 3 +- .../cephfs-detail.component.scss} | 0 .../cephfs-detail.component.spec.ts | 66 +++++++++++++++++++ .../cephfs-detail.component.ts} | 8 +-- .../cephfs-list/cephfs-list.component.html | 4 +- .../cephfs-list/cephfs-list.component.spec.ts | 6 +- .../src/app/ceph/cephfs/cephfs.module.ts | 4 +- .../cephfs/cephfs/cephfs.component.spec.ts | 53 --------------- 8 files changed, 79 insertions(+), 65 deletions(-) rename src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/{cephfs/cephfs.component.html => cephfs-detail/cephfs-detail.component.html} (95%) rename src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/{cephfs/cephfs.component.scss => cephfs-detail/cephfs-detail.component.scss} (100%) create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.spec.ts rename src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/{cephfs/cephfs.component.ts => cephfs-detail/cephfs-detail.component.ts} (94%) delete mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.html similarity index 95% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.html rename to src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.html index 219defb8ffb..f56117085b8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.html @@ -54,6 +54,7 @@ heading="Clients: {{ clientCount }}" (select)="clientsSelect=true" (deselect)="clientsSelect=false"> - + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.scss similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.scss rename to src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.scss diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.spec.ts new file mode 100644 index 00000000000..f1d19b46691 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.spec.ts @@ -0,0 +1,66 @@ +import { Component, Input } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { ChartsModule } from 'ng2-charts/ng2-charts'; +import { BsDropdownModule, ProgressbarModule, TabsModule } from 'ngx-bootstrap'; +import { Observable } from 'rxjs/Observable'; + +import { CephfsService } from '../../../shared/api/cephfs.service'; +import { SharedModule } from '../../../shared/shared.module'; +import { CephfsChartComponent } from '../cephfs-chart/cephfs-chart.component'; +import { ClientsComponent } from '../clients/clients.component'; +import { CephfsDetailComponent } from './cephfs-detail.component'; + +@Component({ selector: 'cd-cephfs-chart', template: '' }) +class CephfsChartStubComponent { + @Input() mdsCounter: any; +} + +@Component({ selector: 'cd-clients', template: '' }) +class ClientsStubComponent { + @Input() mdsCounter: any; +} + +describe('CephfsDetailComponent', () => { + let component: CephfsDetailComponent; + let fixture: ComponentFixture; + + const fakeFilesystemService = { + getCephfs: (id) => { + return Observable.create((observer) => { + return () => console.log('disposed'); + }); + }, + getMdsCounters: (id) => { + return Observable.create((observer) => { + return () => console.log('disposed'); + }); + } + }; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + ChartsModule, + RouterTestingModule, + BsDropdownModule.forRoot(), + ProgressbarModule.forRoot(), + TabsModule.forRoot() + ], + declarations: [CephfsDetailComponent, CephfsChartStubComponent, ClientsStubComponent], + providers: [{ provide: CephfsService, useValue: fakeFilesystemService }] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CephfsDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts similarity index 94% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts rename to src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts index f35dee2519b..378261026d1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts @@ -8,11 +8,11 @@ import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe'; import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; @Component({ - selector: 'cd-cephfs', - templateUrl: './cephfs.component.html', - styleUrls: ['./cephfs.component.scss'] + selector: 'cd-cephfs-detail', + templateUrl: './cephfs-detail.component.html', + styleUrls: ['./cephfs-detail.component.scss'] }) -export class CephfsComponent implements OnChanges, OnInit { +export class CephfsDetailComponent implements OnChanges, OnInit { @ViewChild('poolUsageTpl') poolUsageTpl: TemplateRef; @ViewChild('activityTmpl') activityTmpl: TemplateRef; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.html index e72238d0eb6..6494b2f1405 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.html @@ -13,7 +13,7 @@ forceIdentifier="true" selectionType="single" (updateSelection)="updateSelection($event)"> - - + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.spec.ts index 96497150b07..65856bd5c7b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.spec.ts @@ -8,8 +8,8 @@ import { CdTableSelection } from '../../../shared/models/cd-table-selection'; import { SharedModule } from '../../../shared/shared.module'; import { CephfsListComponent } from './cephfs-list.component'; -@Component({ selector: 'cd-cephfs', template: '' }) -class CephfsStubComponent { +@Component({ selector: 'cd-cephfs-detail', template: '' }) +class CephfsDetailStubComponent { @Input() selection: CdTableSelection; } @@ -28,7 +28,7 @@ describe('CephfsListComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [SharedModule], - declarations: [CephfsListComponent, CephfsStubComponent], + declarations: [CephfsListComponent, CephfsDetailStubComponent], providers: [{ provide: CephfsService, useValue: fakeService }] }).compileComponents(); })); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts index 62a9f368042..eb6d2979f62 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts @@ -8,8 +8,8 @@ import { TabsModule } from 'ngx-bootstrap/tabs'; import { AppRoutingModule } from '../../app-routing.module'; import { SharedModule } from '../../shared/shared.module'; import { CephfsChartComponent } from './cephfs-chart/cephfs-chart.component'; +import { CephfsDetailComponent } from './cephfs-detail/cephfs-detail.component'; import { CephfsListComponent } from './cephfs-list/cephfs-list.component'; -import { CephfsComponent } from './cephfs/cephfs.component'; import { ClientsComponent } from './clients/clients.component'; @NgModule({ @@ -21,6 +21,6 @@ import { ClientsComponent } from './clients/clients.component'; ProgressbarModule.forRoot(), TabsModule.forRoot() ], - declarations: [CephfsComponent, ClientsComponent, CephfsChartComponent, CephfsListComponent] + declarations: [CephfsDetailComponent, ClientsComponent, CephfsChartComponent, CephfsListComponent] }) export class CephfsModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts deleted file mode 100644 index 9d6fe412247..00000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; - -import { Observable } from 'rxjs/Observable'; - -import { CephfsService } from '../../../shared/api/cephfs.service'; -import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe'; -import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; -import { FormatterService } from '../../../shared/services/formatter.service'; -import { CephfsComponent } from './cephfs.component'; - -describe('CephfsComponent', () => { - let component: CephfsComponent; - let fixture: ComponentFixture; - - const fakeFilesystemService = { - getCephfs: (id) => { - return Observable.create((observer) => { - return () => console.log('disposed'); - }); - }, - getMdsCounters: (id) => { - return Observable.create((observer) => { - return () => console.log('disposed'); - }); - } - }; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule], - schemas: [NO_ERRORS_SCHEMA], - declarations: [CephfsComponent, DimlessPipe], - providers: [ - DimlessPipe, - DimlessBinaryPipe, - FormatterService, - { provide: CephfsService, useValue: fakeFilesystemService } - ] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CephfsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); -- 2.39.5