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 { LoadingPanelComponent } from './loading-panel/loading-panel.component';
import { ModalComponent } from './modal/modal.component';
HelperComponent,
SubmitButtonComponent,
UsageBarComponent,
+ ErrorPanelComponent,
LoadingPanelComponent,
ModalComponent,
DeletionModalComponent
SparklineComponent,
HelperComponent,
SubmitButtonComponent,
+ ErrorPanelComponent,
LoadingPanelComponent,
UsageBarComponent
],
--- /dev/null
+<div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">
+ <i class="fa fa-exclamation-triangle fa-fw icon-danger"
+ aria-hidden="true"></i> {{ title }}
+ </h3>
+ </div>
+ <div class="panel-body">
+ <ng-content></ng-content>
+ </div>
+ <div class="panel-footer"
+ *ngIf="backAction.observers.length > 0">
+ <div class="button-group text-right">
+ <button class="btn btn-sm btn-default tc_backButton"
+ type="button"
+ (click)="backAction.emit()"
+ autofocus
+ i18n>
+ Back
+ </button>
+ </div>
+ </div>
+</div>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ErrorPanelComponent } from './error-panel.component';
+
+describe('ErrorPanelComponent', () => {
+ let component: ErrorPanelComponent;
+ let fixture: ComponentFixture<ErrorPanelComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ErrorPanelComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ErrorPanelComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component, EventEmitter, Input, Output } from '@angular/core';
+
+@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<any>}
+ */
+ @Output() backAction = new EventEmitter();
+}