1.1.5 • Published 4 years ago

@axa-ch/aletheia-zoid v1.1.5

Weekly downloads
35
License
ISC
Repository
github
Last release
4 years ago

aletheia-zoid

Table of Contents

Cross-Domain UI-Renderer npm

This package provides Aletheia encapsulated within a zoid component, providing:

Install

First install this package and it's peer dependency @axa-ch/aletheia by:

npm install --save @axa-ch/aletheia-zoid @axa-ch/aletheia

Usage

Be aware that you need to build and serve two pages:

  1. the parent page, which loads the UI-Renderer through an iframe
  2. the child page, which integrates the UI-Rnderer within an iframe

IMPORTANT: the versions of @axa-ch/aletheia-zoid have to be equal in the parent and the child page, if not, then zoid will throw an error that the versions do not match.

Parent

We provide a generic component definition and a React driver.

Properties

The Ui-Renderer supports the following properties:

NameDescriptionTypeRequired
localeLocale of the application - country and language code allowed.string:x:
stageThe current stage at which aletheia is running, i.e. production, acc, dev or local.string:x:
iframeUrlThe URL of the iframe's HTML page.string:x:
isFromMyAxaWhether or not myAXA native Android or iOS App is used.boolean:o:
apiTestKeyAPI Key for local testing.string:o:
xAxaApikeyAPI keys should only be used for public unauthorized API’s. An API key is unique per client application and will be used solely for client identification (for details, please consult the official documentation at confluence).string:o:
oauthTokenOAuth token of type Bearer.string:x:
xAxaContextIdentity propagation in RESTful service is handled via the X-Axa-Context Header (for details, please consult the official documentation at confluence).string:o:
fallbackUrlThe url to fall back to if the process cannot be started.string:x:
apiAPI URL to BPM.string:x:
refreshUrlURL for refreshing the oAuth Access Token.string:o:
redirectUrlURL for refreshing the oAuth Access Token by redirect.string:o:
satCookieNameName of the Secure-Access-Token-Cookie.string:o:
processInstanceIdUnique ID for a running process (mainly used for development).string:o:
processNameName of the process which should be started automatically (mainly used for production).string:o:
endUserKeyUser who started the process.string:x:
roidROIDs (Right Owner ID) are Alcatraz IDs and are used only on DTP Platform (for details, please consult the official documentation at confluence).string:o:
ulsWhether or not to use the User Login Servlet, which offers authetication by user-id and password (for details, please consult the official documentation at confluence).boolean:o:
onProcessEndedFunction to be called upon process end.function:x:
onProcessErrorFunction to be called upon process error.function:x:
onProcessAbortedFunction to be called upon process abortion.function:x:
nvpAn array of NVP objects.array:o:
nvpNamesMapA map to rename NVP-names.array:o:

React

import React from 'react';
import ReactDom from 'react-dom';
import createReact from '@axa-ch/aletheia-zoid/dist/createReact';

const AletheiaZoidReact = createReact(React, ReactDom);

export default AletheiaZoidReact;

Note: Make sure, that you bundle the same React and ReactDom version, and these only once. Else you might see Invalid hook call violations. https://reactjs.org/warnings/invalid-hook-call-warning.html

Child

The child consists of two parts:

  1. the component implementation to be loaded within an iframe
  2. the expected global styles, font files (from the patterns-library V1), polyfills, etc.

child.js:

// 1. You need the minimum CSS of the patterns-library v1 and aletheia
import './child.scss';

// 2. You need the Aletheia-Zoid Component
import '@axa-ch/aletheia-zoid/dist/component';

child.scss:

@import '@axa-ch/patterns-library/src/styles/reboot';

// IMPORTANT: adjust your font's base path accordingly, this is just from the example
$font-base-path: '../node_modules/@axa-ch/patterns-library/src/assets/fonts/';
@import '@axa-ch/patterns-library/src/styles/fonts';

Example

Start the example locally:

  1. run npm run dev
  2. go to http://localhost:1234/parent.html

Please see the example folder.

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago