Merge pull request #164 from bsinno/fix_reflect_tag_color_change_immediatly_after_popup_is_closed
Reflect tag colour change immediatly after popup is closed.
This commit is contained in:
@@ -22,6 +22,7 @@ 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.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
|
||||
|
||||
/**
|
||||
* The default hawkbit event provider.
|
||||
@@ -39,6 +40,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);
|
||||
|
||||
@@ -554,7 +554,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 {
|
||||
|
||||
@@ -611,9 +611,9 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
||||
/**
|
||||
* Create new tag.
|
||||
*/
|
||||
private void crateNewSWModuleType() {
|
||||
private void createNewSWModuleType() {
|
||||
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());
|
||||
@@ -650,7 +650,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() + ")";
|
||||
}
|
||||
@@ -676,7 +676,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();
|
||||
|
||||
@@ -150,7 +150,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
|
||||
final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue());
|
||||
if (optiongroup.getValue().equals(createTagNw)) {
|
||||
if (!checkIsDuplicate(existingTag)) {
|
||||
crateNewTag();
|
||||
createNewTag();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -188,8 +188,8 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
|
||||
/**
|
||||
* Create new tag.
|
||||
*/
|
||||
private void crateNewTag() {
|
||||
final String colorPicked = getColorPickedSting();
|
||||
private void createNewTag() {
|
||||
final String colorPicked = getColorPickedString();
|
||||
final String tagNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagName.getValue());
|
||||
final String tagDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue());
|
||||
if (null != tagNameValue) {
|
||||
@@ -220,7 +220,7 @@ 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();
|
||||
@@ -250,7 +250,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() + ")";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user