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:
@@ -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);
|
||||||
|
|||||||
@@ -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"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user