Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Revert "Maintenance release picks" (#267)
Browse files Browse the repository at this point in the history
* Revert "Maintenance release picks (#259)"

This reverts commit e49702e.
  • Loading branch information
ZheSun88 authored Jul 17, 2018
1 parent e49702e commit d59f330
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 34 deletions.
19 changes: 1 addition & 18 deletions src/main/java/com/vaadin/flow/component/grid/Grid.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ public static class Column<T> extends AbstractColumn<Column<T>> {

private Registration columnDataGeneratorRegistration;

private Renderer<T> renderer;

/**
* Constructs a new Column for use inside a Grid.
*
Expand All @@ -254,13 +252,11 @@ public static class Column<T> extends AbstractColumn<Column<T>> {
* @param columnId
* unique identifier of this column
* @param renderer
* the renderer to use in this column, must not be {@code null}
* the renderer to use in this column
*/
public Column(Grid<T> grid, String columnId, Renderer<T> renderer) {
super(grid);
Objects.requireNonNull(renderer);
this.columnInternalId = columnId;
this.renderer = renderer;

comparator = (a, b) -> 0;

Expand Down Expand Up @@ -289,19 +285,6 @@ protected String getInternalId() {
return columnInternalId;
}

/**
* Get the renderer used for this column.
*
* Note: Mutating the renderer after the Grid has been rendered
* on the client will not change the column, and can lead to
* undefined behavior.
*
* @return the renderer used for this column, should never be {@code null}
*/
public Renderer<T> getRenderer() {
return renderer;
}

/**
* Sets the width of this column as a CSS-string.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ window.Vaadin.Flow.gridConnector = {
}
}

const sorterChangeListener = function() {
const sorterChangeListener = function(event) {
grid.$server.sortersChanged(grid._sorters.map(function(sorter) {
return {
path: sorter.path,
direction: sorter.direction
};
}));
}
grid._createPropertyObserver("_previousSorters", sorterChangeListener);
grid.addEventListener('sorter-changed', sorterChangeListener);

const itemsUpdated = function(items) {
if (!items || !Array.isArray(items)) {
Expand Down
14 changes: 0 additions & 14 deletions src/test/java/com/vaadin/flow/component/grid/GridColumnTest.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@
import org.junit.Test;
import org.junit.rules.ExpectedException;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.grid.Grid.Column;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.data.provider.SortDirection;
import com.vaadin.flow.data.renderer.IconRenderer;
import com.vaadin.flow.function.SerializableComparator;
import com.vaadin.flow.function.SerializableFunction;

public class GridColumnTest {

Grid<String> grid;
Column<String> firstColumn;
Column<String> secondColumn;
Column<String> thirdColumn;
Column<String> fourthColumn;

IconRenderer<String> renderer;

@Rule
public ExpectedException thrown = ExpectedException.none();
Expand All @@ -48,8 +41,6 @@ public void init() {
firstColumn = grid.addColumn(str -> str);
secondColumn = grid.addColumn(str -> str);
thirdColumn = grid.addColumn(str -> str);
renderer = new IconRenderer<String>(generator -> new Label(":D"));
fourthColumn = grid.addColumn(renderer);
}

@Test
Expand Down Expand Up @@ -173,11 +164,6 @@ public void addColumn_defaultComparator() {
-1, result);
}

@Test
public void testRenderer() {
assert renderer!= null;
Assert.assertEquals(renderer, fourthColumn.getRenderer());
}
private void expectNullPointerException(String message) {
thrown.expect(NullPointerException.class);
thrown.expectMessage(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.vaadin.flow.component.grid.it;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
Expand All @@ -29,6 +30,15 @@
public class ButtonInGridIT extends AbstractComponentIT {

@Test
@Ignore
/**
* The test is disabled due #4268. The test is for grid#122 (which is
* actually an issue in the flow-component-renderer inside flow-data
* module).
*
* At the moment the bug is not fixed. So the test fails. Should be enabled
* back once the gird#122 is fixed.
*/
public void pressButtonUsingKeyboard() {
open();

Expand Down

0 comments on commit d59f330

Please sign in to comment.