- Fix ds assignment result
- Fix drag and drop to assignment Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -558,6 +558,12 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> {
|
||||
}
|
||||
final String targTagName = HawkbitCommonUtil.removePrefix(event.getTransferable().getSourceComponent().getId(),
|
||||
SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
|
||||
if (targetList.isEmpty()) {
|
||||
final String actionDidNotWork = i18n.get("message.action.did.not.work", new Object[] {});
|
||||
notification.displayValidationError(actionDidNotWork);
|
||||
return;
|
||||
}
|
||||
|
||||
final TargetTagAssignmentResult result = targetManagement.toggleTagAssignment(targetList, targTagName);
|
||||
|
||||
final List<String> tagsClickedList = managementUIState.getTargetTableFilters().getClickedTargetTags();
|
||||
|
||||
@@ -158,7 +158,7 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
final TableTransferable tbl = (TableTransferable) event.getTransferable();
|
||||
final Table source = tbl.getSourceComponent();
|
||||
if (source.getId().equals(SPUIComponentIdProvider.TARGET_TABLE_ID)) {
|
||||
processTargetDrop(event);
|
||||
UI.getCurrent().access(() -> processTargetDrop(event));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,11 +216,18 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
private void processTargetDrop(final DragAndDropEvent event) {
|
||||
final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails();
|
||||
final TableTransferable transferable = (TableTransferable) event.getTransferable();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final AbstractTable<?, TargetIdName> targetTable = (AbstractTable<?, TargetIdName>) transferable
|
||||
.getSourceComponent();
|
||||
|
||||
final Set<TargetIdName> targetSelected = targetTable.getDeletedEntityByTransferable(transferable);
|
||||
if (targetSelected.isEmpty()) {
|
||||
final String actionDidNotWork = i18n.get("message.action.did.not.work", new Object[] {});
|
||||
notification.displayValidationError(actionDidNotWork);
|
||||
return;
|
||||
}
|
||||
|
||||
final Set<String> targetList = targetSelected.stream().map(t -> t.getControllerId())
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
|
||||
@@ -287,6 +287,7 @@ message.forcequit.action.failed = Force Quitting the action is not possible !
|
||||
message.forcequit.action.confirm = Attention!\nForce quit should only be used when the assignment action is not working properly.\nForce quitting an action has no effect on the connected target. It is just resetting \nthe data stored on the SP update server. \nAre you absolutely sure that you want to force quit this action?
|
||||
message.distribution.no.update = distribution {0} set is already assigned to targets and cannot be changed
|
||||
message.action.not.allowed = Action not allowed
|
||||
message.action.did.not.work = Action did not work. Please try again.
|
||||
message.onlyone.distribution.assigned = Only one distribution set can be assigned
|
||||
message.onlyone.distribution.dropallowed = Only one distribution set can be dropped
|
||||
message.error.missing.typename = Missing Type Name
|
||||
|
||||
@@ -284,6 +284,7 @@ message.force.action.confirm = Are you sure that you want to force this action?
|
||||
message.force.action.success = Action forced successfully !
|
||||
message.distribution.no.update = distribution {0} set is already assigned to targets and cannot be changed
|
||||
message.action.not.allowed = Action not allowed
|
||||
message.action.did.not.work = Action did not work. Please try again.
|
||||
message.onlyone.distribution.assigned = Only one distribution set can be assigned
|
||||
message.onlyone.distribution.dropallowed = Only one distribution set can be dropped
|
||||
message.error.missing.typename = Missing Type Name
|
||||
|
||||
@@ -282,6 +282,7 @@ message.force.action.confirm = Are you sure that you want to force this action?
|
||||
message.force.action.success = Action forced successfully !
|
||||
message.distribution.no.update = distribution {0} set is already assigned to targets and cannot be changed
|
||||
message.action.not.allowed = Action not allowed
|
||||
message.action.did.not.work = Action did not work. Please try again.
|
||||
message.onlyone.distribution.assigned = Only one distribution set can be assigned
|
||||
message.onlyone.distribution.dropallowed = Only one distribution set can be dropped
|
||||
message.error.missing.typename = Missing Type Name
|
||||
|
||||
Reference in New Issue
Block a user