User Tools
Writing /app/www/public/data/meta/onboarding/errigalcommonheader.meta failed
onboarding:errigalcommonheader
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| onboarding:errigalcommonheader [2018/07/10 11:46] – adsilva | onboarding:errigalcommonheader [2021/06/25 10:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Errigal Common Header ====== | ||
| + | |||
| + | --- // | ||
| + | |||
| + | |||
| + | As our project shares the same header with all the applications, | ||
| + | |||
| + | Usage: | ||
| + | |||
| + | First would be the configuration: | ||
| + | |||
| + | < | ||
| + | commonHeader{ | ||
| + | config = " | ||
| + | version = " | ||
| + | url = " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | The configuration is per environment, | ||
| + | |||
| + | The next thing to do would be to load the header code itself. | ||
| + | |||
| + | < | ||
| + | <script src=" | ||
| + | <script src=" | ||
| + | </ | ||
| + | |||
| + | That should pretty much be it. The script will load the required config and JS files. | ||
| + | These files are located within Apache(in the LB). | ||
| + | |||
| + | Available APIs | ||
| + | |||
| + | ERRIGAL_HEADER.setAppTitle(String title); | ||
| + | ERRIGAL_HEADER.setLoginUserName(String username); | ||
| + | ERRIGAL_HEADER.addCSS(String customCss); | ||
| + | | ||
| + | Available functions that you can override: (These will be called whenever you click these links) | ||
| + | |||
| + | ERRIGAL_HEADER.home = function(){} | ||
| + | ERRIGAL_HEADER.logout = function(){} | ||
| + | ERRIGAL_HEADER.admin= function(){} | ||
| + | ERRIGAL_HEADER.support = function(){} | ||
| + | | ||
| + | Recipes: | ||
| + | |||
| + | To change the links in the drop down menu: | ||
| + | |||
| + | < | ||
| + | //set the following to what the App requires. | ||
| + | var myLink = window.ERRIGAL_HEADER.getLink(' | ||
| + | myLink.show = false; //etc etc | ||
| + | //then re-render the DOM | ||
| + | window.ERRIGAL_HEADER.initHeader(document.body); | ||
| + | </ | ||
| + | |||
| + | To change the default config, you may have to change the actual config file being loaded: | ||
| + | |||
| + | for example: https:// | ||
| + | |||
| + | to change the above, edit / | ||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | **Environment Configuration** | ||
| + | |||
| + | * In the ansible scripts per customer configuration the following parameter is configured (true or false) to open the IDMS links in a new tab: **openInNewWindow** | ||
| + | * **cssFileDir**: | ||
| + | * **hidePoweredByLogo**: | ||
| + | |||
| + | ---- | ||
| + | |||
| + | **Deployment Playbooks** | ||
| + | |||
| + | ==== Redeploy Config files example ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | ansible-playbook -i ../ | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Redeploy App example ==== | ||
| + | < | ||
| + | ansible-playbook -i ../ | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Run App locally ==== | ||
| + | In order to run the header app locally and see changes applied to another Errigal application you need to specify the common header settings in the app Config.groovy | ||
| + | |||
| + | **Step1** - Run the header project locally using - python3 -m http.server or python -m SimpleHTTPServer 8000 | ||
| + | |||
| + | **Step2** - Run an Errigal App locally with the following attributes specified in the config file. | ||
| + | < | ||
| + | commonHeader{ | ||
| + | config = " | ||
| + | version = " | ||
| + | url = " | ||
| + | } | ||
| + | </ | ||