Skip to content

Commit

Permalink
Merge branch 'release/4.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Apr 27, 2020
2 parents 6e80054 + bed38de commit ccb75fd
Show file tree
Hide file tree
Showing 10 changed files with 1,680 additions and 1,334 deletions.
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# v4.0.7
## 04/27/2020

1. [](#new)
* Added ability to hide form fields in `data.html.twig` and `data.txt.twig` with `field.store: false`
1. [](#improved)
* Updated node dependencies
* Added new `force_bool: true|false` option to `toggle` field to cast strings for use in BC situations
1. [](#bugfix)
* Fix markdown links in changelog [#415](https://github.com/getgrav/grav-plugin-form/pull/415)

# v4.0.6
## 03/19/2020
1. [](#new)
* CHANGE: Form labels are now displayed in `raw` format so you can use HTML in them
* Added support for `name` attribute on buttons [#411](https://github.com/getgrav/grav-plugin-form/issues/411)
1. [](#improved)
* Added support for `classes` option in `avatar` field
* Added support for `classes` option in `avatar` field
* Recompiled JS with latest NPM libraries
1. [](#bugfix)
* Fixed password field outputting the contents to HTML (will now always be empty when loading the page)
* Escape default output in `formdata.html.twig` [#384](https://github.com/getgrav/grav-plugin-form/issues
* Escape default output in `formdata.html.twig` [#384](https://github.com/getgrav/grav-plugin-form/issues/384)
* Better JS rendering of captcha field scripts for VueJS template compatibility

# v4.0.5
Expand All @@ -29,7 +40,7 @@

1. [](#new)
* Pass phpstan level 1 tests

# v4.0.2
## 02/03/2020

Expand All @@ -38,7 +49,7 @@
1. [](#bugfix)
* Fixed `toggle` field not working with `toggleable: true`
* Fixed fatal error when form type is disabled

# v4.0.1
## 01/02/2020

Expand All @@ -54,7 +65,7 @@

1. [](#new)
* Added `tabindex` to global attributes of default field
* Add ability to Sanitize SVGs on upload (Grav 1.7+ required)
* Add ability to Sanitize SVGs on upload (Grav 1.7+ required)
1. [](#improved)
* Deprecate `select_optgroup` as `select` can handle optgroups now
* Added missing tabindex checks
Expand Down Expand Up @@ -83,7 +94,7 @@
* Change form save action location to `user-data://` stream [#353](https://github.com/getgrav/grav-plugin-form/issues/353)
* Updated `eu`, `fr` and `pl` language
* Make `Form::initialize()` chainable
* Added `folder` option to `save:` action with fallback
* Added `folder` option to `save:` action with fallback
1. [](#bugfix)
* Fixed Submit & Redirect not working as expected [#355](https://github.com/getgrav/grav-plugin-form/issues/355)
* Fixed oversensitive refresh prevention [#354](https://github.com/getgrav/grav-plugin-form/issues/354)
Expand Down
257 changes: 246 additions & 11 deletions assets/form.min.js

Large diffs are not rendered by default.

58 changes: 45 additions & 13 deletions assets/form.vendor.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Form
version: 4.0.6
slug: form
type: plugin
version: 4.0.7
testing: false
description: Enables the forms handling
icon: check-square
Expand Down
37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,34 @@
"author": "Team Grav",
"license": "MIT",
"dependencies": {
"dropzone": "^5.5.1",
"dropzone": "^5.7.0",
"exif-js": "^2.3.0",
"sortablejs": "^1.7.0"
"sortablejs": "^1.10.2"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.5",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"css-loader": "^1.0.0",
"eslint": "^5.6.0",
"eslint-loader": "^2.1.1",
"css-loader": "^3.4.2",
"eslint": "^6.8.0",
"eslint-loader": "^3.0.4",
"exports-loader": "^0.7.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-clean-css": "^3.10.0",
"gulp-csscomb": "^3.0.8",
"gulp-rename": "^1.4.0",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-clean-css": "^4.3.0",
"gulp-csscomb": "^3.1.0",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.0.2",
"gulp-sourcemaps": "^2.6.5",
"gulp-webpack": "^1.5.0",
"immutable": "^4.0.0-rc.12",
"imports-loader": "^0.8.0",
"json-loader": "^0.5.7",
"style-loader": "^0.23.0",
"uglifyjs-webpack-plugin": "^2.0.1",
"webpack": "^4.19.1",
"webpack-cli": "^3.1.0"
"style-loader": "^1.1.3",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"
}
}
4 changes: 2 additions & 2 deletions templates/forms/default/data.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
{% import _self as self %}

{% for index, field in fields %}
{% set show_field = field.store ?? true %}
{% set input = attribute(field, "input@") %}

{% if input is null or input == true %}

{% if form.value(scope ~ field.name) %}
{% if show_field and form.value(scope ~ field.name) %}
{% block field %}
<div>
{% block field_label %}
Expand Down Expand Up @@ -45,4 +46,3 @@
{% import _self as macro %}

{{ macro.render_field(form, form.fields, '') }}

9 changes: 6 additions & 3 deletions templates/forms/default/data.txt.twig
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{%- macro render_field(form, fields, scope) %}
{%- import _self as self %}
{%- for index, field in fields %}
{%- set show_field = field.store ?? true %}
{%- set input = attribute(field, "input@") %}
{%- if input is null or input == true %}
{%- set value = form.value(scope ~ (field.name ?? index)) %}
{{- scope ~ (field.name ?? index) }}: {{ string(value is iterable ? value|json_encode : value|escape('yaml')) ~ "\r\n" }}
{%- if input is null or input == true %}
{%- if show_field %}
{%- set value = form.value(scope ~ (field.name ?? index)) -%}
{{- scope ~ (field.name ?? index) }}: {{ string(value is iterable ? value|json_encode : value|escape('yaml')) ~ "\r\n" }}
{%- endif %}
{%- else %}
{%- if field.fields %}
{%- set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope -%}
Expand Down
4 changes: 4 additions & 0 deletions templates/forms/fields/toggle/toggle.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
{% block input %}
{% set value = (value is same as(false) ? 0 : value) %}

{% if field.force_bool %}
{% set value = value|bool %}
{% endif %}

<div class="switch-toggle switch-grav {{ field.size }} switch-{{ field.options|length }} {{ field.classes }}">
{% set maxLen = 0 %}
{% for text in field.options %}
Expand Down
10 changes: 5 additions & 5 deletions webpack.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var webpack = require('webpack'),
path = require('path'),
UglifyJsPlugin = require('uglifyjs-webpack-plugin'),
isProd = process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'production-wip';
var webpack = require('webpack');
var path = require('path');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var isProd = process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'production-wip';

module.exports = {
entry: {
Expand Down Expand Up @@ -57,7 +57,7 @@ module.exports = {
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'stage-3']
presets: ['@babel/preset-env']
}
}
]
Expand Down
Loading

0 comments on commit ccb75fd

Please sign in to comment.