Skip to content

Commit

Permalink
Release 18.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Shchelkunov committed Jul 12, 2019
1 parent 8f9b909 commit f34bebc
Show file tree
Hide file tree
Showing 30 changed files with 109 additions and 84 deletions.
2 changes: 1 addition & 1 deletion js/core/utils/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var extend = function(target) {
sourceValueIsArray = false,
clone;

if(target === sourceValue) {
if(key === "__proto__" || target === sourceValue) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion js/core/utils/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var deepExtendArraySafe = function(target, changes, extendComplexObject, assignB
prevValue = target[name];
newValue = changes[name];

if(target === newValue) {
if(name === "__proto__" || target === newValue) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion js/ui/grid_core/ui.grid_core.column_fixing.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ var RowsViewFixedColumnsExtender = extend({}, baseFixedColumns, {
} else if(e.reachedBottom) {
scrollableContent = this._findContentElement();
scrollableContainer = e.component._container();
maxScrollTop = scrollableContent.height() + scrollbarWidth - scrollableContainer.height();
maxScrollTop = Math.max(scrollableContent.height() + scrollbarWidth - scrollableContainer.height(), 0);
elasticScrollTop = maxScrollTop - e.scrollOffset.top;
}

Expand Down
7 changes: 6 additions & 1 deletion js/ui/pivot_grid/ui.pivot_grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var $ = require("../../core/renderer"),
PivotGridDataSource = require("./data_source"),
dataAreaNamespace = require("./ui.pivot_grid.data_area"),
headersArea = require("./ui.pivot_grid.headers_area"),
getSize = require("../../core/utils/size").getSize,

fieldsArea = require("./ui.pivot_grid.fields_area"),

Expand Down Expand Up @@ -1783,7 +1784,11 @@ var PivotGrid = Widget.inherit({
rowsAreaHeights = needSynchronizeFieldPanel ? rowHeights.slice(1) : rowHeights;
dataAreaHeights = dataArea.getRowsHeight();

descriptionCellHeight = descriptionCell.outerHeight() + (needSynchronizeFieldPanel ? rowHeights[0] : 0);
descriptionCellHeight = getSize(descriptionCell[0], "height", {
paddings: true,
borders: true,
margins: true
}) + (needSynchronizeFieldPanel ? rowHeights[0] : 0);

columnsAreaRowCount = that._dataController.getColumnsInfo().length;

Expand Down
4 changes: 2 additions & 2 deletions js/ui/scroll_view/ui.scroll_view.native.pull_down.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var PullDownNativeScrollViewStrategy = NativeStrategy.inherit({
this.callBase();
this._topPocketSize = this._$topPocket.height();
this._bottomPocketSize = this._$bottomPocket.height();
this._scrollOffset = this._$container.height() - this._$content.height();
this._scrollOffset = Math.round((this._$container.height() - this._$content.height()) * 100) / 100;
},

_allowedDirections: function() {
Expand Down Expand Up @@ -168,7 +168,7 @@ var PullDownNativeScrollViewStrategy = NativeStrategy.inherit({
},

_isReachBottom: function() {
return this._reachBottomEnabled && this._location <= this._scrollOffset + this._bottomPocketSize;
return this._reachBottomEnabled && this._location - (this._scrollOffset + this._bottomPocketSize) <= 0.1;
},

_reachBottom: function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"gulp-watch": "^5.0.0",
"handlebars": "4.0.11",
"hogan.js": "3.0.2",
"jquery": "3.1.1",
"jquery": "^3.4.1",
"jquery.1": "^1.0.0",
"jquery.2": "^1.0.0",
"jquery.tmpl": "0.0.2",
Expand Down
6 changes: 6 additions & 0 deletions testing/tests/DevExpress.core/utils.extend.tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { extend } from "core/utils/extend";

QUnit.test("extend does not pollute object prototype", (assert) => {
extend(true, { }, JSON.parse(`{ "__proto__": { "pollution": true }}`));
assert.ok(!("pollution" in { }), "object prototype is not polluted");
});
5 changes: 5 additions & 0 deletions testing/tests/DevExpress.core/utils.object.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,8 @@ QUnit.test("deepExtendArraySafe utility does not throw an error with 'null' deep

assert.equal(result.deepProp.toChange, "changed value");
});

QUnit.test("deepExtendArraySafe utility does not pollute object prototype", function(assert) {
objectUtils.deepExtendArraySafe({ }, JSON.parse(`{ "__proto__": { "pollution": true }}`), true);
assert.ok(!("pollution" in { }), "object prototype is not polluted");
});
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ QUnit.test("getHeadersRowHeight with band columns", function(assert) {
// assert
$headerRowElements = this.columnHeadersView._getRowElements();
assert.equal($headerRowElements.length, 2, "count row");
assert.equal(this.columnHeadersView.getHeadersRowHeight(), $($headerRowElements).toArray().reduce((sum, row) => sum + $(row).height(), 0), "height of the headers");
assert.roughEqual(this.columnHeadersView.getHeadersRowHeight(), $($headerRowElements).toArray().reduce((sum, row) => sum + $(row).height(), 0), 1, "height of the headers");
});

QUnit.test("Header with headerFilter - alignment cell content", function(assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,7 @@ function createGridView(options, userOptions) {
});

// assert
assert.roughEqual(colWidths, totalWidths, 0.1, "synchronize widths by columns");
assert.roughEqual(colWidths, totalWidths, 1.101, "synchronize widths by columns");
});

QUnit.test("Disable the bestFit mode before correctColumnWidths", function(assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,6 @@ QUnit.testInActiveWindow("Page down should not prevent default behaviour when pa
QUnit.testInActiveWindow("Page down should scroll page down when paging disabled and vertial scroll exists", function(assert) {
// arrange
var that = this;
var done = assert.async();

this.options = {
height: 200
Expand All @@ -1718,19 +1717,13 @@ QUnit.testInActiveWindow("Page down should scroll page down when paging disabled

this.focusFirstCell();

this.clock.restore();

var isPreventDefaultCalled = this.triggerKeyDown("pageDown").preventDefault;

this.rowsView.getScrollable().on("scroll", function(e) {
setTimeout(function() {
assert.ok(that.rowsView.element().is(":focus"), "rowsView is focused");
assert.deepEqual(that.keyboardNavigationController._focusedCellPosition, { columnIndex: 0, rowIndex: 5 });
done();
});
});
$(this.rowsView.getScrollable()._container()).trigger("scroll");
this.clock.tick();

// assert
assert.ok(that.rowsView.element().is(":focus"), "rowsView is focused");
assert.deepEqual(that.keyboardNavigationController._focusedCellPosition, { columnIndex: 0, rowIndex: 5 });
assert.equal(this.rowsView.getScrollable().scrollTop(), 200);
assert.ok(isPreventDefaultCalled, "preventDefault is called");
});
Expand Down
5 changes: 3 additions & 2 deletions testing/tests/DevExpress.ui.widgets.editors/datebox.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1355,13 +1355,14 @@ QUnit.module("widget sizing render", {}, () => {
width: undefined
}).dxDateBox("instance");

const initialWidth = $element.outerWidth();
const { width: initialWidth } = $element.get(0).getBoundingClientRect();

$parent.css("transform", "scale(0.5)");
component.repaint();
$parent.css("transform", "scale(1)");
const { width: actualWidth } = component.$element().get(0).getBoundingClientRect();

assert.equal(component.$element().outerWidth(), initialWidth, "component has correct width");
assert.strictEqual(actualWidth, initialWidth, "component has correct width");
});

QUnit.test("change width", assert => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ QUnit.module("basics", {}, () => {

$numberBoxInput.blur();
mouse.wheel(-20);
assert.equal(numberBox.option("value"), 100.6);
assert.roughEqual(numberBox.option("value"), 100.6, 1.001);
});

QUnit.test("mousewheel action should not work in disabled state", assert => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2606,7 +2606,7 @@ QUnit.module("searchEnabled", moduleSetup, () => {
});
const $input = $tagBox.find("input");
// NOTE: width should be 0.1 because of T393423
assert.roughEqual($input.width(), 0.1, 0.1, "input has correct width");
assert.roughEqual($input.width(), 0.1, 0.101, "input has correct width");
});

QUnit.test("no placeholder when textbox is not empty", assert => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1387,8 +1387,8 @@ QUnit.test("Layout 0", function(assert) {
assert.roughEqual($cols.eq(0).height(), $cols.eq(1).height(), 0.1, "col heights");

assert.equal($areas.length, 5, "area count");
assert.roughEqual($areas.eq(0).outerHeight(true) + $areas.eq(1).outerHeight(true), $areas.eq(2).outerHeight(true) + $areas.eq(3).outerHeight(true) + $areas.eq(4).outerHeight(true), 0.1, "area 0+1=2+3+4 height");
assert.roughEqual($areas.eq(0).outerHeight(true), $areas.eq(2).outerHeight(true) + $areas.eq(3).outerHeight(true), 0.1, "area 0=2+3 height");
assert.roughEqual($areas.eq(0).outerHeight(true) + $areas.eq(1).outerHeight(true), $areas.eq(2).outerHeight(true) + $areas.eq(3).outerHeight(true) + $areas.eq(4).outerHeight(true), 1.01, "area 0+1=2+3+4 height");
assert.roughEqual($areas.eq(0).outerHeight(true), $areas.eq(2).outerHeight(true) + $areas.eq(3).outerHeight(true), 1.01, "area 0=2+3 height");
assert.roughEqual($areas.eq(1).outerHeight(true), $areas.eq(2).outerHeight(true), 1.1, "area 1=2 height");
assert.equal($areas.eq(0).width(), $areas.eq(1).width(), "area 0=1 width");
assert.equal($areas.eq(1).width(), $areas.eq(2).width(), "area 1=2 width");
Expand Down
15 changes: 11 additions & 4 deletions testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ var $ = require("jquery"),
dateLocalization = require("localization/date"),
devices = require("core/devices"),
browser = require("core/utils/browser"),
dataUtils = require("core/element_data");
dataUtils = require("core/element_data"),
getSize = require("core/utils/size").getSize;

function sumArray(array) {
var sum = 0;
Expand Down Expand Up @@ -4348,10 +4349,16 @@ QUnit.test("columns area row height calculation when description area is big", f
}
}, assert),

tableElement = pivot.$element().find('table').first();
tableElement.find(".dx-area-description-cell").height(80);
tableElement = pivot.$element().find('table').first(),
descriptionCell = tableElement.find(".dx-area-description-cell");

descriptionCell.height(80);

var delta = (tableElement.find(".dx-area-description-cell").outerHeight() - 28) / 2;
var delta = (getSize(descriptionCell[0], "height", {
paddings: true,
borders: true,
margins: true
}) - 28) / 2;

// act
pivot.updateDimensions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@ QUnit.testStart(function() {
var pointer = pointerMock(this.instance.$element().find(".dx-resizable-handle-right").eq(0)).start();
pointer.dragStart().drag(cellWidth * 2, 0).dragEnd();

assert.equal(this.instance.$element().find(".dx-scheduler-appointment").eq(0).outerWidth(), initialWidth, "Width is OK");
assert.roughEqual(this.instance.$element().find(".dx-scheduler-appointment").eq(0).outerWidth(), initialWidth, 1, "Width is OK");
});

QUnit.test("Appointment should have initial size if 'cancel' flag is defined as true during update operation (if appointment takes few days)", function(assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,8 @@ var stubInvokeMethod = function(instance, options) {
assert.roughEqual($shader.outerHeight(), 9.5 * cellHeight, 1.5, "Shader has correct height");
assert.roughEqual($topShader.outerHeight(), 9.5 * cellHeight, 1.5, "Top shader has correct height");
assert.roughEqual($bottomShader.outerHeight(), 22.5 * cellHeight, 1.5, "Bottom shader has correct height");

assert.roughEqual($shader.outerWidth(), 3 * cellWidth, 2, "Shader has correct width");
assert.roughEqual($topShader.outerWidth(), 2 * cellWidth, 1, "Top shader has correct width");
assert.roughEqual($topShader.outerWidth(), 2 * cellWidth, 1.5, "Top shader has correct width");
assert.roughEqual($bottomShader.outerWidth(), cellWidth, 1, "Bottom shader has correct width");
});

Expand All @@ -320,7 +319,7 @@ var stubInvokeMethod = function(instance, options) {
assert.roughEqual($bottomShader.outerHeight(), 22.5 * cellHeight, 1.5, "Bottom shader has correct height");

assert.roughEqual($shader.outerWidth(), 3 * cellWidth, 2, "Indicator has correct width");
assert.roughEqual($topShader.outerWidth(), 2 * cellWidth, 1, "Top shader has correct width");
assert.roughEqual($topShader.outerWidth(), 2 * cellWidth, 1.5, "Top shader has correct width");
assert.roughEqual($bottomShader.outerWidth(), cellWidth, 1, "Bottom shader has correct width");
});

Expand Down Expand Up @@ -386,7 +385,7 @@ var stubInvokeMethod = function(instance, options) {
containerHeight = $indicator.parent().outerHeight();

assert.roughEqual($indicator.outerHeight(), containerHeight, 1, "Shader has correct height");
assert.equal($indicator.css("marginTop"), -containerHeight + "px", "Shader has correct margin");
assert.roughEqual(parseInt($indicator.css("marginTop")), -containerHeight, 1.5, "Shader has correct margin");
});

QUnit.test("TimePanel currentTime cell should have specific class, Day view", function(assert) {
Expand Down Expand Up @@ -652,8 +651,8 @@ var stubInvokeMethod = function(instance, options) {
assert.roughEqual($bottomShader.outerHeight(), 22.5 * cellHeight, 1.5, "Bottom indicator has correct height");

assert.roughEqual($shader.outerWidth(), 898, 1, "Indicator has correct width");
assert.roughEqual($topShader.outerWidth(), 4 * cellWidth, 1, "Top indicator has correct width");
assert.roughEqual($bottomShader.outerWidth(), 3 * cellWidth, 1, "Bottom indicator has correct width");
assert.roughEqual($topShader.outerWidth(), 4 * cellWidth, 1.5, "Top indicator has correct width");
assert.roughEqual($bottomShader.outerWidth(), 3 * cellWidth, 1.5, "Bottom indicator has correct width");
});

QUnit.test("Shader should have limited height, Week view", function(assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ QUnit.test("Long appointment should be rendered correctly after changing view",
$appointments = this.instance.$element().find(".dx-scheduler-appointment");

assert.equal($appointments.length, 1, "appointment is OK");
assert.roughEqual($appointments.eq(0).outerWidth(), cellWidth * 4, 1.001, "appointment size is OK");
assert.roughEqual($appointments.eq(0).outerWidth(), cellWidth * 4, 2.001, "appointment size is OK");
});

QUnit.test("Timepanel rows count should be OK for long appointment", function(assert) {
Expand Down
Loading

0 comments on commit f34bebc

Please sign in to comment.