FM GUI as an NPM library for GUI 2
* added dynamic loading of external modules
* new commands on Alarm to allow create/updating/delete
* new fields in alarm gui
Change-Id: I9a7f4d665618a7949bb02039374974dabf6e5363
diff --git a/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.html b/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.html
index a8e2489..098d83a 100644
--- a/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.html
+++ b/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.html
@@ -14,9 +14,9 @@
~ limitations under the License.
-->
<div id="app-dialog" class="floatpanel dialog" [@confirmDlgState]="message!==''">
- <h3> {{ lionFn('dlg_confirm_action') }} </h3>
+ <h3> {{ title }} </h3>
<p>{{ message }}</p>
<p *ngIf="warning" class="warning strong">{{ warning }}</p>
<div tabindex="10" class="dialog-button" (click)="choice(true)">OK</div>
<div tabindex="11" class="dialog-button" (click)="choice(false)">Cancel</div>
-</div>
\ No newline at end of file
+</div>
diff --git a/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.spec.ts b/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.spec.ts
index f4e76e0..9692e3a 100644
--- a/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.spec.ts
+++ b/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.spec.ts
@@ -32,7 +32,8 @@
let fixture: ComponentFixture<ConfirmComponent>;
const bundleObj = {
'core.view.App': {
- test: 'test1'
+ test: 'test1',
+ dlg_confirm_action: 'Confirm'
}
};
const mockLion = (key) => {
@@ -62,6 +63,9 @@
beforeEach(() => {
fixture = TestBed.createComponent(ConfirmComponent);
component = fixture.debugElement.componentInstance;
+ component.title = 'Confirm';
+ component.message = 'A message';
+ component.warning = 'A warning';
fixture.detectChanges();
});
@@ -73,7 +77,7 @@
const appDe: DebugElement = fixture.debugElement;
const divDe = appDe.query(By.css('div#app-dialog h3'));
const div: HTMLElement = divDe.nativeElement;
- expect(div.textContent).toEqual(' %dlg_confirm_action% ');
+ expect(div.textContent).toEqual(' Confirm ');
});
it('should have a div.dialog-button inside a div#app-dialog', () => {
diff --git a/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.ts b/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.ts
index fca6419..7533a7e 100644
--- a/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.ts
+++ b/web/gui2-fw-lib/projects/gui2-fw-lib/src/lib/layer/confirm/confirm.component.ts
@@ -61,6 +61,7 @@
@Input() message: string;
@Input() warning: string;
+ @Input() title: string;
@Output() chosen: EventEmitter<boolean> = new EventEmitter();
constructor(