[open-ils-commits] [GIT] Evergreen ILS branch master updated. f1e35fe8eec4a89515cdc2f2a7be8b64c310080d

Evergreen Git git at git.evergreen-ils.org
Thu Jun 13 13:54:30 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  f1e35fe8eec4a89515cdc2f2a7be8b64c310080d (commit)
       via  c6b4d1f5d69a38a5bd651257ea2fa46cfefbae24 (commit)
      from  5c4914672feb650d4e743c0425d963190fa13d62 (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 f1e35fe8eec4a89515cdc2f2a7be8b64c310080d
Author: Jane Sandberg <sandbej at linnbenton.edu>
Date:   Thu Jun 13 10:52:19 2019 -0700

    LP#1831786 (follow-up): release note for cross-tab communication demo
    
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>

diff --git a/docs/RELEASE_NOTES_NEXT/Client/ang-crosstab-communication.adoc b/docs/RELEASE_NOTES_NEXT/Client/ang-crosstab-communication.adoc
new file mode 100644
index 0000000000..77982058c6
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Client/ang-crosstab-communication.adoc
@@ -0,0 +1,6 @@
+Cross-Tab Communication Demo
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The Angular Sandbox now includes an example
+for developers interested in sharing data
+between staff client browser tabs.
+

commit c6b4d1f5d69a38a5bd651257ea2fa46cfefbae24
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon Apr 1 18:35:51 2019 -0400

    LP#1831786: add demo of cross-tab communications
    
    This adds to the Angular sandbox page a demo of implementing
    cross-tab communications using BroadcastChannel. To quote the
    instructions added by this patch:
    
    "To test, open this sandbox in a second browser tab.
    Enter something in the input box below, then switch to the other tab
    and click anywhere on the page. You should see the message that you
    sent to the other browser tab."
    
    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: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>

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 54cd87d11e..7406c1f29c 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
@@ -126,6 +126,20 @@
 </div>
 <br/><br/>
 
+<div>
+  <h4>Cross-tab communications example</h4>
+  <p>To test, open this sandbox in a second browser tab. Enter something in the input box below, then switch to the other tab and click anywhere on the page. 
+     You should see the message that you sent to the other browser tab.</p>
+</div>
+<div class="row">
+  <div class="col-lg-3">
+    <input type="text" #sendSbMessage placeholder="message to send to another tab" size="40" (change)="sendMessage($event)">
+  </div>
+  <div class="col-lg-3">
+    message received: {{sbChannelText}}
+  </div>
+</div>
+
 <!-- grid stuff -->
 <ng-template #cellTmpl let-row="row" let-col="col" let-userContext="userContext">
   HELLO {{userContext.hello}}
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
index 543e3cb72b..4dd88921a0 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
@@ -66,6 +66,10 @@ export class SandboxComponent implements OnInit {
     // selector field value on metarecord object
     aMetarecord: string;
 
+    // cross-tab communications example
+    private sbChannel: any;
+    sbChannelText: string;
+
     constructor(
         private idl: IdlService,
         private org: OrgService,
@@ -75,6 +79,10 @@ export class SandboxComponent implements OnInit {
         private format: FormatService,
         private printer: PrintService
     ) {
+        // BroadcastChannel is not yet defined in PhantomJS and elsewhere
+        this.sbChannel = (typeof BroadcastChannel === 'undefined') ?
+            {} : new BroadcastChannel('eg.sbChannel');
+        this.sbChannel.onmessage = (e) => this.sbChannelHandler(e);
     }
 
     ngOnInit() {
@@ -136,6 +144,14 @@ export class SandboxComponent implements OnInit {
         });
     }
 
+    sbChannelHandler = msg => {
+        setTimeout(() => { this.sbChannelText = msg.data.msg; });
+    }
+
+    sendMessage($event) {
+        this.sbChannel.postMessage({msg : $event.target.value});
+    }
+
     openEditor() {
         this.fmRecordEditor.open({size: 'lg'}).then(
             ok => { console.debug(ok); },

-----------------------------------------------------------------------

Summary of changes:
 .../src/eg2/src/app/staff/sandbox/sandbox.component.html | 14 ++++++++++++++
 .../src/eg2/src/app/staff/sandbox/sandbox.component.ts   | 16 ++++++++++++++++
 .../Client/ang-crosstab-communication.adoc               |  6 ++++++
 3 files changed, 36 insertions(+)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Client/ang-crosstab-communication.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list