From 59fdc80e9f45ac2fc2fcb884ff4900faeb5fabb8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 27 Apr 2019 16:52:37 -0700 Subject: [PATCH] GUACAMOLE-742: Provide "disabled" attribute for forms and fields. --- guacamole/src/main/webapp/app/form/directives/form.js | 10 +++++++++- .../src/main/webapp/app/form/directives/formField.js | 10 +++++++++- .../src/main/webapp/app/form/services/formService.js | 4 ++++ .../main/webapp/app/form/templates/checkboxField.html | 2 +- .../src/main/webapp/app/form/templates/dateField.html | 1 + .../src/main/webapp/app/form/templates/emailField.html | 1 + guacamole/src/main/webapp/app/form/templates/form.html | 1 + .../main/webapp/app/form/templates/numberField.html | 2 +- .../main/webapp/app/form/templates/passwordField.html | 2 +- .../main/webapp/app/form/templates/selectField.html | 3 ++- .../main/webapp/app/form/templates/textAreaField.html | 2 +- .../src/main/webapp/app/form/templates/textField.html | 3 ++- .../src/main/webapp/app/form/templates/timeField.html | 1 + .../main/webapp/app/form/templates/timeZoneField.html | 3 ++- 14 files changed, 36 insertions(+), 9 deletions(-) diff --git a/guacamole/src/main/webapp/app/form/directives/form.js b/guacamole/src/main/webapp/app/form/directives/form.js index 518db7dba..be2f3b176 100644 --- a/guacamole/src/main/webapp/app/form/directives/form.js +++ b/guacamole/src/main/webapp/app/form/directives/form.js @@ -64,7 +64,15 @@ angular.module('form').directive('guacForm', [function form() { * * @type Boolean */ - modelOnly : '=' + modelOnly : '=', + + /** + * Whether the contents of the form should be rendered as disabled. + * By default, form fields are enabled. + * + * @type Boolean + */ + disabled : '=' }, templateUrl: 'app/form/templates/form.html', diff --git a/guacamole/src/main/webapp/app/form/directives/formField.js b/guacamole/src/main/webapp/app/form/directives/formField.js index ea0f35fd7..15adc29e4 100644 --- a/guacamole/src/main/webapp/app/form/directives/formField.js +++ b/guacamole/src/main/webapp/app/form/directives/formField.js @@ -53,7 +53,15 @@ angular.module('form').directive('guacFormField', [function formField() { * * @type String */ - model : '=' + model : '=', + + /** + * Whether this field should be rendered as disabled. By default, + * form fields are enabled. + * + * @type Boolean + */ + disabled : '=' }, templateUrl: 'app/form/templates/formField.html', diff --git a/guacamole/src/main/webapp/app/form/services/formService.js b/guacamole/src/main/webapp/app/form/services/formService.js index 168a1efa7..21bfb4742 100644 --- a/guacamole/src/main/webapp/app/form/services/formService.js +++ b/guacamole/src/main/webapp/app/form/services/formService.js @@ -213,6 +213,10 @@ angular.module('form').provider('formService', function formServiceProvider() { * model: * The current String value of the field, if any. * + * disabled: + * A boolean value which is true if the field should be disabled. + * If false or undefined, the field should be enabled. + * * @param {Element} fieldContainer * The DOM Element whose contents should be replaced with the * compiled field template. diff --git a/guacamole/src/main/webapp/app/form/templates/checkboxField.html b/guacamole/src/main/webapp/app/form/templates/checkboxField.html index ad9d8e006..b76368afe 100644 --- a/guacamole/src/main/webapp/app/form/templates/checkboxField.html +++ b/guacamole/src/main/webapp/app/form/templates/checkboxField.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/form/templates/dateField.html b/guacamole/src/main/webapp/app/form/templates/dateField.html index a186e19a5..b6af5463c 100644 --- a/guacamole/src/main/webapp/app/form/templates/dateField.html +++ b/guacamole/src/main/webapp/app/form/templates/dateField.html @@ -1,5 +1,6 @@
diff --git a/guacamole/src/main/webapp/app/form/templates/numberField.html b/guacamole/src/main/webapp/app/form/templates/numberField.html index 3d6312e20..007297365 100644 --- a/guacamole/src/main/webapp/app/form/templates/numberField.html +++ b/guacamole/src/main/webapp/app/form/templates/numberField.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/form/templates/passwordField.html b/guacamole/src/main/webapp/app/form/templates/passwordField.html index 506d8b6b2..56472ef4e 100644 --- a/guacamole/src/main/webapp/app/form/templates/passwordField.html +++ b/guacamole/src/main/webapp/app/form/templates/passwordField.html @@ -1,4 +1,4 @@
- +
\ No newline at end of file diff --git a/guacamole/src/main/webapp/app/form/templates/selectField.html b/guacamole/src/main/webapp/app/form/templates/selectField.html index 3bd2bb876..2f2b9d5ee 100644 --- a/guacamole/src/main/webapp/app/form/templates/selectField.html +++ b/guacamole/src/main/webapp/app/form/templates/selectField.html @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/form/templates/textAreaField.html b/guacamole/src/main/webapp/app/form/templates/textAreaField.html index 082476f14..e049df60d 100644 --- a/guacamole/src/main/webapp/app/form/templates/textAreaField.html +++ b/guacamole/src/main/webapp/app/form/templates/textAreaField.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/form/templates/textField.html b/guacamole/src/main/webapp/app/form/templates/textField.html index a338db4cd..819ae038a 100644 --- a/guacamole/src/main/webapp/app/form/templates/textField.html +++ b/guacamole/src/main/webapp/app/form/templates/textField.html @@ -1,5 +1,6 @@
- + diff --git a/guacamole/src/main/webapp/app/form/templates/timeField.html b/guacamole/src/main/webapp/app/form/templates/timeField.html index 24ae968b0..d45f54c91 100644 --- a/guacamole/src/main/webapp/app/form/templates/timeField.html +++ b/guacamole/src/main/webapp/app/form/templates/timeField.html @@ -1,5 +1,6 @@