Professional interface (admin):
Copyright (C) 2020 RERO Copyright (C) 2020 UCLouvain
Rero-ils-ui is a part of RERO21 project.
It's a Web UI (User Interface) of rero-ils for libraries management.
This interface aims to be simple and clear. It's made with Angular CLI.
It's composed of 3 applications:
- admin: UI for librarians
- public-search: search bar for non-logged users. Used in RERO-ils homepage
- search-bar: logged user search bar (integrated in RERO-ils banner)
We strongly recommend the use of nvm.
And then:
Optionnaly, for development purposes, you can install an IDE such as Visual Studio Code, Atom, WebStorm, etc.
After having launched RERO-ILS server:
# Install nvm
$ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
# reload shell environment to activate nvm
$ source ~/.bashrc
# Install npm
$ nvm install lts/erbium
# Get RERO-ILS-UI and use specific npm
$ git clone https://github.com/rero/rero-ils-ui.git/
$ cd rero-ils-ui
$ nvm use lts/erbium
# Install angular-cli
$ npm i -g @angular/[email protected]
# Project npm dependencies
$ npm i
# Build shared library
$ ng build shared --watch
# Launch a local server using a proxy for https://localhost:5000 (rero-ils server)
$ npm run start-admin-proxy
In case you're updating Node version with nvm:
# First check you node version
node --version # here, 10.16.3
nvm install lts/erbium --reinstall-packages-from=10.16.3
nvm uninstall 10.16.3
Run the rero-ils
dev server on https://localhost:5000
and run npm run start-admin-proxy
or npm run start-public-search-proxy
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
To run all applications in production, just do:
npm run build
It generates all needed files in dist directory.
Run ./run-tests.sh
to execute linting and the unit tests via Karma.
This will do headless browser tests (no Graphical User Interface).
To check test in live, do: ng test [project_name]
where project_name is one of:
- admin
- public-search
- search-bar
For example with projects/admin/src/app/menu/menu.component.spec.ts file:
ng test --main projects/admin/src/app/menu/menu.component.spec.ts
For Chromium users, it would be necessary to set CHROME_BIN variable:
CHROME_BIN=`which chromium` ./run-tests.sh
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
As we use Transifex for rero-ils-ui you need to extract new string.
Transifex is now integrated into git workflow the following way:
When a PR is merged into dev branch, Transifex pulls the new or updated strings. When a language is 100% reviewed, Transifex creates a branch and a PR (one per language) to merge translations to dev branch.
Don't use tx pull or push command, as the synchronization is done automatically, but extract the strings before each PR, as described below:
Choose the command regarding the application you work on:
- Use extract command first to put the strings in source file.
- Then use update command to add the strings in the translations files. This allows the strings to be displayed in any language even if not yet translated.
Commands:
npm run admin_extract_messages
: will extract all strings in admin project and put them in en_US.json file (source file)npm run admin_update_catalog
: will extract all string in source file and put them into de/en/fr/it json files for translationnpm run public-search_extract_messages
: same as admin, but for public-search projectnpm run public-search_update_catalog
: same as admin, but for public-search projectnpm run extract_messages
: launches admin_extract_messages and public-search_extract_messages commandsnpm run update_catalog
: launches public-search_update_catalog and admin_update_catalog commands