From ab82f5c043802f15ed03fbd00fef9852a681177d Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Wed, 6 Mar 2019 18:06:57 -0500 Subject: [PATCH] LP#1831781: add eg-help-popover Angular component Usage: Additional placement attributes accepted. Basically wraps ng-bootstrap's https://ng-bootstrap.github.io/#/components/popover/examples#basic To test ------- [1] Go to the Angular sandbox page (/eg2/en-US/staff/sandbox) and verify functioning of the popovers, which display question marks. Sponsored-by: MassLNC Sponsored-by: Georgia Public Library Service Sponsored-by: Indiana State Library Sponsored-by: CW MARS Sponsored-by: King County Library System Signed-off-by: Cesar Velez Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../eg-help-popover.component.css | 0 .../eg-help-popover.component.html | 7 +++++ .../eg-help-popover.component.spec.ts | 26 +++++++++++++++++++ .../eg-help-popover.component.ts | 25 ++++++++++++++++++ .../src/eg2/src/app/staff/common.module.ts | 7 +++-- .../app/staff/sandbox/sandbox.component.html | 7 ++++- 6 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.css create mode 100644 Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.html create mode 100644 Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.spec.ts create mode 100644 Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.ts diff --git a/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.css b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.html b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.html new file mode 100644 index 0000000000..7891eaa8e4 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.html @@ -0,0 +1,7 @@ +live_help + + + {{helpText}} + + live_help + diff --git a/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.spec.ts b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.spec.ts new file mode 100644 index 0000000000..3dfeecb3ae --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.spec.ts @@ -0,0 +1,26 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; +import { EgHelpPopoverComponent } from './eg-help-popover.component'; + +describe('EgHelpPopoverComponent', () => { + let component: EgHelpPopoverComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EgHelpPopoverComponent ], + imports: [NgbPopoverModule.forRoot()] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EgHelpPopoverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.ts b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.ts new file mode 100644 index 0000000000..77d8fd6413 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/eg-help-popover/eg-help-popover.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit, Input } from '@angular/core'; +import {NgbPopover} from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'eg-help-popover', + templateUrl: './eg-help-popover.component.html', + styleUrls: ['./eg-help-popover.component.css'] +}) +export class EgHelpPopoverComponent implements OnInit { + + @Input() + helpText = ''; + + @Input() + helpLink = ''; + + @Input() + placement = ''; + + constructor() { } + + ngOnInit() { + } + +} diff --git a/Open-ILS/src/eg2/src/app/staff/common.module.ts b/Open-ILS/src/eg2/src/app/staff/common.module.ts index 9c822a2c6c..5575b70c3a 100644 --- a/Open-ILS/src/eg2/src/app/staff/common.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/common.module.ts @@ -21,6 +21,7 @@ import {BucketDialogComponent} from '@eg/staff/share/buckets/bucket-dialog.compo import {BibSummaryComponent} from '@eg/staff/share/bib-summary/bib-summary.component'; import {TranslateComponent} from '@eg/staff/share/translate/translate.component'; import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.component'; +import {EgHelpPopoverComponent} from '@eg/share/eg-help-popover/eg-help-popover.component'; /** * Imports the EG common modules and adds modules common to all staff UI's. @@ -43,7 +44,8 @@ import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.componen BucketDialogComponent, BibSummaryComponent, TranslateComponent, - AdminPageComponent + AdminPageComponent, + EgHelpPopoverComponent ], imports: [ EgCommonModule, @@ -67,7 +69,8 @@ import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.componen BucketDialogComponent, BibSummaryComponent, TranslateComponent, - AdminPageComponent + AdminPageComponent, + EgHelpPopoverComponent ] }) diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html index aa2164432c..9087d044f6 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html @@ -7,7 +7,7 @@ prefix=":) {{dynamicTitleText}}" suffix="Sandbox"> - +
Modify Page Title:
@@ -47,6 +47,8 @@
+ +
@@ -59,11 +61,13 @@
+
+ @@ -71,6 +75,7 @@
+
-- 2.43.2