From: Tatjana Dehler Date: Mon, 8 Oct 2018 09:49:11 +0000 (+0200) Subject: mgr/dashboard: move config table details to their own component X-Git-Tag: v14.0.1~99^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbd69caf17c64f5e93d95375a66ebf07efc427fb;p=ceph.git mgr/dashboard: move config table details to their own component Fixes: http://tracker.ceph.com/issues/24455 Signed-off-by: Tatjana Dehler --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts index 357c8062a4a3..563871f53212 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts @@ -9,6 +9,7 @@ import { TabsModule } from 'ngx-bootstrap/tabs'; import { SharedModule } from '../../shared/shared.module'; import { PerformanceCounterModule } from '../performance-counter/performance-counter.module'; +import { ConfigurationDetailsComponent } from './configuration/configuration-details/configuration-details.component'; import { ConfigurationComponent } from './configuration/configuration.component'; import { HostDetailsComponent } from './hosts/host-details/host-details.component'; import { HostsComponent } from './hosts/hosts.component'; @@ -41,7 +42,8 @@ import { OsdScrubModalComponent } from './osd/osd-scrub-modal/osd-scrub-modal.co OsdPerformanceHistogramComponent, OsdScrubModalComponent, OsdFlagsModalComponent, - HostDetailsComponent + HostDetailsComponent, + ConfigurationDetailsComponent ] }) export class ClusterModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.html new file mode 100755 index 000000000000..ea9b527b7853 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.html @@ -0,0 +1,7 @@ + + + + + + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.scss new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.spec.ts new file mode 100755 index 000000000000..dd70c1df22ab --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.spec.ts @@ -0,0 +1,27 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TabsModule } from 'ngx-bootstrap'; + +import { configureTestBed } from '../../../../../testing/unit-test-helper'; +import { DataTableModule } from '../../../../shared/datatable/datatable.module'; +import { ConfigurationDetailsComponent } from './configuration-details.component'; + +describe('ConfigurationDetailsComponent', () => { + let component: ConfigurationDetailsComponent; + let fixture: ComponentFixture; + + configureTestBed({ + declarations: [ConfigurationDetailsComponent], + imports: [DataTableModule, TabsModule.forRoot()] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfigurationDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts new file mode 100755 index 000000000000..359898da1228 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts @@ -0,0 +1,22 @@ +import { Component, Input, OnChanges } from '@angular/core'; + +import { CdTableSelection } from '../../../../shared/models/cd-table-selection'; + +@Component({ + selector: 'cd-configuration-details', + templateUrl: './configuration-details.component.html', + styleUrls: ['./configuration-details.component.scss'] +}) +export class ConfigurationDetailsComponent implements OnChanges { + @Input() + selection: CdTableSelection; + selectedItem: any; + + constructor() {} + + ngOnChanges() { + if (this.selection.hasSelection) { + this.selectedItem = this.selection.first(); + } + } +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html index 7b3aeb3aa4ca..b7012699ece2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html @@ -14,27 +14,25 @@ - - - - - - - - - - {{ conf.section }}: {{ conf.value }}{{ !isLast ? "," : "" }}
-
+ + + + + + + + {{ conf.section }}: {{ conf.value }}{{ !isLast ? "," : "" }}
-
- - - - - {{ flag | uppercase }}{{ !isLast ? "," : "" }}
-
+
+
+ + + + + + {{ flag | uppercase }}{{ !isLast ? "," : "" }}
-
- +
+
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts index 9bc397802ade..4099de03ec11 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts @@ -8,6 +8,7 @@ import { TabsModule } from 'ngx-bootstrap/tabs/tabs.module'; import { configureTestBed } from '../../../../testing/unit-test-helper'; import { ConfigurationService } from '../../../shared/api/configuration.service'; import { SharedModule } from '../../../shared/shared.module'; +import { ConfigurationDetailsComponent } from './configuration-details/configuration-details.component'; import { ConfigurationComponent } from './configuration.component'; describe('ConfigurationComponent', () => { @@ -15,7 +16,7 @@ describe('ConfigurationComponent', () => { let fixture: ComponentFixture; configureTestBed({ - declarations: [ConfigurationComponent], + declarations: [ConfigurationComponent, ConfigurationDetailsComponent], providers: [ConfigurationService], imports: [ SharedModule,