0.5.0 • Published 6 years ago

users-web v0.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

Users Web interface

Release notes

Application release notes can be found in Confluence https://propertyguru.atlassian.net/wiki/spaces/UE/pages/357466126/Release+Notes+-+Users+Web

JIRA Project

All tasks related to Users Web should be requested via JIRA in User Engagement project. Link for the project is https://propertyguru.atlassian.net/projects/UE

Docker instructions

Build application

npm run ci-build

Build image

npm run docker-build

Run container

Below command will expose application on port 3000 npm run docker-run Once it's started you can load application via http://localhost:3000

Build script

$ npm run build

Tests

Run the all tests using npm:

$ npm test

Unit test

$ npm run test-unit

Unit test & code coverage

$ npm run test-coverage

Sass test

$ npm run test-sass

Usages

After npm run build, there are 2 files in dist folder, one is js and another is js.map. Include .js file in html file.

<script src="../dist/app.js"></script>

Then, UsersWeb will be exposed as global (window) object. Next, create button element since some components need to be rendered on the top of other element

<button id="hello-world">HELLO</button>

Next, use UsersWeb rendering api to render component

<script type="text/javascript">
	UsersWeb.components.renderLoginTooltipHeader('#hello-world', (elm) => {
	    alert('Hello World');
	})
</script>

All rendering functions can be found in /renderers and script functions can be found in /scripts

Examples

See examples directory for all example html files and can be run in browser