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,7 +12,6 @@ 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;
|
||||
@@ -45,7 +44,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
||||
|
||||
@Autowired
|
||||
private ArtifactUploadState artifactUploadState;
|
||||
|
||||
|
||||
@Override
|
||||
protected String getEditButtonId() {
|
||||
return SPUIComponetIdProvider.UPLOAD_SW_MODULE_EDIT_BUTTON;
|
||||
@@ -56,9 +55,8 @@ 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
|
||||
@@ -83,8 +81,6 @@ 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) {
|
||||
@@ -145,8 +141,4 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
||||
protected String getDetailsHeaderCaptionId() {
|
||||
return SPUIComponetIdProvider.TARGET_DETAILS_HEADER_LABEL_ID;
|
||||
}
|
||||
|
||||
private void populateMetadataDetails(){
|
||||
swmMetadataTable.populateSMMetadata(getSelectedBaseEntity());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ public class CommonDialogWindow extends Window {
|
||||
buttonsLayout.setSizeFull();
|
||||
buttonsLayout.setSpacing(true);
|
||||
|
||||
saveButton = SPUIComponentProvider.getButton(SPUIComponetIdProvider.SAVE_BUTTON, "save", "", "", true,
|
||||
FontAwesome.SAVE, SPUIButtonStyleBorderWithIcon.class);
|
||||
saveButton = SPUIComponentProvider.getButton(SPUIComponetIdProvider.SYSTEM_CONFIGURATION_SAVE, "save", "", "",
|
||||
true, FontAwesome.SAVE, SPUIButtonStyleBorderWithIcon.class);
|
||||
saveButton.setSizeUndefined();
|
||||
saveButton.addStyleName("default-color");
|
||||
if (null != saveButtonClickListener) {
|
||||
@@ -106,8 +106,8 @@ public class CommonDialogWindow extends Window {
|
||||
buttonsLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_RIGHT);
|
||||
buttonsLayout.setExpandRatio(saveButton, 1.0F);
|
||||
|
||||
cancelButton = SPUIComponentProvider.getButton(SPUIComponetIdProvider.CANCEL_BUTTON, "cancel", "", "", true,
|
||||
FontAwesome.TIMES, SPUIButtonStyleBorderWithIcon.class);
|
||||
cancelButton = SPUIComponentProvider.getButton(SPUIComponetIdProvider.SYSTEM_CONFIGURATION_CANCEL, "cancel", "",
|
||||
"", true, FontAwesome.TIMES, SPUIButtonStyleBorderWithIcon.class);
|
||||
cancelButton.setSizeUndefined();
|
||||
cancelButton.addStyleName("default-color");
|
||||
if (null != cancelButtonClickListener) {
|
||||
|
||||
@@ -72,12 +72,8 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
private VerticalLayout logLayout;
|
||||
|
||||
private VerticalLayout attributesLayout;
|
||||
|
||||
private VerticalLayout metadataLayout;
|
||||
|
||||
protected SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Initialize components.
|
||||
*/
|
||||
@PostConstruct
|
||||
@@ -149,10 +145,8 @@ 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();
|
||||
@@ -215,9 +209,8 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
||||
populateLog();
|
||||
populateDescription();
|
||||
populateDetailsWidget();
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void populateLog() {
|
||||
logLayout.removeAllComponents();
|
||||
|
||||
@@ -288,15 +281,7 @@ 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.
|
||||
@@ -332,7 +317,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());
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
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 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();
|
||||
final List<DistributionSetMetadata> dsMetadtaList = new ArrayList<>();
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
final 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();
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
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.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.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();
|
||||
final List<SoftwareModuleMetadata> swMetadtaList = new ArrayList<>();
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
final 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,10 +8,8 @@
|
||||
*/
|
||||
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;
|
||||
|
||||
@@ -19,13 +17,11 @@ 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;
|
||||
@@ -42,18 +38,13 @@ 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;
|
||||
@@ -73,10 +64,6 @@ 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;
|
||||
@@ -94,12 +81,8 @@ 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<>();
|
||||
|
||||
@@ -111,8 +94,6 @@ 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();
|
||||
}
|
||||
|
||||
@@ -126,14 +107,6 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
||||
populateDetails();
|
||||
populateModule();
|
||||
populateTags();
|
||||
populateMetadataDetails();
|
||||
}
|
||||
|
||||
protected VerticalLayout createMetadataLayout() {
|
||||
metadataLayout = getTabLayout();
|
||||
metadataLayout.setSizeFull();
|
||||
metadataLayout.addComponent(dsMetadataTable);
|
||||
return metadataLayout;
|
||||
}
|
||||
|
||||
private void populateModule() {
|
||||
@@ -265,11 +238,7 @@ 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();
|
||||
@@ -325,7 +294,6 @@ 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,8 +12,6 @@ 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;
|
||||
@@ -46,7 +44,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
||||
|
||||
@Autowired
|
||||
private ManageDistUIState manageDistUIState;
|
||||
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
||||
onBaseEntityEvent(softwareModuleEvent);
|
||||
@@ -71,11 +69,8 @@ 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");
|
||||
@@ -144,16 +139,11 @@ 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,7 +10,6 @@ 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;
|
||||
@@ -49,19 +48,11 @@ 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();
|
||||
}
|
||||
|
||||
@@ -82,14 +73,6 @@ 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
|
||||
@@ -126,16 +109,11 @@ 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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -692,16 +692,6 @@ public final class SPUIComponetIdProvider {
|
||||
*/
|
||||
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,7 +69,6 @@ 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
|
||||
@@ -91,7 +90,6 @@ 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,7 +67,6 @@ 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,7 +89,6 @@ 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,7 +69,6 @@ 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,7 +89,6 @@ 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