Merge branch 'master' into feature_enable_push_in_deployment_view
Conflicts: hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java
This commit is contained in:
@@ -115,10 +115,10 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
|||||||
protected void populateDetailsWidget() {
|
protected void populateDetailsWidget() {
|
||||||
String maxAssign = HawkbitCommonUtil.SP_STRING_EMPTY;
|
String maxAssign = HawkbitCommonUtil.SP_STRING_EMPTY;
|
||||||
if (getSelectedBaseEntity() != null) {
|
if (getSelectedBaseEntity() != null) {
|
||||||
if (getSelectedBaseEntity().getType().getMaxAssignments() == Integer.MAX_VALUE) {
|
if (getSelectedBaseEntity().getType().getMaxAssignments() == 1) {
|
||||||
maxAssign = getI18n().get("label.multiAssign.type");
|
|
||||||
} else {
|
|
||||||
maxAssign = getI18n().get("label.singleAssign.type");
|
maxAssign = getI18n().get("label.singleAssign.type");
|
||||||
|
} else {
|
||||||
|
maxAssign = getI18n().get("label.multiAssign.type");
|
||||||
}
|
}
|
||||||
updateSoftwareModuleDetailsLayout(getSelectedBaseEntity().getType().getName(),
|
updateSoftwareModuleDetailsLayout(getSelectedBaseEntity().getType().getName(),
|
||||||
getSelectedBaseEntity().getVendor(), maxAssign);
|
getSelectedBaseEntity().getVendor(), maxAssign);
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout {
|
|||||||
assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
||||||
assignOptiongroup.addStyleName("custom-option-group");
|
assignOptiongroup.addStyleName("custom-option-group");
|
||||||
assignOptiongroup.setNullSelectionAllowed(false);
|
assignOptiongroup.setNullSelectionAllowed(false);
|
||||||
|
assignOptiongroup.setId(SPUIDefinitions.ASSIGN_OPTION_GROUP_SOFTWARE_MODULE_TYPE_ID);
|
||||||
assignOptiongroup.select(tagOptions.get(0));
|
assignOptiongroup.select(tagOptions.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ import com.vaadin.data.util.IndexedContainer;
|
|||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
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.HorizontalLayout;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
|
import com.vaadin.ui.VerticalLayout;
|
||||||
import com.vaadin.ui.themes.ValoTheme;
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,8 +62,6 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
|
|
||||||
private static final String SOFT_TYPE_MANDATORY = "mandatory";
|
private static final String SOFT_TYPE_MANDATORY = "mandatory";
|
||||||
|
|
||||||
private static final String UNASSIGN_SOFT_MODULE = "unassignSoftModule";
|
|
||||||
|
|
||||||
private boolean isTargetAssigned;
|
private boolean isTargetAssigned;
|
||||||
|
|
||||||
private boolean isUnassignSoftModAllowed;
|
private boolean isUnassignSoftModAllowed;
|
||||||
@@ -109,7 +109,6 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
|
|
||||||
private void createSwModuleTable() {
|
private void createSwModuleTable() {
|
||||||
addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
|
addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
|
||||||
addStyleName(ValoTheme.TABLE_NO_STRIPES);
|
|
||||||
setSelectable(false);
|
setSelectable(false);
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
setContainerDataSource(getSwModuleContainer());
|
setContainerDataSource(getSwModuleContainer());
|
||||||
@@ -123,22 +122,13 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
final IndexedContainer container = new IndexedContainer();
|
final IndexedContainer container = new IndexedContainer();
|
||||||
container.addContainerProperty(SOFT_TYPE_MANDATORY, Label.class, "");
|
container.addContainerProperty(SOFT_TYPE_MANDATORY, Label.class, "");
|
||||||
container.addContainerProperty(SOFT_TYPE_NAME, Label.class, "");
|
container.addContainerProperty(SOFT_TYPE_NAME, Label.class, "");
|
||||||
container.addContainerProperty(SOFT_MODULE, Label.class, "");
|
container.addContainerProperty(SOFT_MODULE, VerticalLayout.class, "");
|
||||||
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission()) {
|
|
||||||
container.addContainerProperty(UNASSIGN_SOFT_MODULE, Button.class, "");
|
|
||||||
}
|
|
||||||
setColumnExpandRatio(SOFT_TYPE_MANDATORY, 0.1f);
|
setColumnExpandRatio(SOFT_TYPE_MANDATORY, 0.1f);
|
||||||
setColumnExpandRatio(SOFT_TYPE_NAME, 0.4f);
|
setColumnExpandRatio(SOFT_TYPE_NAME, 0.4f);
|
||||||
setColumnExpandRatio(SOFT_MODULE, 0.3f);
|
setColumnExpandRatio(SOFT_MODULE, 0.3f);
|
||||||
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission()) {
|
|
||||||
setColumnExpandRatio(UNASSIGN_SOFT_MODULE, 0.2F);
|
|
||||||
}
|
|
||||||
setColumnAlignment(SOFT_TYPE_MANDATORY, Align.RIGHT);
|
setColumnAlignment(SOFT_TYPE_MANDATORY, Align.RIGHT);
|
||||||
setColumnAlignment(SOFT_TYPE_NAME, Align.LEFT);
|
setColumnAlignment(SOFT_TYPE_NAME, Align.LEFT);
|
||||||
setColumnAlignment(SOFT_MODULE, Align.LEFT);
|
setColumnAlignment(SOFT_MODULE, Align.LEFT);
|
||||||
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission()) {
|
|
||||||
setColumnAlignment(UNASSIGN_SOFT_MODULE, Align.RIGHT);
|
|
||||||
}
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,10 +136,6 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
setColumnHeader(SOFT_TYPE_MANDATORY, "");
|
setColumnHeader(SOFT_TYPE_MANDATORY, "");
|
||||||
setColumnHeader(SOFT_TYPE_NAME, i18n.get("header.caption.typename"));
|
setColumnHeader(SOFT_TYPE_NAME, i18n.get("header.caption.typename"));
|
||||||
setColumnHeader(SOFT_MODULE, i18n.get("header.caption.softwaremodule"));
|
setColumnHeader(SOFT_MODULE, i18n.get("header.caption.softwaremodule"));
|
||||||
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission()) {
|
|
||||||
setColumnHeader(UNASSIGN_SOFT_MODULE, i18n.get("header.caption.unassign"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,31 +174,18 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
final Item saveTblitem = getContainerDataSource().addItem(swModType.getName());
|
final Item saveTblitem = getContainerDataSource().addItem(swModType.getName());
|
||||||
final Label mandatoryLabel = createMandatoryLabel(isMandatory);
|
final Label mandatoryLabel = createMandatoryLabel(isMandatory);
|
||||||
final Label typeName = HawkbitCommonUtil.getFormatedLabel(swModType.getName());
|
final Label typeName = HawkbitCommonUtil.getFormatedLabel(swModType.getName());
|
||||||
|
final VerticalLayout verticalLayout = createSoftModuleLayout(swModType, distributionSet,
|
||||||
|
alreadyAssignedSwModules);
|
||||||
|
|
||||||
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
|
||||||
final Button reassignSoftModule = SPUIComponentProvider.getButton(swModType.getName(), "", "", "", true,
|
|
||||||
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
|
||||||
|
|
||||||
reassignSoftModule.addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules));
|
|
||||||
if (null != alreadyAssignedSwModules && !alreadyAssignedSwModules.isEmpty()) {
|
|
||||||
final String swModuleName = getSwModuleName(alreadyAssignedSwModules, swModType);
|
|
||||||
softwareModule.setValue(swModuleName);
|
|
||||||
softwareModule.setDescription(swModuleName);
|
|
||||||
}
|
|
||||||
saveTblitem.getItemProperty(SOFT_TYPE_MANDATORY).setValue(mandatoryLabel);
|
saveTblitem.getItemProperty(SOFT_TYPE_MANDATORY).setValue(mandatoryLabel);
|
||||||
saveTblitem.getItemProperty(SOFT_TYPE_NAME).setValue(typeName);
|
saveTblitem.getItemProperty(SOFT_TYPE_NAME).setValue(typeName);
|
||||||
saveTblitem.getItemProperty(SOFT_MODULE).setValue(softwareModule);
|
saveTblitem.getItemProperty(SOFT_MODULE).setValue(verticalLayout);
|
||||||
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission() && !isTargetAssigned
|
|
||||||
&& (isSoftModAvaiableForSoftType(alreadyAssignedSwModules, swModType))) {
|
|
||||||
saveTblitem.getItemProperty(UNASSIGN_SOFT_MODULE).setValue(reassignSoftModule);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unassignSW(final ClickEvent event, final DistributionSet distributionSet,
|
private void unassignSW(final ClickEvent event, final DistributionSet distributionSet,
|
||||||
final Set<SoftwareModule> alreadyAssignedSwModules) {
|
final Set<SoftwareModule> alreadyAssignedSwModules) {
|
||||||
final SoftwareModule unAssignedSw = getSoftwareModule((Label) getContainerDataSource()
|
final SoftwareModule unAssignedSw = getSoftwareModule(event.getButton().getId(), alreadyAssignedSwModules);
|
||||||
.getItem(event.getButton().getId()).getItemProperty(SOFT_MODULE).getValue(), alreadyAssignedSwModules);
|
|
||||||
final DistributionSet newDistributionSet = distributionSetManagement.unassignSoftwareModule(distributionSet,
|
final DistributionSet newDistributionSet = distributionSetManagement.unassignSoftwareModule(distributionSet,
|
||||||
unAssignedSw);
|
unAssignedSw);
|
||||||
manageDistUIState.setLastSelectedEntity(DistributionSetIdName.generate(newDistributionSet));
|
manageDistUIState.setLastSelectedEntity(DistributionSetIdName.generate(newDistributionSet));
|
||||||
@@ -233,15 +206,46 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType,
|
||||||
|
final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) {
|
||||||
|
final VerticalLayout verticalLayout = new VerticalLayout();
|
||||||
|
for (final SoftwareModule sw : alreadyAssignedSwModules) {
|
||||||
|
if (swModType.getKey().equals(sw.getType().getKey())) {
|
||||||
|
final HorizontalLayout horizontalLayout = new HorizontalLayout();
|
||||||
|
horizontalLayout.setSizeFull();
|
||||||
|
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
||||||
|
final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true,
|
||||||
|
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
||||||
|
reassignSoftModule
|
||||||
|
.addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules));
|
||||||
|
final String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(),
|
||||||
|
sw.getVersion());
|
||||||
|
softwareModule.setValue(softwareModNameVersion);
|
||||||
|
softwareModule.setDescription(softwareModNameVersion);
|
||||||
|
softwareModule.setId(sw.getName() + "-label");
|
||||||
|
horizontalLayout.addComponent(softwareModule);
|
||||||
|
horizontalLayout.setExpandRatio(softwareModule, 1F);
|
||||||
|
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission() && !isTargetAssigned
|
||||||
|
&& (isSoftModAvaiableForSoftType(alreadyAssignedSwModules, swModType))) {
|
||||||
|
horizontalLayout.addComponent(reassignSoftModule);
|
||||||
|
}
|
||||||
|
verticalLayout.addComponent(horizontalLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return verticalLayout;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param value
|
* @param value
|
||||||
* @param alreadyAssignedSwModules
|
* @param alreadyAssignedSwModules
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected SoftwareModule getSoftwareModule(final Label softwareModule,
|
protected SoftwareModule getSoftwareModule(final String softwareModule,
|
||||||
final Set<SoftwareModule> alreadyAssignedSwModules) {
|
final Set<SoftwareModule> alreadyAssignedSwModules) {
|
||||||
for (final SoftwareModule sw : alreadyAssignedSwModules) {
|
for (final SoftwareModule sw : alreadyAssignedSwModules) {
|
||||||
if (softwareModule.getValue().contains(sw.getName())) {
|
if (softwareModule.equals(sw.getName())) {
|
||||||
return sw;
|
return sw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -256,15 +260,4 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
}
|
}
|
||||||
return mandatoryLable;
|
return mandatoryLable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSwModuleName(final Set<SoftwareModule> swModulesSet, final SoftwareModuleType swModType) {
|
|
||||||
final StringBuilder assignedSWModules = new StringBuilder();
|
|
||||||
for (final SoftwareModule sw : swModulesSet) {
|
|
||||||
if (swModType.getKey().equals(sw.getType().getKey())) {
|
|
||||||
assignedSWModules.append(HawkbitCommonUtil.getFormattedNameVersion(sw.getName(), sw.getVersion()))
|
|
||||||
.append("</br>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return assignedSWModules.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ 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.HorizontalLayout;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.TabSheet;
|
import com.vaadin.ui.TabSheet;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
@@ -64,8 +65,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
private static final long serialVersionUID = -4595004466943546669L;
|
private static final long serialVersionUID = -4595004466943546669L;
|
||||||
|
|
||||||
private static final String SOFT_MODULE = "softwareModule";
|
private static final String SOFT_MODULE = "softwareModule";
|
||||||
|
|
||||||
private static final String UNASSIGN_SOFT_MODULE = "unassignSoftModule";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ManageDistUIState manageDistUIState;
|
private ManageDistUIState manageDistUIState;
|
||||||
@@ -163,24 +163,22 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
||||||
item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
item.getItemProperty(SOFT_MODULE)
|
item.getItemProperty(SOFT_MODULE).setValue(createSoftModuleLayout(entry.getValue().toString()));
|
||||||
.setValue(HawkbitCommonUtil.getFormatedLabel(entry.getValue().toString()));
|
|
||||||
assignSoftModuleButton(item, entry);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assignSoftModuleButton(final Item item, final Map.Entry<String, StringBuilder> entry) {
|
private Button assignSoftModuleButton(final String softwareModuleName) {
|
||||||
if (getPermissionChecker().hasUpdateDistributionPermission() && distributionSetManagement
|
if (getPermissionChecker().hasUpdateDistributionPermission() && distributionSetManagement
|
||||||
.findDistributionSetById(manageDistUIState.getLastSelectedDistribution().get().getId())
|
.findDistributionSetById(manageDistUIState.getLastSelectedDistribution().get().getId())
|
||||||
.getAssignedTargets().isEmpty()) {
|
.getAssignedTargets().isEmpty()) {
|
||||||
final Button reassignSoftModule = SPUIComponentProvider.getButton(entry.getKey(), "", "", "", true,
|
final Button reassignSoftModule = SPUIComponentProvider.getButton(softwareModuleName, "", "", "", true,
|
||||||
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
||||||
reassignSoftModule.setEnabled(false);
|
reassignSoftModule.setEnabled(false);
|
||||||
item.getItemProperty(UNASSIGN_SOFT_MODULE).setValue(reassignSoftModule);
|
return reassignSoftModule;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getUnsavedAssigedSwModule(final String name, final String version) {
|
private String getUnsavedAssigedSwModule(final String name, final String version) {
|
||||||
@@ -198,7 +196,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
* type is drroped, then add to the list.
|
* type is drroped, then add to the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (module.getType().getMaxAssignments() == Integer.MAX_VALUE) {
|
if (module.getType().getMaxAssignments() > 1) {
|
||||||
assignedSWModule.get(module.getType().getName()).append("</br>").append("<I>")
|
assignedSWModule.get(module.getType().getName()).append("</br>").append("<I>")
|
||||||
.append(getUnsavedAssigedSwModule(module.getName(), module.getVersion())).append("</I>");
|
.append(getUnsavedAssigedSwModule(module.getName(), module.getVersion())).append("</I>");
|
||||||
}
|
}
|
||||||
@@ -221,14 +219,27 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
||||||
final Item item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
final Item item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
item.getItemProperty(SOFT_MODULE)
|
item.getItemProperty(SOFT_MODULE).setValue(createSoftModuleLayout(entry.getValue().toString()));
|
||||||
.setValue(HawkbitCommonUtil.getFormatedLabel(entry.getValue().toString()));
|
|
||||||
assignSoftModuleButton(item, entry);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private VerticalLayout createSoftModuleLayout(final String softwareModuleName) {
|
||||||
|
final VerticalLayout verticalLayout = new VerticalLayout();
|
||||||
|
final HorizontalLayout horizontalLayout = new HorizontalLayout();
|
||||||
|
horizontalLayout.setSizeFull();
|
||||||
|
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
||||||
|
final Button reassignSoftModule = assignSoftModuleButton(softwareModuleName);
|
||||||
|
softwareModule.setValue(softwareModuleName);
|
||||||
|
softwareModule.setDescription(softwareModuleName);
|
||||||
|
softwareModule.setId(softwareModuleName + "-label");
|
||||||
|
horizontalLayout.addComponent(softwareModule);
|
||||||
|
horizontalLayout.setExpandRatio(softwareModule, 1F);
|
||||||
|
horizontalLayout.addComponent(reassignSoftModule);
|
||||||
|
verticalLayout.addComponent(horizontalLayout);
|
||||||
|
return verticalLayout;
|
||||||
|
}
|
||||||
|
|
||||||
private VerticalLayout createSoftwareModuleTab() {
|
private VerticalLayout createSoftwareModuleTab() {
|
||||||
final VerticalLayout softwareLayout = getTabLayout();
|
final VerticalLayout softwareLayout = getTabLayout();
|
||||||
softwareLayout.setSizeFull();
|
softwareLayout.setSizeFull();
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
|
|
||||||
private void handleSoftwareCase(final Map<Long, HashSet<SoftwareModuleIdName>> map,
|
private void handleSoftwareCase(final Map<Long, HashSet<SoftwareModuleIdName>> map,
|
||||||
final SoftwareModule softwareModule, final SoftwareModuleIdName softwareModuleIdName) {
|
final SoftwareModule softwareModule, final SoftwareModuleIdName softwareModuleIdName) {
|
||||||
if (softwareModule.getType().getMaxAssignments() == Integer.MAX_VALUE) {
|
if (softwareModule.getType().getMaxAssignments() > 1) {
|
||||||
if (!map.containsKey(softwareModule.getType().getId())) {
|
if (!map.containsKey(softwareModule.getType().getId())) {
|
||||||
map.put(softwareModule.getType().getId(), new HashSet<SoftwareModuleIdName>());
|
map.put(softwareModule.getType().getId(), new HashSet<SoftwareModuleIdName>());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,10 +149,10 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
private void populateDetails() {
|
private void populateDetails() {
|
||||||
String maxAssign = HawkbitCommonUtil.SP_STRING_EMPTY;
|
String maxAssign = HawkbitCommonUtil.SP_STRING_EMPTY;
|
||||||
if (getSelectedBaseEntity() != null) {
|
if (getSelectedBaseEntity() != null) {
|
||||||
if (getSelectedBaseEntity().getType().getMaxAssignments() == Integer.MAX_VALUE) {
|
if (getSelectedBaseEntity().getType().getMaxAssignments() == 1) {
|
||||||
maxAssign = getI18n().get("label.multiAssign.type");
|
|
||||||
} else {
|
|
||||||
maxAssign = getI18n().get("label.singleAssign.type");
|
maxAssign = getI18n().get("label.singleAssign.type");
|
||||||
|
} else {
|
||||||
|
maxAssign = getI18n().get("label.multiAssign.type");
|
||||||
}
|
}
|
||||||
updateSwModuleDetailsLayout(getSelectedBaseEntity().getType().getName(),
|
updateSwModuleDetailsLayout(getSelectedBaseEntity().getType().getName(),
|
||||||
getSelectedBaseEntity().getVendor(), maxAssign);
|
getSelectedBaseEntity().getVendor(), maxAssign);
|
||||||
|
|||||||
@@ -76,6 +76,25 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
|||||||
|
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
|
||||||
|
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||||
|
void onEvent(final MetadataEvent event) {
|
||||||
|
UI.getCurrent()
|
||||||
|
.access(() -> {
|
||||||
|
final DistributionSetMetadata dsMetadata = event.getDistributionSetMetadata();
|
||||||
|
if (dsMetadata != null && isDistributionSetSelected(dsMetadata.getDistributionSet())) {
|
||||||
|
if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_DISTRIBUTION_SET_METADATA) {
|
||||||
|
dsMetadataTable.createMetadata(event.getDistributionSetMetadata().getKey());
|
||||||
|
} else if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_DISTRIBUTION_SET_METADATA) {
|
||||||
|
dsMetadataTable.deleteMetadata(event.getDistributionSetMetadata().getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> refs/heads/master
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||||
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
||||||
@@ -195,24 +214,41 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getShowMetadataButtonId() {
|
protected String getShowMetadataButtonId() {
|
||||||
|
<<<<<<< HEAD
|
||||||
final DistributionSetIdName lastselectedDistDS = managementUIState.getLastSelectedDistribution().isPresent()
|
final DistributionSetIdName lastselectedDistDS = managementUIState.getLastSelectedDistribution().isPresent()
|
||||||
? managementUIState.getLastSelectedDistribution().get() : null;
|
? managementUIState.getLastSelectedDistribution().get() : null;
|
||||||
|
=======
|
||||||
|
final DistributionSetIdName lastselectedDistDS = managementUIState.getLastSelectedDistribution().isPresent() ? managementUIState
|
||||||
|
.getLastSelectedDistribution().get() : null;
|
||||||
|
>>>>>>> refs/heads/master
|
||||||
return SPUIComponentIdProvider.DS_TABLE_MANAGE_METADATA_ID + "." + lastselectedDistDS.getName() + "."
|
return SPUIComponentIdProvider.DS_TABLE_MANAGE_METADATA_ID + "." + lastselectedDistDS.getName() + "."
|
||||||
+ lastselectedDistDS.getVersion();
|
+ lastselectedDistDS.getVersion();
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
private boolean isDistributionSetSelected(final DistributionSet ds) {
|
private boolean isDistributionSetSelected(final DistributionSet ds) {
|
||||||
final DistributionSetIdName lastselectedManageDS = managementUIState.getLastSelectedDistribution().isPresent()
|
final DistributionSetIdName lastselectedManageDS = managementUIState.getLastSelectedDistribution().isPresent()
|
||||||
? managementUIState.getLastSelectedDistribution().get() : null;
|
? managementUIState.getLastSelectedDistribution().get() : null;
|
||||||
return ds != null && lastselectedManageDS != null && lastselectedManageDS.getName().equals(ds.getName())
|
return ds != null && lastselectedManageDS != null && lastselectedManageDS.getName().equals(ds.getName())
|
||||||
|
=======
|
||||||
|
private boolean isDistributionSetSelected(final DistributionSet ds) {
|
||||||
|
final DistributionSetIdName lastselectedManageDS = managementUIState.getLastSelectedDistribution().isPresent() ? managementUIState
|
||||||
|
.getLastSelectedDistribution().get() : null;
|
||||||
|
return ds!=null && lastselectedManageDS != null && lastselectedManageDS.getName().equals(ds.getName())
|
||||||
|
>>>>>>> refs/heads/master
|
||||||
&& lastselectedManageDS.getVersion().endsWith(ds.getVersion());
|
&& lastselectedManageDS.getVersion().endsWith(ds.getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void showMetadata(final ClickEvent event) {
|
protected void showMetadata(final ClickEvent event) {
|
||||||
|
<<<<<<< HEAD
|
||||||
final DistributionSet ds = distributionSetManagement
|
final DistributionSet ds = distributionSetManagement
|
||||||
.findDistributionSetByIdWithDetails(getSelectedBaseEntityId());
|
.findDistributionSetByIdWithDetails(getSelectedBaseEntityId());
|
||||||
UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds, null));
|
UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds, null));
|
||||||
|
=======
|
||||||
|
final DistributionSet ds = distributionSetManagement.findDistributionSetByIdWithDetails(getSelectedBaseEntityId());
|
||||||
|
UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds,null));
|
||||||
|
>>>>>>> refs/heads/master
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,6 +305,11 @@ public final class SPUIDefinitions {
|
|||||||
* New Create Update option group id.
|
* New Create Update option group id.
|
||||||
*/
|
*/
|
||||||
public static final String CREATE_OPTION_GROUP_DISTRIBUTION_SET_TYPE_ID = "create.option.group.dist.set.type.id";
|
public static final String CREATE_OPTION_GROUP_DISTRIBUTION_SET_TYPE_ID = "create.option.group.dist.set.type.id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assign option group id(Firmware/Software).
|
||||||
|
*/
|
||||||
|
public static final String ASSIGN_OPTION_GROUP_SOFTWARE_MODULE_TYPE_ID = "assign.option.group.soft.module.type.id";
|
||||||
/**
|
/**
|
||||||
* SW Module Source Table ID.
|
* SW Module Source Table ID.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user