Delete the eventbus call and add the used event to the

hawkbitEventProvider

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-05-09 17:02:12 +02:00
parent 55c59824fc
commit cbcbe571ea
2 changed files with 4 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ import org.eclipse.hawkbit.eventbus.event.TargetCreatedEvent;
import org.eclipse.hawkbit.eventbus.event.TargetDeletedEvent; import org.eclipse.hawkbit.eventbus.event.TargetDeletedEvent;
import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent; import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent; import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
/** /**
* The default hawkbit event provider. * The default hawkbit event provider.
@@ -37,6 +38,7 @@ public class HawkbitEventProvider implements UIEventProvider {
SINGLE_EVENTS.add(DistributionSetTagUpdateEvent.class); SINGLE_EVENTS.add(DistributionSetTagUpdateEvent.class);
SINGLE_EVENTS.add(RolloutGroupChangeEvent.class); SINGLE_EVENTS.add(RolloutGroupChangeEvent.class);
SINGLE_EVENTS.add(RolloutChangeEvent.class); SINGLE_EVENTS.add(RolloutChangeEvent.class);
SINGLE_EVENTS.add(TargetTagUpdateEvent.class);
BULK_EVENTS.add(TargetCreatedEvent.class); BULK_EVENTS.add(TargetCreatedEvent.class);
BULK_EVENTS.add(TargetInfoUpdateEvent.class); BULK_EVENTS.add(TargetInfoUpdateEvent.class);

View File

@@ -144,7 +144,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue()); final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue());
if (optiongroup.getValue().equals(createTagNw)) { if (optiongroup.getValue().equals(createTagNw)) {
if (!checkIsDuplicate(existingTag)) { if (!checkIsDuplicate(existingTag)) {
crateNewTag(); createNewTag();
} }
} else { } else {
@@ -182,7 +182,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
/** /**
* Create new tag. * Create new tag.
*/ */
private void crateNewTag() { private void createNewTag() {
final String colorPicked = getColorPickedString(); final String colorPicked = getColorPickedString();
final String tagNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagName.getValue()); final String tagNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagName.getValue());
final String tagDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue()); final String tagDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue());
@@ -218,7 +218,6 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
tagManagement.updateTargetTag(targetObj); tagManagement.updateTargetTag(targetObj);
uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { targetObj.getName() })); uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { targetObj.getName() }));
closeWindow(); closeWindow();
eventBus.publish(this, new TargetTagUpdateEvent(targetObj));
} else { } else {
uiNotification.displayValidationError(i18n.get("message.tag.update.mandatory")); uiNotification.displayValidationError(i18n.get("message.tag.update.mandatory"));
} }