--- /dev/null
+<span class="material-icons" placement="{{placement}}" *ngIf="helpLink.length < 1; else withUrl" ngbPopover="{{helpText}}" triggers="keyup.enter click" tabindex="0">live_help</span>
+<ng-template #withUrl>
+ <ng-template #popContent>
+ <a target="_blank" href="{{helpLink}}">{{helpText}}</a>
+ </ng-template>
+ <span class="material-icons" [ngbPopover]="popContent" placement="{{placement}}" triggers="keyup.enter click" tabindex="0">live_help</span>
+</ng-template>
--- /dev/null
+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<EgHelpPopoverComponent>;
+
+ 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();
+ });
+});
--- /dev/null
+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() {
+ }
+
+}
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.
BucketDialogComponent,
BibSummaryComponent,
TranslateComponent,
- AdminPageComponent
+ AdminPageComponent,
+ EgHelpPopoverComponent
],
imports: [
EgCommonModule,
BucketDialogComponent,
BibSummaryComponent,
TranslateComponent,
- AdminPageComponent
+ AdminPageComponent,
+ EgHelpPopoverComponent
]
})
prefix=":) {{dynamicTitleText}}"
suffix="Sandbox">
</eg-title>
-
+<eg-help-popover [placement]="'right'" helpText="This page is for random ng stuff!"></eg-help-popover>
<div class="row flex pt-2">
<div i18n> Modify Page Title: </div>
<div class="col-lg-2">
<div class="row mb-3">
<div class="col-lg-3">
<button class="btn btn-outline-danger" (click)="progress.increment()">Increment Inline</button>
+ <eg-help-popover [placement]="'bottom'" helpText="Exercise your clicking finger by clicking the button above.">
+ </eg-help-popover>
</div>
<div class="col-lg-3">
<eg-progress-inline [max]="100" [value]="1" #progress></eg-progress-inline>
<button class="btn btn-light" (click)="showProgress()">Test Progress Dialog</button>
</div>
<div class="col-lg-3">
+ <eg-help-popover helpLink="https://www.youtube.com/watch?v=dQw4w9WgXcQ" helpText="This popover is supposed to help or something...!"></eg-help-popover>
<eg-combobox [allowFreeText]="true"
placeholder="Combobox with static data"
[entries]="cbEntries"></eg-combobox>
</div>
<div class="col-lg-3">
+ <eg-help-popover helpText="You have to type to see any options in this dropdown."></eg-help-popover>
<eg-combobox
placeholder="Combobox with dynamic data"
[asyncDataSource]="cbAsyncSource"></eg-combobox>
</div>
<div class="row mb-3">
<div class="col-lg-4">
+ <eg-help-popover helpText="If you like Toast you must click below!" placement="'auto'"></eg-help-popover>
<button class="btn btn-info" (click)="testToast()">Test Toast Message</button>
</div>
<div class="col-lg-2">