-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mgr/dashboard: Add info panel component
Signed-off-by: Volker Theile <vtheile@suse.com>
- Loading branch information
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
9 changes: 9 additions & 0 deletions
9
...ind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
} |
28 changes: 28 additions & 0 deletions
28
.../mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
...ybind/mgr/dashboard/frontend/src/app/shared/components/info-panel/info-panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |