Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
drupal-rjsf
Advanced tools
Integrate the React JSONSchema Form javascript library into Drupal's Form and Field API.
Readme
The module integrats the ReactJSONSchemForm js library into Drupal's Form and Field API.
The easiest way to ensure the editor and widgets are always built is to add a post install and update command to the scripts section of your composer.json like so.
"scripts": {
"post-install-cmd": [
"@buildRjsfEditor"
],
"post-update-cmd": [
"@buildRjsfEditor"
],
"buildRjsfEditor": [
"npm install --cwd ./docroot/modules/contrib/rjsf --prefix ./docroot/modules/contrib/rjsf",
"npm --prefix ./docroot/modules/contrib/rjsf run build:all"
]
}
To use an RJSF editor in a Drupal all that needs to be done is to add a rjsf_editor
element to the form and provide the
schema configs for the editor.
$form['rjsf_element'] = [
'#type' => 'rjsf_editor',
'#server_validation' => TRUE,
'#client_validation' => TRUE,
'#schema' => [
'title' => 'A registration form',
'description' => 'A simple form example.',
'type' => 'object',
'required' => ['firstName', 'lastName'],
'properties' => [
'firstName' => [
'type' => 'string',
'title' => 'First name',
'default' => 'Chuck',
],
'lastName' => [
'type' => 'string',
'title' => 'Last name',
],
'telephone' => [
'type' => 'string',
'title' => 'Telephone',
'minLength' => 10,
],
],
],
'#uiSchema' => [
'firstName' => [
'ui:autofocus' => TRUE,
'ui:emptyValue' => '',
'ui:autocomplete' => 'family-name',
],
'lastName' => [
'ui:emptyValue' => '',
'ui:autocomplete' => 'given-name',
],
'age' => [
'ui:widget' => 'updown',
'ui:title' => 'Age of person',
'ui:description' => '(earthian year)',
],
'bio' => [
'ui:widget' => 'textarea',
],
'password' => [
'ui:widget' => 'password',
'ui:help' => 'Hint: Make it strong!',
],
'date' => [
'ui:widget' => 'alt-datetime',
],
'telephone' => [
'ui:options' => [
'inputType' => 'tel',
],
],
],
];
To leverage the full power of Drupal within the RJSF editor several custom react form widgets have been created to cover the most common use cases. There is also an extension pattern making use of Module Federation that allows for integrating custom widgets into the editing experience.
The integration of entity browser allows for RJSF to reference any entity inside of Drupal. With support for multiple browsers developers can define as many entity browser's as they want tailoring the editing experience to the content.
@TODO
Drupal's WYSIWYG editing experience is available inside of components. Developers can set up, configure, control permissions for all rich text styles all from within the normal Drupal pages.
@TODO
@TODO write a link widget to reference Drupal content
@TODO
@TODO write a simple autocomplete widget to compliment the more complex Entity Browser widget.
@TODO
FAQs
Integrate the React JSONSchema Form javascript library into Drupal's Form and Field API.
We found that drupal-rjsf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).