Skip to content

TradeTrust/generic-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic Templates

GithubActions

Generic templates for TradeTrust, where users can use any of these available templates to render their document.

Note: These are just some rendering templates that are made available for users to use, the configurations to use these templates are in the documentation of TradeTrust document creator.

Available Templates type name Verifiable Transferable Support OA V3 Privacy Filter
Bill of Lading EMBEDDED_RENDERER BILL_OF_LADING -
Bill of Lading (Generic) EMBEDDED_RENDERER BILL_OF_LADING_GENERIC - -
Bill of Lading (Carrier) EMBEDDED_RENDERER BILL_OF_LADING_CARRIER - -
Bill of Lading BIMCO V1 EMBEDDED_RENDERER BILL_OF_LADING_V1_BIMCO_STANDARD - -
Warehouse Receipt EMBEDDED_RENDERER WAREHOUSE_RECEIPT - -
Chafta COO EMBEDDED_RENDERER CHAFTA_COO - -
Covering Letter EMBEDDED_RENDERER COVERING_LETTER -
Invoice EMBEDDED_RENDERER INVOICE
Simple COO EMBEDDED_RENDERER SIMPLE_COO - -
Certificate of Non Manipulation EMBEDDED_RENDERER CERTIFICATE_OF_NON_MANIPULATION - -

In the forms[0].defaults.$template field of the configuration file, refer to the above for the type, name, and url values.

Note: To use these available templates, please ensure that you have the correct schema in the configuration file.

Renderer

Storybook


Install

You can download or git clone this repo

$ git clone https://github.com/TradeTrust/generic-templates.git
$ npm install

Commands

$ npm run storybook # open storybook and start editing your components
$ npm run storybook:build # generate docs
$ npm run test:watch # run tests with Jest
$ npm run test:coverage # run tests with coverage
$ npm run integration # run integration test with testcafe
$ npm run lint # lint code
$ npm run build # build component
$ npm run example:application # start embedded application

Testing the templates in an integrated environment

This template provides a simple application that is able to render documents built for the current renderer. To use it:

  1. Open application/index.tsx file and edit the documents property of the App component to suit your needs (provide any document that is available locally, whether it's a javascript, JSON or typescript document).
  2. Start your renderer: npm run dev
  3. Start the local application: npm run example:application
  4. Head to http://localhost:3010/, you should see the configured documents during step 1.

End-to-end and visualisation test

This repository has been configured to run end-to-end tests using Testcafe.

  • concurrently run npm run dev + npm run integration

Features

  • React - A JavaScript library for building user interfaces.
  • Webpack - Component bundler.
  • React testing library - Simple and complete testing utilities that encourage good testing practices.
  • Emotion - Library designed for writing css styles with JavaScript.
  • Babel - Write next generation JavaScript today.
  • Jest - JavaScript testing framework used by Facebook.
  • Testcafe - A node.js tool to automate end-to-end web testing.
  • ESLint - Make sure you are writing a quality code.
  • Prettier - Enforces a consistent style by parsing your code and re-printing it.
  • Typescript - JavaScript superset, providing optional static typing
  • Circle CI - Automate tests and linting for every push or pull request.
  • Storybook - Tool for developing UI components in isolation with documentation.
  • Debug - JS debugging utility that works both in node.js and browsers.

Pinned dependancies

Pure ESM issues:

  • escape-goat to 3.0.0

License

GPL-3.0


Releases

No releases published

Packages

No packages published

Languages