diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java index cc08929bb..6a849d8b7 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java @@ -12,7 +12,9 @@ import java.io.Serializable; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.model.SoftwareModule; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery; import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; @@ -66,6 +68,9 @@ public class SoftwareModuleAddUpdateWindow implements Serializable { @Autowired private transient SoftwareManagement softwareManagement; + @Autowired + private transient UiProperties uiProperties; + private Label madatoryLabel; private TextField nameTextField; @@ -227,8 +232,10 @@ public class SoftwareModuleAddUpdateWindow implements Serializable { * (controller Id, name & description) and action buttons layout */ final VerticalLayout mainLayout = new VerticalLayout(); + mainLayout.setSizeUndefined(); mainLayout.setSpacing(Boolean.TRUE); mainLayout.addStyleName("lay-color"); + mainLayout.addComponent(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRoot())); mainLayout.addComponent(madatoryLabel); mainLayout.setComponentAlignment(madatoryLabel, Alignment.MIDDLE_LEFT); mainLayout.addComponent(hLayout); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java index dc6d1081e..dc0a0911c 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java @@ -16,9 +16,11 @@ import java.util.Set; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.SpPermissionChecker; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent; import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent.SoftwareModuleTypeEnum; import org.eclipse.hawkbit.ui.common.CoordinatesToColor; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; @@ -96,6 +98,9 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C @Autowired private transient EventBus.SessionEventBus eventBus; + @Autowired + private transient UiProperties uiProperties; + private String createTypeStr; private String updateTypeStr; private String singleAssignStr; @@ -226,10 +231,12 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C colorPickerLayout.addComponent(colorSelect); fieldLayout = new VerticalLayout(); + fieldLayout.setSizeUndefined(); fieldLayout.setSpacing(true); fieldLayout.setMargin(false); - fieldLayout.setWidth("100%"); - fieldLayout.setHeight(null); + // fieldLayout.setWidth("100%"); + // fieldLayout.setHeight(null); + fieldLayout.addComponent(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRoot())); fieldLayout.addComponent(createOptiongroup); fieldLayout.addComponent(comboLayout); fieldLayout.addComponent(madatoryLabel); @@ -450,6 +457,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C private void createOptionGroupByValues(final List tagOptions) { createOptiongroup = new OptionGroup("", tagOptions); + createOptiongroup.setCaption(null); createOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL); createOptiongroup.addStyleName("custom-option-group"); createOptiongroup.setNullSelectionAllowed(false); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/PopupWindowHelp.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/PopupWindowHelp.java new file mode 100644 index 000000000..1ee505dec --- /dev/null +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/PopupWindowHelp.java @@ -0,0 +1,69 @@ +/** + * 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; + +import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; + +import com.vaadin.ui.Alignment; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Link; + +/** + * + * Helper class that provides the help icon layout in the right upper corner of + * a popup window + * + */ +public class PopupWindowHelp extends HorizontalLayout { + + private static final long serialVersionUID = 5377482512908004826L; + + private Link linkToHelp; + + /** + * Provides a horizontalLayout with a help icon in the right corner. The + * layout is shown by default. + * + * @param link + * link to the help page in the wiki or on github + */ + public PopupWindowHelp(final String link) { + createLinkToHelp(link); + init(); + } + + /** + * Provides a horizontalLayout with a help icon in the right corner. The + * layout is shown by default. The visibility of the layout can be set. If + * visibility is false the layout is not shown and the space is not + * reserved. + * + * @param link + * link to the help page in the wiki or on github + * @param visible + * false == layout is not shown + */ + public PopupWindowHelp(final String link, final boolean visible) { + createLinkToHelp(link); + init(); + setVisible(visible); + } + + public void init() { + setSizeFull(); + addComponent(linkToHelp); + setComponentAlignment(linkToHelp, Alignment.MIDDLE_RIGHT); + addStyleName("window-style"); + } + + private void createLinkToHelp(final String link) { + linkToHelp = SPUIComponentProvider.getHelpLink(link); + } + +} diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java index 8d609f628..58b1b5fd2 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java @@ -19,8 +19,10 @@ import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.SpPermissionChecker; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.common.CoordinatesToColor; import org.eclipse.hawkbit.ui.common.DistributionSetTypeBeanQuery; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent; @@ -116,6 +118,9 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co @Autowired private transient DistributionSetRepository distributionSetRepository; + @Autowired + private transient UiProperties uiProperties; + /** * Instance of ColorPickerPreview. */ @@ -295,6 +300,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co colorLayout.addComponent(sliderLayout); final VerticalLayout mainWindowLayout = new VerticalLayout(); + mainWindowLayout.addComponent(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRoot())); mainWindowLayout.addComponent(mainLayout); mainWindowLayout.addComponent(colorLayout); mainWindowLayout.addComponent(buttonLayout); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java index 80c1b5700..71a022ad9 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java @@ -22,7 +22,9 @@ import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.TenantMetaData; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.common.DistributionSetTypeBeanQuery; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; @@ -94,6 +96,9 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout { @Autowired private transient TenantMetaDataRepository tenantMetaDataRepository; + @Autowired + private transient UiProperties uiProperties; + private Button saveDistributionBtn; private Button discardDistributionBtn; private TextField distNameTextField; @@ -143,8 +148,8 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout { setSpacing(Boolean.TRUE); addStyleName("lay-color"); setSizeUndefined(); - addComponents(madatoryLabel, distsetTypeNameComboBox, distNameTextField, distVersionTextField, descTextArea, - reqMigStepCheckbox); + addComponents(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRoot()), madatoryLabel, + distsetTypeNameComboBox, distNameTextField, distVersionTextField, descTextArea, reqMigStepCheckbox); addComponent(buttonsLayout); setComponentAlignment(madatoryLabel, Alignment.MIDDLE_LEFT); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java index 210509623..8b3e98e5e 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java @@ -213,6 +213,7 @@ public class CreateUpdateDistributionTagLayoutWindow extends CreateUpdateTagLayo private void createOptionGroup(final List tagOptions) { optiongroup = new OptionGroup("", tagOptions); + optiongroup.setCaption(null); optiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL); optiongroup.addStyleName("custom-option-group"); optiongroup.setNullSelectionAllowed(false); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java index b78db6b4f..0f40528b1 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java @@ -17,7 +17,9 @@ import org.eclipse.hawkbit.repository.SpPermissionChecker; import org.eclipse.hawkbit.repository.TagManagement; import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.eclipse.hawkbit.repository.model.TargetTag; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.common.CoordinatesToColor; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil; @@ -69,6 +71,9 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C protected String createTagNw; protected String updateTagNw; + @Autowired + private transient UiProperties uiProperties; + @Autowired protected I18N i18n; @@ -251,15 +256,16 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C buttonLayout.setWidth("152px"); final VerticalLayout fieldButtonLayout = new VerticalLayout(); + fieldButtonLayout.addComponent(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRoot())); fieldButtonLayout.addComponent(fieldLayout); fieldButtonLayout.addComponent(buttonLayout); fieldButtonLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_CENTER); mainLayout = new HorizontalLayout(); + mainLayout.setSizeFull(); mainLayout.addComponent(fieldButtonLayout); setCompositionRoot(mainLayout); - } private void addListeners() { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java index 973d61857..e87e7371f 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java @@ -14,6 +14,8 @@ import java.util.Set; import org.eclipse.hawkbit.repository.TargetManagement; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetIdName; +import org.eclipse.hawkbit.ui.UiProperties; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; @@ -69,6 +71,9 @@ public class TargetAddUpdateWindowLayout extends CustomComponent { @Autowired private transient UINotification uINotification; + + @Autowired + private transient UiProperties uiProperties; private TextField controllerIDTextField; private TextField nameTextField; @@ -83,7 +88,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent { private String oldTargetName; private String oldTargetDesc; - + /** * Initialize the Add Update Window Component for Target. */ @@ -146,6 +151,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent { mainLayout.setSpacing(Boolean.TRUE); mainLayout.addStyleName("lay-color"); mainLayout.setSizeUndefined(); + mainLayout.addComponent(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRoot())); mainLayout.addComponent(madatoryLabel); mainLayout.setComponentAlignment(madatoryLabel, Alignment.MIDDLE_LEFT); if (Boolean.TRUE.equals(editTarget)) { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java index 657cd97af..0dc27b9f5 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java @@ -19,6 +19,7 @@ import org.eclipse.hawkbit.repository.DeploymentManagement; import org.eclipse.hawkbit.repository.TargetManagement; import org.eclipse.hawkbit.repository.model.DistributionSetIdName; import org.eclipse.hawkbit.ui.UiProperties; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.management.dstable.DistributionBeanQuery; @@ -44,7 +45,6 @@ import com.vaadin.server.FontAwesome; import com.vaadin.shared.ui.combobox.FilteringMode; import com.vaadin.spring.annotation.SpringComponent; import com.vaadin.spring.annotation.ViewScope; -import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; import com.vaadin.ui.CustomComponent; @@ -279,12 +279,14 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent { final HorizontalLayout uploaderLayout = new HorizontalLayout(); uploaderLayout.addComponent(bulkUploader); - uploaderLayout.addComponent(linkToSystemConfigHelp); - uploaderLayout.setComponentAlignment(linkToSystemConfigHelp, Alignment.BOTTOM_RIGHT); - uploaderLayout.setExpandRatio(bulkUploader, 1.0F); + // uploaderLayout.addComponent(linkToSystemConfigHelp); + // uploaderLayout.setComponentAlignment(linkToSystemConfigHelp, + // Alignment.BOTTOM_RIGHT); + // uploaderLayout.setExpandRatio(bulkUploader, 1.0F); uploaderLayout.setSizeFull(); - mainLayout.addComponents(captionLayout, dsNamecomboBox, descTextArea, tokenVerticalLayout, descTextArea, - progressBar, targetsCountLabel, uploaderLayout); + mainLayout.addComponents(captionLayout, + new PopupWindowHelp(uiproperties.getLinks().getDocumentation().getDeploymentView()), dsNamecomboBox, + descTextArea, tokenVerticalLayout, descTextArea, progressBar, targetsCountLabel, uploaderLayout); } /** diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java index 51ac77f10..1bf7dbad6 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java @@ -66,6 +66,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { private void createOptionGroup(final List tagOptions) { optiongroup = new OptionGroup("", tagOptions); + optiongroup.setCaption(null); optiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL); optiongroup.addStyleName("custom-option-group"); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java index a426c300e..f574da244 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java @@ -27,6 +27,7 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorCondit import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessAction; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; import org.eclipse.hawkbit.ui.UiProperties; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.filtermanagement.TargetFilterBeanQuery; @@ -63,7 +64,6 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Link; import com.vaadin.ui.OptionGroup; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; @@ -113,8 +113,6 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent { @Autowired private transient EventBus.SessionEventBus eventBus; - private Label madatoryLabel; - private TextField rolloutName; private ComboBox distributionSet; @@ -137,7 +135,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent { private OptionGroup errorThresholdOptionGroup; - private Link linkToHelp; + // private Link linkToHelp; private Window addUpdateRolloutWindow; @@ -204,9 +202,16 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent { mainLayout.setSpacing(Boolean.TRUE); mainLayout.setSizeUndefined(); - mainLayout.addComponents(getMandatoryLabelLinkToHelp(), rolloutName, distributionSet, getTargetFilterLayout(), - getGroupDetailsLayout(), getTriggerThresoldLayout(), getErrorThresoldLayout(), description, - actionTypeOptionGroupLayout, getSaveDiscardButtonLayout()); + // mainLayout.addComponents(getMandatoryLabelLinkToHelp(), rolloutName, + // distributionSet, getTargetFilterLayout(), + // getGroupDetailsLayout(), getTriggerThresoldLayout(), + // getErrorThresoldLayout(), description, + // actionTypeOptionGroupLayout, getSaveDiscardButtonLayout()); + + mainLayout.addComponents(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRolloutView()), + createMandatoryLabel(), rolloutName, distributionSet, getTargetFilterLayout(), getGroupDetailsLayout(), + getTriggerThresoldLayout(), getErrorThresoldLayout(), description, actionTypeOptionGroupLayout, + getSaveDiscardButtonLayout()); setCompositionRoot(mainLayout); } @@ -263,18 +268,20 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent { return buttonsLayout; } - private HorizontalLayout getMandatoryLabelLinkToHelp() { - final HorizontalLayout mandatoryLabelLinkToHelpLayout = new HorizontalLayout(); - mandatoryLabelLinkToHelpLayout.setSizeFull(); - mandatoryLabelLinkToHelpLayout.addComponents(madatoryLabel, linkToHelp); - mandatoryLabelLinkToHelpLayout.setComponentAlignment(madatoryLabel, Alignment.MIDDLE_LEFT); - mandatoryLabelLinkToHelpLayout.setComponentAlignment(linkToHelp, Alignment.MIDDLE_RIGHT); - mandatoryLabelLinkToHelpLayout.addStyleName("window-style"); - return mandatoryLabelLinkToHelpLayout; - } + // private HorizontalLayout getMandatoryLabelLinkToHelp() { + // final HorizontalLayout mandatoryLabelLinkToHelpLayout = new + // HorizontalLayout(); + // mandatoryLabelLinkToHelpLayout.setSizeFull(); + // mandatoryLabelLinkToHelpLayout.addComponents(madatoryLabel, linkToHelp); + // mandatoryLabelLinkToHelpLayout.setComponentAlignment(madatoryLabel, + // Alignment.MIDDLE_LEFT); + // mandatoryLabelLinkToHelpLayout.setComponentAlignment(linkToHelp, + // Alignment.MIDDLE_RIGHT); + // mandatoryLabelLinkToHelpLayout.addStyleName("window-style"); + // return mandatoryLabelLinkToHelpLayout; + // } private void createRequiredComponents() { - madatoryLabel = createMandatoryLabel(); rolloutName = createRolloutNameField(); distributionSet = createDistributionSetCombo(); populateDistributionSet(); @@ -296,14 +303,15 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent { totalTargetsLabel = createTotalTargetsLabel(); targetFilterQuery = createTargetFilterQuery(); - linkToHelp = createLinkToHelp(); + // linkToHelp = createLinkToHelp(); actionTypeOptionGroupLayout.addStyleName(SPUIStyleDefinitions.ROLLOUT_ACTION_TYPE_LAYOUT); } - private Link createLinkToHelp() { - return SPUIComponentProvider.getHelpLink(uiProperties.getLinks().getDocumentation().getRolloutView()); - } + // private Link createLinkToHelp() { + // return + // SPUIComponentProvider.getHelpLink(uiProperties.getLinks().getDocumentation().getRolloutView()); + // } private Label createGroupSizeLabel() { final Label groupSize = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_LABEL_SIMPLE); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java index 0162f6ed8..cf769ed00 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java @@ -14,6 +14,7 @@ import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.SystemManagement; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.TenantMetaData; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.utils.I18N; import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider; @@ -49,6 +50,9 @@ public class DefaultDistributionSetTypeLayout extends BaseConfigurationView impl @Autowired private I18N i18n; + @Autowired + private transient UiProperties uiProperties; + private Long currentDefaultDisSetType; private Long selectedDefaultDisSetType; diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java index d021254bc..3fa69dd1f 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java @@ -15,6 +15,7 @@ import javax.annotation.PostConstruct; import org.eclipse.hawkbit.ui.HawkbitUI; import org.eclipse.hawkbit.ui.UiProperties; +import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.tenantconfiguration.ConfigurationItem.ConfigurationItemChangeListener; @@ -32,7 +33,6 @@ import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Link; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; @@ -90,6 +90,11 @@ public class TenantConfigurationDashboardView extends CustomComponent implements rootLayout.setMargin(true); rootLayout.setSpacing(true); + final PopupWindowHelp help = new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRolloutView()); + help.setSpacing(true); + rootLayout.addComponent(help); + rootLayout.setComponentAlignment(help, Alignment.BOTTOM_RIGHT); + configurationViews.forEach(view -> rootLayout.addComponent(view)); final HorizontalLayout buttonContent = saveConfigurationButtonsLayout(); @@ -119,9 +124,9 @@ public class TenantConfigurationDashboardView extends CustomComponent implements undoConfigurationBtn.addClickListener(event -> undoConfiguration()); hlayout.addComponent(undoConfigurationBtn); - final Link linkToSystemConfigHelp = SPUIComponentProvider - .getHelpLink(uiProperties.getLinks().getDocumentation().getSystemConfigurationView()); - hlayout.addComponent(linkToSystemConfigHelp); + // final Link linkToSystemConfigHelp = SPUIComponentProvider + // .getHelpLink(uiProperties.getLinks().getDocumentation().getSystemConfigurationView()); + // hlayout.addComponent(linkToSystemConfigHelp); return hlayout; }