From 3a835cd9974288c02cac446fbd9a60f56c765f36 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 5 Sep 2018 11:37:09 -0400 Subject: [PATCH] LP#1775466 Angular doc updates Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/CHEAT_SHEET.adoc | 59 ++++++------------------------ docs/installation/server_installation.adoc | 45 ++++++++++++++++++++++- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/Open-ILS/src/eg2/CHEAT_SHEET.adoc b/Open-ILS/src/eg2/CHEAT_SHEET.adoc index 11ec9cb453..84f4e5dd6c 100644 --- a/Open-ILS/src/eg2/CHEAT_SHEET.adoc +++ b/Open-ILS/src/eg2/CHEAT_SHEET.adoc @@ -1,68 +1,31 @@ -= Evergreen Angular App Cheatsheet = += Evergreen Angular App Cheatsheet -== Install Angular Dependencies +== Basics [source,sh] --------------------------------------------------------------------- -$ cd $EVERGREEN/Open-ILS/src/eg2 -$ npm update -$ npm install +npm update +npm install +ng lint # check code formatting +npm run test # unit tests +ng build --watch # compile dev mode +ng build --prod # compile production mode --------------------------------------------------------------------- -== Compile Angular App -- Dev Mode - -* Compile in "dev" mode using the just-in-time (JIT) compiler. -* Dev mode compilation is faster, but requires the browser fetch - and execute a lot more code. - -[source,sh] ---------------------------------------------------------------------- -$ ng build [--watch] ---------------------------------------------------------------------- - -== Compile Angular App -- Prod Mode - -* Compile in production mode. -* Uses the ahead-of-time (AOT) compiler and other optimizations, which - is slower to compile, but faster to fetch and execute in the browser. - -[source,sh] ---------------------------------------------------------------------- -$ ng build --prod ---------------------------------------------------------------------- - -== Running Unit Tests - -[source,sh] ---------------------------------------------------------------------- -# generates the test data and runs 'ng test' -npm run test ---------------------------------------------------------------------- - -== Verify Code Formatting - -[source,sh] ---------------------------------------------------------------------- -ng lint ---------------------------------------------------------------------- - -== OPTIONAL: Building for an alternate locale +== OPTIONAL: Adding a Locale * Using fr-CA as an example. * An fr-CA configuration is supplied by default. Additional configs must be added where needed. * Currently translation builds are only available on --prod build mode. * Uncomment the locale lines in eg_vhost.conf and restart apache. +* TODO: expand docs on package.json file changes required to add locales. [source,sh] --------------------------------------------------------------------- npm run export-strings npm run merge-strings -- fr-CA # APPLY TRANSLATIONS TO src/locale/messages.fr-CA.xlf -npm run build-fr-CA +npm run build-fr-CA # modify package.json for other locales --------------------------------------------------------------------- -== Access The Interface - -Navigate to https://HOSTNAME/eg2/staff/login - diff --git a/docs/installation/server_installation.adoc b/docs/installation/server_installation.adoc index df3b055f5d..c057e594fa 100644 --- a/docs/installation/server_installation.adoc +++ b/docs/installation/server_installation.adoc @@ -142,8 +142,8 @@ Extra steps for web staff client Skip this entire section if you are using an official release tarball downloaded from http://evergreen-ils.org/downloads -Install dependencies for web staff client -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Install dependencies for AngularJS web staff client +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [NOTE] You may skip this section if you have installed the @@ -183,6 +183,47 @@ npm run build-prod npm run test ------------------------------------------------------------------------------ +Install dependencies for Angular web staff client +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[NOTE] +You may skip this section if you have installed the +<>. You will still need to do the following +steps in <>. + +1. Install the long-term stability (LTS) release of +https://nodejs.org[Node.js]. Add the Node.js `/bin` directory to your +environment variable `PATH`. + +[[install_files_for_angular_web_staff_client]] +Install files for web staff client +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Building, Testing, Minification: The remaining steps all take place within + the Angalar staff root: ++ +[source,sh] +------------------------------------------------------------------------------ +cd $EVERGREEN_ROOT/Open-ILS/src/eg2/ +------------------------------------------------------------------------------ ++ +2. Install Project-local Dependencies. npm inspects the 'package.json' file + for dependencies and fetches them from the Node package network. ++ +[source,sh] +------------------------------------------------------------------------------ +npm install # fetch JS dependencies +------------------------------------------------------------------------------ ++ +3. Run the build script. ++ +[source,sh] +------------------------------------------------------------------------------ +# build and run tests +ng build --prod +npm run test +------------------------------------------------------------------------------ + Configuration and compilation instructions ------------------------------------------ -- 2.11.0