LP1915326: Followup to Silence Offline / Shared Worker Errors The user agent string hasn't been 'PhantomJS' for quite some time, so look for 'Headless' and add that to the Firefox launcher. Also redirect requests for offline-db-worker.js to the current directory. Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Galen Charlton <gmc@equinoxOLI.org> Signed-off-by: Jane Sandberg <js7389@princeton.edu>
LP#1915326: fix AngularJS test suite Several tests of egOrg started failing when Lovefield was added as a dependency. This patch fixes them by ensuring that Lovefield is loaded. To test ------- [1] Go to Open-ILS/web/js/ui/default/staff and run `npm run test`. Note that six tests fail because 'lf' is undefined. [2] Apply the patch and repeat step 1. This time, all of the tests should pass. Signed-off-by: Galen Charlton <gmc@equinoxOLI.org> Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Galen Charlton <gmc@equinoxOLI.org> Signed-off-by: Jane Sandberg <js7389@princeton.edu>
LP1845693: Test Angular(JS) with modern browsers Rather than using PhantomJS to test Angular(JS), we can use all supported browsers for the web client. Currently this is Firefox and Chrom(ium). Because of the number of dependencies this also requires that testing is removed from the standard build instructions and only done in specific testing environments or on developer machines. Signed-off-by: Jason Boyer <JBoyer@eoli.info> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1721807: regression test This adds an automated regression test as well as some additional unit tests for the web staff reporter app and template service. This patch could be applied by itself to verify that the regression test (run using 'npm run test' for master or 'grunt test' for rel_3_0) fails. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1739803 Webstaff: Replace Grunt with Webpack * Remove grunt devDependencies * Add Webpack devDepenencies * Copy and minify operations are now handled by Webpack via 'npm run build' for dev builds and 'npm run build-prod' for production/minified builds. * Running 'npm run build-watch' executes webpack in --watch mode to watch for affected file changes and automatically rebuild. Useful for development. * Karma unit tests are now invoked directly from node via 'npm run test'. * Docs and release installer updated to match. * Removed long-outdated inline installer readme. Webpack is configured to create bundles from sets of JS files. As it stands, there are 2 sets: core.bundle.js and vendor.bundle.js. Core has all of the EG core services that are loaded on every page. Vendor contains all of the 3rd-party dependencies (angular, etc.). These 2 bundles are loaded on every web staff page (via base_js.tt2). All other <script/> tags remain as they were. When building in dev mode ('npm run build'), core service JS files are bunded un-minified with an inline source map for debugging. Vendor files (angularjs, etc.) are always minified because they are quite large. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1708291: introduce egI18N egI18N is a module that will serve as a grab-bag of functions related to I18N and L10N. The initial function it provides takes a acpl IDL object and returns a formatted name qualified by the org unit, with the underlying template accessible to the translation subsystem. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Conflicts: Open-ILS/src/templates/staff/base_js.tt2 Open-ILS/web/js/ui/default/staff/Gruntfile.js Signed-off-by: Dan Wells <dbw2@calvin.edu>
LP#1642086 TPAC Jquery path repair, .gitignore, karma * Repair JS path in TPAC jquery import. * Tell git to ignore Open-ILS/web/js/ui/default/common/build/ since it only contains generated files. * Add jquery to Karma unit test dependencies. This is not strictly required, since angular includes a slim jquery shim, but having the unit tests load the same base JS as the UI is probably best. Confirmed tests still pass. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
offline: Load Lovefield wrapper in addition to the Lovefield framework Spotted by Bill Erickson. Thanks, Bill. Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Conflicts: Open-ILS/web/js/ui/default/staff/test/karma.conf.js Signed-off-by: Kathy Lussier <klussier@masslnc.org>
offline: Load lovefield in the testing framework Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1689608: Minor fixes Fixe a typo in the seed data: TEXT not NEXT Also, add the user bucket service to karma test so that our tests are happy. Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1701001: carve out a reusable patron search service This patch moves the patron search service and the base patron search controller into a separate, reusable file. The core patron search service is available for injection as patronSvc from the new egPatronSearchMod, while BasePatronSearchCtrl now exists as a base controller for the patron search form that can be extended as needed by doing something like this: module.controller('DerivedPatronSearchCtrl', [ '$scope', '$controller', function ($scope, $controller) { // Initialize the super class and extend it. angular.extend(this, $controller('BasePatronSearchCtrl', {$scope: $scope})); ... Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
LP#1564508 Hatch status in hamburger, remove statusbar * Move the Hatch connectivity status indicator into the upper-right hamburger menu. * Removes the long-hidden hatch/websockets statusbar. * Since the Hamburger forces a re-digest of the interface when opened, the code no longer attempts to force the page to re-$apply() when the Hatch connection opens or closes. It's no longer necesssary (and was buggy). * The WebSockets connectivity status is not added to the hamburger. The websockets connection will go up and down regularly as connections expire and reset. Having the indicator flash could lead to unneccesary panic. Plus, if websockets are down, staff can't log in anyway. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1680624 angular-ui-bootstrap stopped shipping minified files Per https://github.com/angular-ui/bootstrap/issues/5522 upstream feels users should minimize the files themselves. Signed-off-by: Dan Scott <dan@coffeecode.net> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Ben Shum <ben@evergreener.net>
LP#1680624 Consolidate package dependencies into package.json npm already enables us to designate dependencies in package.json, and projects have increasingly consolidated what bower used to be used for in package.json. We can do this with an npm-compatible version of angular-order-object-by from github. There are a few other tweaks to npm vs bower file locations, such as ng-toast instead of ngtoast for ngToast. Pin to AngularJS 1.5.x for now Signed-off-by: Dan Scott <dan@coffeecode.net> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Ben Shum <ben@evergreener.net>
LP#1526185 Operator Change Service Move operator change functionality into its own dedicated service. Notify user when action fails due to unauthorized credentials, complete with message as to what has gone wrong. Fire off any failed action after input of authorized credentials. Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1356477: add quick receipt button This patch adds a new button to the webstaff checkout page called Quick Receipt. If the button itself is pushed, a receipt containing the current checkouts is either printed or emailed, depending on the user's preference. If the drop-down portion of the button is used, staff members can override the user's default preference to print or email the receipt. The Quick Receipt button is enabled only if at least one checkout has been made during the current session. Note that email receipts is an option only when the patron has an email address supplied. An icon next to the Quick Receipt button will be either a printer or an envelope depending on the user's preferred receipt setting. This patch also modifies the "Done" button. If pressed, the session is ended and the receipt is generated according to the user's preferences, but the drop-down portion can be used to end the session while letting the staff member choose how the receipt is emitted. If a receipt is emailed, a toast is displayed saying so. Signed-off-by: Mike Rylander <miker@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1527694 Webstaff clear last patron Store most recent patron ID via cookie instead of localStorage so the value can expire when then browser is closed. Adds angular-cookies (ngCookies) dependency. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Mike Rylander <mrylander@gmail.com> Conflicts: Open-ILS/web/js/ui/default/staff/bower.json
webstaff: egAudio HTML5 audio service egCore.audio.play('audio.event.dot.path'); Service to look up audio URL's by key name. Supports fall-thru behavior where 'foo.bar.baz' will fall-thru to 'foo.bar' and 'foo' depending on whether an audio file is avaialable. Signed-off-by: Bill Erickson <berickxx@gmail.com>
webstaff: add angular-file-saver to test manifest Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
LP#1402797 browser client interval parser Adds a new service on the core module for adding date handling utilities. Included in this commit is a new function: egDate.intervalToSeconds(interval); Includes Gruntfile additions and unit tests. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>