0.0.1 • Published 4 years ago
biz-docs-ui v0.0.1
Documents UI for BizBot
Available Scripts
In the project directory, you can run:
yarn start
Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
yarn publish:npm
Builds module for using within React apps. Usage:
import BizDocsUI from 'biz-docs-ui';
<Wrapper>
<BizDocsUI appToken="<appToken>" />
</Wrapper>
yarn build
Builds stand-alone script for browsers. Usage:
1) Load script on your html page
2) window.bizSDK.renderDocsUI({ ...params })
Parameters
- rootDomId (required, string) - parent DOM where to render the App. Is for stand-alone JS version only.
- appToken (required, string) - token of registered application. Ask support if you don't have your app registered yet
- contextFilter (required, func) - determines context and which data user should work with:
- default:
(perms, userId) => ([String(userId)])
whereperms
is an array of string-like permissions anduserId
(int) is id of current user. Returns everything for user context only. - returns: array of string-like permissions
In order to return data for company context use
() => orgNumber
, whereorgNumber
should be passed from your app.
- default:
- env (optional, string) - which environment to use. Default is
prod
. Choices aredev|stage|prod|local
. - userToken (optional, string) - default is
cookie
, so you don't need to care about it when using together with BizSDK. You can also pass user token there. - docsApiUrl (optional, string) - custom URL of Docs API. You can't use it if you are not from BizBot dev team.
- queryApiUrl (optional, string) - custom URL of Core Query API. Also useless if you are not from BizBot dev team.
NOTE that all the TOKENS are secret and should never appear in HTML code as it's not secure
Requirements
Module is designed for usage together with BizSDK.
In case you'd like to use it without BizSDK:
- you need to have
Bootstrap 4
stylesheets and scripts on your html page - use theme
https://dashkit.goodthemes.co/
, otherwise you need to attachFeature icons
like it's done in example on/public/stand-alone.html
0.0.1
4 years ago