Merge branch 'fix_introduce_consistent_button_position_in_change_dialogs' of https://github.com/bsinno/hawkbit.git into fix_introduce_consistent_button_position_in_change_dialogs
This commit is contained in:
@@ -12,6 +12,7 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
|||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleMetadatadetailslayout;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
||||||
@@ -55,6 +56,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
|||||||
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
|
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
|
||||||
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
|
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
|
||||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||||
|
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -81,6 +83,8 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
|||||||
updateSoftwareModuleDetailsLayout(HawkbitCommonUtil.SP_STRING_EMPTY, HawkbitCommonUtil.SP_STRING_EMPTY,
|
updateSoftwareModuleDetailsLayout(HawkbitCommonUtil.SP_STRING_EMPTY, HawkbitCommonUtil.SP_STRING_EMPTY,
|
||||||
maxAssign);
|
maxAssign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
populateMetadataDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSoftwareModuleDetailsLayout(final String type, final String vendor, final String maxAssign) {
|
private void updateSoftwareModuleDetailsLayout(final String type, final String vendor, final String maxAssign) {
|
||||||
@@ -141,4 +145,8 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
|||||||
protected String getDetailsHeaderCaptionId() {
|
protected String getDetailsHeaderCaptionId() {
|
||||||
return SPUIComponetIdProvider.TARGET_DETAILS_HEADER_LABEL_ID;
|
return SPUIComponetIdProvider.TARGET_DETAILS_HEADER_LABEL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void populateMetadataDetails(){
|
||||||
|
swmMetadataTable.populateSMMetadata(getSelectedBaseEntity());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,11 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
|
|
||||||
private VerticalLayout attributesLayout;
|
private VerticalLayout attributesLayout;
|
||||||
|
|
||||||
/**
|
private VerticalLayout metadataLayout;
|
||||||
|
|
||||||
|
protected SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
||||||
|
|
||||||
|
/**
|
||||||
* Initialize components.
|
* Initialize components.
|
||||||
*/
|
*/
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -145,8 +149,10 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
detailsTab.setHeight(90, Unit.PERCENTAGE);
|
detailsTab.setHeight(90, Unit.PERCENTAGE);
|
||||||
detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE);
|
detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE);
|
||||||
detailsTab.setId(getTabSheetId());
|
detailsTab.setId(getTabSheetId());
|
||||||
|
swmMetadataTable = new SoftwareModuleMetadatadetailslayout();
|
||||||
|
swmMetadataTable.init(getI18n(), getPermissionChecker());
|
||||||
addTabs(detailsTab);
|
addTabs(detailsTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildLayout() {
|
private void buildLayout() {
|
||||||
final HorizontalLayout nameEditLayout = new HorizontalLayout();
|
final HorizontalLayout nameEditLayout = new HorizontalLayout();
|
||||||
@@ -209,6 +215,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
populateLog();
|
populateLog();
|
||||||
populateDescription();
|
populateDescription();
|
||||||
populateDetailsWidget();
|
populateDetailsWidget();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void populateLog() {
|
protected void populateLog() {
|
||||||
@@ -282,6 +289,14 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
return descriptionLayout;
|
return descriptionLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected VerticalLayout createMetadataLayout() {
|
||||||
|
metadataLayout = getTabLayout();
|
||||||
|
metadataLayout.setSizeFull();
|
||||||
|
metadataLayout.addComponent(swmMetadataTable);
|
||||||
|
return metadataLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default caption of header to be displayed when no data row selected in
|
* Default caption of header to be displayed when no data row selected in
|
||||||
* table.
|
* table.
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package org.eclipse.hawkbit.ui.common.detailslayout;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
|
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||||
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.vaadin.spring.events.EventBus.SessionEventBus;
|
||||||
|
|
||||||
|
import com.vaadin.data.Item;
|
||||||
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
|
import com.vaadin.ui.Button;
|
||||||
|
import com.vaadin.ui.Label;
|
||||||
|
import com.vaadin.ui.Table;
|
||||||
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
|
public class DistributionSetMetadatadetailslayout extends Table{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2913758299611837718L;
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(DistributionSetMetadatadetailslayout.class);
|
||||||
|
|
||||||
|
private static final String METADATA_KEY = "Key";
|
||||||
|
|
||||||
|
private static final String VIEW ="view";
|
||||||
|
|
||||||
|
private SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
|
private I18N i18n;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize software module table- to be displayed in details layout.
|
||||||
|
*
|
||||||
|
* @param i18n
|
||||||
|
* I18N
|
||||||
|
* @param isUnassignSoftModAllowed
|
||||||
|
* boolean flag to check for unassign functionality allowed for
|
||||||
|
* the view.
|
||||||
|
* @param distributionSetManagement
|
||||||
|
* DistributionSetManagement
|
||||||
|
* @param permissionChecker
|
||||||
|
* SpPermissionChecker
|
||||||
|
* @param eventBus
|
||||||
|
* SessionEventBus
|
||||||
|
* @param manageDistUIState
|
||||||
|
* ManageDistUIState
|
||||||
|
*/
|
||||||
|
public void init(final I18N i18n, final SpPermissionChecker permissionChecker) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
createDSMetadataTable();
|
||||||
|
addCustomGeneratedColumns();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createDSMetadataTable() {
|
||||||
|
addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
|
||||||
|
addStyleName(ValoTheme.TABLE_NO_STRIPES);
|
||||||
|
setSelectable(false);
|
||||||
|
setImmediate(true);
|
||||||
|
setContainerDataSource(getSwModuleContainer());
|
||||||
|
setColumnHeaderMode(ColumnHeaderMode.EXPLICIT);
|
||||||
|
addDSMetadataTableHeader();
|
||||||
|
setSizeFull(); // check if this style is required
|
||||||
|
addStyleName(SPUIStyleDefinitions.SW_MODULE_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IndexedContainer getSwModuleContainer() {
|
||||||
|
final IndexedContainer container = new IndexedContainer();
|
||||||
|
container.addContainerProperty(METADATA_KEY, String.class, "");
|
||||||
|
setColumnExpandRatio(METADATA_KEY, 0.7f);
|
||||||
|
setColumnAlignment(METADATA_KEY, Align.LEFT);
|
||||||
|
|
||||||
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
|
container.addContainerProperty(VIEW, Label.class, "");
|
||||||
|
setColumnExpandRatio(VIEW, 0.2F);
|
||||||
|
setColumnAlignment(VIEW, Align.RIGHT);
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDSMetadataTableHeader() {
|
||||||
|
setColumnHeader(METADATA_KEY, i18n.get("label.dist.details.key"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate software module table.
|
||||||
|
*
|
||||||
|
* @param distributionSet
|
||||||
|
*/
|
||||||
|
public void populateDSMetadata(final DistributionSet distributionSet) {
|
||||||
|
removeAllItems();
|
||||||
|
List<DistributionSetMetadata> dsMetadtaList = new ArrayList<>();
|
||||||
|
for(int i=1;i<=5;i++){
|
||||||
|
DistributionSetMetadata dsMetadata = new DistributionSetMetadata();
|
||||||
|
dsMetadata.setKey("ReleaseNote AAA" +i);
|
||||||
|
dsMetadata.setValue("ReleaseNote AAA sample data"+i);
|
||||||
|
dsMetadtaList.add(dsMetadata);
|
||||||
|
}
|
||||||
|
if (null != distributionSet) {
|
||||||
|
/* final List<DistributionSetMetadata> dsMetadataList = distributionSet.getMetadata();*/
|
||||||
|
final List<DistributionSetMetadata> dsMetadataList = dsMetadtaList;
|
||||||
|
if (null != dsMetadataList && !dsMetadataList.isEmpty()) {
|
||||||
|
dsMetadataList.forEach(dsMetadata -> setDSMetadataProperties(dsMetadata));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDSMetadataProperties(final DistributionSetMetadata dsMetadata){
|
||||||
|
final Item item = getContainerDataSource().addItem(dsMetadata.getKey());
|
||||||
|
item.getItemProperty(METADATA_KEY).setValue(dsMetadata.getKey());
|
||||||
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
|
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCustomGeneratedColumns() {
|
||||||
|
addGeneratedColumn(VIEW,
|
||||||
|
(source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button customMetadataDetailButton(final String itemId) {
|
||||||
|
final Item row1 = getItem(itemId);
|
||||||
|
final String metadataKey = (String) row1.getItemProperty(METADATA_KEY).getValue();
|
||||||
|
|
||||||
|
final Button viewIcon = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), VIEW,
|
||||||
|
"View DistributionSet Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
||||||
|
viewIcon.setData(metadataKey);
|
||||||
|
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
|
||||||
|
//viewIcon.addClickListener(event -> onClickOfDetailButton(event));
|
||||||
|
return viewIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getDetailLinkId(final String name) {
|
||||||
|
return new StringBuilder(SPUIComponetIdProvider.DS_METADATA_DETAIL_LINK).append('.').append(name)
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package org.eclipse.hawkbit.ui.common.detailslayout;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
|
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||||
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
|
import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
|
||||||
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.vaadin.data.Item;
|
||||||
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
|
import com.vaadin.ui.Button;
|
||||||
|
import com.vaadin.ui.Label;
|
||||||
|
import com.vaadin.ui.Table;
|
||||||
|
import com.vaadin.ui.Table.Align;
|
||||||
|
import com.vaadin.ui.Table.ColumnHeaderMode;
|
||||||
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
|
public class SoftwareModuleMetadatadetailslayout extends Table {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2913758299611838818L;
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(SoftwareModuleMetadatadetailslayout.class);
|
||||||
|
|
||||||
|
private static final String METADATA_KEY = "Key";
|
||||||
|
|
||||||
|
private static final String VIEW ="view";
|
||||||
|
|
||||||
|
private SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
|
private I18N i18n;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize software module table- to be displayed in details layout.
|
||||||
|
*
|
||||||
|
* @param i18n
|
||||||
|
* I18N
|
||||||
|
* @param isUnassignSoftModAllowed
|
||||||
|
* boolean flag to check for unassign functionality allowed for
|
||||||
|
* the view.
|
||||||
|
* @param distributionSetManagement
|
||||||
|
* DistributionSetManagement
|
||||||
|
* @param permissionChecker
|
||||||
|
* SpPermissionChecker
|
||||||
|
* @param eventBus
|
||||||
|
* SessionEventBus
|
||||||
|
* @param manageDistUIState
|
||||||
|
* ManageDistUIState
|
||||||
|
*/
|
||||||
|
public void init(final I18N i18n, final SpPermissionChecker permissionChecker) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
createSWMMetadataTable();
|
||||||
|
addCustomGeneratedColumns();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createSWMMetadataTable() {
|
||||||
|
addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
|
||||||
|
addStyleName(ValoTheme.TABLE_NO_STRIPES);
|
||||||
|
setSelectable(false);
|
||||||
|
setImmediate(true);
|
||||||
|
setContainerDataSource(getSwModuleMetadataContainer());
|
||||||
|
setColumnHeaderMode(ColumnHeaderMode.EXPLICIT);
|
||||||
|
addSMMetadataTableHeader();
|
||||||
|
setSizeFull(); // check if this style is required
|
||||||
|
addStyleName(SPUIStyleDefinitions.SW_MODULE_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IndexedContainer getSwModuleMetadataContainer() {
|
||||||
|
final IndexedContainer container = new IndexedContainer();
|
||||||
|
container.addContainerProperty(METADATA_KEY, String.class, "");
|
||||||
|
setColumnExpandRatio(METADATA_KEY, 0.7f);
|
||||||
|
setColumnAlignment(METADATA_KEY, Align.LEFT);
|
||||||
|
|
||||||
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
|
container.addContainerProperty(VIEW, Label.class, "");
|
||||||
|
setColumnExpandRatio(VIEW, 0.2F);
|
||||||
|
setColumnAlignment(VIEW, Align.RIGHT);
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addSMMetadataTableHeader() {
|
||||||
|
setColumnHeader(METADATA_KEY, i18n.get("label.dist.details.key"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate software module table.
|
||||||
|
*
|
||||||
|
* @param distributionSet
|
||||||
|
*/
|
||||||
|
public void populateSMMetadata(final SoftwareModule swModule) {
|
||||||
|
removeAllItems();
|
||||||
|
List<SoftwareModuleMetadata> swMetadtaList = new ArrayList<>();
|
||||||
|
for(int i=1;i<=5;i++){
|
||||||
|
SoftwareModuleMetadata swMetadata = new SoftwareModuleMetadata();
|
||||||
|
swMetadata.setKey("ReleaseNote BBB" +i);
|
||||||
|
swMetadata.setValue("ReleaseNote BBB sample data"+i);
|
||||||
|
swMetadtaList.add(swMetadata);
|
||||||
|
}
|
||||||
|
if (null != swModule) {
|
||||||
|
/*final List<SoftwareModuleMetadata> swMetadataList = swModule.getMetadata();*/
|
||||||
|
final List<SoftwareModuleMetadata> swMetadataList = swMetadtaList;
|
||||||
|
if (null != swMetadataList && !swMetadataList.isEmpty()) {
|
||||||
|
swMetadataList.forEach(swMetadata -> setSWMetadataProperties(swMetadata));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata){
|
||||||
|
final Item item = getContainerDataSource().addItem(swMetadata.getKey());
|
||||||
|
item.getItemProperty(METADATA_KEY).setValue(swMetadata.getKey());
|
||||||
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
|
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCustomGeneratedColumns() {
|
||||||
|
addGeneratedColumn(VIEW,
|
||||||
|
(source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button customMetadataDetailButton(final String itemId) {
|
||||||
|
final Item row1 = getItem(itemId);
|
||||||
|
final String metadataKey = (String) row1.getItemProperty(METADATA_KEY).getValue();
|
||||||
|
|
||||||
|
final Button viewIcon = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), VIEW,
|
||||||
|
"View Software Module Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
||||||
|
viewIcon.setData(metadataKey);
|
||||||
|
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
|
||||||
|
//viewIcon.addClickListener(event -> onClickOfDetailButton(event));
|
||||||
|
return viewIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getDetailLinkId(final String name) {
|
||||||
|
return new StringBuilder(SPUIComponetIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name)
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,8 +8,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.dstable;
|
package org.eclipse.hawkbit.ui.distributions.dstable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -17,11 +19,13 @@ import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
|||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||||
|
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent.SoftwareModuleEventType;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent.SoftwareModuleEventType;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.common.detailslayout.DistributionSetMetadatadetailslayout;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleDetailsTable;
|
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleDetailsTable;
|
||||||
import org.eclipse.hawkbit.ui.common.tagdetails.DistributionTagToken;
|
import org.eclipse.hawkbit.ui.common.tagdetails.DistributionTagToken;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
@@ -38,13 +42,18 @@ import org.vaadin.spring.events.EventScope;
|
|||||||
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import com.vaadin.spring.annotation.SpringComponent;
|
||||||
import com.vaadin.spring.annotation.ViewScope;
|
import com.vaadin.spring.annotation.ViewScope;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
|
import com.vaadin.ui.Table.Align;
|
||||||
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
import com.vaadin.ui.Component;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.TabSheet;
|
import com.vaadin.ui.TabSheet;
|
||||||
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.VerticalLayout;
|
import com.vaadin.ui.VerticalLayout;
|
||||||
import com.vaadin.ui.Window;
|
import com.vaadin.ui.Window;
|
||||||
@@ -65,6 +74,10 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
|
|
||||||
private static final String UNASSIGN_SOFT_MODULE = "unassignSoftModule";
|
private static final String UNASSIGN_SOFT_MODULE = "unassignSoftModule";
|
||||||
|
|
||||||
|
private static final String DS_METADA_KEY = "Key";
|
||||||
|
|
||||||
|
private static final String VIEW ="view";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ManageDistUIState manageDistUIState;
|
private ManageDistUIState manageDistUIState;
|
||||||
|
|
||||||
@@ -82,8 +95,12 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
|
|
||||||
private SoftwareModuleDetailsTable softwareModuleTable;
|
private SoftwareModuleDetailsTable softwareModuleTable;
|
||||||
|
|
||||||
|
private DistributionSetMetadatadetailslayout dsMetadataTable;
|
||||||
|
|
||||||
private VerticalLayout tagsLayout;
|
private VerticalLayout tagsLayout;
|
||||||
|
|
||||||
|
private VerticalLayout metadataLayout;
|
||||||
|
|
||||||
Map<String, StringBuilder> assignedSWModule = new HashMap<>();
|
Map<String, StringBuilder> assignedSWModule = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,6 +111,8 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
softwareModuleTable = new SoftwareModuleDetailsTable();
|
softwareModuleTable = new SoftwareModuleDetailsTable();
|
||||||
softwareModuleTable.init(getI18n(), true, getPermissionChecker(), distributionSetManagement, getEventBus(),
|
softwareModuleTable.init(getI18n(), true, getPermissionChecker(), distributionSetManagement, getEventBus(),
|
||||||
manageDistUIState);
|
manageDistUIState);
|
||||||
|
dsMetadataTable = new DistributionSetMetadatadetailslayout();
|
||||||
|
dsMetadataTable.init(getI18n(), getPermissionChecker());
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +126,14 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
populateDetails();
|
populateDetails();
|
||||||
populateModule();
|
populateModule();
|
||||||
populateTags();
|
populateTags();
|
||||||
|
populateMetadataDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected VerticalLayout createMetadataLayout() {
|
||||||
|
metadataLayout = getTabLayout();
|
||||||
|
metadataLayout.setSizeFull();
|
||||||
|
metadataLayout.addComponent(dsMetadataTable);
|
||||||
|
return metadataLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateModule() {
|
private void populateModule() {
|
||||||
@@ -239,6 +266,10 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void populateMetadataDetails(){
|
||||||
|
dsMetadataTable.populateDSMetadata(getSelectedBaseEntity());
|
||||||
|
}
|
||||||
|
|
||||||
private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
|
private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
|
||||||
final VerticalLayout detailsTabLayout = getDetailsLayout();
|
final VerticalLayout detailsTabLayout = getDetailsLayout();
|
||||||
detailsTabLayout.removeAllComponents();
|
detailsTabLayout.removeAllComponents();
|
||||||
@@ -294,6 +325,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
|
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
|
||||||
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
|
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
|
||||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||||
|
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
|||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.common.detailslayout.DistributionSetMetadatadetailslayout;
|
||||||
|
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleMetadatadetailslayout;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
@@ -69,8 +71,11 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
|
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
|
||||||
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
|
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
|
||||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||||
|
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDefaultCaption() {
|
protected String getDefaultCaption() {
|
||||||
return getI18n().get("upload.swModuleTable.header");
|
return getI18n().get("upload.swModuleTable.header");
|
||||||
@@ -139,6 +144,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
@Override
|
@Override
|
||||||
protected void populateDetailsWidget() {
|
protected void populateDetailsWidget() {
|
||||||
populateDetails();
|
populateDetails();
|
||||||
|
populateMetadataDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -146,4 +152,8 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
return SPUIComponetIdProvider.TARGET_DETAILS_HEADER_LABEL_ID;
|
return SPUIComponetIdProvider.TARGET_DETAILS_HEADER_LABEL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void populateMetadataDetails(){
|
||||||
|
swmMetadataTable.populateSMMetadata(getSelectedBaseEntity());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.ui.management.dstable;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.common.detailslayout.DistributionSetMetadatadetailslayout;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleDetailsTable;
|
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleDetailsTable;
|
||||||
import org.eclipse.hawkbit.ui.common.tagdetails.DistributionTagToken;
|
import org.eclipse.hawkbit.ui.common.tagdetails.DistributionTagToken;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
@@ -49,10 +50,18 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
|||||||
|
|
||||||
private SoftwareModuleDetailsTable softwareModuleTable;
|
private SoftwareModuleDetailsTable softwareModuleTable;
|
||||||
|
|
||||||
|
private VerticalLayout metadataLayout;
|
||||||
|
|
||||||
|
private DistributionSetMetadatadetailslayout dsMetadataTable;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
softwareModuleTable = new SoftwareModuleDetailsTable();
|
softwareModuleTable = new SoftwareModuleDetailsTable();
|
||||||
softwareModuleTable.init(getI18n(), false, getPermissionChecker(), null, null, null);
|
softwareModuleTable.init(getI18n(), false, getPermissionChecker(), null, null, null);
|
||||||
|
|
||||||
|
dsMetadataTable = new DistributionSetMetadatadetailslayout();
|
||||||
|
dsMetadataTable.init(getI18n(), getPermissionChecker());
|
||||||
|
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +82,14 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
|||||||
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
|
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
|
||||||
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
|
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
|
||||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||||
|
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected VerticalLayout createMetadataLayout() {
|
||||||
|
metadataLayout = getTabLayout();
|
||||||
|
metadataLayout.setSizeFull();
|
||||||
|
metadataLayout.addComponent(dsMetadataTable);
|
||||||
|
return metadataLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -110,10 +127,15 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
|||||||
return SPUIComponetIdProvider.DISTRIBUTION_DETAILS_TABSHEET;
|
return SPUIComponetIdProvider.DISTRIBUTION_DETAILS_TABSHEET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void populateMetadataDetails(){
|
||||||
|
dsMetadataTable.populateDSMetadata(getSelectedBaseEntity());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void populateDetailsWidget() {
|
protected void populateDetailsWidget() {
|
||||||
softwareModuleTable.populateModule(getSelectedBaseEntity());
|
softwareModuleTable.populateModule(getSelectedBaseEntity());
|
||||||
populateDetails(getSelectedBaseEntity());
|
populateDetails(getSelectedBaseEntity());
|
||||||
|
populateMetadataDetails();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -682,6 +682,16 @@ public final class SPUIComponetIdProvider {
|
|||||||
*/
|
*/
|
||||||
public static final String CUSTOM_FILTER_DETAIL_LINK = "custom.filter.detail.link";
|
public static final String CUSTOM_FILTER_DETAIL_LINK = "custom.filter.detail.link";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DistributionSet - Metadata button id.
|
||||||
|
*/
|
||||||
|
public static final String DS_METADATA_DETAIL_LINK = "distributionset.metadata.detail.link";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Software Module - Metadata button id.
|
||||||
|
*/
|
||||||
|
public static final String SW_METADATA_DETAIL_LINK = "softwaremodule.metadata.detail.link";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* custom filter - save button id.
|
* custom filter - save button id.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ caption.bulk.upload.targets = Bulk Upload
|
|||||||
caption.softwares.distdetail.tab = Modules
|
caption.softwares.distdetail.tab = Modules
|
||||||
caption.tags.tab = Tags
|
caption.tags.tab = Tags
|
||||||
caption.logs.tab = Logs
|
caption.logs.tab = Logs
|
||||||
|
caption.metadata.tab = Metadata
|
||||||
caption.attributes.tab = Attributes
|
caption.attributes.tab = Attributes
|
||||||
caption.types.tab = Types
|
caption.types.tab = Types
|
||||||
caption.save.window = Action Details
|
caption.save.window = Action Details
|
||||||
@@ -90,6 +91,7 @@ caption.force.action.confirmbox = Confirm Force Active Action
|
|||||||
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
||||||
|
|
||||||
# Labels prefix with - label
|
# Labels prefix with - label
|
||||||
|
label.dist.details.key = Key
|
||||||
label.dist.details.type = Type :
|
label.dist.details.type = Type :
|
||||||
label.dist.details.name = Name :
|
label.dist.details.name = Name :
|
||||||
label.dist.details.version = Version :
|
label.dist.details.version = Version :
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ caption.bulk.upload.targets = Bulk Upload
|
|||||||
caption.softwares.distdetail.tab = Modules
|
caption.softwares.distdetail.tab = Modules
|
||||||
caption.tags.tab = Tags
|
caption.tags.tab = Tags
|
||||||
caption.logs.tab = Logs
|
caption.logs.tab = Logs
|
||||||
|
caption.metadata.tab = Metadata
|
||||||
caption.attributes.tab = Attributes
|
caption.attributes.tab = Attributes
|
||||||
caption.types.tab = Types
|
caption.types.tab = Types
|
||||||
caption.save.window = Action Details
|
caption.save.window = Action Details
|
||||||
@@ -89,6 +90,7 @@ caption.filter.custom = Custom Filter
|
|||||||
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
||||||
|
|
||||||
# Labels prefix with - label
|
# Labels prefix with - label
|
||||||
|
label.dist.details.key = Key
|
||||||
label.dist.details.type = Type :
|
label.dist.details.type = Type :
|
||||||
label.dist.details.name = Name :
|
label.dist.details.name = Name :
|
||||||
label.dist.details.version = Version :
|
label.dist.details.version = Version :
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ caption.bulk.upload.targets = Bulk Upload
|
|||||||
caption.softwares.distdetail.tab = Modules
|
caption.softwares.distdetail.tab = Modules
|
||||||
caption.tags.tab = Tags
|
caption.tags.tab = Tags
|
||||||
caption.logs.tab = Logs
|
caption.logs.tab = Logs
|
||||||
|
caption.metadata.tab = Metadata
|
||||||
caption.attributes.tab = Attributes
|
caption.attributes.tab = Attributes
|
||||||
caption.types.tab = Types
|
caption.types.tab = Types
|
||||||
caption.save.window = Action Details
|
caption.save.window = Action Details
|
||||||
@@ -89,6 +90,7 @@ caption.force.action.confirmbox = Confirm Force Active Action
|
|||||||
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
||||||
|
|
||||||
# Labels prefix with - label
|
# Labels prefix with - label
|
||||||
|
label.dist.details.key = Key
|
||||||
label.dist.details.type = Type :
|
label.dist.details.type = Type :
|
||||||
label.dist.details.name = Name :
|
label.dist.details.name = Name :
|
||||||
label.dist.details.version = Version :
|
label.dist.details.version = Version :
|
||||||
|
|||||||
Reference in New Issue
Block a user