[open-ils-commits] [GIT] Evergreen ILS branch master updated. a1a03fa71d95bed03a5498d12c3be8c5f0ec10cf
Evergreen Git
git at git.evergreen-ils.org
Fri Jun 28 11:28:35 EDT 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via a1a03fa71d95bed03a5498d12c3be8c5f0ec10cf (commit)
via ab82f5c043802f15ed03fbd00fef9852a681177d (commit)
from a150021887df4898aec00057bb2ab81f8b417fd4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a1a03fa71d95bed03a5498d12c3be8c5f0ec10cf
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date: Mon Jun 17 12:32:05 2019 -0400
LP#1831781: tweaks to eg-help-popover
- Wrap the image in a button; this removes the need for setting
tabindex and makes the cursor display as a pointer when it
is over the popover.
- Add aria-label attributes
- add some usage comments
Thanks to Jane Sandberg for the feedback that inspired this patch.
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
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
index 7891eaa8e4..b75422b02f 100644
--- 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
@@ -1,7 +1,8 @@
-<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 #popContent>
+ <a target="_blank" href="{{helpLink}}" *ngIf="helpLink.length >= 1">{{helpText}}</a>
+ <span *ngIf="helpLink.length < 1">{{helpText}}</span>
</ng-template>
+<button class="btn btn-sm" placement="{{placement}}" [ngbPopover]="popContent" triggers="click"i
+ i18n-aria-label aria-label="Show help" aria-haspopup="true">
+ <span class="material-icons" i18n-aria-label aria-label="Show help">live_help</span>
+</button>
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
index 77d8fd6413..ffad186aad 100644
--- 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
@@ -2,24 +2,31 @@ 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']
+ selector: 'eg-help-popover',
+ templateUrl: './eg-help-popover.component.html',
+ styleUrls: ['./eg-help-popover.component.css']
})
export class EgHelpPopoverComponent implements OnInit {
- @Input()
- helpText = '';
+ // The text to display in the popover
+ @Input()
+ helpText = '';
- @Input()
- helpLink = '';
+ // An optional link to include in the popover. If supplied,
+ // the entire helpText is wrapped in it
+ @Input()
+ helpLink = '';
- @Input()
- placement = '';
+ // placement value passed to ngbPopover that controls
+ // where the popover is displayed. Values include
+ // 'auto', 'right', 'left', 'top-left', 'bottom-right',
+ // 'top', and so forth.
+ @Input()
+ placement = '';
- constructor() { }
+ constructor() { }
- ngOnInit() {
- }
+ ngOnInit() {
+ }
}
commit ab82f5c043802f15ed03fbd00fef9852a681177d
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date: Wed Mar 6 18:06:57 2019 -0500
LP#1831781: add eg-help-popover Angular component
Usage:
<eg-help-popover helpLink="https://youtu.be/dQw4w9WgXcQ"
helptext="Helpful msg. Optional link."></eg-help-popover>
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 <cesar.velez at equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
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 @@
+<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>
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<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();
+ });
+});
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';
+
+ at 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">
</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">
@@ -47,6 +47,8 @@
<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>
@@ -59,11 +61,13 @@
<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>
@@ -71,6 +75,7 @@
</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">
-----------------------------------------------------------------------
Summary of changes:
.../eg-help-popover/eg-help-popover.component.css} | 0
.../eg-help-popover/eg-help-popover.component.html | 8 ++++++
.../eg-help-popover.component.spec.ts | 26 ++++++++++++++++++
.../eg-help-popover/eg-help-popover.component.ts | 32 ++++++++++++++++++++++
Open-ILS/src/eg2/src/app/staff/common.module.ts | 7 +++--
.../src/app/staff/sandbox/sandbox.component.html | 7 ++++-
6 files changed, 77 insertions(+), 3 deletions(-)
copy Open-ILS/src/eg2/src/{assets/.gitkeep => app/share/eg-help-popover/eg-help-popover.component.css} (100%)
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
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list