From 933f2d08dc5cb57743a25aaec54cc4ab9b5259f5 Mon Sep 17 00:00:00 2001 From: ViktorSlavov Date: Wed, 11 Sep 2019 14:53:01 +0300 Subject: [PATCH 1/7] test(dialog): dialog shows overlay at animation start, #1966 --- tests/unit/dialog/dialog-test.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/unit/dialog/dialog-test.js b/tests/unit/dialog/dialog-test.js index 3ed47cc82..d71ca5ef9 100644 --- a/tests/unit/dialog/dialog-test.js +++ b/tests/unit/dialog/dialog-test.js @@ -724,11 +724,11 @@ QUnit.test("[ID20] Modal Open and Close animations, passed as objects, should fi }); }); -QUnit.test("[ID21] Modal openAnimation should display modal overlay on end", function (assert) { - assert.expect(1); +QUnit.test("[ID21] Modal openAnimation should display modal overlay on start", function (assert) { + assert.expect(2); var $dialog = this.util.appendToFixture("

Hello World!

") .igDialog({ - state: 'open', + state: 'closed', modal: true, height: '400px', width: '600px', @@ -739,12 +739,10 @@ QUnit.test("[ID21] Modal openAnimation should display modal overlay on end", fun return true; } }); - var done = assert.async(); - this.util.wait(320).then(function () { - var backgroundIndex = parseInt($dialog.data("igDialog")._modalDiv.css("zIndex")); - assert.ok(backgroundIndex > 0, "z-Index of overlay is not greater than 1"); - done(); - }); + assert.notOk($dialog.data('igDialog')._modalDiv); + $dialog.igDialog('open'); + var backgroundIndex = parseInt($dialog.data("igDialog")._modalDiv.css("zIndex")); + assert.ok(backgroundIndex > 0, "z-Index of overlay is not greater than 1"); }); QUnit.test("[ID22] Stacking two dialogs within eachother should not create scrollbars", function (assert) { From 9b2f8efbbc7f6a441ef56e765977995f1ecad63a Mon Sep 17 00:00:00 2001 From: ViktorSlavov Date: Wed, 11 Sep 2019 14:54:07 +0300 Subject: [PATCH 2/7] fix(dialog): dialog shows overlay at start of open animation, #1966 --- src/js/modules/infragistics.ui.dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/modules/infragistics.ui.dialog.js b/src/js/modules/infragistics.ui.dialog.js index 8db6b86ee..4f4237493 100644 --- a/src/js/modules/infragistics.ui.dialog.js +++ b/src/js/modules/infragistics.ui.dialog.js @@ -1516,9 +1516,9 @@ //V.S. 21 February, 2018 - #1204 animation chaining was not always calling moveToTop properly if (typeof anim === "string") { + self.moveToTop(true); elem.hide().show(anim, function () { self._trigger("animationEnded", e, arg); - self.moveToTop(true); }); } else { if (typeof anim !== "object") { @@ -1526,8 +1526,8 @@ } anim.complete = function () { self._trigger("animationEnded", e, arg); - self.moveToTop(true); }; + self.moveToTop(true); elem.hide(0).show(anim); } } else { From 9638b1cc6d49c11b2c5ddd572a219cfe5dd5fea3 Mon Sep 17 00:00:00 2001 From: wnvko Date: Wed, 11 Sep 2019 17:33:05 +0300 Subject: [PATCH 3/7] test(editors): validators should correctly set its language and locale, #1901 --- tests/unit/editors/baseEditor/base-test.js | 42 ++++++++++++++++++++++ tests/unit/editors/baseEditor/tests.html | 3 ++ 2 files changed, 45 insertions(+) diff --git a/tests/unit/editors/baseEditor/base-test.js b/tests/unit/editors/baseEditor/base-test.js index 625ed5569..492fefea3 100644 --- a/tests/unit/editors/baseEditor/base-test.js +++ b/tests/unit/editors/baseEditor/base-test.js @@ -503,3 +503,45 @@ QUnit.test('Destroy method reverts input state.', function (assert) { //check the value attribute and see if it is restored assert.equal(document.getElementById(textEditorId).getAttribute("value"), "myInputValue", 'Input value attr is not the same as before Editor init'); }); + +QUnit.only('Set editor`s validator language', function (assert) { + assert.expect(6); + var $textEditorNoLocale = this.util.appendToFixture(this.inputTag); + $textEditorNoLocale.igTextEditor( + { + validatorOptions : { + required: true + } + }); + + assert.equal($textEditorNoLocale.igValidator("option", "locale"), undefined, "Validator's locale should be undefined when editor has no locale"); + assert.equal($textEditorNoLocale.igValidator("option", "language").language, undefined, "Validator's language should be undefined when editor has no language"); + + var $textEditorWithLocale = this.util.appendToFixture(this.inputTag); + $textEditorWithLocale.igTextEditor( + { + language: "fr", + locale: "bg", + validatorOptions : { + required: true + } + }); + + assert.equal($textEditorWithLocale.igValidator("option", "locale"), "bg", "Validator's locale should be 'bg' when editor has locale"); + assert.equal($textEditorWithLocale.igValidator("option", "language"), "fr", "Validator's language should be 'fr when editor has language"); + + var $textEditorValidatorWithLocale = this.util.appendToFixture(this.inputTag); + $textEditorValidatorWithLocale.igTextEditor( + { + language: "fr", + locale: "bg", + validatorOptions : { + language: "es", + locale: "jp", + required: true + } + }); + + assert.equal($textEditorValidatorWithLocale.igValidator("option", "locale"), "jp", "Validator's language should be 'fr when validator has language"); + assert.equal($textEditorValidatorWithLocale.igValidator("option", "language"), "es", "Validator's locale should be 'es' when validator has locale"); +}); diff --git a/tests/unit/editors/baseEditor/tests.html b/tests/unit/editors/baseEditor/tests.html index 7c5a7ddcd..1688f0a7e 100644 --- a/tests/unit/editors/baseEditor/tests.html +++ b/tests/unit/editors/baseEditor/tests.html @@ -7,6 +7,7 @@ + @@ -18,6 +19,7 @@ + @@ -25,6 +27,7 @@ + From f0a17182e26e52e6d3dfa6ed80fc6adb3e2d452b Mon Sep 17 00:00:00 2001 From: wnvko Date: Wed, 11 Sep 2019 17:51:56 +0300 Subject: [PATCH 4/7] feat(editors): update validator's locale and language correctly, #1901 --- src/js/modules/infragistics.ui.editors.js | 13 ++++++++++++- tests/unit/editors/baseEditor/base-test.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index a55569ac8..8dc7e88aa 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -641,7 +641,9 @@ }, _setupValidator: function () { if (this.element.igValidator) { - this._validator = this.element.igValidator(this.options.validatorOptions).data("igValidator"); + // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly + var validatorOptions = $.extend({}, { language: this.options.language, locale: this.options.locale}, this.options.validatorOptions); + this._validator = this.element.igValidator(validatorOptions).data("igValidator"); this._validator.owner = this; } }, @@ -1831,6 +1833,13 @@ notifier.notify(notifier.options.state, message); } }, + // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly + _changeLocaleForValidator: function () { + if (this._validator) { + this._validator.options.locale = this.options.locale; + this._validator.options.language = this.options.language; + } + }, changeLocale: function () { /* changes the all locales into the widget element to the language specified in [options.language](ui.igtexteditor#options:language) Note that this method is for rare scenarios, see [language](ui.igtexteditor#options:language) or [locale](ui.igtexteditor#options:locale) option setter @@ -1840,6 +1849,8 @@ */ this._superApply(arguments); this._changeLocaleForNotifier(); + // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly + this._changeLocaleForValidator(); }, _setOption: function (option, value) { // igTextEditor /* igTextEditor custom setOption goes here */ diff --git a/tests/unit/editors/baseEditor/base-test.js b/tests/unit/editors/baseEditor/base-test.js index 492fefea3..adabe5b6b 100644 --- a/tests/unit/editors/baseEditor/base-test.js +++ b/tests/unit/editors/baseEditor/base-test.js @@ -504,7 +504,7 @@ QUnit.test('Destroy method reverts input state.', function (assert) { assert.equal(document.getElementById(textEditorId).getAttribute("value"), "myInputValue", 'Input value attr is not the same as before Editor init'); }); -QUnit.only('Set editor`s validator language', function (assert) { +QUnit.test('Set editor`s validator language', function (assert) { assert.expect(6); var $textEditorNoLocale = this.util.appendToFixture(this.inputTag); $textEditorNoLocale.igTextEditor( From 1baf1ad55b4f7016d7ce719e7071ed46e28124ab Mon Sep 17 00:00:00 2001 From: wnvko Date: Wed, 11 Sep 2019 18:01:59 +0300 Subject: [PATCH 5/7] chore(editors): fix lint errors, #1901 --- src/js/modules/infragistics.ui.editors.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index f1b16798c..f454dd150 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -641,8 +641,13 @@ }, _setupValidator: function () { if (this.element.igValidator) { + // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly - var validatorOptions = $.extend({}, { language: this.options.language, locale: this.options.locale}, this.options.validatorOptions); + var validatorOptions = $.extend( + {}, + { language: this.options.language, locale: this.options.locale }, + this.options.validatorOptions + ); this._validator = this.element.igValidator(validatorOptions).data("igValidator"); this._validator.owner = this; } @@ -1833,6 +1838,7 @@ notifier.notify(notifier.options.state, message); } }, + // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly _changeLocaleForValidator: function () { if (this._validator) { @@ -1849,6 +1855,7 @@ */ this._superApply(arguments); this._changeLocaleForNotifier(); + // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly this._changeLocaleForValidator(); }, From 98d2bea242fe01d52b838e3e4bb8cb3131cf23dc Mon Sep 17 00:00:00 2001 From: wnvko Date: Thu, 12 Sep 2019 16:58:30 +0300 Subject: [PATCH 6/7] chore(editors): fix spacing and grammar, #1901 --- src/js/modules/infragistics.ui.editors.js | 2 +- tests/unit/editors/baseEditor/tests.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index f454dd150..e0e4c262f 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -642,7 +642,7 @@ _setupValidator: function () { if (this.element.igValidator) { - // MV 9th Sep 2019 Bug #1901 Update validator's language and locale correctly + // MV 9th Sep 2019 Bug #1901 Update validator language and locale correctly var validatorOptions = $.extend( {}, { language: this.options.language, locale: this.options.locale }, diff --git a/tests/unit/editors/baseEditor/tests.html b/tests/unit/editors/baseEditor/tests.html index 1688f0a7e..7334fa7ae 100644 --- a/tests/unit/editors/baseEditor/tests.html +++ b/tests/unit/editors/baseEditor/tests.html @@ -7,7 +7,7 @@ - + From 31350167c04243c3837460bc708c4cca850e7194 Mon Sep 17 00:00:00 2001 From: wnvko Date: Thu, 12 Sep 2019 17:01:25 +0300 Subject: [PATCH 7/7] chore(editors): more tabs fixing, #1901 --- src/js/modules/infragistics.ui.editors.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index e0e4c262f..45a70acff 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -641,9 +641,8 @@ }, _setupValidator: function () { if (this.element.igValidator) { - - // MV 9th Sep 2019 Bug #1901 Update validator language and locale correctly - var validatorOptions = $.extend( + // MV 9th Sep 2019 Bug #1901 Update validator language and locale correctly + var validatorOptions = $.extend( {}, { language: this.options.language, locale: this.options.locale }, this.options.validatorOptions