1.3.1 • Published 3 years ago

@stacknvault/cra-template-iex2-app v1.3.1

Weekly downloads
75
License
MIT
Repository
github
Last release
3 years ago

IEX2 applications

IEX2 allows developers use the technology they want to generate expose templates to send real estate items to a given contact.

Developers can leverage the IEX2 components and the expose script to develop and publish expose templates.

Structure of the expose

An expose has stages. It represents the lifecycle that the customer goes through when buying real estate. Some sensitive information may be hidden until certain stage and some sections will be also available after certain stage.

A section is a block that is presented to the user. Examples:

  • Provisioning Contract Agreement

  • A Hero Banner

  • An image carousel

  • ...

The engine expects two files to exist on the public directory:

  • assets/context/config.json

  • assets/context/context.json

config.json

This file includes the configuration of the fields that are available for the entity (the estate) at whatever stage:

An example:

{
	"includes": [
		{"entityName": "entity", "fieldName": "flowfact_geolocation", "minStage": 1},
		{"entityName": "entity", "fieldName": "addresses", "minStage": 1},
		{"entityName": "entity", "fieldName": "latitude", "minStage": 1},
		{"entityName": "entity", "fieldName": "longitude", "minStage": 1},
		{"entityName": "entity", "fieldName": "id", "minStage": 0},
		{"entityName": "entity", "fieldName": "AnnualNetColdRentActualCommercial", "minStage": 0},
		...
		{"entityName": "entity", "fieldName": "yield_actual", "minStage": 0}
	]
}
  • The entity.addresses field isn't available on de model until stage 1

When Stage objects are used, like on the example below, the framework controls when to show them depending on the stage:

...
<Stage  level="0">
	<ContractAgreement
	theme={theme}
	contracts={ffmap`company.legislationTexts`}
	imgObj={ffmap`entity.mainImage`}/>
</Stage>
<Stage  level="1">
	<WhateverOtherSection/>
	...
</Stage>

Functions like ffmap help access the data from the context.

The expose script

Setting up the environment

The following environment variables need to be set:

  • TOKEN: It's taken from Flowfact, from the Settings --> API access menu
  • REACT_APP_STAGE: development|staging|production
  • PUBLIC_URL: Must be set to "." due to the way the exposes are going to be consumed by the consumer

Apart from the regular yarn scripts, in the project directory, you can run:

yarn run expose help

USAGE:

npm run expose <publish|delete|list|render|set-stage|get-context>  --<option name>=<option value>

For help, run:

npm run expose help

or

npm run expose <command> help

yarn run expose publish help

Publishes a template.

USAGE:

npm run expose publish  [ --template-id=<your own template id> ] [ --name="<the name of the template>"] [--global]

If no other args are specified, they will be taken from .lastRun. The only flag not taken from .lastRun will be --global

yarn run expose delete help

Deletes a template.

USAGE:

npm run expose delete  [ --template-id=<your own template id> ] [--global]

If no other args are specified, they will be taken from .lastRun. The only flag not taken from .lastRun will be --global

yarn run expose list help

Lists templates.

USAGE:

npm run expose list [--global]

If no other args are specified, they will be taken from .lastRun. The only flag not taken from .lastRun will be --global

yarn run expose render help

Renders a template for a given contact-id, entity-id and optional company-id.

USAGE:
npm run expose render [--render-id=<your own render id> ] --template-id=<template id> --contact-id=<contact id> --entity-id=<entity id> [ --company-id=<company id> ]

If no other args are specified, they will be taken from .lastRun. The only flag not taken from .lastRun will be --global

If company id is not specified, it will be taken from the sender

A custom render-id can be used.

yarn run expose set-stage help

Sets the stage of a rendered template

USAGE:

npm run expose set-stage --render-id=<render id> --stage=<stage number starting from 0>

If no other args than the stage are specified, they will be taken from .lastRun. The only flag not taken from .lastRun will be --global

yarn run expose get-context help

Gets the context for a given contact-id, entity-id and optional company-id and it writes it to public/assets/context/context.json.

USAGE:

npm run expose get-context --contact-id=<contact id> --entity-id=<entity id> --stage=<stage number starting from 0> [ --company-id=<company id> ]

If no other args than the stage are specified, they will be taken from .lastRun. The only flag not taken from .lastRun will be --global

If company id is not specified, it will be taken from the sender
1.3.1

3 years ago

1.2.53

3 years ago

1.3.0

3 years ago

1.2.52

3 years ago

1.2.51

3 years ago

1.2.50

3 years ago

1.2.48

3 years ago

1.2.47

3 years ago

1.2.46

3 years ago

1.2.45

3 years ago

1.2.44

4 years ago

1.2.42

4 years ago

1.2.41

4 years ago

1.2.40

4 years ago

1.2.39

4 years ago

1.2.38

4 years ago

1.2.37

4 years ago

1.2.35

4 years ago

1.2.34

4 years ago

1.2.32

4 years ago

1.2.31

4 years ago

1.2.30

4 years ago

1.2.29

4 years ago

1.2.28

4 years ago

1.2.27

4 years ago

1.2.24

4 years ago

1.2.23

4 years ago

1.2.22

4 years ago

1.2.21

4 years ago

1.2.20

4 years ago

1.2.18

4 years ago

1.2.19

4 years ago

1.2.16

4 years ago

1.2.17

4 years ago

1.2.15

4 years ago

1.2.14

4 years ago

1.2.12

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.2.11

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.19

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago