@bigbinary/neeto-form-frontend v1.3.3
neeto-form-nano
The neeto-form-nano
allows us to build forms within neeto applications. This nano exports @bigbinary/neeto-form-frontend
NPM package and neeto-form-engine
Rails engine.
Contents
Development with Host Application
Engine
The engine adds setup for form on backend and allows us to attach forms to any model. It also stores submissions.
Installation
Add this line to your application's Gemfile:
source "NEETO_GEM_SERVER_URL" do # ...existing gems gem 'neeto-form-engine' end
And then execute:
bundle install
Install the migrations
bundle exec rails neeto_form_engine:install:migrations
Run the migrations
bundle exec rails db:migrate
Add this line to your application's
config/routes.rb
file (replaceat
to your desired route):mount NeetoFormEngine::Engine, at: "/neeto_form_engine"
Create file
neeto_form_engine.rb
underconfig/initializers
to provide theowner_class
informationNeetoFormEngine.owner_class = "Organization"
Configure models to add below association to the provided owner class
has_many :forms, class_name: "::NeetoFormEngine::Form", as: :owner
Configure models to add below association to scope submission records (optional)
has_one :submission, class_name: "::NeetoFormEngine::Submission", as: :record
Configure model to add below association to attach form (optional)
has_one :form, class_name: "::NeetoFormEngine::Form", as: :attachable
Customizability
The engine supports customizing the default behavior of Questions::UpdateService
. The supported methods/constants can be overridden by defining them in the concern NeetoFormEngine::Customizable::Questions::Updateable
Available methods:
create_question!
: This takes 2 arguments:params
andquestion
. Theparams
argument contains the question parameters passed from the front-end, and thequestion
argument contains the current question. This argument is required if you need translation support.additional_question_params
: If you want to include additional attributes while creating questions, you can specify them using this method. It takes one argumentparams
which will be the question parameters passed from the front-end.Available constants:
EXCLUDED_UPDATE_PARAMS
: If you have included extra parameters other thankind
for additional use cases that are not valid entity attributes, they need to be specified asEXCLUDED_UPDATE_PARAMS
.
Frontend package
The frontend package allows us to create forms across neeto products.
Installation
Install the NPM package
yarn add @bigbinary/neeto-form-frontend
The frontend package has a few peer dependencies that are required for the proper functioning of the package. Install all the peer dependencies using the below command:
yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3.1 formik@2.2.9 @bigbinary/neeto-commons-frontend
Import stylesheet from the following location:
@import "@bigbinary/neeto-form-frontend/dist/main.css";
Instructions for development
Check the Frontend package development guide for step-by-step instructions to develop the frontend package.
Usage
You can learn more about the usage here: 1. Components 2. Hooks
Instructions for Publishing
Consult the building and releasing packages guide for details on how to publish.
3 days ago
4 days ago
9 days ago
11 days ago
12 days ago
17 days ago
18 days ago
19 days ago
19 days ago
19 days ago
22 days ago
23 days ago
26 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
6 months ago
5 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
9 months ago
9 months ago
7 months ago
7 months ago
7 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
7 months ago
7 months ago
10 months ago
10 months ago
11 months ago
7 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago