Skip to content

Commit

Permalink
mgr/dashboard: Add info panel component
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Theile <vtheile@suse.com>
  • Loading branch information
votdev committed May 14, 2018
1 parent 1f0c292 commit d1b179d
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { PipesModule } from '../pipes/pipes.module';
import { DeletionModalComponent } from './deletion-modal/deletion-modal.component';
import { ErrorPanelComponent } from './error-panel/error-panel.component';
import { HelperComponent } from './helper/helper.component';
import { InfoPanelComponent } from './info-panel/info-panel.component';
import { LoadingPanelComponent } from './loading-panel/loading-panel.component';
import { ModalComponent } from './modal/modal.component';
import { SparklineComponent } from './sparkline/sparkline.component';
Expand Down Expand Up @@ -37,6 +38,7 @@ import { ViewCacheComponent } from './view-cache/view-cache.component';
UsageBarComponent,
ErrorPanelComponent,
LoadingPanelComponent,
InfoPanelComponent,
ModalComponent,
DeletionModalComponent
],
Expand All @@ -48,6 +50,7 @@ import { ViewCacheComponent } from './view-cache/view-cache.component';
SubmitButtonComponent,
ErrorPanelComponent,
LoadingPanelComponent,
InfoPanelComponent,
UsageBarComponent
],
entryComponents: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<alert type="info">
<table>
<tr>
<td rowspan="2" class="info-panel-alert-icon">
<i class="fa fa-3x fa-info-circle alert-info"
aria-hidden="true"></i>
</td>
<td class="info-panel-alert-title">
{{ title }}
</td>
</tr>
<tr>
<td class="info-panel-alert-text">
<ng-content></ng-content>
</td>
</tr>
</table>
</alert>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.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;
}
.info-panel-alert-text {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AlertModule } from 'ngx-bootstrap';

import { InfoPanelComponent } from './info-panel.component';

describe('InfoPanelComponent', () => {
let component: InfoPanelComponent;
let fixture: ComponentFixture<InfoPanelComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ InfoPanelComponent ],
imports: [ AlertModule.forRoot() ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(InfoPanelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component, Input } from '@angular/core';

@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 = 'Information';
}

0 comments on commit d1b179d

Please sign in to comment.