Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Controller ID within target, filter and rollouts view #1056

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.eclipse.hawkbit.ui.common.data.proxies.ProxyIdentifiableEntity;
import org.eclipse.hawkbit.ui.common.data.proxies.ProxyNamedEntity;
import org.eclipse.hawkbit.ui.common.data.proxies.ProxyTarget;
import org.eclipse.hawkbit.ui.common.grid.support.DeleteSupport;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
Expand Down Expand Up @@ -120,6 +121,22 @@ public static <E extends ProxyNamedEntity> Column<E, String> addNameColumn(final
return addColumn(i18n, grid, E::getName, "header.name", columnId, 100D);
}

/**
* Add controllerId column to grid
*
* @param grid
* to add the column to
* @param i18n
* message source for internationalization
* @param columnId
* column ID
* @return the created column
*/
public static Column<ProxyTarget, String> addControllerIdColumn(final Grid<ProxyTarget> grid,
final VaadinMessageSource i18n, final String columnId) {
return addColumn(i18n, grid, ProxyTarget::getControllerId, "header.controllerId", columnId, 100D);
herdt-michael marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* Add description column to grid
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public class TargetFilterTargetGrid extends AbstractGrid<ProxyTarget, String> {
private static final long serialVersionUID = 1L;

private static final String TARGET_CONTROLLER_ID = "targetControllerId";
private static final String TARGET_NAME_ID = "targetName";
private static final String TARGET_DESCRIPTION_ID = "targetDescription";
private static final String TARGET_STATUS_ID = "targetStatus";
Expand Down Expand Up @@ -72,6 +73,8 @@ public String getGridId() {

@Override
public void addColumns() {
GridComponentBuilder.addControllerIdColumn(this, i18n, TARGET_CONTROLLER_ID);

GridComponentBuilder.addNameColumn(this, i18n, TARGET_NAME_ID);

GridComponentBuilder.addDescriptionColumn(this, i18n, TARGET_DESCRIPTION_ID);
Expand All @@ -83,4 +86,5 @@ public void addColumns() {

getColumns().forEach(column -> column.setHidable(true));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class TargetGrid extends AbstractGrid<ProxyTarget, TargetManagementFilter
private static final long serialVersionUID = 1L;

private static final String TARGET_STATUS_ID = "targetStatus";
private static final String TARGET_CONTROLLER_ID = "targetControllerId";
private static final String TARGET_NAME_ID = "targetName";
private static final String TARGET_POLLING_STATUS_ID = "targetPolling";
private static final String TARGET_DESC_ID = "targetDescription";
Expand Down Expand Up @@ -310,6 +311,10 @@ public void addColumns() {
Arrays.asList(addPinColumn(), addDeleteColumn()));
}

private Column<ProxyTarget, String> addControllerIdColumn() {
return GridComponentBuilder.addControllerIdColumn(this, i18n, TARGET_CONTROLLER_ID);
}

private Column<ProxyTarget, String> addNameColumn() {
return GridComponentBuilder.addNameColumn(this, i18n, TARGET_NAME_ID);
}
Expand Down Expand Up @@ -340,6 +345,7 @@ private Column<ProxyTarget, Button> addDeleteColumn() {
@Override
protected void addMaxColumns() {
addNameColumn().setExpandRatio(2);
addControllerIdColumn().setExpandRatio(2);

GridComponentBuilder.addDescriptionColumn(this, i18n, TARGET_DESC_ID).setExpandRatio(2);
GridComponentBuilder.addCreatedAndModifiedColumns(this, i18n);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
public class RolloutGroupTargetGrid extends AbstractGrid<ProxyTarget, Long> {
private static final long serialVersionUID = 1L;

private static final String TARGET_CONTROLLER_ID = "targetControllerId";

private final RolloutManagementUIState rolloutManagementUIState;

private final RolloutActionStatusIconSupplier<ProxyTarget> actionStatusIconSupplier;
Expand Down Expand Up @@ -65,9 +67,11 @@ public String getGridId() {

@Override
public void addColumns() {
GridComponentBuilder.addNameColumn(this, i18n, SPUILabelDefinitions.VAR_NAME).setExpandRatio(3);
GridComponentBuilder.addControllerIdColumn(this, i18n, TARGET_CONTROLLER_ID).setExpandRatio(2);

GridComponentBuilder.addNameColumn(this, i18n, SPUILabelDefinitions.VAR_NAME).setExpandRatio(2);

GridComponentBuilder.addDescriptionColumn(this, i18n, SPUILabelDefinitions.VAR_DESC).setExpandRatio(3);
GridComponentBuilder.addDescriptionColumn(this, i18n, SPUILabelDefinitions.VAR_DESC).setExpandRatio(2);

GridComponentBuilder.addIconColumn(this, actionStatusIconSupplier::getLabel, SPUILabelDefinitions.VAR_STATUS,
i18n.getMessage("header.status"));
Expand All @@ -91,4 +95,5 @@ public void restoreState() {
public MasterEntitySupport<ProxyRolloutGroup> getMasterEntitySupport() {
return masterEntitySupport;
}

}
1 change: 1 addition & 0 deletions hawkbit-ui/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ calendar.second=second
calendar.seconds=seconds

header.name = Name
header.controllerId = Controller ID
header.vendor = Vendor
header.version = Version
header.description = Description
Expand Down