[Bps-public-commit] rt-extension-formtools branch dynamic-forms-from-config updated. 0.53-37-gfb77f27
BPS Git Server
git at git.bestpractical.com
Fri Oct 6 17:12:36 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-formtools".
The branch, dynamic-forms-from-config has been updated
via fb77f2726982b6f26f453c2f3ffcb5a3ebcf208c (commit)
from a05114f948884441090591afa516417aec4e3f28 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fb77f2726982b6f26f453c2f3ffcb5a3ebcf208c
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 6 13:11:44 2023 -0400
Support to enable/disable show_validation for custom fields on modify page
diff --git a/html/Admin/FormTools/Modify.html b/html/Admin/FormTools/Modify.html
index b9c9248..9b23c46 100644
--- a/html/Admin/FormTools/Modify.html
+++ b/html/Admin/FormTools/Modify.html
@@ -138,6 +138,17 @@
<input name="default" type="text" class="form-control" placeholder="<% $default_values{$item} %>" value="" />
</div>
</div>
+ <div class="form-row">
+ <div class="col-3 label"></div>
+ <div class="col-9 value">
+ <div class="custom-control custom-checkbox">
+ <input class="custom-control-input" id="<% CSSClass($item) %>-validation" type="checkbox" name="show_validation" value="1" checked="checked" />
+ <label class="custom-control-label" for="<% CSSClass($item) %>-validation">
+ <&|/l&>Show validation</&>
+ </label>
+ </div>
+ </div>
+ </div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
@@ -337,6 +348,19 @@
<input name="default" type="text" class="form-control" placeholder="<% $default_values{$item->{arguments}{name}} %>" value="<% $item->{arguments}{default} // '' %>" />
</div>
</div>
+% if ( !RT::Extension::FormTools::is_core_field($item->{arguments}{name}) ) {
+ <div class="form-row">
+ <div class="col-3 label"></div>
+ <div class="col-9 value">
+ <div class="custom-control custom-checkbox">
+ <input class="custom-control-input" id="formtools-element-<% $form_page_id{$page_name} %>-<% $i %>-validation" type="checkbox" name="show_validation" value="1" <% $item->{arguments}{show_validation} ? q{checked="checked"} : '' |n %> />
+ <label class="custom-control-label" for="formtools-element-<% $form_page_id{$page_name} %>-<% $i %>-validation">
+ <&|/l&>Show validation</&>
+ </label>
+ </div>
+ </div>
+ </div>
+% }
% } elsif ( $item->{type} eq 'hidden' ) {
<div class="form-row">
<div class="col-3 label"><&|/l&>Name</&>:</div>
diff --git a/static/js/rt-extension-formtools.js b/static/js/rt-extension-formtools.js
index edd3929..d8055b7 100644
--- a/static/js/rt-extension-formtools.js
+++ b/static/js/rt-extension-formtools.js
@@ -110,6 +110,16 @@ formTools = {
else {
delete value.arguments.default;
}
+
+ const validation = form.find(':input[name=show_validation]');
+ if ( validation.length ) {
+ if ( validation.is(':checked') ) {
+ value.arguments.show_validation = 1;
+ }
+ else {
+ delete value.arguments.show_validation;
+ }
+ }
}
else if ( value.type === 'hidden' ) {
value['input-name'] = form.find(':input[name=name]').val();
-----------------------------------------------------------------------
Summary of changes:
html/Admin/FormTools/Modify.html | 24 ++++++++++++++++++++++++
static/js/rt-extension-formtools.js | 10 ++++++++++
2 files changed, 34 insertions(+)
hooks/post-receive
--
rt-extension-formtools
More information about the Bps-public-commit
mailing list