Git Product home page Git Product logo

uchibeke / composer-form Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 9.0 774 KB

A modeling tool for generating a web form from a blockchain model type and validating and submitting the filled out form to a Hyperledger Blockchain

Home Page: https://hyperledger.github.io/composer/

License: Other

HTML 3.03% CSS 2.45% JavaScript 94.53%
blockchain hyperledger-composer-model modeling-language hyperledger hyperledger-fabric diagram-editor hyperledger-composer hyperledger-setup

composer-form's Introduction

Hyperledger Composer Form

Hyperledger Composer Form is a form generator for Hyperledger composer.

Coverage Status

Build Status

The Hyperledger Composer modelling language is used by both Hyperledger Composer and Accord Project Cicero as an object-oriented data description (schema) language, based on a textual domain-specific language. Both communities would benefit from improved tooling for the modelling language, including the ability to generate UML style diagrams and web-forms from class descriptions described using the Hyperledger Composer modelling language.

Web Form Generator

A web-form generated from model types would allow transactions to be submitted (or assets/participants created) by filling out a web-form, as opposed to submitting JSON formatted text, easing ease of use and guiding the user. The web form generator dynamically creates form elements based on a root type from a Hyperledger Composer model. Some simplifying assumptions are made to solve the issue of data-binding from arbitrarily complex object models to web forms. The generated web form generator is an embeddable, modular, component that can be easily embedded in web-based tools, such as Hyperledger Composer Playground, or similar.

How this project is structured

  • Three packages: main, react-app and vanilla-js

  • The main package does the work and react-app and vanilla-js use the form generated by main

  • Each package has it's own package.json

More Information

Modeling Language | Hyperledger Composer: https://hyperledger.github.io/composer/reference/cto_language.html GitHub - accordproject/cicero: Open Source implementation of Accord Protocol Template Specification: https://github.com/accordproject/cicero Hyperledger Composer: https://composer-playground.mybluemix.net

What does this do

  • Web-form Generator: A functional dynamic web component, that generates a web-form based on the fully-qualified name of a type from a Hyperledger Composer Model. A sample web application that shows the dynamic web component in action.

  • Ask a question on Stack Overflow

  • Chat on the Rocket.Chat discussion channels

Suggested reading list is:

Getting in touch

If you have a question on using Hyperledger Composer

If you have found a defect or want to raise a feature requests

If you want to contribute to the develop of Hyperledger Composer

License

Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.

composer-form's People

Contributors

uchibeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mttrbrts tkuhrt

composer-form's Issues

Support for model selection from model file

When generating a form from a model file that contains multiple models, I should be able to select which of the models that I want to render:

  • I should be able to make the selection programmatically
  • I should be able to make the selection in the UI

Support for nested models

Enums, Relationships, and Concepts should be handled and built into the form generator.

  • We will support up to 3 levels of nesting

Form generation from local model file

  • From a free-textarea or similar, the user should be able to provide text by copy / paste as the source for the generator.
  • The source model should be validate before form generation
  • Errors in the source model should be visualized in the UI.

Accept user input in the form and validate against model

Dan:

A cool demo would be a React app that: (edited)

1. Prompt the user for the the fully-qualified name of a CML type and a URL to import the type from
2. Generate the web form dynamically from the type
3. User populates the web form
4. The JSON is displayed and validated against the mode

Custom Styling

As a user of this library, I should be able to apply custom styling to the generated code so that it fits within the context of my application.

Browserify the package

So that I can run the generator client-side, the packages should be browserified. This includes dependencies such as composer-common

Setup CI and testing

Matt:

Let’s talk about CI/CD later today. AP and Composer both use travis for builds, mocha/chai for tests, and coveralls for test coverage

If we’re in GitHub land, using a GH project associated with your repo is probably sufficient. You could create a kanban board to organise your tasks and issues into milestones

Use mono repo for managing components

Three components

  • The main form generator tool (Reusable and generic)
  • React form generator and
  • Vanilla JS version

Setup code repo with lerna and start working on the generic form generator

Form is generated multiple times

To reproduce paste this contents:

namespace org.accordproject.address

/**
 * Based on http://schema.org/PostalAddress
 */
concept Foo {
  o String streetAddress optional
  o String postalCode optional
  o String postOfficeBoxNumber optional
  o String addressRegion optional
  o String addressLocality optional
  o String addressCountry optional
}

There are 3 instances of Foo generated.

Localization

Add localization.

Dan

It would be very useful to be able to decorate the Composer model with annotations that are used as the labels for the generated form. See accordproject/template-archive#111. Additional annotations could be defined for accessibility, keyboard navigation etc.

Publish to NPM

I should be able to install the composer-form libraries from NPM so that I can use them in a project

Generation of Model Instances from Form contents

On a button click or function call, the contents of a valid form should generate a JSON serialization.

Parsing this JSON serialization with the Model Manager's Serializer (fromJSON) should be guaranteed to succeed.

Questions

  • What does it mean for a form to be valid?
  • How do you handle / present errors in the serialization process?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.