Note
|
Angular v6 requires NodeJS v8. Node v8 appears to work fine with the AngularJS client, but for now, you may wish to build this code on a separate VM to avoid disruption. |
Setup
Apache Configuration
-
Add the following to /etc/apache2/eg_vhost.conf
<Directory "/openils/var/web/eg2"> FallbackResource /eg2/index.html </Directory>
Install Node v8
$ cd /tmp $ wget 'https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz' $ sudo tar -C /usr/local --strip-components 1 -xJf node-v8.11.1-linux-x64.tar.xz $ sudo npm update $ sudo npm install -g @angular/cli
Install Evergreen
Checkout Branch
-
Checkout and deploy the working branch as usual.
-
Currently user/berick/lp1626157-ang6-app @ working but this may change.
Install Angular Dependencies
$ cd $EVERGREEN/Open-ILS/src/eg2 $ npm update $ npm install
OPTIONAL: Installing on an existing Evergreen server
-
Rebuild the AngularJS dependencies using Node v8.
$ cd $EVERGREEN/Open-ILS/web/js/ui/default/staff/ $ rm -r node_modules $ npm update $ npm install $ npm run build # or build-watch
Compile Angular App — Dev Mode
-
Uses the JIT compiler which is faster to compile, but slower in the browser.
-
--watch option also supported.
-
$ ng build --deploy-url /eg2/ --base-href /eg2/ --output-path ../../web/eg2/
Compile Angular App — Prod Mode
-
Uses the AOT compiler, which is slower to compile, but faster in the browser.
$ ng build --aot --prod --deploy-url /eg2/ --base-href /eg2/ --output-path ../../web/eg2/
Deploy
Build and install Evergreen code as usual. Restart Evergreen and Apache.
Access The Interface
Navigate to https://HOSTNAME/eg2/staff/login
OPTIONAL: Running on an existing EG server
Clear browser cookies for the EG server domain before logging in. The cookie path changes so both /eg/staff and /eg2 can share cookies.