From 91d7c9a8c88b60cbe66219e40658d46490fd4a35 Mon Sep 17 00:00:00 2001 From: BingoRUS Date: Thu, 25 Apr 2019 19:12:02 +0300 Subject: [PATCH] Release 18.2.8 --- build/gulp/npm.js | 4 --- build/gulp/vendor.js | 9 ----- js/data/odata/utils.js | 2 +- js/ui/grid_core/ui.grid_core.selection.js | 2 +- .../carmine/generic.carmine.less | 2 +- .../contrast/generic.contrast.less | 1 - .../color-schemes/dark/generic.dark.less | 2 +- .../darkviolet/generic.darkviolet.less | 2 +- .../color-schemes/light/generic.light.less | 6 ++-- styles/widgets/generic/list.generic.less | 2 +- .../material/color-schemes/material.dark.less | 2 +- .../color-schemes/material.light.less | 2 +- testing/helpers/ajaxMock.js | 5 +-- testing/runner/Views/Main/RunSuite.cshtml | 6 ++-- .../tests/DevExpress.data/odataStore.tests.js | 21 +++++++++++ .../dataGrid.tests.js | 35 +++++++++++++++++++ .../rowsView.tests.js | 2 +- 17 files changed, 74 insertions(+), 31 deletions(-) diff --git a/build/gulp/npm.js b/build/gulp/npm.js index 054a4afff51c..93428028c215 100644 --- a/build/gulp/npm.js +++ b/build/gulp/npm.js @@ -43,10 +43,6 @@ var DIST_GLOBS = [ '!artifacts/js/jquery*', '!artifacts/js/jszip*', '!artifacts/js/dx.custom*', - '!artifacts/js/quill*', - '!artifacts/js/Quill*', - '!artifacts/js/turndown*', - '!artifacts/js/showdown*', '!artifacts/ts/jquery*', '!artifacts/ts/knockout*', '!artifacts/ts/globalize*', diff --git a/build/gulp/vendor.js b/build/gulp/vendor.js index 6b26096e8027..509c5cf3fea9 100644 --- a/build/gulp/vendor.js +++ b/build/gulp/vendor.js @@ -37,15 +37,6 @@ const VENDORS = [ path: '/globalize/dist/globalize/@(number|currency|date|message).js', noUglyFile: true, base: '/globalize/dist/' - }, - { - path: '/quill/dist/quill.js' - }, - { - path: '/showdown/dist/showdown.js' - }, - { - path: '/turndown/lib/turndown.browser.umd.js' } ]; diff --git a/js/data/odata/utils.js b/js/data/odata/utils.js index 953925edad91..1d9d042263f1 100644 --- a/js/data/odata/utils.js +++ b/js/data/odata/utils.js @@ -326,7 +326,7 @@ var errorFromResponse = function(obj, textStatus, ajaxOptions) { } } - if(httpStatus >= 400) { + if(httpStatus >= 400 || httpStatus === 0) { errorData.httpStatus = httpStatus; return extend(Error(message), errorData); } diff --git a/js/ui/grid_core/ui.grid_core.selection.js b/js/ui/grid_core/ui.grid_core.selection.js index dcb555c8f98d..8a231b0f9bd0 100644 --- a/js/ui/grid_core/ui.grid_core.selection.js +++ b/js/ui/grid_core/ui.grid_core.selection.js @@ -456,7 +456,7 @@ exports.SelectionController = gridCore.Controller.inherit((function() { if(this.isSelectionWithCheckboxes()) { keys.control = true; } - return this._selection.changeItemSelection(itemIndex, keys); + return this._selection.changeItemSelection(this._dataController.getRowIndexDelta() + itemIndex, keys); }, focusedItemIndex: function(itemIndex) { diff --git a/styles/widgets/generic/color-schemes/carmine/generic.carmine.less b/styles/widgets/generic/color-schemes/carmine/generic.carmine.less index e5f1d677d6e2..f0a84623d515 100644 --- a/styles/widgets/generic/color-schemes/carmine/generic.carmine.less +++ b/styles/widgets/generic/color-schemes/carmine/generic.carmine.less @@ -526,7 +526,7 @@ * @paletteColorOpacity .25 */ @list-item-selected-bg: @base-select-bg; // #f05b41 => #ffb5a8 -@list-item-focused-selected-bg: fade(@base-focus-color, 70%); +@list-item-focused-selected-bg: fade(@base-focus-bg, 70%); @list-focused-bg: @base-focus-bg; @list-item-color: @base-text-color; @list-item-hover-color: @base-hover-color; diff --git a/styles/widgets/generic/color-schemes/contrast/generic.contrast.less b/styles/widgets/generic/color-schemes/contrast/generic.contrast.less index 930ba059916b..fcbf2b88b8b1 100644 --- a/styles/widgets/generic/color-schemes/contrast/generic.contrast.less +++ b/styles/widgets/generic/color-schemes/contrast/generic.contrast.less @@ -22,7 +22,6 @@ @base-hover-color: @base-accent; @base-focus-color: @base-accent; @base-shadow-color: transparent; -@base-select-color: @base-text-color; @base-default: #52BBE7; @base-success: #71C35E; diff --git a/styles/widgets/generic/color-schemes/dark/generic.dark.less b/styles/widgets/generic/color-schemes/dark/generic.dark.less index 661fbd63d077..1502446e1197 100644 --- a/styles/widgets/generic/color-schemes/dark/generic.dark.less +++ b/styles/widgets/generic/color-schemes/dark/generic.dark.less @@ -528,7 +528,7 @@ * @paletteColorOpacity .25 */ @list-item-selected-bg: @base-select-bg; -@list-item-focused-selected-bg: fade(@base-focus-color, 70%); +@list-item-focused-selected-bg: fade(@base-focus-bg, 70%); @list-focused-bg: @base-focus-bg; @list-item-color: @base-text-color; @list-item-hover-color: @base-hover-color; diff --git a/styles/widgets/generic/color-schemes/darkviolet/generic.darkviolet.less b/styles/widgets/generic/color-schemes/darkviolet/generic.darkviolet.less index f1f0c6a3ee5c..d609b401e238 100644 --- a/styles/widgets/generic/color-schemes/darkviolet/generic.darkviolet.less +++ b/styles/widgets/generic/color-schemes/darkviolet/generic.darkviolet.less @@ -534,7 +534,7 @@ * @paletteColorOpacity .25 */ @list-item-selected-bg: @base-select-bg; -@list-item-focused-selected-bg: fade(@base-focus-color, 70%); +@list-item-focused-selected-bg: fade(@base-focus-bg, 70%); @list-focused-bg: @base-focus-bg; @list-item-color: @base-text-color; @list-item-hover-color: @base-hover-color; diff --git a/styles/widgets/generic/color-schemes/light/generic.light.less b/styles/widgets/generic/color-schemes/light/generic.light.less index b7b122a0abea..bfdd17fec20f 100644 --- a/styles/widgets/generic/color-schemes/light/generic.light.less +++ b/styles/widgets/generic/color-schemes/light/generic.light.less @@ -531,7 +531,7 @@ */ @list-item-selected-bg: @base-select-bg; -@list-item-focused-selected-bg: fade(@base-focus-color, 70%); +@list-item-focused-selected-bg: fade(@base-focus-bg, 70%); @list-focused-bg: @base-focus-bg; @list-item-color: @base-text-color; @list-item-hover-color: @base-hover-color; @@ -1525,8 +1525,8 @@ * @group navigations.treeview * @paletteColorOpacity 1 */ -@treeview-focused-bg: @base-focus-color; -@treeview-focus-color: @base-inverted-text-color; +@treeview-focused-bg: @base-focus-bg; +@treeview-focus-color: @base-focus-color; @treeview-hover-bg: @base-hover-bg; @treeview-item-hover-color: @treeview-color; @treeview-border-color: @base-border-color; diff --git a/styles/widgets/generic/list.generic.less b/styles/widgets/generic/list.generic.less index 49bb55001954..a9ad9d8a5710 100644 --- a/styles/widgets/generic/list.generic.less +++ b/styles/widgets/generic/list.generic.less @@ -93,7 +93,7 @@ &.dx-state-focused.dx-list-item-selected { background-color: @list-item-focused-selected-bg; - color: @base-select-color; + color: @base-inverted-text-color; } &.dx-state-active { diff --git a/styles/widgets/material/color-schemes/material.dark.less b/styles/widgets/material/color-schemes/material.dark.less index b9a976c0d311..14c43a1e14db 100644 --- a/styles/widgets/material/color-schemes/material.dark.less +++ b/styles/widgets/material/color-schemes/material.dark.less @@ -586,7 +586,7 @@ * @paletteColorOpacity .25 */ @list-item-selected-bg: lighten(@base-bg, 12%); -@list-item-focused-selected-bg: fade(@base-focus-color, 70%); +@list-item-focused-selected-bg: fade(@base-focus-bg, 70%); @list-item-hover-color: @base-hover-color; @list-item-selected-color: fade(@base-text-color, 100%); diff --git a/styles/widgets/material/color-schemes/material.light.less b/styles/widgets/material/color-schemes/material.light.less index 532214f99cd4..ec96dbe1e190 100644 --- a/styles/widgets/material/color-schemes/material.light.less +++ b/styles/widgets/material/color-schemes/material.light.less @@ -557,7 +557,7 @@ * @paletteColorOpacity .25 */ @list-item-selected-bg: darken(@base-bg, 12%); -@list-item-focused-selected-bg: fade(@base-focus-color, 70%); +@list-item-focused-selected-bg: fade(@base-focus-bg, 70%); @list-item-hover-color: @base-hover-color; @list-item-selected-color: fade(@base-text-color, 100%); diff --git a/testing/helpers/ajaxMock.js b/testing/helpers/ajaxMock.js index 0d1969cec944..9853ad56f196 100644 --- a/testing/helpers/ajaxMock.js +++ b/testing/helpers/ajaxMock.js @@ -1,5 +1,6 @@ var ajax = require("core/utils/ajax"); var extend = require("core/utils/extend").extend; +var typeUtils = require("core/utils/type"); var $ = require("jquery"); var originSendRequest = ajax.sendRequest; var urlMap = {}; @@ -28,7 +29,7 @@ exports.setup = function(options) { var mockOptions = findUrlOptions(request.url); var jQueryTextStatus = mockOptions.jQueryTextStatus; - response.status = mockOptions.status || 200; + response.status = typeUtils.isDefined(mockOptions.status) ? mockOptions.status : 200; response.statusText = mockOptions.statusText || "200 OK"; response.responseText = mockOptions.responseText; @@ -37,7 +38,7 @@ exports.setup = function(options) { } timers.push(setTimeout(function() { - if(response.status === 404 || jQueryTextStatus === "parsererror") { + if(response.status === 0 || response.status === 404 || jQueryTextStatus === "parsererror") { response.error = jQueryTextStatus ? {} : { message: response.statusText }; deferred.rejectWith(response, [ response, jQueryTextStatus || "error", mockOptions]); } else { diff --git a/testing/runner/Views/Main/RunSuite.cshtml b/testing/runner/Views/Main/RunSuite.cshtml index c1719914044c..3db1a90d0015 100644 --- a/testing/runner/Views/Main/RunSuite.cshtml +++ b/testing/runner/Views/Main/RunSuite.cshtml @@ -173,9 +173,9 @@ 'knockout': '@Url.Content("~/node_modules/knockout/build/output/knockout-latest.debug.js")', 'angular': '@Url.Content("~/artifacts/js/angular.js")', 'jszip': '@Url.Content("~/artifacts/js/jszip.js")', - 'quill': '@Url.Content("~/artifacts/js/quill.js")', - 'turndown': '@Url.Content("~/artifacts/js/turndown.browser.umd.js")', - 'showdown': '@Url.Content("~/artifacts/js/showdown.js")', + 'quill': '@Url.Content("~/node_modules/quill/dist/quill.js")', + 'turndown': '@Url.Content("~/node_modules/turndown/lib/turndown.browser.umd.js")', + 'showdown': '@Url.Content("~/node_modules/showdown/dist/showdown.js")', // Global CSS 'style-compiler-test-server': '@Model.StyleCompilerTestServerUrl', diff --git a/testing/tests/DevExpress.data/odataStore.tests.js b/testing/tests/DevExpress.data/odataStore.tests.js index 97e24cd05fa2..dbf16a80b02d 100644 --- a/testing/tests/DevExpress.data/odataStore.tests.js +++ b/testing/tests/DevExpress.data/odataStore.tests.js @@ -1810,6 +1810,27 @@ QUnit.test("error handlers (check params)", function(assert) { }, done, assert); }); +QUnit.test("non HTTP failure", function(assert) { + var done = assert.async(); + ajaxMock.setup({ + url: "odata.org/get", + status: 0 + }); + + var store = new ODataStore({ + url: "odata.org/get" + }); + + store.load() + .fail((e) => { + assert.equal(e.httpStatus, 0); + }) + .done(() => { + assert.ok(false, MUST_NOT_REACH_MESSAGE); + }) + .always(done); +}); + QUnit.test("error handlers (query evaluation)", function(assert) { var done = assert.async(); diff --git a/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js b/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js index d175019f9691..726fea5f68f5 100644 --- a/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js +++ b/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js @@ -6802,6 +6802,41 @@ QUnit.test("selectAll should works correctly if selectAllMode is page and row re assert.equal(dataGrid.getSelectedRowKeys().length, 20, "selected row key count equals pageSize"); }); +// T726385 +QUnit.test("selection after scrolling should works correctly if row rendering mode is virtual", function(assert) { + // arrange, act + var array = [], + dataGrid; + + for(var i = 1; i <= 30; i++) { + array.push({ id: i }); + } + + dataGrid = $("#dataGrid").dxDataGrid({ + height: 100, + dataSource: array, + keyExpr: "id", + loadingTimeout: undefined, + selection: { + mode: "single" + }, + scrolling: { + rowRenderingMode: "virtual", + useNative: false + } + }).dxDataGrid("instance"); + + // act + dataGrid.getScrollable().scrollTo({ y: 10000 }); + $(dataGrid.getRowElement(0)).trigger("dxclick"); + + // assert + var visibleRows = dataGrid.getVisibleRows(); + assert.equal(visibleRows.length, 10, "visible row count"); + assert.equal(visibleRows[0].isSelected, true, "first visible row is selected"); + assert.deepEqual(dataGrid.getSelectedRowKeys(), [11], "selected row key count equals pageSize"); +}); + // T644981 QUnit.test("grouping should works correctly if row rendering mode is virtual and dataSource is remote", function(assert) { // arrange, act diff --git a/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js b/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js index 3a891f90e3fb..0c1355c21a13 100644 --- a/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js +++ b/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js @@ -6700,7 +6700,7 @@ QUnit.test("Get width of horizontal scrollbar when both scrollbars are shown", f // T606944 QUnit.test("The vertical scrollbar should not be shown when there is a horizontal scrollbar", function(assert) { - if(browser.msie && browser.version === "18.17763") { + if(browser.msie && browser.version === "18.18362") { assert.ok(true); return; }