From: Patrick Seidensal Date: Wed, 11 Sep 2019 14:39:22 +0000 (+0200) Subject: mgr/dashboard: create alert panel component X-Git-Tag: v15.1.0~1350^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cbe9cb65f6c8fe6889cb36afb09cc68c7c4a8440;p=ceph.git mgr/dashboard: create alert panel component to integrate {warning,error,info} component into alert panel component. Fixes: https://tracker.ceph.com/issues/41774 Signed-off-by: Patrick Seidensal --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html index e5e7677d2b46..d0231f442df2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html @@ -1,8 +1,9 @@ - + Please consult the documentation on how to configure and enable the iSCSI Targets management functionality. @@ -12,7 +13,7 @@ Available information:
{{ status }}
-
+ Please consult the +Please consult the documentation on how to - configure and enable the orchestrator functionality. + configure and enable the orchestrator functionality. Devices @@ -18,4 +19,4 @@ - \ No newline at end of file + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html index 33ce5c557767..1829ef671571 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html @@ -1,7 +1,8 @@ Loading configuration... -The configuration could not be loaded. +The configuration could not be loaded.
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html index 91fd03a2a1cc..708b0d324368 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html @@ -14,7 +14,7 @@ [data]="osd.details.osd_metadata"> - Metadata not available + Metadata not available @@ -33,8 +33,9 @@ - Histogram not available: {{ osd.histogram_failed }} + Histogram not available: {{ osd.histogram_failed }}
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html index 7b2dcd69b31b..1885772cc7c6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html @@ -68,7 +68,7 @@ let-actionDescription="actionDescription">
- The {selection.hasSingleSelection, select, 1 {OSD is} 0 {OSDs are}} not safe to destroy! + The {selection.hasSingleSelection, select, 1 {OSD is} 0 {OSDs are}} not safe to destroy!
OSD {{ getSelectedIds() | list }} will be {{ actionDescription }} if you proceed. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.html index fabd506cae86..d5e3fe1688a7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.html @@ -1,12 +1,12 @@ - The data received has the JSON format version 2.x and is currently incompatible with the dashboard. + The data received has the JSON format version 2.x and is currently incompatible with the dashboard. - {{ device.value.userMessage }} + {{ device.value.userMessage }} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html index dc897b6541b3..e495bfc6ab2b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html @@ -1,8 +1,9 @@ -Please consult the +Please consult the documentation on how to - configure and enable the orchestrator functionality. + configure and enable the orchestrator functionality. - \ No newline at end of file + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.html index e3db036f1b70..fad7d9e470f9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.html @@ -1,5 +1,5 @@ - + {{ message }}
Please consult the documentation on how to configure and enable the NFS Ganesha management functionality. -
+ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.html index 097ea48c858d..2d6c16b7f7de 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.html @@ -9,5 +9,5 @@ - Performance counters not available + Performance counters not available diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html index b9984b5cf2e8..88b93a22bf61 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html @@ -1,5 +1,5 @@ - + {{ message }}
Please consult the documentation on how to configure and enable the Object Gateway management functionality. -
+ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html index 5508baff5fca..5b50b84200c9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html @@ -1,8 +1,8 @@ -Loading bucket data...
+ *ngIf="!loading && !error">
Loading user data... -The user data could not be loaded. + i18n>The user data could not be loaded.
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.html new file mode 100644 index 000000000000..a4c228489358 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+ + {{ title }}
+ +
+
+ +
+ +
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.scss new file mode 100644 index 000000000000..a663f9295dc7 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.scss @@ -0,0 +1,8 @@ +.alert-panel-icon { + vertical-align: top; + padding-right: 15px; // See @alert-padding in bootstrap/less/variables.less +} + +.alert-panel-title { + font-weight: bold; +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.spec.ts new file mode 100644 index 000000000000..2692712a74db --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { AlertComponent, AlertConfig } from 'ngx-bootstrap/alert'; + +import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; +import { AlertPanelComponent } from './alert-panel.component'; + +describe('AlertPanelComponent', () => { + let component: AlertPanelComponent; + let fixture: ComponentFixture; + + configureTestBed({ + declarations: [AlertPanelComponent, AlertComponent], + providers: [AlertConfig, i18nProviders] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AlertPanelComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.ts new file mode 100644 index 000000000000..48324e190696 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.ts @@ -0,0 +1,46 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { I18n } from '@ngx-translate/i18n-polyfill'; +import { Icons } from '../../enum/icons.enum'; + +@Component({ + selector: 'cd-alert-panel', + templateUrl: './alert-panel.component.html', + styleUrls: ['./alert-panel.component.scss'] +}) +export class AlertPanelComponent implements OnInit { + @Input() + title = ''; + @Input() + bootstrapClass = ''; + @Output() + backAction = new EventEmitter(); + + @Input() + type: 'warning' | 'error' | 'info'; + @Input() + typeIcon: Icons | string; + + icons = Icons; + + constructor(private i18n: I18n) {} + + ngOnInit() { + switch (this.type) { + case 'warning': + this.title = this.title || this.i18n('Warning'); + this.typeIcon = this.typeIcon || Icons.warning; + this.bootstrapClass = this.bootstrapClass || 'warning'; + break; + case 'error': + this.title = this.title || this.i18n('Error'); + this.typeIcon = this.typeIcon || Icons.destroyCircle; + this.bootstrapClass = this.bootstrapClass || 'danger'; + break; + case 'info': + this.title = this.title || this.i18n('Information'); + this.typeIcon = this.typeIcon || Icons.infoCircle; + this.bootstrapClass = this.bootstrapClass || 'info'; + break; + } + } +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts index 4a2b64af201a..841b39655e02 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts @@ -12,14 +12,13 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip'; import { DirectivesModule } from '../directives/directives.module'; import { PipesModule } from '../pipes/pipes.module'; +import { AlertPanelComponent } from './alert-panel/alert-panel.component'; import { BackButtonComponent } from './back-button/back-button.component'; import { ConfigOptionComponent } from './config-option/config-option.component'; import { ConfirmationModalComponent } from './confirmation-modal/confirmation-modal.component'; import { CriticalConfirmationModalComponent } from './critical-confirmation-modal/critical-confirmation-modal.component'; -import { ErrorPanelComponent } from './error-panel/error-panel.component'; import { GrafanaComponent } from './grafana/grafana.component'; import { HelperComponent } from './helper/helper.component'; -import { InfoPanelComponent } from './info-panel/info-panel.component'; import { LanguageSelectorComponent } from './language-selector/language-selector.component'; import { LoadingPanelComponent } from './loading-panel/loading-panel.component'; import { ModalComponent } from './modal/modal.component'; @@ -30,7 +29,6 @@ import { SparklineComponent } from './sparkline/sparkline.component'; import { SubmitButtonComponent } from './submit-button/submit-button.component'; import { UsageBarComponent } from './usage-bar/usage-bar.component'; import { ViewCacheComponent } from './view-cache/view-cache.component'; -import { WarningPanelComponent } from './warning-panel/warning-panel.component'; @NgModule({ imports: [ @@ -55,19 +53,17 @@ import { WarningPanelComponent } from './warning-panel/warning-panel.component'; SelectBadgesComponent, SubmitButtonComponent, UsageBarComponent, - ErrorPanelComponent, LoadingPanelComponent, - InfoPanelComponent, ModalComponent, CriticalConfirmationModalComponent, ConfirmationModalComponent, - WarningPanelComponent, LanguageSelectorComponent, GrafanaComponent, SelectComponent, BackButtonComponent, RefreshSelectorComponent, - ConfigOptionComponent + ConfigOptionComponent, + AlertPanelComponent ], providers: [], exports: [ @@ -77,17 +73,15 @@ import { WarningPanelComponent } from './warning-panel/warning-panel.component'; SelectBadgesComponent, SubmitButtonComponent, BackButtonComponent, - ErrorPanelComponent, LoadingPanelComponent, - InfoPanelComponent, UsageBarComponent, ModalComponent, - WarningPanelComponent, LanguageSelectorComponent, GrafanaComponent, SelectComponent, RefreshSelectorComponent, - ConfigOptionComponent + ConfigOptionComponent, + AlertPanelComponent ], entryComponents: [ModalComponent, CriticalConfirmationModalComponent, ConfirmationModalComponent] }) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.html deleted file mode 100644 index b94fe85689f1..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - -
- - - {{ title }} -
- -
-
- -
- -
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.scss deleted file mode 100644 index 945fd6f81bbf..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -.error-panel-alert-icon { - vertical-align: top; - padding-right: 15px; // See @alert-padding in bootstrap/less/variables.less -} -.error-panel-alert-title { - font-weight: bold; -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.spec.ts deleted file mode 100644 index f93558338057..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AlertModule } from 'ngx-bootstrap/alert'; - -import { configureTestBed } from '../../../../testing/unit-test-helper'; -import { ErrorPanelComponent } from './error-panel.component'; - -describe('ErrorPanelComponent', () => { - let component: ErrorPanelComponent; - let fixture: ComponentFixture; - - configureTestBed({ - declarations: [ErrorPanelComponent], - imports: [AlertModule.forRoot()] - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ErrorPanelComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.ts deleted file mode 100644 index 56b322158e45..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/error-panel/error-panel.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { Icons } from '../../../shared/enum/icons.enum'; - -@Component({ - selector: 'cd-error-panel', - templateUrl: './error-panel.component.html', - styleUrls: ['./error-panel.component.scss'] -}) -export class ErrorPanelComponent { - /** - * The title to be displayed. Defaults to 'Error'. - * @type {string} - */ - @Input() - title = 'Error'; - - /** - * The event that is triggered when the 'Back' button is pressed. - * @type {EventEmitter} - */ - @Output() - backAction = new EventEmitter(); - - icons = Icons; -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.html index 777707327a5f..d6ac94af42aa 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.html @@ -2,17 +2,19 @@ Loading panel data... -Please consult the +Please consult the documentation on how to - configure and enable the monitoring functionality. + configure and enable the monitoring functionality. -Grafana Dashboard doesn't exist. Please refer to +Grafana Dashboard doesn't exist. Please refer to documentation on how to - add dashboards to Grafana. + add dashboards to Grafana.
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts index d063cd6b0a68..409f3b8a1a31 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts @@ -9,7 +9,7 @@ import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-h import { SummaryService } from '../../../shared/services/summary.service'; import { SettingsService } from '../../api/settings.service'; import { CephReleaseNamePipe } from '../../pipes/ceph-release-name.pipe'; -import { InfoPanelComponent } from '../info-panel/info-panel.component'; +import { AlertPanelComponent } from '../alert-panel/alert-panel.component'; import { LoadingPanelComponent } from '../loading-panel/loading-panel.component'; import { GrafanaComponent } from './grafana.component'; @@ -18,7 +18,7 @@ describe('GrafanaComponent', () => { let fixture: ComponentFixture; configureTestBed({ - declarations: [GrafanaComponent, InfoPanelComponent, LoadingPanelComponent], + declarations: [GrafanaComponent, AlertPanelComponent, LoadingPanelComponent], imports: [AlertModule.forRoot(), HttpClientTestingModule, RouterTestingModule, FormsModule], providers: [CephReleaseNamePipe, SettingsService, SummaryService, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.html deleted file mode 100644 index f5efe531149b..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - {{ title }} -
- -
-
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.scss deleted file mode 100644 index 27c0e3218d54..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -.info-panel-alert-icon { - vertical-align: top; - padding-right: 15px; // See @alert-padding in bootstrap/less/variables.less -} -.info-panel-alert-title { - font-weight: bold; -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.spec.ts deleted file mode 100644 index 6a28aecb13fc..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AlertModule } from 'ngx-bootstrap/alert'; - -import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; -import { InfoPanelComponent } from './info-panel.component'; - -describe('InfoPanelComponent', () => { - let component: InfoPanelComponent; - let fixture: ComponentFixture; - - configureTestBed({ - declarations: [InfoPanelComponent], - imports: [AlertModule.forRoot()], - providers: i18nProviders - }); - - beforeEach(() => { - fixture = TestBed.createComponent(InfoPanelComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.ts deleted file mode 100644 index a5427d9f1ed2..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input } from '@angular/core'; - -import { I18n } from '@ngx-translate/i18n-polyfill'; -import { Icons } from '../../../shared/enum/icons.enum'; - -@Component({ - selector: 'cd-info-panel', - templateUrl: './info-panel.component.html', - styleUrls: ['./info-panel.component.scss'] -}) -export class InfoPanelComponent { - /** - * The title to be displayed. Defaults to 'Information'. - * @type {string} - */ - @Input() - title = this.i18n('Information'); - - icons = Icons; - - constructor(private i18n: I18n) {} -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.html index 73e9ea6ad137..05afc42bcf26 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.html @@ -1,15 +1,18 @@ - + Retrieving data for . Please wait... - + - + Displaying previously cached data for . - + - + Could not load data for . Please check the cluster health. - + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.spec.ts index f55b8a62cb62..ba33678a77a4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.spec.ts @@ -3,9 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AlertModule } from 'ngx-bootstrap/alert'; import { configureTestBed } from '../../../../testing/unit-test-helper'; -import { ErrorPanelComponent } from '../error-panel/error-panel.component'; -import { InfoPanelComponent } from '../info-panel/info-panel.component'; -import { WarningPanelComponent } from '../warning-panel/warning-panel.component'; +import { AlertPanelComponent } from '../alert-panel/alert-panel.component'; import { ViewCacheComponent } from './view-cache.component'; describe('ViewCacheComponent', () => { @@ -13,12 +11,7 @@ describe('ViewCacheComponent', () => { let fixture: ComponentFixture; configureTestBed({ - declarations: [ - ErrorPanelComponent, - InfoPanelComponent, - ViewCacheComponent, - WarningPanelComponent - ], + declarations: [ViewCacheComponent, AlertPanelComponent], imports: [AlertModule.forRoot()] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.ts index b0a806d0d472..7370b07ae8b6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/view-cache/view-cache.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum'; +import { ViewCacheStatus } from '../../enum/view-cache-status.enum'; @Component({ selector: 'cd-view-cache', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.html deleted file mode 100644 index 2592112bff03..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - {{ title }} -
- -
-
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.scss deleted file mode 100644 index b47e386f48f4..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -.warning-panel-alert-icon { - vertical-align: top; - padding-right: 15px; // See @alert-padding in bootstrap/less/variables.less -} -.warning-panel-alert-title { - font-weight: bold; -} -.warning-panel-alert-text { -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.spec.ts deleted file mode 100644 index 834aebe6f39e..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AlertModule } from 'ngx-bootstrap/alert'; - -import { configureTestBed } from '../../../../testing/unit-test-helper'; -import { WarningPanelComponent } from './warning-panel.component'; - -describe('WarningPanelComponent', () => { - let component: WarningPanelComponent; - let fixture: ComponentFixture; - - configureTestBed({ - declarations: [WarningPanelComponent], - imports: [AlertModule.forRoot()] - }); - - beforeEach(() => { - fixture = TestBed.createComponent(WarningPanelComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.ts deleted file mode 100644 index e29e9feebbc0..000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/warning-panel/warning-panel.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Icons } from '../../../shared/enum/icons.enum'; - -@Component({ - selector: 'cd-warning-panel', - templateUrl: './warning-panel.component.html', - styleUrls: ['./warning-panel.component.scss'] -}) -export class WarningPanelComponent { - /** - * The title to be displayed. Defaults to 'Warning'. - * @type {string} - */ - @Input() - title = 'Warning'; - - icons = Icons; -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html index 1a74935ef9c0..c7a8f894af06 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html @@ -1,5 +1,6 @@ -Failed to load data. +Failed to load data.