You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2018/11/20 18:04:24 UTC

[31/50] [abbrv] ignite git commit: IGNITE-9339 Form-field-size improvements. - Fixes #5440.

IGNITE-9339 Form-field-size improvements. - Fixes #5440.

Signed-off-by: Andrey Novikov <an...@gridgain.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7c632e68
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7c632e68
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7c632e68

Branch: refs/heads/ignite-9720
Commit: 7c632e68d4b48480b22cdc950c67944415b8bd5e
Parents: 351d080
Author: Ilya Borisov <Kl...@gmail.com>
Authored: Tue Nov 20 11:30:03 2018 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Tue Nov 20 11:30:03 2018 +0700

----------------------------------------------------------------------
 .../web-console/e2e/testcafe/components/FormField.js | 11 +++++------
 .../components/form-field-size/controller.js         |  6 ++++++
 .../form-field/components/form-field-size/index.js   |  3 ++-
 .../form-field/components/form-field-size/style.scss | 15 +++++++++++++++
 .../components/form-field-size/template.pug          |  1 +
 5 files changed, 29 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7c632e68/modules/web-console/e2e/testcafe/components/FormField.js
----------------------------------------------------------------------
diff --git a/modules/web-console/e2e/testcafe/components/FormField.js b/modules/web-console/e2e/testcafe/components/FormField.js
index b0e8967..0c6c4eb 100644
--- a/modules/web-console/e2e/testcafe/components/FormField.js
+++ b/modules/web-console/e2e/testcafe/components/FormField.js
@@ -32,13 +32,12 @@ export class FormField {
         if (id)
             this._selector = Selector(`#${id}`).parent(this.constructor.ROOT_SELECTOR);
         else if (label) {
-            this._selector = Selector(() => {
-                return Array
-                    .from(window.document.querySelectorAll(this.constructor.LABEL_SELECTOR))
-                    .filter((el) => el.textContent.contains(label))
-                    .map((el) => el.parent(this.constructor.ROOT_SELECTOR))
+            this._selector = Selector((LABEL_SELECTOR, ROOT_SELECTOR, label) => {
+                return [].slice.call((window.document.querySelectorAll(LABEL_SELECTOR)))
+                    .filter((el) => el.textContent.includes(label))
+                    .map((el) => el.closest(ROOT_SELECTOR))
                     .pop();
-            });
+            })(this.constructor.LABEL_SELECTOR, this.constructor.ROOT_SELECTOR, label);
         } else if (model)
             this._selector = AngularJSSelector.byModel(model).parent(this.constructor.ROOT_SELECTOR);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c632e68/modules/web-console/frontend/app/components/form-field/components/form-field-size/controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/form-field/components/form-field-size/controller.js b/modules/web-console/frontend/app/components/form-field/components/form-field-size/controller.js
index 7663e9d..7f2f1b1 100644
--- a/modules/web-console/frontend/app/components/form-field/components/form-field-size/controller.js
+++ b/modules/web-console/frontend/app/components/form-field/components/form-field-size/controller.js
@@ -28,6 +28,8 @@ export default class PCFormFieldSizeController {
     onScaleChange;
     /** @type {ng.IFormController} */
     innerForm;
+    /** @type {boolean?} */
+    autofocus;
 
     static $inject = ['$element', '$attrs'];
 
@@ -38,6 +40,10 @@ export default class PCFormFieldSizeController {
             {label: 'Mb', value: 1024 * 1024},
             {label: 'Gb', value: 1024 * 1024 * 1024}
         ],
+        gigabytes: [
+            {label: 'Gb', value: 1},
+            {label: 'Tb', value: 1024}
+        ],
         seconds: [
             {label: 'ns', value: 1 / 1000},
             {label: 'ms', value: 1},

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c632e68/modules/web-console/frontend/app/components/form-field/components/form-field-size/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/form-field/components/form-field-size/index.js b/modules/web-console/frontend/app/components/form-field/components/form-field-size/index.js
index 5e08df2..e7da7d5 100644
--- a/modules/web-console/frontend/app/components/form-field/components/form-field-size/index.js
+++ b/modules/web-console/frontend/app/components/form-field/components/form-field-size/index.js
@@ -36,6 +36,7 @@ export default {
         sizeType: '@?',
         sizeScaleLabel: '@?',
         onScaleChange: '&?',
-        ngDisabled: '<?'
+        ngDisabled: '<?',
+        autofocus: '<?'
     }
 };

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c632e68/modules/web-console/frontend/app/components/form-field/components/form-field-size/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/form-field/components/form-field-size/style.scss b/modules/web-console/frontend/app/components/form-field/components/form-field-size/style.scss
index c522200..8b86e05 100644
--- a/modules/web-console/frontend/app/components/form-field/components/form-field-size/style.scss
+++ b/modules/web-console/frontend/app/components/form-field/components/form-field-size/style.scss
@@ -16,5 +16,20 @@
  */
 
 form-field-size {
+    --scale-select-width: 60px;
+    --error-area-width: 36px;
+    --default-input-padding-horizontal: 10px;
+
 	display: block;
+
+    .form-field__error {
+        width: var(--error-area-width);
+        position: absolute;
+        right: var(--scale-select-width);
+        bottom: 0;
+    }
+
+    &.ng-invalid input, input.ng-invalid {
+        padding-right: var(--error-area-width);
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c632e68/modules/web-console/frontend/app/components/form-field/components/form-field-size/template.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/form-field/components/form-field-size/template.pug b/modules/web-console/frontend/app/components/form-field/components/form-field-size/template.pug
index b712a67..147440b 100644
--- a/modules/web-console/frontend/app/components/form-field/components/form-field-size/template.pug
+++ b/modules/web-console/frontend/app/components/form-field/components/form-field-size/template.pug
@@ -39,6 +39,7 @@ include /app/helpers/jade/mixins
         max='{{ $ctrl.max ? $ctrl.max / $ctrl.sizeScale.value : "" }}'
         ng-required='$ctrl.required'
         ng-disabled='$ctrl.ngDisabled'
+        ignite-form-field-input-autofocus='{{$ctrl.autofocus}}'
     )
     button.select-toggle(
         bs-select