From 256877faddb99a7f7529819fad4399cdd1550343 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Wed, 13 Apr 2016 16:42:34 +0200 Subject: [PATCH 1/3] Reflect tag color change immediatly after popup is closed. (Deployment Management) Correct one spelling mistake in method name. Signed-off-by: Melanie Retter --- .../artifacts/smtype/CreateUpdateSoftwareTypeLayout.java | 6 +++--- .../management/targettag/CreateUpdateTargetTagLayout.java | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) 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..ecc0ad79d 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 @@ -612,7 +612,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C */ private void crateNewSWModuleType() { int assignNumber = 0; - final String colorPicked = getColorPickedSting(); + final String colorPicked = getColorPickedString(); final String typeNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeName.getValue()); final String typeKeyValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeKey.getValue()); final String typeDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeDesc.getValue()); @@ -649,7 +649,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C * * @return String of color picked value. */ - private String getColorPickedSting() { + private String getColorPickedString() { return "rgb(" + getSelPreview().getColor().getRed() + "," + getSelPreview().getColor().getGreen() + "," + getSelPreview().getColor().getBlue() + ")"; } @@ -675,7 +675,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C existingType.setDescription(null != typeDescValue ? typeDescValue : null); - existingType.setColour(getColorPickedSting()); + existingType.setColour(getColorPickedString()); swTypeManagementService.updateSoftwareModuleType(existingType); uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { existingType.getName() })); closeWindow(); 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..aee07afc4 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 @@ -183,7 +183,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { * Create new tag. */ private void crateNewTag() { - final String colorPicked = getColorPickedSting(); + final String colorPicked = getColorPickedString(); final String tagNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagName.getValue()); final String tagDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue()); if (null != tagNameValue) { @@ -214,10 +214,11 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { if (null != nameUpdateValue) { targetObj.setName(nameUpdateValue); targetObj.setDescription(null != descUpdateValue ? descUpdateValue : null); - targetObj.setColour(getColorPickedSting()); + targetObj.setColour(getColorPickedString()); tagManagement.updateTargetTag(targetObj); uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { targetObj.getName() })); closeWindow(); + eventBus.publish(this, new TargetTagUpdateEvent(targetObj)); } else { uiNotification.displayValidationError(i18n.get("message.tag.update.mandatory")); } @@ -244,7 +245,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { * * @return String of color picked value. */ - private String getColorPickedSting() { + private String getColorPickedString() { return "rgb(" + getSelPreview().getColor().getRed() + "," + getSelPreview().getColor().getGreen() + "," + getSelPreview().getColor().getBlue() + ")"; } From 55c59824fc4d4a150ed6f875548c2c19f79b1bbe Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Wed, 4 May 2016 15:58:53 +0200 Subject: [PATCH 2/3] Correct a typo Signed-off-by: Melanie Retter --- .../ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ecc0ad79d..341d619ea 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 @@ -553,7 +553,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C .findSoftwareModuleTypeByName(typeName.getValue()); if (createOptiongroup.getValue().equals(createTypeStr)) { if (!checkIsKeyDuplicate(typeKey.getValue()) && !checkIsDuplicate(existingType)) { - crateNewSWModuleType(); + createNewSWModuleType(); } } else { @@ -610,7 +610,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C /** * Create new tag. */ - private void crateNewSWModuleType() { + private void createNewSWModuleType() { int assignNumber = 0; final String colorPicked = getColorPickedString(); final String typeNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeName.getValue()); From cbcbe571ea164022341477ac2eab4853c50684e5 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Mon, 9 May 2016 17:02:12 +0200 Subject: [PATCH 3/3] Delete the eventbus call and add the used event to the hawkbitEventProvider Signed-off-by: Melanie Retter --- .../java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java | 2 ++ .../ui/management/targettag/CreateUpdateTargetTagLayout.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java index 12bcaacbc..4c1017fd4 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java @@ -21,6 +21,7 @@ import org.eclipse.hawkbit.eventbus.event.TargetCreatedEvent; import org.eclipse.hawkbit.eventbus.event.TargetDeletedEvent; import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent; import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent; +import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent; /** * The default hawkbit event provider. @@ -37,6 +38,7 @@ public class HawkbitEventProvider implements UIEventProvider { SINGLE_EVENTS.add(DistributionSetTagUpdateEvent.class); SINGLE_EVENTS.add(RolloutGroupChangeEvent.class); SINGLE_EVENTS.add(RolloutChangeEvent.class); + SINGLE_EVENTS.add(TargetTagUpdateEvent.class); BULK_EVENTS.add(TargetCreatedEvent.class); BULK_EVENTS.add(TargetInfoUpdateEvent.class); 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 aee07afc4..9a2805f19 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 @@ -144,7 +144,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue()); if (optiongroup.getValue().equals(createTagNw)) { if (!checkIsDuplicate(existingTag)) { - crateNewTag(); + createNewTag(); } } else { @@ -182,7 +182,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { /** * Create new tag. */ - private void crateNewTag() { + private void createNewTag() { final String colorPicked = getColorPickedString(); final String tagNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagName.getValue()); final String tagDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue()); @@ -218,7 +218,6 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout { tagManagement.updateTargetTag(targetObj); uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { targetObj.getName() })); closeWindow(); - eventBus.publish(this, new TargetTagUpdateEvent(targetObj)); } else { uiNotification.displayValidationError(i18n.get("message.tag.update.mandatory")); }