From 6c725efd70ad7ed9ae045249cabc773799179716 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Fri, 3 Jun 2016 09:49:36 +0200 Subject: [PATCH] Code review, correct font-size of close/minimize button of commonDialogWindow Signed-off-by: Melanie Retter --- .../SoftwareModuleAddUpdateWindow.java | 45 ++++++++++++++----- .../CreateUpdateSoftwareTypeLayout.java | 8 ++-- .../ColorPickerConstants.java | 10 ++++- .../ColorPickerHelper.java | 40 ++++++++++++----- .../ColorPickerLayout.java | 10 +++-- .../hawkbit/ui/common/CommonDialogWindow.java | 16 ++++++- .../SPUIButtonStyleBorderWithIcon.java | 24 +++++++--- .../CreateUpdateDistSetTypeLayout.java | 39 ++++++---------- .../CreateOrUpdateFilterHeader.java | 18 +++----- ...ava => AbstractCreateUpdateTagLayout.java} | 13 +++--- .../ui/layouts/CreateUpdateTypeLayout.java | 22 +++++---- .../DistributionAddUpdateWindowLayout.java | 5 +-- ...eateUpdateDistributionTagLayoutWindow.java | 11 ++--- .../TargetBulkUpdateWindowLayout.java | 4 +- .../CreateUpdateTargetTagLayoutWindow.java | 10 ++--- .../targettag/MultipleTargetFilter.java | 1 + .../rollout/AddUpdateRolloutWindowLayout.java | 29 +++++++++--- .../ui/rollout/rollout/RolloutListGrid.java | 11 ++--- .../ui/rollout/rollout/RolloutListHeader.java | 4 -- .../DefaultDistributionSetTypeLayout.java | 5 +-- .../TenantConfigurationDashboardView.java | 11 +++-- ...ficateAuthenticationConfigurationItem.java | 5 +-- ...yTokenAuthenticationConfigurationItem.java | 1 + .../ui/utils/SPUIComponetIdProvider.java | 4 -- .../themes/hawkbit/customstyles/others.scss | 2 +- .../hawkbit/customstyles/popup-common.scss | 8 +++- 26 files changed, 213 insertions(+), 143 deletions(-) rename hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/{colorPicker => colorpicker}/ColorPickerConstants.java (77%) rename hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/{colorPicker => colorpicker}/ColorPickerHelper.java (66%) rename hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/{colorPicker => colorpicker}/ColorPickerLayout.java (97%) rename hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/{CreateUpdateTagLayout.java => AbstractCreateUpdateTagLayout.java} (98%) 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 f766af2d4..33cefae8a 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,6 @@ 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.CommonDialogWindow; import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery; @@ -29,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory; import org.vaadin.spring.events.EventBus; +import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.spring.annotation.SpringComponent; import com.vaadin.spring.annotation.ViewScope; import com.vaadin.ui.ComboBox; @@ -64,9 +64,6 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se @Autowired private transient SoftwareManagement softwareManagement; - @Autowired - private transient UiProperties uiProperties; - private Label mandatoryLabel; private TextField nameTextField; @@ -182,9 +179,8 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se } /** - * Keep UI components on Layout. + * Build the window content and get an instance of customDialogWindow * - * @return */ private void createWindow() { @@ -215,22 +211,28 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se nameTextField.focus(); } + /** + * add a TextChangeListener to the description TextField + */ private void addDescriptionTextChangeListener() { descTextArea.addTextChangeListener(event -> { if (event.getText().equals(oldDescriptionValue) && vendorTextField.getValue().equals(oldVendorValue)) { - window.setSaveButtonEnabled(false); + window.setSaveButtonEnabled(hasDescriptionOrVendorChanged(event)); } else { - window.setSaveButtonEnabled(true); + window.setSaveButtonEnabled(hasDescriptionOrVendorChanged(event)); } }); } + /** + * add a TextChangeListener to the vendor TextField + */ private void addVendorTextChangeListener() { vendorTextField.addTextChangeListener(event -> { if (event.getText().equals(oldVendorValue) && descTextArea.getValue().equals(oldDescriptionValue)) { - window.setSaveButtonEnabled(false); + window.setSaveButtonEnabled(hasDescriptionOrVendorChanged(event)); } else { - window.setSaveButtonEnabled(true); + window.setSaveButtonEnabled(hasDescriptionOrVendorChanged(event)); } }); } @@ -264,6 +266,9 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se } } + /** + * updates a softwareModule + */ private void updateSwModule() { final String newDesc = HawkbitCommonUtil.trimAndNullIfEmpty(descTextArea.getValue()); final String newVendor = HawkbitCommonUtil.trimAndNullIfEmpty(vendorTextField.getValue()); @@ -280,6 +285,9 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se closeThisWindow(); } + /** + * fill the data of a softwareModule in the content of the window + */ private void populateValuesOfSwModule() { final SoftwareModule swModle = softwareManagement.findSoftwareModuleById(baseSwModuleId); nameTextField.setValue(swModle.getName()); @@ -333,6 +341,10 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se return isValid; } + /** + * saves or updates a softwareModule depending on the information if it is a + * new softwareModule or an existing one + */ private void save() { if (editSwModule) { updateSwModule(); @@ -341,4 +353,17 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se addNewBaseSoftware(); } } + + /** + * Checks if the description and vendor have changed and set the button + * enabled/disabled + * + * @param event + * TextChangeEvent + * @return Boolean + */ + private boolean hasDescriptionOrVendorChanged(final TextChangeEvent event) { + return !(event.getText().equals(oldDescriptionValue) && vendorTextField.getValue().equals(oldVendorValue)); + } + } 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 d23329f37..70aceb6db 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 @@ -11,12 +11,13 @@ package org.eclipse.hawkbit.ui.artifacts.smtype; import java.util.ArrayList; import java.util.List; +import org.apache.commons.lang3.StringUtils; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent; import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent.SoftwareModuleTypeEnum; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerConstants; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerHelper; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper; import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.layouts.CreateUpdateTypeLayout; @@ -279,9 +280,8 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout protected void previewButtonClicked() { if (!tagPreviewBtnClicked) { final String selectedOption = (String) optiongroup.getValue(); - if (null != selectedOption && selectedOption.equalsIgnoreCase(updateTypeStr)) { + if (StringUtils.isNotEmpty(selectedOption) && selectedOption.equalsIgnoreCase(updateTypeStr)) { if (null != tagNameComboBox.getValue()) { - final SoftwareModuleType typeSelected = swTypeManagementService .findSoftwareModuleTypeByName(tagNameComboBox.getValue().toString()); if (null != typeSelected) { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerConstants.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerConstants.java similarity index 77% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerConstants.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerConstants.java index ddb4eb70c..06e280e4e 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerConstants.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerConstants.java @@ -6,12 +6,20 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ui.colorPicker; +package org.eclipse.hawkbit.ui.colorpicker; import com.vaadin.shared.ui.colorpicker.Color; +/** + * Provides color constants for the ColorPickerLayout + * + */ public class ColorPickerConstants { public static final String DEFAULT_COLOR = "rgb(44,151,32)"; public static final Color START_COLOR = new Color(0, 146, 58); + + private ColorPickerConstants() { + + } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerHelper.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerHelper.java similarity index 66% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerHelper.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerHelper.java index 815bb97b2..923c58fe3 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerHelper.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerHelper.java @@ -6,8 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ui.colorPicker; +package org.eclipse.hawkbit.ui.colorpicker; +import org.apache.commons.lang3.StringUtils; import org.eclipse.hawkbit.ui.management.tag.SpColorPickerPreview; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -15,19 +16,27 @@ import org.slf4j.LoggerFactory; import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.ui.Slider.ValueOutOfBoundsException; +/** + * Contains helper methods for the ColorPickerLayout to handle the ColorPicker + * + */ public class ColorPickerHelper { private static final Logger LOG = LoggerFactory.getLogger(ColorPickerHelper.class); + private ColorPickerHelper() { + + } + /** - * Get color picked value in string. + * Get color picked value as string. * * @return String of color picked value. */ public static String getColorPickedString(final SpColorPickerPreview preview) { - return "rgb(" + preview.getColor().getRed() + "," + preview.getColor().getGreen() + "," - + preview.getColor().getBlue() + ")"; + final Color color = preview.getColor(); + return "rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue() + ")"; } /** @@ -39,9 +48,11 @@ public class ColorPickerHelper { */ public static Color rgbToColorConverter(final String value) { - if (!value.startsWith("rgb")) { - return null; + if (StringUtils.isEmpty(value) || (StringUtils.isNotEmpty(value) && !value.startsWith("rgb"))) { + throw new IllegalArgumentException( + "String to convert is empty or of invalid format - value: '" + value + "'"); } + // RGB color format rgb/rgba(255,255,255,0.1) final String[] colors = value.substring(value.indexOf('(') + 1, value.length() - 1).split(","); final int red = Integer.parseInt(colors[0]); @@ -50,20 +61,27 @@ public class ColorPickerHelper { if (colors.length > 3) { final int alpha = (int) (Double.parseDouble(colors[3]) * 255d); return new Color(red, green, blue, alpha); - } else { - return new Color(red, green, blue); } + return new Color(red, green, blue); } + /** + * + * Gets the selectedColor in the ColorPickerLayout and sets the slider + * values + * + * @param colorPickerLayout + * colorPickerLayout + */ public static void setRgbSliderValues(final ColorPickerLayout colorPickerLayout) { try { final double redColorValue = colorPickerLayout.getSelectedColor().getRed(); - colorPickerLayout.getRedSlider().setValue(new Double(redColorValue)); + colorPickerLayout.getRedSlider().setValue(Double.valueOf(redColorValue)); final double blueColorValue = colorPickerLayout.getSelectedColor().getBlue(); - colorPickerLayout.getBlueSlider().setValue(new Double(blueColorValue)); + colorPickerLayout.getBlueSlider().setValue(Double.valueOf(blueColorValue)); final double greenColorValue = colorPickerLayout.getSelectedColor().getGreen(); - colorPickerLayout.getGreenSlider().setValue(new Double(greenColorValue)); + colorPickerLayout.getGreenSlider().setValue(Double.valueOf(greenColorValue)); } catch (final ValueOutOfBoundsException e) { LOG.error("Unable to set RGB color value to " + colorPickerLayout.getSelectedColor().getRed() + "," + colorPickerLayout.getSelectedColor().getGreen() + "," diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerLayout.java similarity index 97% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerLayout.java index dba5ac8df..7d2046bd9 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorPicker/ColorPickerLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/colorpicker/ColorPickerLayout.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ui.colorPicker; +package org.eclipse.hawkbit.ui.colorpicker; import java.util.HashSet; import java.util.Set; @@ -21,13 +21,15 @@ import com.vaadin.ui.Slider; import com.vaadin.ui.components.colorpicker.ColorPickerGradient; import com.vaadin.ui.components.colorpicker.ColorSelector; +/** + * + * Defines the Layout for the ColorPicker + * + */ public class ColorPickerLayout extends GridLayout { private static final long serialVersionUID = -7025970080613796692L; - /** - * Local Instance of ColorPickerPreview. - */ private SpColorPickerPreview selPreview; private ColorPickerGradient colorSelect; diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CommonDialogWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CommonDialogWindow.java index 8b179ba4a..6b59ebd69 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CommonDialogWindow.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CommonDialogWindow.java @@ -9,11 +9,13 @@ package org.eclipse.hawkbit.ui.common; import org.apache.commons.lang3.StringUtils; +import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleBorderWithIcon; import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.server.FontAwesome; @@ -27,6 +29,12 @@ import com.vaadin.ui.Link; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; +/** + * + * Superclass for pop-up-windows including a minimize and close icon in the + * upper right corner and a save and cancel button at the bottom. + * + */ public class CommonDialogWindow extends Window { private static final long serialVersionUID = -1321949234316858703L; @@ -49,6 +57,9 @@ public class CommonDialogWindow extends Window { protected ValueChangeListener buttonEnableListener; + @Autowired + private transient UiProperties uiProperties; + public CommonDialogWindow() { init(null, null); @@ -84,6 +95,7 @@ public class CommonDialogWindow extends Window { setResizable(true); center(); setModal(true); + addStyleName("fontsize"); } private HorizontalLayout createActionButtonsLayout(final ClickListener saveButtonClickListener, @@ -100,7 +112,7 @@ public class CommonDialogWindow extends Window { if (null != saveButtonClickListener) { saveButton.addClickListener(saveButtonClickListener); } else { - LOG.warn("No ClickListener for saveButton specified"); + throw new IllegalArgumentException("no ClickListener for save button specified"); } buttonsLayout.addComponent(saveButton); buttonsLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_RIGHT); @@ -113,7 +125,7 @@ public class CommonDialogWindow extends Window { if (null != cancelButtonClickListener) { cancelButton.addClickListener(cancelButtonClickListener); } else { - LOG.warn("No ClickListener for cancelButton specified"); + throw new IllegalArgumentException("no ClickListener for cancel button specified"); } buttonsLayout.addComponent(cancelButton); buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_LEFT); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleBorderWithIcon.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleBorderWithIcon.java index 2f8b88d74..be72dd700 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleBorderWithIcon.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleBorderWithIcon.java @@ -14,6 +14,8 @@ import com.vaadin.ui.themes.ValoTheme; public class SPUIButtonStyleBorderWithIcon implements SPUIButtonDecorator { + Button button; + /** * Style for button: Primary. */ @@ -21,7 +23,19 @@ public class SPUIButtonStyleBorderWithIcon implements SPUIButtonDecorator { @Override public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) { - // Set Style + this.button = button; + + setButtonStyle(style, setStyle); + setButtonIcon(icon); + + button.addStyleName(ValoTheme.LABEL_SMALL); + button.setSizeFull(); + + return button; + } + + private void setButtonStyle(final String style, final boolean setStyle) { + if (null != style) { if (setStyle) { button.setStyleName(style); @@ -29,14 +43,12 @@ public class SPUIButtonStyleBorderWithIcon implements SPUIButtonDecorator { button.addStyleName(style); } } - button.addStyleName(ValoTheme.LABEL_SMALL); - button.setSizeFull(); + } + + private void setButtonIcon(final Resource icon) { - // Set icon if (null != icon) { button.setIcon(icon); } - return button; } - } 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 266339050..c43110b10 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 @@ -16,8 +16,8 @@ import org.eclipse.hawkbit.repository.DistributionSetRepository; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerConstants; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerHelper; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper; import org.eclipse.hawkbit.ui.common.DistributionSetTypeBeanQuery; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; @@ -350,12 +350,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout final CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue(); final Boolean isMandatory = mandatoryCheckBox.getValue(); final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(distTypeName); - if (isMandatory) { - newDistType.addMandatoryModuleType(swModuleType); - - } else { - newDistType.addOptionalModuleType(swModuleType); - } + checkMandatoryAndAddMandatoryModuleType(newDistType, isMandatory, swModuleType); } if (null != typeDescValue) { newDistType.setDescription(typeDescValue); @@ -400,12 +395,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout final String distTypeName = (String) item.getItemProperty(DIST_TYPE_NAME).getValue(); final SoftwareModuleType swModuleType = softwareManagement .findSoftwareModuleTypeByName(distTypeName); - if (isMandatory) { - updateDistSetType.addMandatoryModuleType(swModuleType); - - } else { - updateDistSetType.addOptionalModuleType(swModuleType); - } + checkMandatoryAndAddMandatoryModuleType(updateDistSetType, isMandatory, swModuleType); } } updateDistSetType.setColour(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())); @@ -422,6 +412,16 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout } + private void checkMandatoryAndAddMandatoryModuleType(final DistributionSetType updateDistSetType, + final Boolean isMandatory, final SoftwareModuleType swModuleType) { + if (isMandatory) { + updateDistSetType.addMandatoryModuleType(swModuleType); + + } else { + updateDistSetType.addOptionalModuleType(swModuleType); + } + } + private DistributionSetType removeSWModuleTypesFromDistSetType(final String selectedDistSetType) { final DistributionSetType distSetType = fetchDistributionSetType(selectedDistSetType); @@ -590,17 +590,6 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout } } - /** - * reset the tag name and tag description component border color. - */ - @Override - protected void restoreComponentStyles() { - - super.restoreComponentStyles(); - typeKey.removeStyleName(TYPE_NAME_DYNAMIC_STYLE); - typeKey.addStyleName(SPUIDefinitions.DIST_SET_TYPE_KEY); - } - @Override protected void save(final ClickEvent event) { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java index cbade914b..a9ea2092d 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java @@ -68,7 +68,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button private static final long serialVersionUID = 7474232427119031474L; - private static final String breadcrumbCustomFilters = "breadcrumb.target.filter.custom.filters"; + private static final String BREADCRUMB_CUSTOM_FILTERS = "breadcrumb.target.filter.custom.filters"; @Autowired private I18N i18n; @@ -238,8 +238,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button final Button createFilterViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null, SPUIButtonStyleSmallNoBorder.class); createFilterViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); - createFilterViewLink.setDescription(i18n.get(breadcrumbCustomFilters)); - createFilterViewLink.setCaption(i18n.get(breadcrumbCustomFilters)); + createFilterViewLink.setDescription(i18n.get(BREADCRUMB_CUSTOM_FILTERS)); + createFilterViewLink.setCaption(i18n.get(BREADCRUMB_CUSTOM_FILTERS)); createFilterViewLink.addClickListener(value -> showCustomFiltersView()); return createFilterViewLink; @@ -487,15 +487,11 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button public void buttonClick(final ClickEvent event) { if (SPUIComponetIdProvider.CUSTOM_FILTER_SAVE_ICON.equals(event.getComponent().getId()) && manadatoryFieldsPresent()) { - if (filterManagementUIState.isCreateFilterViewDisplayed()) { - if (!doesAlreadyExists()) { - createTargetFilterQuery(); - } + if (filterManagementUIState.isCreateFilterViewDisplayed() && !doesAlreadyExists()) { + createTargetFilterQuery(); } else { - if (!nameTextField.getValue().equals(oldFilterName)) { - if (!doesAlreadyExists()) { - updateCustomFilter(); - } + if (!nameTextField.getValue().equals(oldFilterName) && !doesAlreadyExists()) { + updateCustomFilter(); } else { updateCustomFilter(); } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTagLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractCreateUpdateTagLayout.java similarity index 98% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTagLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractCreateUpdateTagLayout.java index efe629eb7..c92790022 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTagLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractCreateUpdateTagLayout.java @@ -15,9 +15,9 @@ import org.eclipse.hawkbit.repository.TagManagement; import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.eclipse.hawkbit.repository.model.Tag; import org.eclipse.hawkbit.repository.model.TargetTag; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerConstants; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerHelper; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerLayout; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerLayout; import org.eclipse.hawkbit.ui.common.CommonDialogWindow; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil; @@ -27,8 +27,6 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.UINotification; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.vaadin.spring.events.EventBus; @@ -58,9 +56,9 @@ import com.vaadin.ui.themes.ValoTheme; /** * Abstract class for create/update target tag layout. */ -public abstract class CreateUpdateTagLayout extends CustomComponent implements ColorChangeListener, ColorSelector { +public abstract class AbstractCreateUpdateTagLayout extends CustomComponent + implements ColorChangeListener, ColorSelector { private static final long serialVersionUID = 4229177824620576456L; - private static final Logger LOG = LoggerFactory.getLogger(CreateUpdateTagLayout.class); private static final String TAG_NAME_DYNAMIC_STYLE = "new-tag-name"; private static final String TAG_DESC_DYNAMIC_STYLE = "new-tag-desc"; protected static final String TAG_DYNAMIC_STYLE = "tag-color-preview"; @@ -236,6 +234,7 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C protected void previewButtonClicked() { if (!tagPreviewBtnClicked) { setColor(); + mainLayout.getComponent(1, 0); mainLayout.addComponent(colorPickerLayout, 1, 0); mainLayout.setComponentAlignment(colorPickerLayout, Alignment.MIDDLE_CENTER); } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTypeLayout.java index ad2758a5f..019b64aaa 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTypeLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/CreateUpdateTypeLayout.java @@ -11,8 +11,8 @@ package org.eclipse.hawkbit.ui.layouts; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.NamedEntity; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerConstants; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerHelper; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil; import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider; @@ -32,7 +32,13 @@ import com.vaadin.ui.components.colorpicker.ColorChangeEvent; import com.vaadin.ui.components.colorpicker.ColorSelector; import com.vaadin.ui.themes.ValoTheme; -public class CreateUpdateTypeLayout extends CreateUpdateTagLayout { +/** + * + * Superclass defining common properties and methods for creating/updating + * types. + * + */ +public class CreateUpdateTypeLayout extends AbstractCreateUpdateTagLayout { private static final long serialVersionUID = 5732904956185988397L; @@ -187,6 +193,7 @@ public class CreateUpdateTypeLayout extends CreateUpdateTagLayout { protected void restoreComponentStyles() { super.restoreComponentStyles(); typeKey.removeStyleName(TYPE_NAME_DYNAMIC_STYLE); + typeKey.addStyleName(SPUIDefinitions.TYPE_KEY); } /** @@ -298,20 +305,17 @@ public class CreateUpdateTypeLayout extends CreateUpdateTagLayout { @Override protected void save(final ClickEvent event) { - // TODO Auto-generated method stub - + // is implemented in the inherited class } @Override protected void populateTagNameCombo() { - // TODO Auto-generated method stub - + // is implemented in the inherited class } @Override protected void setTagDetails(final String tagSelected) { - // TODO Auto-generated method stub - + // is implemented in the inherited class } } 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 2ce9f84f5..459893521 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,6 @@ 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.CommonDialogWindow; import org.eclipse.hawkbit.ui.common.DistributionSetTypeBeanQuery; import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType; @@ -91,9 +90,6 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent { @Autowired private transient TenantMetaDataRepository tenantMetaDataRepository; - @Autowired - private transient UiProperties uiProperties; - private TextField distNameTextField; private TextField distVersionTextField; private Label madatoryLabel; @@ -537,4 +533,5 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent { public void setOriginalDistSetTYpe(final String originalDistSetType) { this.originalDistSetType = originalDistSetType; } + } 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 1c6372033..c4da4d12e 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 @@ -16,9 +16,9 @@ import org.eclipse.hawkbit.eventbus.event.DistributionSetTagCreatedBulkEvent; import org.eclipse.hawkbit.eventbus.event.DistributionSetTagDeletedEvent; import org.eclipse.hawkbit.eventbus.event.DistributionSetTagUpdateEvent; import org.eclipse.hawkbit.repository.model.DistributionSetTag; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerConstants; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerHelper; -import org.eclipse.hawkbit.ui.layouts.CreateUpdateTagLayout; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper; +import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.vaadin.spring.events.EventScope; @@ -31,11 +31,12 @@ import com.vaadin.ui.UI; /** * - * + * Class for Create/Update Tag Layout of distribution set + * */ @SpringComponent @ViewScope -public class CreateUpdateDistributionTagLayoutWindow extends CreateUpdateTagLayout { +public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdateTagLayout { private static final long serialVersionUID = 444276149954167545L; 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 e938f68f3..231b072fd 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 @@ -354,7 +354,9 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent { } /** - * @return + * create and return window + * + * @return Window window */ public Window getWindow() { managementUIState.setBulkUploadWindowMinimised(false); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayoutWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayoutWindow.java index f3f78377a..ae0c19f38 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayoutWindow.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayoutWindow.java @@ -16,9 +16,9 @@ import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent; import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent; import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent; import org.eclipse.hawkbit.repository.model.TargetTag; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerConstants; -import org.eclipse.hawkbit.ui.colorPicker.ColorPickerHelper; -import org.eclipse.hawkbit.ui.layouts.CreateUpdateTagLayout; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants; +import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper; +import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout; import org.vaadin.spring.events.EventScope; import org.vaadin.spring.events.annotation.EventBusListenerMethod; @@ -28,11 +28,11 @@ import com.vaadin.ui.Button.ClickEvent; /** * - * + * Class for Create / Update Tag Layout of target */ @SpringComponent @ViewScope -public class CreateUpdateTargetTagLayoutWindow extends CreateUpdateTagLayout { +public class CreateUpdateTargetTagLayoutWindow extends AbstractCreateUpdateTagLayout { private static final long serialVersionUID = 2446682350481560235L; diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java index 6e4c73a92..c2403e96a 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java @@ -170,4 +170,5 @@ public class MultipleTargetFilter extends Accordion implements SelectedTabChange UI.getCurrent().addWindow(addUpdateWindow); addUpdateWindow.setVisible(true); } + } 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 0f5b00f1a..f29c4e9d9 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 @@ -41,6 +41,8 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.UINotification; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory; import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer; @@ -76,6 +78,8 @@ public class AddUpdateRolloutWindowLayout extends GridLayout { private static final long serialVersionUID = 2999293468801479916L; + private static final Logger LOG = LoggerFactory.getLogger(AddUpdateRolloutWindowLayout.class); + private static final String MESSAGE_ROLLOUT_FIELD_VALUE_RANGE = "message.rollout.field.value.range"; private static final String MESSAGE_ENTER_NUMBER = "message.enter.number"; @@ -642,11 +646,14 @@ public class AddUpdateRolloutWindowLayout extends GridLayout { new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, groupSize), 0, groupSize) .validate(Integer.valueOf(value.toString())); } - } catch (final InvalidValueException ex) { - throw ex; + } + // suppress the need of preserve original exception, will blow + // up the + // log and not necessary here + catch (@SuppressWarnings("squid:S1166") final InvalidValueException ex) { + LOG.error(ex.getMessage()); } } - } private int getGroupSize() { @@ -662,8 +669,12 @@ public class AddUpdateRolloutWindowLayout extends GridLayout { new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value); new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 100), 0, 100) .validate(Integer.valueOf(value.toString())); - } catch (final InvalidValueException ex) { - throw ex; + } + // suppress the need of preserve original exception, will blow + // up the + // log and not necessary here + catch (@SuppressWarnings("squid:S1166") final InvalidValueException ex) { + LOG.error(ex.getMessage()); } } } @@ -677,8 +688,12 @@ public class AddUpdateRolloutWindowLayout extends GridLayout { new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value); new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 500), 0, 500) .validate(Integer.valueOf(value.toString())); - } catch (final InvalidValueException ex) { - throw ex; + } + // suppress the need of preserve original exception, will blow + // up the + // log and not necessary here + catch (@SuppressWarnings("squid:S1166") final InvalidValueException ex) { + LOG.error(ex.getMessage()); } } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java index a63dd37e8..c55800138 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java @@ -632,15 +632,13 @@ public class RolloutListGrid extends AbstractGrid { @Override public TotalTargetCountStatus convertToModel(final String value, - final Class targetType, final Locale locale) - throws com.vaadin.data.util.converter.Converter.ConversionException { + final Class targetType, final Locale locale) { return null; } @Override public String convertToPresentation(final TotalTargetCountStatus value, - final Class targetType, final Locale locale) - throws com.vaadin.data.util.converter.Converter.ConversionException { + final Class targetType, final Locale locale) { return DistributionBarHelper.getDistributionBarAsHTMLString(value.getStatusTotalCountMap()); } @@ -664,14 +662,13 @@ public class RolloutListGrid extends AbstractGrid { private static final long serialVersionUID = 6589305227035220369L; @Override - public Long convertToModel(final String value, final Class targetType, final Locale locale) - throws com.vaadin.data.util.converter.Converter.ConversionException { + public Long convertToModel(final String value, final Class targetType, final Locale locale) { return null; } @Override public String convertToPresentation(final Long value, final Class targetType, - final Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { + final Locale locale) { if (value == 0) { return ""; } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java index f4d2a325f..b3043eb4a 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java @@ -15,7 +15,6 @@ import org.eclipse.hawkbit.ui.common.grid.AbstractGridHeader; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.rollout.event.RolloutEvent; import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState; -import org.eclipse.hawkbit.ui.utils.I18N; import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; @@ -49,9 +48,6 @@ public class RolloutListHeader extends AbstractGridHeader { @Autowired private transient EventBus.SessionEventBus eventBus; - @Autowired - private I18N i18n; - @Autowired private AddUpdateRolloutWindowLayout addUpdateRolloutWindow; 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 098456d88..aa2a31a7c 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,7 +14,6 @@ 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; @@ -50,9 +49,6 @@ public class DefaultDistributionSetTypeLayout extends BaseConfigurationView impl @Autowired private I18N i18n; - @Autowired - private transient UiProperties uiProperties; - private Long currentDefaultDisSetType; private Long selectedDefaultDisSetType; @@ -158,4 +154,5 @@ public class DefaultDistributionSetTypeLayout extends BaseConfigurationView impl changeIcon.setVisible(false); } } + } 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 a6f1b8c32..1ef0d1960 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 @@ -32,6 +32,7 @@ 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; @@ -118,9 +119,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; } @@ -142,9 +143,7 @@ public class TenantConfigurationDashboardView extends CustomComponent implements } private void undoConfiguration() { - configurationViews.forEach(confView -> { - confView.undo(); - }); + configurationViews.forEach(confView -> confView.undo()); // More methods saveConfigurationBtn.setEnabled(false); undoConfigurationBtn.setEnabled(false); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java index e49f77b8d..872bdef29 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java @@ -41,10 +41,6 @@ public class CertificateAuthenticationConfigurationItem extends AbstractAuthenti private VerticalLayout detailLayout; private TextField caRootAuthorityTextField; - /** - * @param systemManagement - * the system management to retrie the configuration - */ @Autowired public CertificateAuthenticationConfigurationItem( final TenantConfigurationManagement tenantConfigurationManagement) { @@ -147,4 +143,5 @@ public class CertificateAuthenticationConfigurationItem extends AbstractAuthenti configurationCaRootAuthorityChanged = true; notifyConfigurationChanged(); } + } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java index 86d51409a..31e910ddc 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java @@ -195,4 +195,5 @@ public class GatewaySecurityTokenAuthenticationConfigurationItem extends Abstrac gatewayTokenNameTextField.setValue(getSecurityTokenName()); gatewayTokenkeyLabel.setValue(getSecurityTokenKey()); } + } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java index 3992cf042..8766e06cb 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java @@ -11,10 +11,6 @@ package org.eclipse.hawkbit.ui.utils; /** * Interface to provide the unchanged constants. * - * - * - * - * */ public final class SPUIComponetIdProvider { /** diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss index 3e90b5ed2..d327baa94 100644 --- a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss +++ b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss @@ -88,7 +88,7 @@ } .icon-only { - // margin-bottom: 6px !important; + margin-bottom: 6px !important; } //Toggle between pin and status icon diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss index 7b4bfe0d1..457fc266d 100644 --- a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss +++ b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss @@ -11,7 +11,6 @@ //Color picker layout position adjustment .rgb-vertical-layout { - // margin-top: 100px !important; padding-bottom: 12px; } @@ -47,4 +46,11 @@ box-shadow: none !important; height: 75px !important; } + + .v-window-fontsize .v-window-closebox, + .v-window-fontsize .v-window-maximizebox, + .v-window-fontsize .v-window-restorebox { + font-size: 16px; + } + }