Displaying Metadata details of DistributionSet & SoftwareModule
Signed-off-by: venu1278 <venugopal.boodidadinne@in.bosch.com>
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.state.ArtifactUploadState;
|
||||
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.utils.HawkbitCommonUtil;
|
||||
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
||||
@@ -44,7 +45,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
||||
|
||||
@Autowired
|
||||
private ArtifactUploadState artifactUploadState;
|
||||
|
||||
|
||||
@Override
|
||||
protected String getEditButtonId() {
|
||||
return SPUIComponetIdProvider.UPLOAD_SW_MODULE_EDIT_BUTTON;
|
||||
@@ -55,8 +56,9 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
||||
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
|
||||
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
|
||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onEdit(final ClickEvent event) {
|
||||
final Window addSoftwareModule = softwareModuleAddUpdateWindow
|
||||
@@ -81,6 +83,8 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
||||
updateSoftwareModuleDetailsLayout(HawkbitCommonUtil.SP_STRING_EMPTY, HawkbitCommonUtil.SP_STRING_EMPTY,
|
||||
maxAssign);
|
||||
}
|
||||
|
||||
populateMetadataDetails();
|
||||
}
|
||||
|
||||
private void updateSoftwareModuleDetailsLayout(final String type, final String vendor, final String maxAssign) {
|
||||
@@ -141,4 +145,8 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
||||
protected String getDetailsHeaderCaptionId() {
|
||||
return SPUIComponetIdProvider.TARGET_DETAILS_HEADER_LABEL_ID;
|
||||
}
|
||||
|
||||
private void populateMetadataDetails(){
|
||||
swmMetadataTable.populateSMMetadata(getSelectedBaseEntity());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,8 +72,12 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
private VerticalLayout logLayout;
|
||||
|
||||
private VerticalLayout attributesLayout;
|
||||
|
||||
/**
|
||||
|
||||
private VerticalLayout metadataLayout;
|
||||
|
||||
protected SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
||||
|
||||
/**
|
||||
* Initialize components.
|
||||
*/
|
||||
@PostConstruct
|
||||
@@ -145,8 +149,10 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
detailsTab.setHeight(90, Unit.PERCENTAGE);
|
||||
detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE);
|
||||
detailsTab.setId(getTabSheetId());
|
||||
swmMetadataTable = new SoftwareModuleMetadatadetailslayout();
|
||||
swmMetadataTable.init(getI18n(), getPermissionChecker());
|
||||
addTabs(detailsTab);
|
||||
}
|
||||
}
|
||||
|
||||
private void buildLayout() {
|
||||
final HorizontalLayout nameEditLayout = new HorizontalLayout();
|
||||
@@ -209,8 +215,9 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
populateLog();
|
||||
populateDescription();
|
||||
populateDetailsWidget();
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void populateLog() {
|
||||
logLayout.removeAllComponents();
|
||||
|
||||
@@ -281,7 +288,15 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
descriptionLayout = getTabLayout();
|
||||
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
|
||||
* table.
|
||||
@@ -317,7 +332,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
public VerticalLayout getDetailsLayout() {
|
||||
return detailsLayout;
|
||||
}
|
||||
|
||||
|
||||
private void populateDescription() {
|
||||
if (selectedBaseEntity != null) {
|
||||
updateDescriptionLayout(i18n.get("label.description"), selectedBaseEntity.getDescription());
|
||||
|
||||
@@ -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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.model.DistributionSet;
|
||||
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.SoftwareModuleIdName;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent.SoftwareModuleEventType;
|
||||
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.tagdetails.DistributionTagToken;
|
||||
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 com.vaadin.data.Item;
|
||||
import com.vaadin.data.util.IndexedContainer;
|
||||
import com.vaadin.server.FontAwesome;
|
||||
import com.vaadin.spring.annotation.SpringComponent;
|
||||
import com.vaadin.spring.annotation.ViewScope;
|
||||
import com.vaadin.ui.Button;
|
||||
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.TabSheet;
|
||||
import com.vaadin.ui.Table;
|
||||
import com.vaadin.ui.UI;
|
||||
import com.vaadin.ui.VerticalLayout;
|
||||
import com.vaadin.ui.Window;
|
||||
@@ -64,6 +73,10 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
private static final String SOFT_MODULE = "softwareModule";
|
||||
|
||||
private static final String UNASSIGN_SOFT_MODULE = "unassignSoftModule";
|
||||
|
||||
private static final String DS_METADA_KEY = "Key";
|
||||
|
||||
private static final String VIEW ="view";
|
||||
|
||||
@Autowired
|
||||
private ManageDistUIState manageDistUIState;
|
||||
@@ -81,8 +94,12 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
private transient DistributionSetManagement distributionSetManagement;
|
||||
|
||||
private SoftwareModuleDetailsTable softwareModuleTable;
|
||||
|
||||
private DistributionSetMetadatadetailslayout dsMetadataTable;
|
||||
|
||||
private VerticalLayout tagsLayout;
|
||||
|
||||
private VerticalLayout metadataLayout;
|
||||
|
||||
Map<String, StringBuilder> assignedSWModule = new HashMap<>();
|
||||
|
||||
@@ -94,6 +111,8 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
softwareModuleTable = new SoftwareModuleDetailsTable();
|
||||
softwareModuleTable.init(getI18n(), true, getPermissionChecker(), distributionSetManagement, getEventBus(),
|
||||
manageDistUIState);
|
||||
dsMetadataTable = new DistributionSetMetadatadetailslayout();
|
||||
dsMetadataTable.init(getI18n(), getPermissionChecker());
|
||||
super.init();
|
||||
}
|
||||
|
||||
@@ -107,6 +126,14 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
populateDetails();
|
||||
populateModule();
|
||||
populateTags();
|
||||
populateMetadataDetails();
|
||||
}
|
||||
|
||||
protected VerticalLayout createMetadataLayout() {
|
||||
metadataLayout = getTabLayout();
|
||||
metadataLayout.setSizeFull();
|
||||
metadataLayout.addComponent(dsMetadataTable);
|
||||
return metadataLayout;
|
||||
}
|
||||
|
||||
private void populateModule() {
|
||||
@@ -238,7 +265,11 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
updateDistributionSetDetailsLayout(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void populateMetadataDetails(){
|
||||
dsMetadataTable.populateDSMetadata(getSelectedBaseEntity());
|
||||
}
|
||||
|
||||
private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
|
||||
final VerticalLayout detailsTabLayout = getDetailsLayout();
|
||||
detailsTabLayout.removeAllComponents();
|
||||
@@ -294,6 +325,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
|
||||
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
|
||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||
}
|
||||
|
||||
@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.smtable.SoftwareModuleAddUpdateWindow;
|
||||
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.distributions.state.ManageDistUIState;
|
||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||
@@ -44,7 +46,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
||||
|
||||
@Autowired
|
||||
private ManageDistUIState manageDistUIState;
|
||||
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
||||
onBaseEntityEvent(softwareModuleEvent);
|
||||
@@ -69,8 +71,11 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
||||
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
|
||||
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
|
||||
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
|
||||
detailsTab.addTab(createMetadataLayout(), getI18n().get("caption.metadata.tab"), null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected String getDefaultCaption() {
|
||||
return getI18n().get("upload.swModuleTable.header");
|
||||
@@ -139,11 +144,16 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
||||
@Override
|
||||
protected void populateDetailsWidget() {
|
||||
populateDetails();
|
||||
populateMetadataDetails();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDetailsHeaderCaptionId() {
|
||||
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.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.tagdetails.DistributionTagToken;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
@@ -48,11 +49,19 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
||||
private DistributionTagToken distributionTagToken;
|
||||
|
||||
private SoftwareModuleDetailsTable softwareModuleTable;
|
||||
|
||||
private VerticalLayout metadataLayout;
|
||||
|
||||
private DistributionSetMetadatadetailslayout dsMetadataTable;
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
softwareModuleTable = new SoftwareModuleDetailsTable();
|
||||
softwareModuleTable.init(getI18n(), false, getPermissionChecker(), null, null, null);
|
||||
|
||||
dsMetadataTable = new DistributionSetMetadatadetailslayout();
|
||||
dsMetadataTable.init(getI18n(), getPermissionChecker());
|
||||
|
||||
super.init();
|
||||
}
|
||||
|
||||
@@ -73,6 +82,14 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
||||
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
|
||||
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.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
|
||||
@@ -109,11 +126,16 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
||||
protected String getTabSheetId() {
|
||||
return SPUIComponetIdProvider.DISTRIBUTION_DETAILS_TABSHEET;
|
||||
}
|
||||
|
||||
private void populateMetadataDetails(){
|
||||
dsMetadataTable.populateDSMetadata(getSelectedBaseEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void populateDetailsWidget() {
|
||||
softwareModuleTable.populateModule(getSelectedBaseEntity());
|
||||
populateDetails(getSelectedBaseEntity());
|
||||
populateMetadataDetails();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -681,6 +681,16 @@ public final class SPUIComponetIdProvider {
|
||||
* custom filter - update button id.
|
||||
*/
|
||||
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.
|
||||
|
||||
@@ -69,6 +69,7 @@ caption.bulk.upload.targets = Bulk Upload
|
||||
caption.softwares.distdetail.tab = Modules
|
||||
caption.tags.tab = Tags
|
||||
caption.logs.tab = Logs
|
||||
caption.metadata.tab = Metadata
|
||||
caption.attributes.tab = Attributes
|
||||
caption.types.tab = Types
|
||||
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
|
||||
|
||||
# Labels prefix with - label
|
||||
label.dist.details.key = Key
|
||||
label.dist.details.type = Type :
|
||||
label.dist.details.name = Name :
|
||||
label.dist.details.version = Version :
|
||||
|
||||
@@ -67,6 +67,7 @@ caption.bulk.upload.targets = Bulk Upload
|
||||
caption.softwares.distdetail.tab = Modules
|
||||
caption.tags.tab = Tags
|
||||
caption.logs.tab = Logs
|
||||
caption.metadata.tab = Metadata
|
||||
caption.attributes.tab = Attributes
|
||||
caption.types.tab = Types
|
||||
caption.save.window = Action Details
|
||||
@@ -89,6 +90,7 @@ caption.filter.custom = Custom Filter
|
||||
caption.filter.delete.confirmbox = Confirm Filter Delete Action
|
||||
|
||||
# Labels prefix with - label
|
||||
label.dist.details.key = Key
|
||||
label.dist.details.type = Type :
|
||||
label.dist.details.name = Name :
|
||||
label.dist.details.version = Version :
|
||||
|
||||
@@ -69,6 +69,7 @@ caption.bulk.upload.targets = Bulk Upload
|
||||
caption.softwares.distdetail.tab = Modules
|
||||
caption.tags.tab = Tags
|
||||
caption.logs.tab = Logs
|
||||
caption.metadata.tab = Metadata
|
||||
caption.attributes.tab = Attributes
|
||||
caption.types.tab = Types
|
||||
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
|
||||
|
||||
# Labels prefix with - label
|
||||
label.dist.details.key = Key
|
||||
label.dist.details.type = Type :
|
||||
label.dist.details.name = Name :
|
||||
label.dist.details.version = Version :
|
||||
|
||||
Reference in New Issue
Block a user