Add the "@Override" annotation
Add some description to JUnit Tests Remove unused override comments Remove unused javadoc on private methode Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -133,18 +133,15 @@ public class AmqpMessageHandlerServiceTest {
|
|||||||
messageProperties.setHeader(MessageHeaderKey.THING_ID, "1");
|
messageProperties.setHeader(MessageHeaderKey.THING_ID, "1");
|
||||||
final Message message = messageConverter.toMessage(new byte[0], messageProperties);
|
final Message message = messageConverter.toMessage(new byte[0], messageProperties);
|
||||||
|
|
||||||
// mock
|
|
||||||
final ArgumentCaptor<String> targetIdCaptor = ArgumentCaptor.forClass(String.class);
|
final ArgumentCaptor<String> targetIdCaptor = ArgumentCaptor.forClass(String.class);
|
||||||
final ArgumentCaptor<URI> uriCaptor = ArgumentCaptor.forClass(URI.class);
|
final ArgumentCaptor<URI> uriCaptor = ArgumentCaptor.forClass(URI.class);
|
||||||
when(controllerManagementMock.findOrRegisterTargetIfItDoesNotexist(targetIdCaptor.capture(),
|
when(controllerManagementMock.findOrRegisterTargetIfItDoesNotexist(targetIdCaptor.capture(),
|
||||||
uriCaptor.capture())).thenReturn(null);
|
uriCaptor.capture())).thenReturn(null);
|
||||||
|
|
||||||
// test
|
|
||||||
amqpMessageHandlerService.onMessage(message, MessageType.THING_CREATED.name(), TENANT);
|
amqpMessageHandlerService.onMessage(message, MessageType.THING_CREATED.name(), TENANT);
|
||||||
|
|
||||||
// verify
|
assertThat(targetIdCaptor.getValue()).as("Extraxted Thing should be the same").isEqualTo(knownThingId);
|
||||||
assertThat(targetIdCaptor.getValue()).isEqualTo(knownThingId);
|
assertThat(uriCaptor.getValue().toString()).as("Extraxted Uri should be the same").isEqualTo("amqp://MyTest");
|
||||||
assertThat(uriCaptor.getValue().toString()).isEqualTo("amqp://MyTest");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,8 +268,9 @@ public class AmqpMessageHandlerServiceTest {
|
|||||||
|
|
||||||
// verify
|
// verify
|
||||||
final DownloadResponse downloadResponse = (DownloadResponse) messageConverter.fromMessage(onMessage);
|
final DownloadResponse downloadResponse = (DownloadResponse) messageConverter.fromMessage(onMessage);
|
||||||
assertThat(downloadResponse).isNotNull();
|
assertThat(downloadResponse).as("Message body should not null").isNotNull();
|
||||||
assertThat(downloadResponse.getResponseCode()).isEqualTo(HttpStatus.NOT_FOUND.value());
|
assertThat(downloadResponse.getResponseCode()).as("Message body response code is wrong")
|
||||||
|
.isEqualTo(HttpStatus.NOT_FOUND.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -294,8 +292,9 @@ public class AmqpMessageHandlerServiceTest {
|
|||||||
|
|
||||||
// verify
|
// verify
|
||||||
final DownloadResponse downloadResponse = (DownloadResponse) messageConverter.fromMessage(onMessage);
|
final DownloadResponse downloadResponse = (DownloadResponse) messageConverter.fromMessage(onMessage);
|
||||||
assertThat(downloadResponse).isNotNull();
|
assertThat(downloadResponse).as("Message body should not null").isNotNull();
|
||||||
assertThat(downloadResponse.getResponseCode()).isEqualTo(HttpStatus.NOT_FOUND.value());
|
assertThat(downloadResponse.getResponseCode()).as("Message body response code is wrong")
|
||||||
|
.isEqualTo(HttpStatus.NOT_FOUND.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -325,9 +324,10 @@ public class AmqpMessageHandlerServiceTest {
|
|||||||
|
|
||||||
// verify
|
// verify
|
||||||
final DownloadResponse downloadResponse = (DownloadResponse) messageConverter.fromMessage(onMessage);
|
final DownloadResponse downloadResponse = (DownloadResponse) messageConverter.fromMessage(onMessage);
|
||||||
assertThat(downloadResponse).isNotNull();
|
assertThat(downloadResponse).as("Message body should not null").isNotNull();
|
||||||
assertThat(downloadResponse.getResponseCode()).isEqualTo(HttpStatus.OK.value());
|
assertThat(downloadResponse.getResponseCode()).as("Message body response code is wrong")
|
||||||
assertThat(downloadResponse.getArtifact().getSize()).isEqualTo(1L);
|
.isEqualTo(HttpStatus.OK.value());
|
||||||
|
assertThat(downloadResponse.getArtifact().getSize()).as("Wrong artifact size in message body").isEqualTo(1L);
|
||||||
assertThat(downloadResponse.getDownloadUrl()).startsWith("http://localhost/api/v1/downloadserver/downloadId/");
|
assertThat(downloadResponse.getDownloadUrl()).startsWith("http://localhost/api/v1/downloadserver/downloadId/");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,9 +364,11 @@ public class AmqpMessageHandlerServiceTest {
|
|||||||
final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent = captorTargetAssignDistributionSetEvent
|
final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent = captorTargetAssignDistributionSetEvent
|
||||||
.getValue();
|
.getValue();
|
||||||
|
|
||||||
assertThat(targetAssignDistributionSetEvent.getControllerId()).isEqualTo("target1");
|
assertThat(targetAssignDistributionSetEvent.getControllerId()).as("event has wrong controller id")
|
||||||
assertThat(targetAssignDistributionSetEvent.getActionId()).isEqualTo(22L);
|
.isEqualTo("target1");
|
||||||
assertThat(targetAssignDistributionSetEvent.getSoftwareModules()).isEqualTo(softwareModuleList);
|
assertThat(targetAssignDistributionSetEvent.getActionId()).as("event has wrong action id").isEqualTo(22L);
|
||||||
|
assertThat(targetAssignDistributionSetEvent.getSoftwareModules()).as("event has wrong sofware modules")
|
||||||
|
.isEqualTo(softwareModuleList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class MethodSecurityUtil {
|
|||||||
if (!METHOD_SECURITY_EXCLUSION.contains(method.getName()) && !method.isSynthetic()
|
if (!METHOD_SECURITY_EXCLUSION.contains(method.getName()) && !method.isSynthetic()
|
||||||
&& Modifier.isPublic(method.getModifiers())) {
|
&& Modifier.isPublic(method.getModifiers())) {
|
||||||
final PreAuthorize annotation = method.getAnnotation(PreAuthorize.class);
|
final PreAuthorize annotation = method.getAnnotation(PreAuthorize.class);
|
||||||
assertThat(annotation).describedAs(
|
assertThat(annotation).as(
|
||||||
"The public method " + method.getName() + " is not annoated with @PreAuthorize, security leak?")
|
"The public method " + method.getName() + " is not annoated with @PreAuthorize, security leak?")
|
||||||
.isNotNull();
|
.isNotNull();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.AbstractIntegrationTest;
|
import org.eclipse.hawkbit.AbstractIntegrationTest;
|
||||||
import org.eclipse.hawkbit.Constants;
|
import org.eclipse.hawkbit.Constants;
|
||||||
@@ -98,8 +97,9 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final List<ActionWithStatusCount> findActionsWithStatusCountByTarget = deploymentManagement
|
final List<ActionWithStatusCount> findActionsWithStatusCountByTarget = deploymentManagement
|
||||||
.findActionsWithStatusCountByTargetOrderByIdDesc(testTarget.get(0));
|
.findActionsWithStatusCountByTargetOrderByIdDesc(testTarget.get(0));
|
||||||
|
|
||||||
assertThat(findActionsWithStatusCountByTarget).hasSize(1);
|
assertThat(findActionsWithStatusCountByTarget).as("wrong action size").hasSize(1);
|
||||||
assertThat(findActionsWithStatusCountByTarget.get(0).getActionStatusCount()).isEqualTo(3L);
|
assertThat(findActionsWithStatusCountByTarget.get(0).getActionStatusCount()).as("wrong action status size")
|
||||||
|
.isEqualTo(3L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -115,27 +115,32 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final DistributionSetTag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("Tag1"));
|
final DistributionSetTag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("Tag1"));
|
||||||
|
|
||||||
final List<DistributionSet> assignedDS = distributionSetManagement.assignTag(assignDS, tag);
|
final List<DistributionSet> assignedDS = distributionSetManagement.assignTag(assignDS, tag);
|
||||||
assertThat(assignedDS.size()).isEqualTo(4);
|
assertThat(assignedDS.size()).as("assigned ds has wrong size").isEqualTo(4);
|
||||||
assignedDS.forEach(ds -> assertThat(ds.getTags().size()).isEqualTo(1));
|
assignedDS.forEach(ds -> assertThat(ds.getTags().size()).as("ds has wrong tag size").isEqualTo(1));
|
||||||
|
|
||||||
DistributionSetTag findDistributionSetTag = tagManagement.findDistributionSetTag("Tag1");
|
DistributionSetTag findDistributionSetTag = tagManagement.findDistributionSetTag("Tag1");
|
||||||
assertThat(assignedDS.size()).isEqualTo(findDistributionSetTag.getAssignedToDistributionSet().size());
|
assertThat(assignedDS.size()).as("assigned ds has wrong size")
|
||||||
|
.isEqualTo(findDistributionSetTag.getAssignedToDistributionSet().size());
|
||||||
|
|
||||||
assertThat(distributionSetManagement.unAssignTag(Long.valueOf(100), findDistributionSetTag)).isNull();
|
assertThat(distributionSetManagement.unAssignTag(Long.valueOf(100), findDistributionSetTag))
|
||||||
|
.as("unassign tag result should be null").isNull();
|
||||||
|
|
||||||
final DistributionSet unAssignDS = distributionSetManagement.unAssignTag(assignDS.get(0),
|
final DistributionSet unAssignDS = distributionSetManagement.unAssignTag(assignDS.get(0),
|
||||||
findDistributionSetTag);
|
findDistributionSetTag);
|
||||||
assertThat(unAssignDS.getId()).isEqualTo(assignDS.get(0));
|
assertThat(unAssignDS.getId()).as("unassigned ds is wrong").isEqualTo(assignDS.get(0));
|
||||||
assertThat(unAssignDS.getTags().size()).isEqualTo(0);
|
assertThat(unAssignDS.getTags().size()).as("unassigned ds has wrong tag size").isEqualTo(0);
|
||||||
findDistributionSetTag = tagManagement.findDistributionSetTag("Tag1");
|
findDistributionSetTag = tagManagement.findDistributionSetTag("Tag1");
|
||||||
assertThat(findDistributionSetTag.getAssignedToDistributionSet().size()).isEqualTo(3);
|
assertThat(findDistributionSetTag.getAssignedToDistributionSet().size()).as("ds tag ds has wrong ds size")
|
||||||
|
.isEqualTo(3);
|
||||||
|
|
||||||
final List<DistributionSet> unAssignTargets = distributionSetManagement
|
final List<DistributionSet> unAssignTargets = distributionSetManagement
|
||||||
.unAssignAllDistributionSetsByTag(findDistributionSetTag);
|
.unAssignAllDistributionSetsByTag(findDistributionSetTag);
|
||||||
findDistributionSetTag = tagManagement.findDistributionSetTag("Tag1");
|
findDistributionSetTag = tagManagement.findDistributionSetTag("Tag1");
|
||||||
assertThat(findDistributionSetTag.getAssignedToDistributionSet().size()).isEqualTo(0);
|
assertThat(findDistributionSetTag.getAssignedToDistributionSet().size()).as("ds tag has wrong ds size")
|
||||||
assertThat(unAssignTargets.size()).isEqualTo(3);
|
.isEqualTo(0);
|
||||||
unAssignTargets.forEach(target -> assertThat(target.getTags().size()).isEqualTo(0));
|
assertThat(unAssignTargets.size()).as("unassigned target has wrong size").isEqualTo(3);
|
||||||
|
unAssignTargets
|
||||||
|
.forEach(target -> assertThat(target.getTags().size()).as("target has wrong tag size").isEqualTo(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -157,7 +162,8 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
targetManagement.findAllTargetIds().forEach(targetIdName -> {
|
targetManagement.findAllTargetIds().forEach(targetIdName -> {
|
||||||
assertThat(deploymentManagement.findActiveActionsByTarget(
|
assertThat(deploymentManagement.findActiveActionsByTarget(
|
||||||
targetManagement.findTargetByControllerID(targetIdName.getControllerId()))).hasSize(2);
|
targetManagement.findTargetByControllerID(targetIdName.getControllerId())))
|
||||||
|
.as("active action has wrong size").hasSize(2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,14 +186,14 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
// check initial status
|
// check initial status
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.UNKNOWN);
|
.as("target has update status").isEqualTo(TargetUpdateStatus.UNKNOWN);
|
||||||
|
|
||||||
// assign the two sets in a row
|
// assign the two sets in a row
|
||||||
Action firstAction = assignSet(target, dsFirst);
|
Action firstAction = assignSet(target, dsFirst);
|
||||||
Action secondAction = assignSet(target, dsSecond);
|
Action secondAction = assignSet(target, dsSecond);
|
||||||
|
|
||||||
assertThat(actionRepository.findAll()).hasSize(2);
|
assertThat(actionRepository.findAll()).as("wrong size of actions").hasSize(2);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(2);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(2);
|
||||||
|
|
||||||
// we cancel second -> back to first
|
// we cancel second -> back to first
|
||||||
deploymentManagement.cancelAction(secondAction,
|
deploymentManagement.cancelAction(secondAction,
|
||||||
@@ -197,10 +203,11 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
secondAction.setStatus(Status.CANCELED);
|
secondAction.setStatus(Status.CANCELED);
|
||||||
controllerManagement.addCancelActionStatus(
|
controllerManagement.addCancelActionStatus(
|
||||||
new ActionStatus(secondAction, Status.CANCELED, System.currentTimeMillis()), secondAction);
|
new ActionStatus(secondAction, Status.CANCELED, System.currentTimeMillis()), secondAction);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(4);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of actions status").hasSize(4);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet()).isEqualTo(dsFirst);
|
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet()).as("wrong ds")
|
||||||
|
.isEqualTo(dsFirst);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.PENDING);
|
.as("wrong update status").isEqualTo(TargetUpdateStatus.PENDING);
|
||||||
|
|
||||||
// we cancel first -> back to installed
|
// we cancel first -> back to installed
|
||||||
deploymentManagement.cancelAction(firstAction,
|
deploymentManagement.cancelAction(firstAction,
|
||||||
@@ -210,11 +217,11 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
firstAction.setStatus(Status.CANCELED);
|
firstAction.setStatus(Status.CANCELED);
|
||||||
controllerManagement.addCancelActionStatus(
|
controllerManagement.addCancelActionStatus(
|
||||||
new ActionStatus(firstAction, Status.CANCELED, System.currentTimeMillis()), firstAction);
|
new ActionStatus(firstAction, Status.CANCELED, System.currentTimeMillis()), firstAction);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(6);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(6);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
||||||
.isEqualTo(dsInstalled);
|
.as("wrong assigned ds").isEqualTo(dsInstalled);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.IN_SYNC);
|
.as("wrong update status").isEqualTo(TargetUpdateStatus.IN_SYNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -236,14 +243,14 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
// check initial status
|
// check initial status
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.UNKNOWN);
|
.as("wrong update status").isEqualTo(TargetUpdateStatus.UNKNOWN);
|
||||||
|
|
||||||
// assign the two sets in a row
|
// assign the two sets in a row
|
||||||
Action firstAction = assignSet(target, dsFirst);
|
Action firstAction = assignSet(target, dsFirst);
|
||||||
Action secondAction = assignSet(target, dsSecond);
|
Action secondAction = assignSet(target, dsSecond);
|
||||||
|
|
||||||
assertThat(actionRepository.findAll()).hasSize(2);
|
assertThat(actionRepository.findAll()).as("wrong size of actions").hasSize(2);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(2);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(2);
|
||||||
|
|
||||||
// we cancel first -> second is left
|
// we cancel first -> second is left
|
||||||
deploymentManagement.cancelAction(firstAction,
|
deploymentManagement.cancelAction(firstAction,
|
||||||
@@ -253,26 +260,28 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
firstAction.setStatus(Status.CANCELED);
|
firstAction.setStatus(Status.CANCELED);
|
||||||
controllerManagement.addCancelActionStatus(
|
controllerManagement.addCancelActionStatus(
|
||||||
new ActionStatus(firstAction, Status.CANCELED, System.currentTimeMillis()), firstAction);
|
new ActionStatus(firstAction, Status.CANCELED, System.currentTimeMillis()), firstAction);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(4);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(4);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet()).isEqualTo(dsSecond);
|
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
||||||
|
.as("wrong assigned ds").isEqualTo(dsSecond);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.PENDING);
|
.as("wrong target update status").isEqualTo(TargetUpdateStatus.PENDING);
|
||||||
|
|
||||||
// we cancel second -> remain assigned until finished cancellation
|
// we cancel second -> remain assigned until finished cancellation
|
||||||
deploymentManagement.cancelAction(secondAction,
|
deploymentManagement.cancelAction(secondAction,
|
||||||
targetManagement.findTargetByControllerID(target.getControllerId()));
|
targetManagement.findTargetByControllerID(target.getControllerId()));
|
||||||
secondAction = deploymentManagement.findActionWithDetails(secondAction.getId());
|
secondAction = deploymentManagement.findActionWithDetails(secondAction.getId());
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(5);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(5);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet()).isEqualTo(dsSecond);
|
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
||||||
|
.as("wrong assigned ds").isEqualTo(dsSecond);
|
||||||
// confirm cancellation
|
// confirm cancellation
|
||||||
secondAction.setStatus(Status.CANCELED);
|
secondAction.setStatus(Status.CANCELED);
|
||||||
controllerManagement.addCancelActionStatus(
|
controllerManagement.addCancelActionStatus(
|
||||||
new ActionStatus(secondAction, Status.CANCELED, System.currentTimeMillis()), secondAction);
|
new ActionStatus(secondAction, Status.CANCELED, System.currentTimeMillis()), secondAction);
|
||||||
// cancelled success -> back to dsInstalled
|
// cancelled success -> back to dsInstalled
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
||||||
.isEqualTo(dsInstalled);
|
.as("wrong installed ds").isEqualTo(dsInstalled);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.IN_SYNC);
|
.as("wrong target info update status").isEqualTo(TargetUpdateStatus.IN_SYNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -291,13 +300,13 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
// verify initial status
|
// verify initial status
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.UNKNOWN);
|
.as("wrong target info update status").isEqualTo(TargetUpdateStatus.UNKNOWN);
|
||||||
|
|
||||||
Action assigningAction = assignSet(target, ds);
|
Action assigningAction = assignSet(target, ds);
|
||||||
|
|
||||||
// verify assignment
|
// verify assignment
|
||||||
assertThat(actionRepository.findAll()).hasSize(1);
|
assertThat(actionRepository.findAll()).as("wrong size of action").hasSize(1);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(1);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(1);
|
||||||
|
|
||||||
target = targetManagement.findTargetByControllerID(target.getControllerId());
|
target = targetManagement.findTargetByControllerID(target.getControllerId());
|
||||||
|
|
||||||
@@ -310,11 +319,11 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
assigningAction = deploymentManagement.findActionWithDetails(assigningAction.getId());
|
assigningAction = deploymentManagement.findActionWithDetails(assigningAction.getId());
|
||||||
|
|
||||||
// verify
|
// verify
|
||||||
assertThat(assigningAction.getStatus()).isEqualTo(Status.CANCELED);
|
assertThat(assigningAction.getStatus()).as("wrong size of status").isEqualTo(Status.CANCELED);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
assertThat(targetManagement.findTargetByControllerID("4712").getAssignedDistributionSet())
|
||||||
.isEqualTo(dsInstalled);
|
.as("wrong assigned ds").isEqualTo(dsInstalled);
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.IN_SYNC);
|
.as("wrong target update status").isEqualTo(TargetUpdateStatus.IN_SYNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -333,13 +342,13 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
// verify initial status
|
// verify initial status
|
||||||
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.UNKNOWN);
|
.as("wrong update status").isEqualTo(TargetUpdateStatus.UNKNOWN);
|
||||||
|
|
||||||
final Action assigningAction = assignSet(target, ds);
|
final Action assigningAction = assignSet(target, ds);
|
||||||
|
|
||||||
// verify assignment
|
// verify assignment
|
||||||
assertThat(actionRepository.findAll()).hasSize(1);
|
assertThat(actionRepository.findAll()).as("wrong size of action").hasSize(1);
|
||||||
assertThat(actionStatusRepository.findAll()).hasSize(1);
|
assertThat(actionStatusRepository.findAll()).as("wrong size of action status").hasSize(1);
|
||||||
|
|
||||||
// force quit assignment
|
// force quit assignment
|
||||||
try {
|
try {
|
||||||
@@ -354,11 +363,11 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
deploymentManagement.assignDistributionSet(ds.getId(), new String[] { target.getControllerId() });
|
deploymentManagement.assignDistributionSet(ds.getId(), new String[] { target.getControllerId() });
|
||||||
assertThat(
|
assertThat(
|
||||||
targetManagement.findTargetByControllerID(target.getControllerId()).getTargetInfo().getUpdateStatus())
|
targetManagement.findTargetByControllerID(target.getControllerId()).getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.PENDING);
|
.as("wrong update status").isEqualTo(TargetUpdateStatus.PENDING);
|
||||||
assertThat(targetManagement.findTargetByControllerID(target.getControllerId()).getAssignedDistributionSet())
|
assertThat(targetManagement.findTargetByControllerID(target.getControllerId()).getAssignedDistributionSet())
|
||||||
.isEqualTo(ds);
|
.as("wrong assigned ds").isEqualTo(ds);
|
||||||
final Action action = actionRepository.findByTargetAndDistributionSet(pageReq, target, ds).getContent().get(0);
|
final Action action = actionRepository.findByTargetAndDistributionSet(pageReq, target, ds).getContent().get(0);
|
||||||
assertThat(action).isNotNull();
|
assertThat(action).as("action should not be null").isNotNull();
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,26 +399,30 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
deploymentManagement.assignDistributionSet(ds, savedDeployedTargets);
|
deploymentManagement.assignDistributionSet(ds, savedDeployedTargets);
|
||||||
|
|
||||||
// verify that one Action for each assignDistributionSet
|
// verify that one Action for each assignDistributionSet
|
||||||
assertThat(actionRepository.findAll(pageReq).getNumberOfElements()).isEqualTo(20);
|
assertThat(actionRepository.findAll(pageReq).getNumberOfElements()).as("wrong size of actions").isEqualTo(20);
|
||||||
|
|
||||||
final Iterable<Target> allFoundTargets = targetManagement.findTargetsAll(pageReq).getContent();
|
final Iterable<Target> allFoundTargets = targetManagement.findTargetsAll(pageReq).getContent();
|
||||||
|
|
||||||
assertThat(allFoundTargets).containsAll(savedDeployedTargets).containsAll(savedNakedTargets);
|
assertThat(allFoundTargets).as("founded targets are wrong").containsAll(savedDeployedTargets)
|
||||||
assertThat(savedDeployedTargets).doesNotContain(Iterables.toArray(savedNakedTargets, Target.class));
|
.containsAll(savedNakedTargets);
|
||||||
assertThat(savedNakedTargets).doesNotContain(Iterables.toArray(savedDeployedTargets, Target.class));
|
assertThat(savedDeployedTargets).as("saved target are wrong")
|
||||||
|
.doesNotContain(Iterables.toArray(savedNakedTargets, Target.class));
|
||||||
|
assertThat(savedNakedTargets).as("saved target are wrong")
|
||||||
|
.doesNotContain(Iterables.toArray(savedDeployedTargets, Target.class));
|
||||||
|
|
||||||
for (final Target myt : savedNakedTargets) {
|
for (final Target myt : savedNakedTargets) {
|
||||||
final Target t = targetManagement.findTargetByControllerID(myt.getControllerId());
|
final Target t = targetManagement.findTargetByControllerID(myt.getControllerId());
|
||||||
assertThat(deploymentManagement.findActionsByTarget(t)).isEmpty();
|
assertThat(deploymentManagement.findActionsByTarget(t)).as("action should be empty").isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final Target myt : savedDeployedTargets) {
|
for (final Target myt : savedDeployedTargets) {
|
||||||
final Target t = targetManagement.findTargetByControllerID(myt.getControllerId());
|
final Target t = targetManagement.findTargetByControllerID(myt.getControllerId());
|
||||||
final List<Action> activeActionsByTarget = deploymentManagement.findActiveActionsByTarget(t);
|
final List<Action> activeActionsByTarget = deploymentManagement.findActiveActionsByTarget(t);
|
||||||
assertThat(activeActionsByTarget).isNotEmpty();
|
assertThat(activeActionsByTarget).as("action should not be empty").isNotEmpty();
|
||||||
assertThat(t.getTargetInfo().getUpdateStatus()).isEqualTo(TargetUpdateStatus.PENDING);
|
assertThat(t.getTargetInfo().getUpdateStatus()).as("wrong target update status")
|
||||||
|
.isEqualTo(TargetUpdateStatus.PENDING);
|
||||||
for (final Action ua : activeActionsByTarget) {
|
for (final Action ua : activeActionsByTarget) {
|
||||||
assertThat(ua.getDistributionSet()).isEqualTo(ds);
|
assertThat(ua.getDistributionSet()).as("action has wrong ds").isEqualTo(ds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,12 +461,13 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
// give some chance to receive events asynchronously
|
// give some chance to receive events asynchronously
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
final List<TargetAssignDistributionSetEvent> events = eventHandlerMock.getEvents(1, TimeUnit.MILLISECONDS);
|
final List<TargetAssignDistributionSetEvent> events = eventHandlerMock.getEvents(1, TimeUnit.MILLISECONDS);
|
||||||
assertThat(events).isEmpty();
|
assertThat(events).as("events should be empty").isEmpty();
|
||||||
|
|
||||||
final EventHandlerMock eventHandlerMockAfterCompletionOfDs = new EventHandlerMock(10);
|
final EventHandlerMock eventHandlerMockAfterCompletionOfDs = new EventHandlerMock(10);
|
||||||
eventBus.register(eventHandlerMockAfterCompletionOfDs);
|
eventBus.register(eventHandlerMockAfterCompletionOfDs);
|
||||||
|
|
||||||
assertThat(deploymentManagement.assignDistributionSet(nowComplete, targets).getAssigned()).isEqualTo(10);
|
assertThat(deploymentManagement.assignDistributionSet(nowComplete, targets).getAssigned())
|
||||||
|
.as("assign ds doesn't work").isEqualTo(10);
|
||||||
assertTargetAssignDistributionSetEvents(targets, nowComplete,
|
assertTargetAssignDistributionSetEvents(targets, nowComplete,
|
||||||
eventHandlerMockAfterCompletionOfDs.getEvents(10, TimeUnit.SECONDS));
|
eventHandlerMockAfterCompletionOfDs.getEvents(10, TimeUnit.SECONDS));
|
||||||
}
|
}
|
||||||
@@ -493,7 +507,8 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
// retrieving all Actions created by the assignDistributionSet call
|
// retrieving all Actions created by the assignDistributionSet call
|
||||||
final Page<Action> page = actionRepository.findAll(pageReq);
|
final Page<Action> page = actionRepository.findAll(pageReq);
|
||||||
// and verify the number
|
// and verify the number
|
||||||
assertThat(page.getTotalElements()).isEqualTo(noOfDeployedTargets * noOfDistributionSets);
|
assertThat(page.getTotalElements()).as("wrong size of actions")
|
||||||
|
.isEqualTo(noOfDeployedTargets * noOfDistributionSets);
|
||||||
|
|
||||||
// only records retrieved from the DB can be evaluated to be sure that
|
// only records retrieved from the DB can be evaluated to be sure that
|
||||||
// all fields are
|
// all fields are
|
||||||
@@ -504,17 +519,20 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final Iterable<Target> undeployedTargetsFromDB = targetRepository.findAll(undeployedTargetIDs);
|
final Iterable<Target> undeployedTargetsFromDB = targetRepository.findAll(undeployedTargetIDs);
|
||||||
|
|
||||||
// test that number of Targets
|
// test that number of Targets
|
||||||
assertThat(allFoundTargets.spliterator().getExactSizeIfKnown())
|
assertThat(allFoundTargets.spliterator().getExactSizeIfKnown()).as("number of target is wrong")
|
||||||
.isEqualTo(deployedTargetsFromDB.spliterator().getExactSizeIfKnown()
|
.isEqualTo(deployedTargetsFromDB.spliterator().getExactSizeIfKnown()
|
||||||
+ undeployedTargetsFromDB.spliterator().getExactSizeIfKnown());
|
+ undeployedTargetsFromDB.spliterator().getExactSizeIfKnown());
|
||||||
assertThat(deployedTargetsFromDB.spliterator().getExactSizeIfKnown()).isEqualTo(noOfDeployedTargets);
|
assertThat(deployedTargetsFromDB.spliterator().getExactSizeIfKnown()).as("number of target is wrong")
|
||||||
assertThat(undeployedTargetsFromDB.spliterator().getExactSizeIfKnown()).isEqualTo(noOfUndeployedTargets);
|
.isEqualTo(noOfDeployedTargets);
|
||||||
|
assertThat(undeployedTargetsFromDB.spliterator().getExactSizeIfKnown()).as("number of target is wrong")
|
||||||
|
.isEqualTo(noOfUndeployedTargets);
|
||||||
|
|
||||||
// test the content of different lists
|
// test the content of different lists
|
||||||
assertThat(allFoundTargets).containsAll(deployedTargetsFromDB).containsAll(undeployedTargetsFromDB);
|
assertThat(allFoundTargets).as("content of founded target is wrong").containsAll(deployedTargetsFromDB)
|
||||||
assertThat(deployedTargetsFromDB).containsAll(savedDeployedTargets)
|
.containsAll(undeployedTargetsFromDB);
|
||||||
|
assertThat(deployedTargetsFromDB).as("content of deployed target is wrong").containsAll(savedDeployedTargets)
|
||||||
.doesNotContain(Iterables.toArray(undeployedTargetsFromDB, Target.class));
|
.doesNotContain(Iterables.toArray(undeployedTargetsFromDB, Target.class));
|
||||||
assertThat(undeployedTargetsFromDB).containsAll(savedNakedTargets)
|
assertThat(undeployedTargetsFromDB).as("content of undeployed target is wrong").containsAll(savedNakedTargets)
|
||||||
.doesNotContain(Iterables.toArray(deployedTargetsFromDB, Target.class));
|
.doesNotContain(Iterables.toArray(deployedTargetsFromDB, Target.class));
|
||||||
|
|
||||||
// For each of the 4 targets 1 distribution sets gets assigned
|
// For each of the 4 targets 1 distribution sets gets assigned
|
||||||
@@ -542,42 +560,42 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final DistributionSet dsC = deployResWithDsC.getDistributionSets().get(0);
|
final DistributionSet dsC = deployResWithDsC.getDistributionSets().get(0);
|
||||||
|
|
||||||
// retrieving the UpdateActions created by the assignments
|
// retrieving the UpdateActions created by the assignments
|
||||||
final Action updActA = actionRepository.findByDistributionSet(pageRequest, dsA).getContent().get(0);
|
actionRepository.findByDistributionSet(pageRequest, dsA).getContent().get(0);
|
||||||
final Action updActB = actionRepository.findByDistributionSet(pageRequest, dsB).getContent().get(0);
|
actionRepository.findByDistributionSet(pageRequest, dsB).getContent().get(0);
|
||||||
final Action updActC = actionRepository.findByDistributionSet(pageRequest, dsC).getContent().get(0);
|
actionRepository.findByDistributionSet(pageRequest, dsC).getContent().get(0);
|
||||||
|
|
||||||
// verifying the correctness of the assignments
|
// verifying the correctness of the assignments
|
||||||
for (final Target t : deployResWithDsA.getDeployedTargets()) {
|
for (final Target t : deployResWithDsA.getDeployedTargets()) {
|
||||||
assertThat(t.getAssignedDistributionSet().getId()).isEqualTo(dsA.getId());
|
assertThat(t.getAssignedDistributionSet().getId()).as("assignment is not correct").isEqualTo(dsA.getId());
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
||||||
.getInstalledDistributionSet()).isNull();
|
.getInstalledDistributionSet()).as("installed ds should be null").isNull();
|
||||||
}
|
}
|
||||||
for (final Target t : deployResWithDsB.getDeployedTargets()) {
|
for (final Target t : deployResWithDsB.getDeployedTargets()) {
|
||||||
assertThat(t.getAssignedDistributionSet().getId()).isEqualTo(dsB.getId());
|
assertThat(t.getAssignedDistributionSet().getId()).as("assigned ds is wrong").isEqualTo(dsB.getId());
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
||||||
.getInstalledDistributionSet()).isNull();
|
.getInstalledDistributionSet()).as("installed ds should be null").isNull();
|
||||||
}
|
}
|
||||||
for (final Target t : deployResWithDsC.getDeployedTargets()) {
|
for (final Target t : deployResWithDsC.getDeployedTargets()) {
|
||||||
assertThat(t.getAssignedDistributionSet().getId()).isEqualTo(dsC.getId());
|
assertThat(t.getAssignedDistributionSet().getId()).isEqualTo(dsC.getId());
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
||||||
.getInstalledDistributionSet()).isNull();
|
.getInstalledDistributionSet()).as("installed ds should not be null").isNull();
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.PENDING);
|
.as("wrong target info update status").isEqualTo(TargetUpdateStatus.PENDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Target> updatedTsDsA = sendUpdateActionStatusToTargets(dsA, deployResWithDsA.getDeployedTargets(),
|
final List<Target> updatedTsDsA = sendUpdateActionStatusToTargets(dsA, deployResWithDsA.getDeployedTargets(),
|
||||||
Status.FINISHED, new String[] { "alles gut" });
|
Status.FINISHED, new String[] { "alles gut" });
|
||||||
|
|
||||||
// verify, that dsA is deployed correctly
|
// verify, that dsA is deployed correctly
|
||||||
assertThat(updatedTsDsA).isEqualTo(deployResWithDsA.getDeployedTargets());
|
assertThat(updatedTsDsA).as("ds is not deployed correctly").isEqualTo(deployResWithDsA.getDeployedTargets());
|
||||||
for (final Target t_ : updatedTsDsA) {
|
for (final Target t_ : updatedTsDsA) {
|
||||||
final Target t = targetManagement.findTargetByControllerID(t_.getControllerId());
|
final Target t = targetManagement.findTargetByControllerID(t_.getControllerId());
|
||||||
assertThat(t.getAssignedDistributionSet()).isEqualTo(dsA);
|
assertThat(t.getAssignedDistributionSet()).as("assigned ds is wrong").isEqualTo(dsA);
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
||||||
.getInstalledDistributionSet()).isEqualTo(dsA);
|
.getInstalledDistributionSet()).as("installed ds is wrong").isEqualTo(dsA);
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.IN_SYNC);
|
.as("wrong target info update status").isEqualTo(TargetUpdateStatus.IN_SYNC);
|
||||||
assertThat(deploymentManagement.findActiveActionsByTarget(t)).hasSize(0);
|
assertThat(deploymentManagement.findActiveActionsByTarget(t)).as("no actions should be active").hasSize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deploy dsA to the target which already have dsB deployed -> must
|
// deploy dsA to the target which already have dsB deployed -> must
|
||||||
@@ -586,18 +604,18 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
// UpdateAction for dsA
|
// UpdateAction for dsA
|
||||||
final Iterable<Target> deployed2DS = deploymentManagement
|
final Iterable<Target> deployed2DS = deploymentManagement
|
||||||
.assignDistributionSet(dsA, deployResWithDsB.getDeployedTargets()).getAssignedTargets();
|
.assignDistributionSet(dsA, deployResWithDsB.getDeployedTargets()).getAssignedTargets();
|
||||||
final Action updActA2 = actionRepository.findByDistributionSet(pageRequest, dsA).getContent().get(1);
|
actionRepository.findByDistributionSet(pageRequest, dsA).getContent().get(1);
|
||||||
|
|
||||||
assertThat(deployed2DS).containsAll(deployResWithDsB.getDeployedTargets());
|
assertThat(deployed2DS).as("deployed ds is wrong").containsAll(deployResWithDsB.getDeployedTargets());
|
||||||
assertThat(deployed2DS).hasSameSizeAs(deployResWithDsB.getDeployedTargets());
|
assertThat(deployed2DS).as("deployed ds is wrong").hasSameSizeAs(deployResWithDsB.getDeployedTargets());
|
||||||
|
|
||||||
for (final Target t_ : deployed2DS) {
|
for (final Target t_ : deployed2DS) {
|
||||||
final Target t = targetManagement.findTargetByControllerID(t_.getControllerId());
|
final Target t = targetManagement.findTargetByControllerID(t_.getControllerId());
|
||||||
assertThat(t.getAssignedDistributionSet()).isEqualTo(dsA);
|
assertThat(t.getAssignedDistributionSet()).as("assigned ds is wrong").isEqualTo(dsA);
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo()
|
||||||
.getInstalledDistributionSet()).isNull();
|
.getInstalledDistributionSet()).as("installed ds should be null").isNull();
|
||||||
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo().getUpdateStatus())
|
assertThat(targetManagement.findTargetByControllerID(t.getControllerId()).getTargetInfo().getUpdateStatus())
|
||||||
.isEqualTo(TargetUpdateStatus.PENDING);
|
.as("wrong target info update status").isEqualTo(TargetUpdateStatus.PENDING);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -630,22 +648,22 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
distributionSetManagement.deleteDistributionSet(dsA.getId());
|
distributionSetManagement.deleteDistributionSet(dsA.getId());
|
||||||
dsA = distributionSetManagement.findDistributionSetById(dsA.getId());
|
dsA = distributionSetManagement.findDistributionSetById(dsA.getId());
|
||||||
assertThat(dsA).isNull();
|
assertThat(dsA).as("ds should be null").isNull();
|
||||||
|
|
||||||
// // verify that the ds is not physically deleted
|
// // verify that the ds is not physically deleted
|
||||||
for (final DistributionSet ds : deploymentResult.getDistributionSets()) {
|
for (final DistributionSet ds : deploymentResult.getDistributionSets()) {
|
||||||
distributionSetManagement.deleteDistributionSet(ds.getId());
|
distributionSetManagement.deleteDistributionSet(ds.getId());
|
||||||
final DistributionSet foundDS = distributionSetManagement.findDistributionSetById(ds.getId());
|
final DistributionSet foundDS = distributionSetManagement.findDistributionSetById(ds.getId());
|
||||||
assertThat(foundDS).isNotNull();
|
assertThat(foundDS).as("founded should not be null").isNotNull();
|
||||||
assertThat(foundDS.isDeleted()).isTrue();
|
assertThat(foundDS.isDeleted()).as("founded ds should be deleted").isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify that deleted attribute is used correctly
|
// verify that deleted attribute is used correctly
|
||||||
List<DistributionSet> allFoundDS = distributionSetManagement.findDistributionSetsAll(pageReq, false, true)
|
List<DistributionSet> allFoundDS = distributionSetManagement.findDistributionSetsAll(pageReq, false, true)
|
||||||
.getContent();
|
.getContent();
|
||||||
assertThat(allFoundDS.size()).isEqualTo(0);
|
assertThat(allFoundDS.size()).as("no ds should be founded").isEqualTo(0);
|
||||||
allFoundDS = distributionSetManagement.findDistributionSetsAll(pageRequest, true, true).getContent();
|
allFoundDS = distributionSetManagement.findDistributionSetsAll(pageRequest, true, true).getContent();
|
||||||
assertThat(allFoundDS).hasSize(noOfDistributionSets);
|
assertThat(allFoundDS).as("wrong size of founded ds").hasSize(noOfDistributionSets);
|
||||||
|
|
||||||
for (final DistributionSet ds : deploymentResult.getDistributionSets()) {
|
for (final DistributionSet ds : deploymentResult.getDistributionSets()) {
|
||||||
sendUpdateActionStatusToTargets(ds, deploymentResult.getDeployedTargets(), Status.FINISHED,
|
sendUpdateActionStatusToTargets(ds, deploymentResult.getDeployedTargets(), Status.FINISHED,
|
||||||
@@ -659,9 +677,9 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
// successfully and no activeAction is referring to created distribution
|
// successfully and no activeAction is referring to created distribution
|
||||||
// sets
|
// sets
|
||||||
allFoundDS = distributionSetManagement.findDistributionSetsAll(pageRequest, false, true).getContent();
|
allFoundDS = distributionSetManagement.findDistributionSetsAll(pageRequest, false, true).getContent();
|
||||||
assertThat(allFoundDS.size()).isEqualTo(0);
|
assertThat(allFoundDS.size()).as("no ds should be founded").isEqualTo(0);
|
||||||
allFoundDS = distributionSetManagement.findDistributionSetsAll(pageRequest, true, true).getContent();
|
allFoundDS = distributionSetManagement.findDistributionSetsAll(pageRequest, true, true).getContent();
|
||||||
assertThat(allFoundDS).hasSize(noOfDistributionSets);
|
assertThat(allFoundDS).as("size of founded ds is wrong").hasSize(noOfDistributionSets);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,15 +703,15 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
"blabla alles gut");
|
"blabla alles gut");
|
||||||
}
|
}
|
||||||
|
|
||||||
assertThat(targetManagement.countTargetsAll()).isNotZero();
|
assertThat(targetManagement.countTargetsAll()).as("size of targets is wrong").isNotZero();
|
||||||
assertThat(actionStatusRepository.count()).isNotZero();
|
assertThat(actionStatusRepository.count()).as("size of action status is wrong").isNotZero();
|
||||||
|
|
||||||
targetManagement
|
targetManagement
|
||||||
.deleteTargets(deploymentResult.getUndeployedTargetIDs().toArray(new Long[noOfUndeployedTargets]));
|
.deleteTargets(deploymentResult.getUndeployedTargetIDs().toArray(new Long[noOfUndeployedTargets]));
|
||||||
targetManagement.deleteTargets(deploymentResult.getDeployedTargetIDs().toArray(new Long[noOfDeployedTargets]));
|
targetManagement.deleteTargets(deploymentResult.getDeployedTargetIDs().toArray(new Long[noOfDeployedTargets]));
|
||||||
|
|
||||||
assertThat(targetManagement.countTargetsAll()).isZero();
|
assertThat(targetManagement.countTargetsAll()).as("size of targets should be zero").isZero();
|
||||||
assertThat(actionStatusRepository.count()).isZero();
|
assertThat(actionStatusRepository.count()).as("size of action status is wrong").isZero();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Target> sendUpdateActionStatusToTargets(final DistributionSet dsA, final Iterable<Target> targs,
|
private List<Target> sendUpdateActionStatusToTargets(final DistributionSet dsA, final Iterable<Target> targs,
|
||||||
@@ -744,7 +762,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
// checking the revisions of the created entities
|
// checking the revisions of the created entities
|
||||||
// verifying that the revision of the object and the revision within the
|
// verifying that the revision of the object and the revision within the
|
||||||
// DB has not changed
|
// DB has not changed
|
||||||
assertThat(dsA.getOptLockRevision()).isEqualTo(
|
assertThat(dsA.getOptLockRevision()).as("lock revision is wrong").isEqualTo(
|
||||||
distributionSetManagement.findDistributionSetByIdWithDetails(dsA.getId()).getOptLockRevision());
|
distributionSetManagement.findDistributionSetByIdWithDetails(dsA.getId()).getOptLockRevision());
|
||||||
|
|
||||||
// verifying that the assignment is correct
|
// verifying that the assignment is correct
|
||||||
@@ -795,12 +813,11 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
public void checkThatDsRevisionsIsNotChangedWithTargetAssignment() {
|
public void checkThatDsRevisionsIsNotChangedWithTargetAssignment() {
|
||||||
final DistributionSet dsA = TestDataUtil.generateDistributionSet("a", softwareManagement,
|
final DistributionSet dsA = TestDataUtil.generateDistributionSet("a", softwareManagement,
|
||||||
distributionSetManagement);
|
distributionSetManagement);
|
||||||
final DistributionSet dsB = TestDataUtil.generateDistributionSet("b", softwareManagement,
|
TestDataUtil.generateDistributionSet("b", softwareManagement, distributionSetManagement);
|
||||||
distributionSetManagement);
|
|
||||||
Target targ = targetManagement
|
Target targ = targetManagement
|
||||||
.createTarget(TestDataUtil.buildTargetFixture("target-id-A", "first description"));
|
.createTarget(TestDataUtil.buildTargetFixture("target-id-A", "first description"));
|
||||||
|
|
||||||
assertThat(dsA.getOptLockRevision()).isEqualTo(
|
assertThat(dsA.getOptLockRevision()).as("lock revision is wrong").isEqualTo(
|
||||||
distributionSetManagement.findDistributionSetByIdWithDetails(dsA.getId()).getOptLockRevision());
|
distributionSetManagement.findDistributionSetByIdWithDetails(dsA.getId()).getOptLockRevision());
|
||||||
|
|
||||||
final List<Target> targs = new ArrayList<Target>();
|
final List<Target> targs = new ArrayList<Target>();
|
||||||
@@ -808,7 +825,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final Iterable<Target> savedTargs = deploymentManagement.assignDistributionSet(dsA, targs).getAssignedTargets();
|
final Iterable<Target> savedTargs = deploymentManagement.assignDistributionSet(dsA, targs).getAssignedTargets();
|
||||||
targ = savedTargs.iterator().next();
|
targ = savedTargs.iterator().next();
|
||||||
|
|
||||||
assertThat(dsA.getOptLockRevision()).isEqualTo(
|
assertThat(dsA.getOptLockRevision()).as("lock revision is wrong").isEqualTo(
|
||||||
distributionSetManagement.findDistributionSetByIdWithDetails(dsA.getId()).getOptLockRevision());
|
distributionSetManagement.findDistributionSetByIdWithDetails(dsA.getId()).getOptLockRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,14 +842,14 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
||||||
// verify preparation
|
// verify preparation
|
||||||
Action findAction = deploymentManagement.findAction(action.getId());
|
Action findAction = deploymentManagement.findAction(action.getId());
|
||||||
assertThat(findAction.getActionType()).isEqualTo(ActionType.SOFT);
|
assertThat(findAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.SOFT);
|
||||||
|
|
||||||
// test
|
// test
|
||||||
deploymentManagement.forceTargetAction(action.getId());
|
deploymentManagement.forceTargetAction(action.getId());
|
||||||
|
|
||||||
// verify test
|
// verify test
|
||||||
findAction = deploymentManagement.findAction(action.getId());
|
findAction = deploymentManagement.findAction(action.getId());
|
||||||
assertThat(findAction.getActionType()).isEqualTo(ActionType.FORCED);
|
assertThat(findAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.FORCED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -848,15 +865,15 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
||||||
// verify perparation
|
// verify perparation
|
||||||
Action findAction = deploymentManagement.findAction(action.getId());
|
Action findAction = deploymentManagement.findAction(action.getId());
|
||||||
assertThat(findAction.getActionType()).isEqualTo(ActionType.FORCED);
|
assertThat(findAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.FORCED);
|
||||||
|
|
||||||
// test
|
// test
|
||||||
final Action forceTargetAction = deploymentManagement.forceTargetAction(action.getId());
|
final Action forceTargetAction = deploymentManagement.forceTargetAction(action.getId());
|
||||||
|
|
||||||
// verify test
|
// verify test
|
||||||
assertThat(forceTargetAction.getActionType()).isEqualTo(ActionType.FORCED);
|
assertThat(forceTargetAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.FORCED);
|
||||||
findAction = deploymentManagement.findAction(action.getId());
|
findAction = deploymentManagement.findAction(action.getId());
|
||||||
assertThat(findAction.getActionType()).isEqualTo(ActionType.FORCED);
|
assertThat(findAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.FORCED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -918,14 +935,14 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
if (event.getControllerId().equals(myt.getControllerId())) {
|
if (event.getControllerId().equals(myt.getControllerId())) {
|
||||||
found = true;
|
found = true;
|
||||||
final List<Action> activeActionsByTarget = deploymentManagement.findActiveActionsByTarget(myt);
|
final List<Action> activeActionsByTarget = deploymentManagement.findActiveActionsByTarget(myt);
|
||||||
assertThat(activeActionsByTarget).isNotEmpty();
|
assertThat(activeActionsByTarget).as("size of active actions for target is wrong").isNotEmpty();
|
||||||
assertThat(event.getActionId()).isEqualTo(activeActionsByTarget.get(0).getId())
|
assertThat(event.getActionId()).as("Action id in database and event do not match")
|
||||||
.as("Action id in database and event do not match");
|
.isEqualTo(activeActionsByTarget.get(0).getId());
|
||||||
assertThat(event.getSoftwareModules())
|
assertThat(event.getSoftwareModules()).as("softwaremodule size is not correct")
|
||||||
.containsOnly(ds.getModules().toArray(new SoftwareModule[ds.getModules().size()]));
|
.containsOnly(ds.getModules().toArray(new SoftwareModule[ds.getModules().size()]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertThat(found).isTrue().as("No event found for controller " + myt.getControllerId());
|
assertThat(found).as("No event found for controller " + myt.getControllerId()).isTrue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,42 +961,19 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
private final List<Target> deployedTargets = new ArrayList<Target>();
|
private final List<Target> deployedTargets = new ArrayList<Target>();
|
||||||
private final List<DistributionSet> distributionSets = new ArrayList<DistributionSet>();
|
private final List<DistributionSet> distributionSets = new ArrayList<DistributionSet>();
|
||||||
|
|
||||||
private final String undeployedTargetPrefix;
|
|
||||||
private final String deployedTargetPrefix;
|
|
||||||
private final String distributionSetPrefix;
|
|
||||||
|
|
||||||
public DeploymentResult(final Iterable<Target> deployedTs, final Iterable<Target> undeployedTs,
|
public DeploymentResult(final Iterable<Target> deployedTs, final Iterable<Target> undeployedTs,
|
||||||
final Iterable<DistributionSet> dss, final String deployedTargetPrefix,
|
final Iterable<DistributionSet> dss, final String deployedTargetPrefix,
|
||||||
final String undeployedTargetPrefix, final String distributionSetPrefix) {
|
final String undeployedTargetPrefix, final String distributionSetPrefix) {
|
||||||
|
|
||||||
this.undeployedTargetPrefix = undeployedTargetPrefix;
|
|
||||||
this.deployedTargetPrefix = deployedTargetPrefix;
|
|
||||||
this.distributionSetPrefix = distributionSetPrefix;
|
|
||||||
|
|
||||||
Iterables.addAll(deployedTargets, deployedTs);
|
Iterables.addAll(deployedTargets, deployedTs);
|
||||||
Iterables.addAll(undeployedTargets, undeployedTs);
|
Iterables.addAll(undeployedTargets, undeployedTs);
|
||||||
Iterables.addAll(distributionSets, dss);
|
Iterables.addAll(distributionSets, dss);
|
||||||
|
|
||||||
deployedTargets.forEach(new Consumer<Target>() {
|
deployedTargets.forEach(t -> deployedTargetIDs.add(t.getId()));
|
||||||
@Override
|
|
||||||
public void accept(final Target t) {
|
|
||||||
deployedTargetIDs.add(t.getId());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
undeployedTargets.forEach(new Consumer<Target>() {
|
undeployedTargets.forEach(t -> undeployedTargetIDs.add(t.getId()));
|
||||||
@Override
|
|
||||||
public void accept(final Target t) {
|
|
||||||
undeployedTargetIDs.add(t.getId());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
distributionSets.forEach(new Consumer<DistributionSet>() {
|
distributionSets.forEach(ds -> distributionSetIDs.add(ds.getId()));
|
||||||
@Override
|
|
||||||
public void accept(final DistributionSet ds) {
|
|
||||||
distributionSetIDs.add(ds.getId());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1018,27 +1012,6 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
return deployedTargets;
|
return deployedTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the noOfUndeployedTargets
|
|
||||||
*/
|
|
||||||
public int getNoOfUndeployedTargets() {
|
|
||||||
return undeployedTargetIDs.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the noOfDeployedTargets
|
|
||||||
*/
|
|
||||||
public int getNoOfDeployedTargets() {
|
|
||||||
return deployedTargetIDs.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the noOfDistributionSets
|
|
||||||
*/
|
|
||||||
public int getNoOfDistributionSets() {
|
|
||||||
return distributionSets.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the undeployedTargetIDs
|
* @return the undeployedTargetIDs
|
||||||
*/
|
*/
|
||||||
@@ -1046,26 +1019,6 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
return undeployedTargetIDs;
|
return undeployedTargetIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the undeployedTargetPrefix
|
|
||||||
*/
|
|
||||||
public String getUndeployedTargetPrefix() {
|
|
||||||
return undeployedTargetPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the deployedTargetPrefix
|
|
||||||
*/
|
|
||||||
public String getDeployedTargetPrefix() {
|
|
||||||
return deployedTargetPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the distributionSetPrefix
|
|
||||||
*/
|
|
||||||
public String getDistributionSetPrefix() {
|
|
||||||
return distributionSetPrefix;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class EventHandlerMock {
|
private static class EventHandlerMock {
|
||||||
@@ -1090,9 +1043,9 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
latch.await(timeout, unit);
|
latch.await(timeout, unit);
|
||||||
final List<TargetAssignDistributionSetEvent> handledEvents = new LinkedList<TargetAssignDistributionSetEvent>(
|
final List<TargetAssignDistributionSetEvent> handledEvents = new LinkedList<TargetAssignDistributionSetEvent>(
|
||||||
events);
|
events);
|
||||||
assertThat(handledEvents).hasSize(expectedNumberOfEvents)
|
assertThat(handledEvents).as("Did not receive the expected amount of events (" + expectedNumberOfEvents
|
||||||
.as("Did not receive the expected amount of events (" + expectedNumberOfEvents
|
+ ") within timeout. Received events are " + handledEvents).hasSize(expectedNumberOfEvents);
|
||||||
+ ") within timeout. Received events are " + handledEvents);
|
|
||||||
return handledEvents;
|
return handledEvents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1118,9 +1071,8 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
throws InterruptedException {
|
throws InterruptedException {
|
||||||
latch.await(timeout, unit);
|
latch.await(timeout, unit);
|
||||||
final List<CancelTargetAssignmentEvent> handledEvents = new LinkedList<CancelTargetAssignmentEvent>(events);
|
final List<CancelTargetAssignmentEvent> handledEvents = new LinkedList<CancelTargetAssignmentEvent>(events);
|
||||||
assertThat(handledEvents).hasSize(expectedNumberOfEvents)
|
assertThat(handledEvents).as("Did not receive the expected amount of events (" + expectedNumberOfEvents
|
||||||
.as("Did not receive the expected amount of events (" + expectedNumberOfEvents
|
+ ") within timeout. Received events are " + handledEvents).hasSize(expectedNumberOfEvents);
|
||||||
+ ") within timeout. Received events are " + handledEvents);
|
|
||||||
return handledEvents;
|
return handledEvents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.AbstractIntegrationTest;
|
import org.eclipse.hawkbit.AbstractIntegrationTest;
|
||||||
@@ -96,7 +95,8 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
// +1 because we go back #maxMonthBackAmountReportTargets but in the
|
// +1 because we go back #maxMonthBackAmountReportTargets but in the
|
||||||
// report the current month
|
// report the current month
|
||||||
// is included for sure, so from this month we go back
|
// is included for sure, so from this month we go back
|
||||||
assertThat(targetsCreatedOverPeriod.getData()).hasSize(maxMonthBackAmountReportTargets + 1);
|
assertThat(targetsCreatedOverPeriod.getData()).as("created over period has wrong size")
|
||||||
|
.hasSize(maxMonthBackAmountReportTargets + 1);
|
||||||
for (final DataReportSeriesItem<LocalDate> reportItem : targetsCreatedOverPeriod.getData()) {
|
for (final DataReportSeriesItem<LocalDate> reportItem : targetsCreatedOverPeriod.getData()) {
|
||||||
// only one target is created for each month
|
// only one target is created for each month
|
||||||
assertThat(reportItem.getData().intValue()).as("Target for each month").isEqualTo(1);
|
assertThat(reportItem.getData().intValue()).as("Target for each month").isEqualTo(1);
|
||||||
@@ -147,10 +147,11 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
// +1 because we go back #maxMonthBackAmountReportTargets but in the
|
// +1 because we go back #maxMonthBackAmountReportTargets but in the
|
||||||
// report the current month
|
// report the current month
|
||||||
// is included for sure, so from this month we go back
|
// is included for sure, so from this month we go back
|
||||||
assertThat(feedbackReceivedOverTime.getData()).hasSize(maxMonthBackAmountReportTargets + 1);
|
assertThat(feedbackReceivedOverTime.getData()).as("feedback receiver has wrong data size")
|
||||||
|
.hasSize(maxMonthBackAmountReportTargets + 1);
|
||||||
for (final DataReportSeriesItem<LocalDate> reportItem : feedbackReceivedOverTime.getData()) {
|
for (final DataReportSeriesItem<LocalDate> reportItem : feedbackReceivedOverTime.getData()) {
|
||||||
// only one target feedback is created for each month
|
// only one target feedback is created for each month
|
||||||
assertThat(reportItem.getData().intValue()).isEqualTo(1);
|
assertThat(reportItem.getData().intValue()).as("data size is wrong").isEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check cache evict
|
// check cache evict
|
||||||
@@ -165,7 +166,7 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
}
|
}
|
||||||
feedbackReceivedOverTime = reportManagement.feedbackReceivedOverTime(DateTypes.perMonth(), from, to);
|
feedbackReceivedOverTime = reportManagement.feedbackReceivedOverTime(DateTypes.perMonth(), from, to);
|
||||||
for (final DataReportSeriesItem<LocalDate> reportItem : feedbackReceivedOverTime.getData()) {
|
for (final DataReportSeriesItem<LocalDate> reportItem : feedbackReceivedOverTime.getData()) {
|
||||||
assertThat(reportItem.getData().intValue()).isEqualTo(2);
|
assertThat(reportItem.getData().intValue()).as("report item has wrong data size").isEqualTo(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -227,12 +228,12 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
.isEqualTo(3L);
|
.isEqualTo(3L);
|
||||||
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
||||||
assertThat(Arrays.stream(outerData).map(DataReportSeriesItem::getType).collect(Collectors.toList()))
|
assertThat(Arrays.stream(outerData).map(DataReportSeriesItem::getType).collect(Collectors.toList()))
|
||||||
.contains("0.0.0", "0.0.1");
|
.as("versio item contains wrong version").contains("0.0.0", "0.0.1");
|
||||||
} else if (dataReportSeriesItem.getType().equals("ds2")) {
|
} else if (dataReportSeriesItem.getType().equals("ds2")) {
|
||||||
assertThat(dataReportSeriesItem.getData()).as("Version/Item type of DistributionSet 2 in statistics")
|
assertThat(dataReportSeriesItem.getData()).as("Version/Item type of DistributionSet 2 in statistics")
|
||||||
.isEqualTo(1L);
|
.isEqualTo(1L);
|
||||||
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
||||||
assertThat(outerData).hasSize(1);
|
assertThat(outerData).as("Version/Item type has wrong size").hasSize(1);
|
||||||
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 2 in statistics")
|
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 2 in statistics")
|
||||||
.isEqualTo("0.0.2");
|
.isEqualTo("0.0.2");
|
||||||
} else if (dataReportSeriesItem.getType().equals("ds3")) {
|
} else if (dataReportSeriesItem.getType().equals("ds3")) {
|
||||||
@@ -240,7 +241,7 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
assertThat(dataReportSeriesItem.getData()).as("Version/Item type of DistributionSet 3 in statistics")
|
assertThat(dataReportSeriesItem.getData()).as("Version/Item type of DistributionSet 3 in statistics")
|
||||||
.isEqualTo(0L);
|
.isEqualTo(0L);
|
||||||
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
||||||
assertThat(outerData).hasSize(1);
|
assertThat(outerData).as("Version/Item type has wrong size").hasSize(1);
|
||||||
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 3 in statistics")
|
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 3 in statistics")
|
||||||
.isEqualTo("0.0.3");
|
.isEqualTo("0.0.3");
|
||||||
} else {
|
} else {
|
||||||
@@ -395,13 +396,13 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
||||||
assertThat(Arrays.stream(outerData).map(DataReportSeriesItem::getType).collect(Collectors.toList()))
|
assertThat(Arrays.stream(outerData).map(DataReportSeriesItem::getType).collect(Collectors.toList()))
|
||||||
.contains("0.0.0", "0.0.1");
|
.as("Out series contains wrong version").contains("0.0.0", "0.0.1");
|
||||||
|
|
||||||
} else if (dataReportSeriesItem.getType().equals("ds2")) {
|
} else if (dataReportSeriesItem.getType().equals("ds2")) {
|
||||||
assertThat(dataReportSeriesItem.getData()).as("Total count of DistributionSet 2 in statistics")
|
assertThat(dataReportSeriesItem.getData()).as("Total count of DistributionSet 2 in statistics")
|
||||||
.isEqualTo(1L);
|
.isEqualTo(1L);
|
||||||
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
||||||
assertThat(outerData).hasSize(1);
|
assertThat(outerData).as("out series has wrong size").hasSize(1);
|
||||||
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 2 in statistics")
|
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 2 in statistics")
|
||||||
.isEqualTo("0.0.2");
|
.isEqualTo("0.0.2");
|
||||||
|
|
||||||
@@ -409,7 +410,7 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
assertThat(dataReportSeriesItem.getData()).as("Total count of DistributionSet 3 in statistics")
|
assertThat(dataReportSeriesItem.getData()).as("Total count of DistributionSet 3 in statistics")
|
||||||
.isEqualTo(0L);
|
.isEqualTo(0L);
|
||||||
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
final DataReportSeriesItem<String>[] outerData = innerOuterDataReportSeries.getOuterSeries().getData();
|
||||||
assertThat(outerData).hasSize(1);
|
assertThat(outerData).as("out series has wrong size").hasSize(1);
|
||||||
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 3 in statistics")
|
assertThat(outerData[0].getType()).as("Version/Item type of DistributionSet 3 in statistics")
|
||||||
.isEqualTo("0.0.3");
|
.isEqualTo("0.0.3");
|
||||||
} else {
|
} else {
|
||||||
@@ -487,33 +488,26 @@ public class ReportManagementTest extends AbstractIntegrationTest {
|
|||||||
final int targetCreateAmount = 10;
|
final int targetCreateAmount = 10;
|
||||||
|
|
||||||
// create targets for another tenant
|
// create targets for another tenant
|
||||||
securityRule.runAs(WithSpringAuthorityRule.withUserAndTenant("user", "anotherTenant"), new Callable<Void>() {
|
securityRule.runAs(WithSpringAuthorityRule.withUserAndTenant("user", "anotherTenant"), () -> {
|
||||||
@Override
|
for (int index = 0; index < targetCreateAmount; index++) {
|
||||||
public Void call() throws Exception {
|
targetManagement.createTarget(new Target("t" + index));
|
||||||
for (int index = 0; index < targetCreateAmount; index++) {
|
|
||||||
targetManagement.createTarget(new Target("t" + index));
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
// ensure targets has been created for 'anotherTenant'
|
// ensure targets has been created for 'anotherTenant'
|
||||||
final Slice<Target> targetsForAnotherTenant = securityRule.runAs(
|
final Slice<Target> targetsForAnotherTenant = securityRule.runAs(
|
||||||
WithSpringAuthorityRule.withUserAndTenant("user", "anotherTenant"), new Callable<Slice<Target>>() {
|
WithSpringAuthorityRule.withUserAndTenant("user", "anotherTenant"),
|
||||||
@Override
|
() -> targetManagement.findTargetsAll(new PageRequest(0, 1000)));
|
||||||
public Slice<Target> call() throws Exception {
|
assertThat(targetsForAnotherTenant).as("targets has wrong size").hasSize(targetCreateAmount);
|
||||||
return targetManagement.findTargetsAll(new PageRequest(0, 1000));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
assertThat(targetsForAnotherTenant).hasSize(targetCreateAmount);
|
|
||||||
|
|
||||||
final LocalDateTime to = LocalDateTime.now();
|
final LocalDateTime to = LocalDateTime.now();
|
||||||
final LocalDateTime from = to.minusMonths(targetCreateAmount);
|
final LocalDateTime from = to.minusMonths(targetCreateAmount);
|
||||||
// now retrieve the report for the 'mytenant'
|
// now retrieve the report for the 'mytenant'
|
||||||
final DataReportSeries<LocalDate> targetsCreatedOverPeriod = reportManagement
|
final DataReportSeries<LocalDate> targetsCreatedOverPeriod = reportManagement
|
||||||
.targetsCreatedOverPeriod(DateTypes.perMonth(), from, to);
|
.targetsCreatedOverPeriod(DateTypes.perMonth(), from, to);
|
||||||
// final no targets should final be created for this tenant
|
assertThat(targetsCreatedOverPeriod.getData()).as("final no targets should final be created for this tenant")
|
||||||
assertThat(targetsCreatedOverPeriod.getData()).hasSize(0);
|
.hasSize(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ import com.vaadin.spring.annotation.ViewScope;
|
|||||||
import com.vaadin.ui.Component;
|
import com.vaadin.ui.Component;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.UI;
|
|
||||||
import com.vaadin.ui.Table.TableTransferable;
|
import com.vaadin.ui.Table.TableTransferable;
|
||||||
|
import com.vaadin.ui.UI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload view footer layout implementation.
|
* Upload view footer layout implementation.
|
||||||
@@ -71,12 +71,7 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#init()
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -134,23 +129,11 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* hasDeletePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasDeletePermission() {
|
protected boolean hasDeletePermission() {
|
||||||
return permChecker.hasDeleteDistributionPermission();
|
return permChecker.hasDeleteDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* hasUpdatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasUpdatePermission() {
|
protected boolean hasUpdatePermission() {
|
||||||
/**
|
/**
|
||||||
@@ -161,12 +144,6 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* getDeleteAreaLabel()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDeleteAreaLabel() {
|
protected String getDeleteAreaLabel() {
|
||||||
return i18n.get("label.software.module.drop.area");
|
return i18n.get("label.software.module.drop.area");
|
||||||
@@ -177,29 +154,17 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
return SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID;
|
return SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* getDeleteLayoutAcceptCriteria()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected AcceptCriterion getDeleteLayoutAcceptCriteria() {
|
protected AcceptCriterion getDeleteLayoutAcceptCriteria() {
|
||||||
return uploadViewAcceptCriteria;
|
return uploadViewAcceptCriteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* processDroppedComponent(com.vaadin .event.dd.DragAndDropEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void processDroppedComponent(final DragAndDropEvent event) {
|
protected void processDroppedComponent(final DragAndDropEvent event) {
|
||||||
final Component sourceComponent = event.getTransferable().getSourceComponent();
|
final Component sourceComponent = event.getTransferable().getSourceComponent();
|
||||||
if (sourceComponent instanceof Table) {
|
if (sourceComponent instanceof Table) {
|
||||||
final Table sourceTable = (Table) event.getTransferable().getSourceComponent();
|
final Table sourceTable = (Table) event.getTransferable().getSourceComponent();
|
||||||
addToDeleteList(sourceTable,(TableTransferable) event.getTransferable());
|
addToDeleteList(sourceTable, (TableTransferable) event.getTransferable());
|
||||||
updateSWActionCount();
|
updateSWActionCount();
|
||||||
}
|
}
|
||||||
if (sourceComponent.getId().startsWith(SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX)) {
|
if (sourceComponent.getId().startsWith(SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX)) {
|
||||||
@@ -223,11 +188,11 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
private void deleteSWModuleType(final String swModuleTypeName) {
|
private void deleteSWModuleType(final String swModuleTypeName) {
|
||||||
artifactUploadState.getSelectedDeleteSWModuleTypes().add(swModuleTypeName);
|
artifactUploadState.getSelectedDeleteSWModuleTypes().add(swModuleTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addToDeleteList(final Table sourceTable, final TableTransferable transferable) {
|
private void addToDeleteList(final Table sourceTable, final TableTransferable transferable) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final Set<Long> swModuleSelected = (Set<Long>) sourceTable.getValue();
|
final Set<Long> swModuleSelected = (Set<Long>) sourceTable.getValue();
|
||||||
final Set<Long> swModuleIdNameSet = new HashSet<Long>();
|
final Set<Long> swModuleIdNameSet = new HashSet<>();
|
||||||
if (!swModuleSelected.contains(transferable.getData(SPUIDefinitions.ITEMID))) {
|
if (!swModuleSelected.contains(transferable.getData(SPUIDefinitions.ITEMID))) {
|
||||||
swModuleIdNameSet.add((Long) transferable.getData(SPUIDefinitions.ITEMID));
|
swModuleIdNameSet.add((Long) transferable.getData(SPUIDefinitions.ITEMID));
|
||||||
} else {
|
} else {
|
||||||
@@ -239,33 +204,18 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
artifactUploadState.getDeleteSofwareModules().put(id, swModuleName);
|
artifactUploadState.getDeleteSofwareModules().put(id, swModuleName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the software module delete count.
|
|
||||||
*/
|
|
||||||
private void updateSWActionCount() {
|
private void updateSWActionCount() {
|
||||||
final int count = artifactUploadState.getDeleteSofwareModules().size()
|
final int count = artifactUploadState.getDeleteSofwareModules().size()
|
||||||
+ artifactUploadState.getSelectedDeleteSWModuleTypes().size();
|
+ artifactUploadState.getSelectedDeleteSWModuleTypes().size();
|
||||||
updateActionsCount(count);
|
updateActionsCount(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* getNoActionsButtonLabel()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getNoActionsButtonLabel() {
|
protected String getNoActionsButtonLabel() {
|
||||||
return i18n.get("button.no.actions");
|
return i18n.get("button.no.actions");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#
|
|
||||||
* getActionsButtonLabel()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getActionsButtonLabel() {
|
protected String getActionsButtonLabel() {
|
||||||
return i18n.get("button.actions");
|
return i18n.get("button.actions");
|
||||||
@@ -276,25 +226,11 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
updateSWActionCount();
|
updateSWActionCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* getUnsavedActionsWindowCaption ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getUnsavedActionsWindowCaption() {
|
protected String getUnsavedActionsWindowCaption() {
|
||||||
return i18n.get("caption.save.window");
|
return i18n.get("caption.save.window");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* unsavedActionsWindowClosed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void unsavedActionsWindowClosed() {
|
protected void unsavedActionsWindowClosed() {
|
||||||
final String message = uploadViewConfirmationWindowLayout.getConsolidatedMessage();
|
final String message = uploadViewConfirmationWindowLayout.getConsolidatedMessage();
|
||||||
@@ -303,26 +239,12 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* getUnsavedActionsWindowContent ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Component getUnsavedActionsWindowContent() {
|
protected Component getUnsavedActionsWindowContent() {
|
||||||
uploadViewConfirmationWindowLayout.init();
|
uploadViewConfirmationWindowLayout.init();
|
||||||
return uploadViewConfirmationWindowLayout;
|
return uploadViewConfirmationWindowLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* hasUnsavedActions()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasUnsavedActions() {
|
protected boolean hasUnsavedActions() {
|
||||||
return !artifactUploadState.getDeleteSofwareModules().isEmpty()
|
return !artifactUploadState.getDeleteSofwareModules().isEmpty()
|
||||||
@@ -339,23 +261,11 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* isBulkUploadAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasBulkUploadPermission() {
|
protected boolean hasBulkUploadPermission() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* showBulkUploadWindow()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void showBulkUploadWindow() {
|
protected void showBulkUploadWindow() {
|
||||||
/**
|
/**
|
||||||
@@ -363,12 +273,6 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
|
|
||||||
* restoreBulkUploadStatusCount()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void restoreBulkUploadStatusCount() {
|
protected void restoreBulkUploadStatusCount() {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class SoftwareModuleDetails extends AbstractTableDetailsLayout {
|
|||||||
/**
|
/**
|
||||||
* Initialize the component.
|
* Initialize the component.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
/**
|
/**
|
||||||
* Initialize the components.
|
* Initialize the components.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -84,55 +85,26 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
eventbus.unsubscribe(this);
|
eventbus.unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getHeaderCaption
|
|
||||||
* ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHeaderCaption() {
|
protected String getHeaderCaption() {
|
||||||
return i18n.get("upload.swModuleTable.header");
|
return i18n.get("upload.swModuleTable.header");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getSearchBoxId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchBoxId() {
|
protected String getSearchBoxId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_SEARCH_TEXT_FIELD;
|
return SPUIComponetIdProvider.SW_MODULE_SEARCH_TEXT_FIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#getSearchRestIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchRestIconId() {
|
protected String getSearchRestIconId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_SEARCH_RESET_ICON;
|
return SPUIComponetIdProvider.SW_MODULE_SEARCH_RESET_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getAddIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getAddIconId() {
|
protected String getAddIconId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_ADD_BUTTON;
|
return SPUIComponetIdProvider.SW_MODULE_ADD_BUTTON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#onLoadSearchBoxValue()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String onLoadSearchBoxValue() {
|
protected String onLoadSearchBoxValue() {
|
||||||
if (artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()) {
|
if (artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()) {
|
||||||
@@ -141,68 +113,34 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getDropFilterId(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDropFilterId() {
|
protected String getDropFilterId() {
|
||||||
/* No dropping on software module table header in Upload View */
|
/* No dropping on software module table header in Upload View */
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#hasCreatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreatePermission() {
|
protected boolean hasCreatePermission() {
|
||||||
return permChecker.hasCreateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#isDropHintRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDropHintRequired() {
|
protected boolean isDropHintRequired() {
|
||||||
/* No dropping on software module table header in Upload View */
|
/* No dropping on software module table header in Upload View */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#isDropFilterRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDropFilterRequired() {
|
protected boolean isDropFilterRequired() {
|
||||||
/* No dropping on software module table header in Upload View */
|
/* No dropping on software module table header in Upload View */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#
|
|
||||||
* getShowFilterButtonLayoutId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getShowFilterButtonLayoutId() {
|
protected String getShowFilterButtonLayoutId() {
|
||||||
return "show.type.icon";
|
return "show.type.icon";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#showFilterButtonsLayout
|
|
||||||
* ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void showFilterButtonsLayout() {
|
protected void showFilterButtonsLayout() {
|
||||||
artifactUploadState.setSwTypeFilterClosed(false);
|
artifactUploadState.setSwTypeFilterClosed(false);
|
||||||
@@ -210,39 +148,19 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#resetSearchText(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
if(artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()){
|
if (artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()) {
|
||||||
artifactUploadState.getSoftwareModuleFilters().setSearchText(null);
|
artifactUploadState.getSoftwareModuleFilters().setSearchText(null);
|
||||||
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getMaxMinIconId(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getMaxMinIconId() {
|
protected String getMaxMinIconId() {
|
||||||
return SPUIComponetIdProvider.SW_MAX_MIN_TABLE_ICON;
|
return SPUIComponetIdProvider.SW_MAX_MIN_TABLE_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#maximizeTable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void maximizeTable() {
|
public void maximizeTable() {
|
||||||
artifactUploadState.setSwModuleTableMaximized(Boolean.TRUE);
|
artifactUploadState.setSwModuleTableMaximized(Boolean.TRUE);
|
||||||
@@ -250,58 +168,28 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#minimizeTable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void minimizeTable() {
|
public void minimizeTable() {
|
||||||
artifactUploadState.setSwModuleTableMaximized(Boolean.FALSE);
|
artifactUploadState.setSwModuleTableMaximized(Boolean.FALSE);
|
||||||
eventbus.publish(this, new SoftwareModuleEvent(SoftwareModuleEventType.MINIMIZED, null));
|
eventbus.publish(this, new SoftwareModuleEvent(SoftwareModuleEventType.MINIMIZED, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#onLoadIsTableMaximized(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTableMaximized() {
|
public Boolean onLoadIsTableMaximized() {
|
||||||
return artifactUploadState.isSwModuleTableMaximized();
|
return artifactUploadState.isSwModuleTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#
|
|
||||||
* onLoadIsShowFilterButtonDisplayed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
||||||
return artifactUploadState.isSwTypeFilterClosed();
|
return artifactUploadState.isSwTypeFilterClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#searchBy(java.lang.
|
|
||||||
* String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void searchBy(final String newSearchText) {
|
protected void searchBy(final String newSearchText) {
|
||||||
artifactUploadState.getSoftwareModuleFilters().setSearchText(newSearchText);
|
artifactUploadState.getSoftwareModuleFilters().setSearchText(newSearchText);
|
||||||
eventbus.publish(this, SMFilterEvent.FILTER_BY_TEXT);
|
eventbus.publish(this, SMFilterEvent.FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#addNewItem(com.vaadin.
|
|
||||||
* ui.Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void addNewItem(final ClickEvent event) {
|
protected void addNewItem(final ClickEvent event) {
|
||||||
final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow();
|
final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow();
|
||||||
@@ -310,11 +198,6 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
addSoftwareModule.setVisible(Boolean.TRUE);
|
addSoftwareModule.setVisible(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#canAddNewItem()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isAddNewItemAllowed() {
|
protected Boolean isAddNewItemAllowed() {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
@@ -335,47 +218,21 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getBulkUploadIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBulkUploadIconId() {
|
protected String getBulkUploadIconId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#bulkUpload(com.
|
|
||||||
* vaadin.ui.Button.ClickEvent )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void bulkUpload(final ClickEvent event) {
|
protected void bulkUpload(final ClickEvent event) {
|
||||||
/**
|
// No implementation as no bulk upload is supported.
|
||||||
* No implementation as no bulk upload is supported.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isBulkUploadAllowed() {
|
protected Boolean isBulkUploadAllowed() {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadInProgress()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isBulkUploadInProgress() {
|
protected boolean isBulkUploadInProgress() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ import com.vaadin.spring.annotation.ViewScope;
|
|||||||
/**
|
/**
|
||||||
* Software module type filter buttons.
|
* Software module type filter buttons.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -59,6 +57,7 @@ public class SMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
* @param filterButtonClickBehaviour
|
* @param filterButtonClickBehaviour
|
||||||
* the clickable behaviour.
|
* the clickable behaviour.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||||
super.init(filterButtonClickBehaviour);
|
super.init(filterButtonClickBehaviour);
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
@@ -86,58 +85,28 @@ public class SMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.layouts.SPFilterButtons#getButtonsTableId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButtonsTableId() {
|
protected String getButtonsTableId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID;
|
return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterButtons#
|
|
||||||
* createButtonsLazyQueryContainer()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||||
return HawkbitCommonUtil.createLazyQueryContainer(
|
return HawkbitCommonUtil.createLazyQueryContainer(
|
||||||
new BeanQueryFactory<SoftwareModuleTypeBeanQuery>(SoftwareModuleTypeBeanQuery.class));
|
new BeanQueryFactory<SoftwareModuleTypeBeanQuery>(SoftwareModuleTypeBeanQuery.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.layouts.SPFilterButtons#isClickedByDefault(java.
|
|
||||||
* lang.Long)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isClickedByDefault(final Long buttonId) {
|
protected boolean isClickedByDefault(final Long buttonId) {
|
||||||
return artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType().isPresent() && artifactUploadState
|
return artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType().isPresent() && artifactUploadState
|
||||||
.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId);
|
.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.layouts.SPFilterButtons#createButtonId(java.lang.
|
|
||||||
* String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String createButtonId(final String name) {
|
protected String createButtonId(final String name) {
|
||||||
return SPUIComponetIdProvider.SM_TYPE_FILTER_BTN_ID + name;
|
return SPUIComponetIdProvider.SM_TYPE_FILTER_BTN_ID + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.SPFilterButtons#
|
|
||||||
* getFilterButtonDropHandler()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected DropHandler getFilterButtonDropHandler() {
|
protected DropHandler getFilterButtonDropHandler() {
|
||||||
return new DropHandler() {
|
return new DropHandler() {
|
||||||
@@ -155,13 +124,6 @@ public class SMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* getButttonWrapperId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButttonWrapperIdPrefix() {
|
protected String getButttonWrapperIdPrefix() {
|
||||||
return SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX;
|
return SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX;
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ import com.vaadin.ui.Window;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Software module type filter buttons header.
|
* Software module type filter buttons header.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -53,6 +50,7 @@ public class SMTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
/**
|
/**
|
||||||
* Initialize the components.
|
* Initialize the components.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -61,32 +59,16 @@ public class SMTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.layouts.SPFilterHeader#hasCreateUpdatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreateUpdatePermission() {
|
protected boolean hasCreateUpdatePermission() {
|
||||||
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterHeader#getTitle()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
return SPUILabelDefinitions.TYPE;
|
return SPUILabelDefinitions.TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.layouts.SPFilterHeader#settingsIconClicked(com.
|
|
||||||
* vaadin.ui.Button.ClickEvent )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void settingsIconClicked(final ClickEvent event) {
|
protected void settingsIconClicked(final ClickEvent event) {
|
||||||
final Window addUpdateWindow = createUpdateSWTypeLayout.getWindow();
|
final Window addUpdateWindow = createUpdateSWTypeLayout.getWindow();
|
||||||
@@ -94,58 +76,27 @@ public class SMTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
addUpdateWindow.setVisible(Boolean.TRUE);
|
addUpdateWindow.setVisible(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.layouts.SPFilterHeader#dropHitsRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean dropHitsRequired() {
|
protected boolean dropHitsRequired() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.SPFilterHeader#
|
|
||||||
* hideFilterButtonLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void hideFilterButtonLayout() {
|
protected void hideFilterButtonLayout() {
|
||||||
artifactUploadState.setSwTypeFilterClosed(true);
|
artifactUploadState.setSwTypeFilterClosed(true);
|
||||||
eventbus.publish(this, UploadArtifactUIEvent.HIDE_FILTER_BY_TYPE);
|
eventbus.publish(this, UploadArtifactUIEvent.HIDE_FILTER_BY_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.SPFilterHeader#
|
|
||||||
* getConfigureFilterButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getConfigureFilterButtonId() {
|
protected String getConfigureFilterButtonId() {
|
||||||
return SPUIDefinitions.ADD_SOFTWARE_MODULE_TYPE;
|
return SPUIDefinitions.ADD_SOFTWARE_MODULE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getHideButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHideButtonId() {
|
protected String getHideButtonId() {
|
||||||
return SPUIComponetIdProvider.SM_SHOW_FILTER_BUTTON_ID;
|
return SPUIComponetIdProvider.SM_SHOW_FILTER_BUTTON_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* isAddTagRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAddTagRequired() {
|
protected boolean isAddTagRequired() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
*
|
*
|
||||||
* module.
|
* module.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class ConfirmationDialog implements Button.ClickListener {
|
public class ConfirmationDialog implements Button.ClickListener {
|
||||||
/** Serial version UID. */
|
/** Serial version UID. */
|
||||||
@@ -127,6 +124,7 @@ public class ConfirmationDialog implements Button.ClickListener {
|
|||||||
* @param event
|
* @param event
|
||||||
* the click event.
|
* the click event.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void buttonClick(final ClickEvent event) {
|
public void buttonClick(final ClickEvent event) {
|
||||||
if (window.getParent() != null) {
|
if (window.getParent() != null) {
|
||||||
UI.getCurrent().removeWindow(window);
|
UI.getCurrent().removeWindow(window);
|
||||||
@@ -146,6 +144,7 @@ public class ConfirmationDialog implements Button.ClickListener {
|
|||||||
/**
|
/**
|
||||||
* Interface for confirmation dialog callbacks.
|
* Interface for confirmation dialog callbacks.
|
||||||
*/
|
*/
|
||||||
|
@FunctionalInterface
|
||||||
public interface ConfirmationDialogCallback {
|
public interface ConfirmationDialogCallback {
|
||||||
/**
|
/**
|
||||||
* The user response.
|
* The user response.
|
||||||
|
|||||||
@@ -87,34 +87,16 @@ public class DistributionTagToken extends AbstractTagToken {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.tagDetails.AbstractTagToken#getTagStyleName
|
|
||||||
* ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTagStyleName() {
|
protected String getTagStyleName() {
|
||||||
return "distribution-tag-";
|
return "distribution-tag-";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
|
|
||||||
* getTokenInputPrompt()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTokenInputPrompt() {
|
protected String getTokenInputPrompt() {
|
||||||
return i18n.get("combo.type.tag.name");
|
return i18n.get("combo.type.tag.name");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.tagDetails.AbstractTagToken#assignTag(java.
|
|
||||||
* lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void assignTag(final String tagNameSelected) {
|
protected void assignTag(final String tagNameSelected) {
|
||||||
if (tagNameSelected != null) {
|
if (tagNameSelected != null) {
|
||||||
|
|||||||
@@ -14,29 +14,11 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for button: Primary.
|
* Style for button: Primary.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SPUIButtonStylePrimarySmall implements SPUIButtonDecorator {
|
public class SPUIButtonStylePrimarySmall implements SPUIButtonDecorator {
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Decorate Button and return.
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
*
|
|
||||||
* @param button
|
|
||||||
* as Button
|
|
||||||
* @param style
|
|
||||||
* as String
|
|
||||||
* @param setStyle
|
|
||||||
* as String
|
|
||||||
* @param icon
|
|
||||||
* as resource
|
|
||||||
* @return Button
|
|
||||||
*/
|
|
||||||
public Button decorate(Button button, String style, boolean setStyle, Resource icon) {
|
|
||||||
button.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL);
|
button.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL);
|
||||||
// Set Style
|
// Set Style
|
||||||
if (null != style) {
|
if (null != style) {
|
||||||
|
|||||||
@@ -14,29 +14,12 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for button: Small.
|
* Style for button: Small.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SPUIButtonStyleSmall implements SPUIButtonDecorator {
|
public class SPUIButtonStyleSmall implements SPUIButtonDecorator {
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Decorate Button and return.
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
*
|
|
||||||
* @param button
|
|
||||||
* as Button
|
|
||||||
* @param style
|
|
||||||
* as String
|
|
||||||
* @param setStyle
|
|
||||||
* as String
|
|
||||||
* @param icon
|
|
||||||
* as resource
|
|
||||||
* @return Button
|
|
||||||
*/
|
|
||||||
public Button decorate(Button button, String style, boolean setStyle, Resource icon) {
|
|
||||||
button.addStyleName(ValoTheme.BUTTON_SMALL);
|
button.addStyleName(ValoTheme.BUTTON_SMALL);
|
||||||
// Set Style
|
// Set Style
|
||||||
if (null != style) {
|
if (null != style) {
|
||||||
|
|||||||
@@ -14,29 +14,12 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for button: Small NoBorder Height UnDefined.
|
* Style for button: Small NoBorder Height UnDefined.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SPUIButtonStyleSmallNoBorderUH implements SPUIButtonDecorator {
|
public class SPUIButtonStyleSmallNoBorderUH implements SPUIButtonDecorator {
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Decorate Button and return.
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
*
|
|
||||||
* @param button
|
|
||||||
* as Button
|
|
||||||
* @param style
|
|
||||||
* as String
|
|
||||||
* @param setStyle
|
|
||||||
* as String
|
|
||||||
* @param icon
|
|
||||||
* as resource
|
|
||||||
* @return Button
|
|
||||||
*/
|
|
||||||
public Button decorate(Button button, String style, boolean setStyle, Resource icon) {
|
|
||||||
button.addStyleName(ValoTheme.BUTTON_SMALL);
|
button.addStyleName(ValoTheme.BUTTON_SMALL);
|
||||||
button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
|
button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
|
||||||
button.setHeightUndefined();
|
button.setHeightUndefined();
|
||||||
|
|||||||
@@ -14,29 +14,12 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for button: Small NoBorder Height and size UnDefined.
|
* Style for button: Small NoBorder Height and size UnDefined.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SPUIButtonStyleSmallNoBorderUHS implements SPUIButtonDecorator {
|
public class SPUIButtonStyleSmallNoBorderUHS implements SPUIButtonDecorator {
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Decorate Button and return.
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
*
|
|
||||||
* @param button
|
|
||||||
* as Button
|
|
||||||
* @param style
|
|
||||||
* as String
|
|
||||||
* @param setStyle
|
|
||||||
* as String
|
|
||||||
* @param icon
|
|
||||||
* as resource
|
|
||||||
* @return Button
|
|
||||||
*/
|
|
||||||
public Button decorate(Button button, String style, boolean setStyle, Resource icon) {
|
|
||||||
button.addStyleName(ValoTheme.BUTTON_SMALL);
|
button.addStyleName(ValoTheme.BUTTON_SMALL);
|
||||||
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
|
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
|
||||||
button.setHeightUndefined();
|
button.setHeightUndefined();
|
||||||
|
|||||||
@@ -14,29 +14,12 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for button: Small.
|
* Style for button: Small.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SPUIButtonStyleTiny implements SPUIButtonDecorator {
|
public class SPUIButtonStyleTiny implements SPUIButtonDecorator {
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Decorate Button and return.
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
*
|
|
||||||
* @param button
|
|
||||||
* as Button
|
|
||||||
* @param style
|
|
||||||
* as String
|
|
||||||
* @param setStyle
|
|
||||||
* as String
|
|
||||||
* @param icon
|
|
||||||
* as resource
|
|
||||||
* @return Button
|
|
||||||
*/
|
|
||||||
public Button decorate(Button button, String style, boolean setStyle, Resource icon) {
|
|
||||||
button.addStyleName(ValoTheme.BUTTON_TINY);
|
button.addStyleName(ValoTheme.BUTTON_TINY);
|
||||||
// Set Style
|
// Set Style
|
||||||
if (null != style) {
|
if (null != style) {
|
||||||
|
|||||||
@@ -16,27 +16,10 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for button: Tag.
|
* Style for button: Tag.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SPUITagButtonStyle implements SPUIButtonDecorator {
|
public class SPUITagButtonStyle implements SPUIButtonDecorator {
|
||||||
/**
|
|
||||||
* Decorate Button and return.
|
@Override
|
||||||
*
|
|
||||||
* @param button
|
|
||||||
* as Button
|
|
||||||
* @param style
|
|
||||||
* as String
|
|
||||||
* @param setStyle
|
|
||||||
* as String
|
|
||||||
* @param icon
|
|
||||||
* as resource
|
|
||||||
* @return Button
|
|
||||||
*/
|
|
||||||
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void getSelectedTableItemData(final Long id) {
|
private void getSelectedTableItemData(final Long id) {
|
||||||
Item saveTblitem = null;
|
Item saveTblitem;
|
||||||
if (null != selectedTablecontainer) {
|
if (null != selectedTablecontainer) {
|
||||||
saveTblitem = selectedTablecontainer.addItem(id);
|
saveTblitem = selectedTablecontainer.addItem(id);
|
||||||
saveTblitem.getItemProperty(DIST_TYPE_NAME).setValue(
|
saveTblitem.getItemProperty(DIST_TYPE_NAME).setValue(
|
||||||
|
|||||||
@@ -60,44 +60,24 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
* @param filterButtonClickBehaviour
|
* @param filterButtonClickBehaviour
|
||||||
* the clickable behaviour.
|
* the clickable behaviour.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||||
super.init(filterButtonClickBehaviour);
|
super.init(filterButtonClickBehaviour);
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* getButtonsTableId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButtonsTableId() {
|
protected String getButtonsTableId() {
|
||||||
|
|
||||||
return SPUIComponetIdProvider.DISTRIBUTION_SET_TYPE_TABLE_ID;
|
return SPUIComponetIdProvider.DISTRIBUTION_SET_TYPE_TABLE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* createButtonsLazyQueryContainer ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||||
return HawkbitCommonUtil.createLazyQueryContainer(
|
return HawkbitCommonUtil.createLazyQueryContainer(
|
||||||
new BeanQueryFactory<DistributionSetTypeBeanQuery>(DistributionSetTypeBeanQuery.class));
|
new BeanQueryFactory<DistributionSetTypeBeanQuery>(DistributionSetTypeBeanQuery.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* isClickedByDefault(java.lang .Long)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isClickedByDefault(final Long buttonId) {
|
protected boolean isClickedByDefault(final Long buttonId) {
|
||||||
|
|
||||||
@@ -105,26 +85,12 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
&& manageDistUIState.getManageDistFilters().getClickedDistSetType().getId().equals(buttonId);
|
&& manageDistUIState.getManageDistFilters().getClickedDistSetType().getId().equals(buttonId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* createButtonId(java.lang. String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String createButtonId(final String name) {
|
protected String createButtonId(final String name) {
|
||||||
|
|
||||||
return SPUIComponetIdProvider.DS_TYPE_FILTER_BTN_ID + name;
|
return SPUIComponetIdProvider.DS_TYPE_FILTER_BTN_ID + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* getFilterButtonDropHandler()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected DropHandler getFilterButtonDropHandler() {
|
protected DropHandler getFilterButtonDropHandler() {
|
||||||
|
|
||||||
@@ -148,13 +114,6 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
|
||||||
* getButttonWrapperId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButttonWrapperIdPrefix() {
|
protected String getButttonWrapperIdPrefix() {
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ import com.vaadin.ui.Window;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution Set Type filter buttons header.
|
* Distribution Set Type filter buttons header.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -49,9 +46,7 @@ public class DSTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CreateUpdateDistSetTypeLayout createUpdateDistSetTypeLayout;
|
private CreateUpdateDistSetTypeLayout createUpdateDistSetTypeLayout;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the components.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -60,37 +55,16 @@ public class DSTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hasCreateUpdatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreateUpdatePermission() {
|
protected boolean hasCreateUpdatePermission() {
|
||||||
|
|
||||||
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#getTitle(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
return SPUILabelDefinitions.TYPE;
|
return SPUILabelDefinitions.TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* settingsIconClicked(com.vaadin .ui.Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void settingsIconClicked(final ClickEvent event) {
|
protected void settingsIconClicked(final ClickEvent event) {
|
||||||
final Window addUpdateWindow = createUpdateDistSetTypeLayout.getWindow();
|
final Window addUpdateWindow = createUpdateDistSetTypeLayout.getWindow();
|
||||||
@@ -99,25 +73,11 @@ public class DSTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* dropHitsRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean dropHitsRequired() {
|
protected boolean dropHitsRequired() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hideFilterButtonLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void hideFilterButtonLayout() {
|
protected void hideFilterButtonLayout() {
|
||||||
manageDistUIState.setDistTypeFilterClosed(true);
|
manageDistUIState.setDistTypeFilterClosed(true);
|
||||||
@@ -125,38 +85,17 @@ public class DSTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getConfigureFilterButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getConfigureFilterButtonId() {
|
protected String getConfigureFilterButtonId() {
|
||||||
|
|
||||||
return SPUIDefinitions.ADD_DISTRIBUTION_TYPE_TAG;
|
return SPUIDefinitions.ADD_DISTRIBUTION_TYPE_TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getHideButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHideButtonId() {
|
protected String getHideButtonId() {
|
||||||
|
|
||||||
return SPUIDefinitions.HIDE_FILTER_DIST_TYPE;
|
return SPUIDefinitions.HIDE_FILTER_DIST_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* isAddTagRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAddTagRequired() {
|
protected boolean isAddTagRequired() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ import com.vaadin.ui.Window;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution table header.
|
* Distribution table header.
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -60,9 +58,7 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DistributionAddUpdateWindowLayout addUpdateWindowLayout;
|
private DistributionAddUpdateWindowLayout addUpdateWindowLayout;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the component.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -76,54 +72,26 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getHeaderCaption(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHeaderCaption() {
|
protected String getHeaderCaption() {
|
||||||
return i18n.get("header.dist.table");
|
return i18n.get("header.dist.table");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getSearchBoxId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchBoxId() {
|
protected String getSearchBoxId() {
|
||||||
return SPUIComponetIdProvider.DIST_SEARCH_TEXTFIELD;
|
return SPUIComponetIdProvider.DIST_SEARCH_TEXTFIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getSearchRestIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchRestIconId() {
|
protected String getSearchRestIconId() {
|
||||||
return SPUIComponetIdProvider.DIST_SEARCH_ICON;
|
return SPUIComponetIdProvider.DIST_SEARCH_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getAddIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getAddIconId() {
|
protected String getAddIconId() {
|
||||||
return SPUIComponetIdProvider.DIST_ADD_ICON;
|
return SPUIComponetIdProvider.DIST_ADD_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* onLoadSearchBoxValue()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String onLoadSearchBoxValue() {
|
protected String onLoadSearchBoxValue() {
|
||||||
if (manageDistUIstate.getManageDistFilters().getSearchText().isPresent()) {
|
if (manageDistUIstate.getManageDistFilters().getSearchText().isPresent()) {
|
||||||
@@ -132,11 +100,6 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getDropFilterId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDropFilterId() {
|
protected String getDropFilterId() {
|
||||||
return null;
|
return null;
|
||||||
@@ -170,7 +133,7 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
if(manageDistUIstate.getManageDistFilters().getSearchText().isPresent()){
|
if (manageDistUIstate.getManageDistFilters().getSearchText().isPresent()) {
|
||||||
manageDistUIstate.getManageDistFilters().setSearchText(null);
|
manageDistUIstate.getManageDistFilters().setSearchText(null);
|
||||||
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
@@ -223,11 +186,6 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
eventbus.unsubscribe(this);
|
eventbus.unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#canAddNewItem()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isAddNewItemAllowed() {
|
protected Boolean isAddNewItemAllowed() {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
@@ -248,47 +206,21 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getBulkUploadIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBulkUploadIconId() {
|
protected String getBulkUploadIconId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#bulkUpload(com.
|
|
||||||
* vaadin.ui.Button.ClickEvent )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void bulkUpload(final ClickEvent event) {
|
protected void bulkUpload(final ClickEvent event) {
|
||||||
/**
|
// No implementation as no bulk upload is supported.
|
||||||
* No implementation as no bulk upload is supported.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isBulkUploadAllowed() {
|
protected Boolean isBulkUploadAllowed() {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadInProgress()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isBulkUploadInProgress() {
|
protected boolean isBulkUploadInProgress() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ import com.vaadin.ui.Window;
|
|||||||
/**
|
/**
|
||||||
* Implementation of software module details block using generic abstract
|
* Implementation of software module details block using generic abstract
|
||||||
* details style .
|
* details style .
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -70,9 +67,7 @@ public class SwModuleDetails extends AbstractTableDetailsLayout {
|
|||||||
|
|
||||||
private SoftwareModule selectedSwModule;
|
private SoftwareModule selectedSwModule;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the component.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -133,49 +128,21 @@ public class SwModuleDetails extends AbstractTableDetailsLayout {
|
|||||||
detailsTab.addTab(createLogLayout(), i18n.get("caption.logs.tab"), null);
|
detailsTab.addTab(createLogLayout(), i18n.get("caption.logs.tab"), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.detailslayout.TableDetailsLayout#
|
|
||||||
* getDefaultCaption()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDefaultCaption() {
|
protected String getDefaultCaption() {
|
||||||
return i18n.get("upload.swModuleTable.header");
|
return i18n.get("upload.swModuleTable.header");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.detailslayout.TableDetailsLayout#
|
|
||||||
* onLoadIsSwModuleSelected()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean onLoadIsTableRowSelected() {
|
protected Boolean onLoadIsTableRowSelected() {
|
||||||
return !manageDistUIState.getSelectedSoftwareModules().isEmpty();
|
return !manageDistUIState.getSelectedSoftwareModules().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.detailslayout.TableDetailsLayout#
|
|
||||||
* onLoadIsTableMaximized()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean onLoadIsTableMaximized() {
|
protected Boolean onLoadIsTableMaximized() {
|
||||||
return manageDistUIState.isSwModuleTableMaximized();
|
return manageDistUIState.isSwModuleTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.detailslayout.TableDetailsLayout#
|
|
||||||
* populateDetailsWidget()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void populateDetailsWidget() {
|
protected void populateDetailsWidget() {
|
||||||
populateDetailsWidget(selectedSwModule);
|
populateDetailsWidget(selectedSwModule);
|
||||||
@@ -191,12 +158,6 @@ public class SwModuleDetails extends AbstractTableDetailsLayout {
|
|||||||
return permissionChecker.hasUpdateDistributionPermission();
|
return permissionChecker.hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* getTabSheetId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTabSheetId() {
|
protected String getTabSheetId() {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ import com.vaadin.ui.Window;
|
|||||||
/**
|
/**
|
||||||
* Implementation of software module Header block using generic abstract details
|
* Implementation of software module Header block using generic abstract details
|
||||||
* style .
|
* style .
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -61,9 +58,7 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
private SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the components.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -82,45 +77,21 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getHeaderCaption
|
|
||||||
* ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHeaderCaption() {
|
protected String getHeaderCaption() {
|
||||||
return i18n.get("upload.swModuleTable.header");
|
return i18n.get("upload.swModuleTable.header");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getSearchBoxId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchBoxId() {
|
protected String getSearchBoxId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_SEARCH_TEXT_FIELD;
|
return SPUIComponetIdProvider.SW_MODULE_SEARCH_TEXT_FIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#getSearchRestIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchRestIconId() {
|
protected String getSearchRestIconId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_SEARCH_RESET_ICON;
|
return SPUIComponetIdProvider.SW_MODULE_SEARCH_RESET_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getAddIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getAddIconId() {
|
protected String getAddIconId() {
|
||||||
return SPUIComponetIdProvider.SW_MODULE_ADD_BUTTON;
|
return SPUIComponetIdProvider.SW_MODULE_ADD_BUTTON;
|
||||||
@@ -134,99 +105,47 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getDropFilterId(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDropFilterId() {
|
protected String getDropFilterId() {
|
||||||
/* not required */
|
/* not required */
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isDropHintRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDropHintRequired() {
|
protected boolean isDropHintRequired() {
|
||||||
/* not required */
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#isDropFilterRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDropFilterRequired() {
|
protected boolean isDropFilterRequired() {
|
||||||
/* Not Yet Implemented */
|
/* Not Yet Implemented */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#
|
|
||||||
* getShowFilterButtonLayoutId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getShowFilterButtonLayoutId() {
|
protected String getShowFilterButtonLayoutId() {
|
||||||
return "show.type.icon";
|
return "show.type.icon";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#showFilterButtonsLayout
|
|
||||||
* ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void showFilterButtonsLayout() {
|
protected void showFilterButtonsLayout() {
|
||||||
manageDistUIState.setSwTypeFilterClosed(false);
|
manageDistUIState.setSwTypeFilterClosed(false);
|
||||||
eventbus.publish(this, DistributionsUIEvent.SHOW_SM_FILTER_BY_TYPE);
|
eventbus.publish(this, DistributionsUIEvent.SHOW_SM_FILTER_BY_TYPE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#resetSearchText(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
if(manageDistUIState.getSoftwareModuleFilters().getSearchText().isPresent()){
|
if (manageDistUIState.getSoftwareModuleFilters().getSearchText().isPresent()) {
|
||||||
manageDistUIState.getSoftwareModuleFilters().setSearchText(null);
|
manageDistUIState.getSoftwareModuleFilters().setSearchText(null);
|
||||||
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#getMaxMinIconId(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getMaxMinIconId() {
|
protected String getMaxMinIconId() {
|
||||||
return SPUIComponetIdProvider.SW_MAX_MIN_TABLE_ICON;
|
return SPUIComponetIdProvider.SW_MAX_MIN_TABLE_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#maximizeTable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void maximizeTable() {
|
public void maximizeTable() {
|
||||||
manageDistUIState.setSwModuleTableMaximized(Boolean.TRUE);
|
manageDistUIState.setSwModuleTableMaximized(Boolean.TRUE);
|
||||||
@@ -234,58 +153,28 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#minimizeTable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void minimizeTable() {
|
public void minimizeTable() {
|
||||||
manageDistUIState.setSwModuleTableMaximized(Boolean.FALSE);
|
manageDistUIState.setSwModuleTableMaximized(Boolean.FALSE);
|
||||||
eventbus.publish(this, new SoftwareModuleEvent(SoftwareModuleEventType.MINIMIZED, null));
|
eventbus.publish(this, new SoftwareModuleEvent(SoftwareModuleEventType.MINIMIZED, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#onLoadIsTableMaximized(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTableMaximized() {
|
public Boolean onLoadIsTableMaximized() {
|
||||||
return manageDistUIState.isSwModuleTableMaximized();
|
return manageDistUIState.isSwModuleTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTableHeader#
|
|
||||||
* onLoadIsShowFilterButtonDisplayed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
||||||
return manageDistUIState.isSwTypeFilterClosed();
|
return manageDistUIState.isSwTypeFilterClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#searchBy(java.lang.
|
|
||||||
* String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void searchBy(final String newSearchText) {
|
protected void searchBy(final String newSearchText) {
|
||||||
manageDistUIState.getSoftwareModuleFilters().setSearchText(newSearchText);
|
manageDistUIState.getSoftwareModuleFilters().setSearchText(newSearchText);
|
||||||
eventbus.publish(this, SMFilterEvent.FILTER_BY_TEXT);
|
eventbus.publish(this, SMFilterEvent.FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#addNewItem(com.vaadin.
|
|
||||||
* ui.Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void addNewItem(final ClickEvent event) {
|
protected void addNewItem(final ClickEvent event) {
|
||||||
final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow();
|
final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow();
|
||||||
@@ -294,22 +183,11 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
addSoftwareModule.setVisible(Boolean.TRUE);
|
addSoftwareModule.setVisible(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.SPTableHeader#hasCreatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreatePermission() {
|
protected boolean hasCreatePermission() {
|
||||||
return permChecker.hasCreateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isAddNewItemAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isAddNewItemAllowed() {
|
protected Boolean isAddNewItemAllowed() {
|
||||||
return true;
|
return true;
|
||||||
@@ -330,47 +208,21 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getBulkUploadIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBulkUploadIconId() {
|
protected String getBulkUploadIconId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#bulkUpload(com.
|
|
||||||
* vaadin.ui.Button.ClickEvent )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void bulkUpload(final ClickEvent event) {
|
protected void bulkUpload(final ClickEvent event) {
|
||||||
/**
|
// No implementation as no bulk upload is supported.
|
||||||
* No implementation as no bulk upload is supported.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isBulkUploadAllowed() {
|
protected Boolean isBulkUploadAllowed() {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadInProgress()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isBulkUploadInProgress() {
|
protected boolean isBulkUploadInProgress() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -56,12 +56,6 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize component.
|
|
||||||
*
|
|
||||||
* @param filterButtonClickBehaviour
|
|
||||||
* the clickable behaviour.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||||
super.init(filterButtonClickBehaviour);
|
super.init(filterButtonClickBehaviour);
|
||||||
@@ -70,7 +64,6 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButtonsTableId() {
|
protected String getButtonsTableId() {
|
||||||
|
|
||||||
return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID;
|
return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +113,6 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButttonWrapperIdPrefix() {
|
protected String getButttonWrapperIdPrefix() {
|
||||||
|
|
||||||
return SPUIDefinitions.SOFTWARE_MODULE_TAG_ID_PREFIXS;
|
return SPUIDefinitions.SOFTWARE_MODULE_TAG_ID_PREFIXS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ import com.vaadin.ui.Window;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Software Module Type filter buttons header.
|
* Software Module Type filter buttons header.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -51,9 +48,7 @@ public class DistSMTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
|
private CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the components.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -62,50 +57,21 @@ public class DistSMTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getHideButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHideButtonId() {
|
protected String getHideButtonId() {
|
||||||
return SPUIComponetIdProvider.SM_SHOW_FILTER_BUTTON_ID;
|
return SPUIComponetIdProvider.SM_SHOW_FILTER_BUTTON_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hasCreateUpdatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreateUpdatePermission() {
|
protected boolean hasCreateUpdatePermission() {
|
||||||
|
|
||||||
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#getTitle(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
|
|
||||||
return SPUILabelDefinitions.TYPE;
|
return SPUILabelDefinitions.TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* settingsIconClicked(com.vaadin .ui.Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void settingsIconClicked(final ClickEvent event) {
|
protected void settingsIconClicked(final ClickEvent event) {
|
||||||
final Window addUpdateWindow = createUpdateSWTypeLayout.getWindow();
|
final Window addUpdateWindow = createUpdateSWTypeLayout.getWindow();
|
||||||
@@ -114,51 +80,22 @@ public class DistSMTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* dropHitsRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean dropHitsRequired() {
|
protected boolean dropHitsRequired() {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hideFilterButtonLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void hideFilterButtonLayout() {
|
protected void hideFilterButtonLayout() {
|
||||||
manageDistUIState.setSwTypeFilterClosed(true);
|
manageDistUIState.setSwTypeFilterClosed(true);
|
||||||
eventBus.publish(this, DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE);
|
eventBus.publish(this, DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getConfigureFilterButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getConfigureFilterButtonId() {
|
protected String getConfigureFilterButtonId() {
|
||||||
return SPUIDefinitions.ADD_SOFTWARE_MODULE_TYPE;
|
return SPUIDefinitions.ADD_SOFTWARE_MODULE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* isAddTagRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAddTagRequired() {
|
protected boolean isAddTagRequired() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ import com.vaadin.ui.Window;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution set details layout.
|
* Distribution set details layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -75,9 +72,7 @@ public class DistributionDetails extends AbstractTableDetailsLayout {
|
|||||||
|
|
||||||
private UI ui;
|
private UI ui;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* softwareLayout Initialize the component.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
@@ -116,23 +111,11 @@ public class DistributionDetails extends AbstractTableDetailsLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* getDefaultCaption()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDefaultCaption() {
|
protected String getDefaultCaption() {
|
||||||
return i18n.get("distribution.details.header");
|
return i18n.get("distribution.details.header");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* addTabs(com.vaadin. ui.TabSheet)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void addTabs(final TabSheet detailsTab) {
|
protected void addTabs(final TabSheet detailsTab) {
|
||||||
detailsTab.addTab(createDetailsLayout(), i18n.get("caption.tab.details"), null);
|
detailsTab.addTab(createDetailsLayout(), i18n.get("caption.tab.details"), null);
|
||||||
@@ -142,12 +125,6 @@ public class DistributionDetails extends AbstractTableDetailsLayout {
|
|||||||
detailsTab.addTab(createLogLayout(), i18n.get("caption.logs.tab"), null);
|
detailsTab.addTab(createLogLayout(), i18n.get("caption.logs.tab"), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* onEdit(com.vaadin.ui .Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void onEdit(final ClickEvent event) {
|
protected void onEdit(final ClickEvent event) {
|
||||||
final Window newDistWindow = distributionAddUpdateWindowLayout.getWindow();
|
final Window newDistWindow = distributionAddUpdateWindowLayout.getWindow();
|
||||||
@@ -157,79 +134,37 @@ public class DistributionDetails extends AbstractTableDetailsLayout {
|
|||||||
newDistWindow.setVisible(Boolean.TRUE);
|
newDistWindow.setVisible(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* getEditButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getEditButtonId() {
|
protected String getEditButtonId() {
|
||||||
return SPUIComponetIdProvider.DS_EDIT_BUTTON;
|
return SPUIComponetIdProvider.DS_EDIT_BUTTON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* onLoadIsTableRowSelected ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean onLoadIsTableRowSelected() {
|
protected Boolean onLoadIsTableRowSelected() {
|
||||||
return !(managementUIState.getSelectedDsIdName().isPresent()
|
return !(managementUIState.getSelectedDsIdName().isPresent()
|
||||||
&& managementUIState.getSelectedDsIdName().get().isEmpty());
|
&& managementUIState.getSelectedDsIdName().get().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* onLoadIsTableMaximized ()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean onLoadIsTableMaximized() {
|
protected Boolean onLoadIsTableMaximized() {
|
||||||
return managementUIState.isDsTableMaximized();
|
return managementUIState.isDsTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* populateDetailsWidget()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void populateDetailsWidget() {
|
protected void populateDetailsWidget() {
|
||||||
populateDetailsWidget(selectedDsModule);
|
populateDetailsWidget(selectedDsModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* clearDetails()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void clearDetails() {
|
protected void clearDetails() {
|
||||||
populateDetailsWidget(null);
|
populateDetailsWidget(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* hasEditPermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean hasEditPermission() {
|
protected Boolean hasEditPermission() {
|
||||||
return permissionChecker.hasUpdateDistributionPermission();
|
return permissionChecker.hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.detailslayout.AbstractTableDetailsLayout#
|
|
||||||
* getTabSheetId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTabSheetId() {
|
protected String getTabSheetId() {
|
||||||
return SPUIComponetIdProvider.DISTRIBUTION_DETAILS_TABSHEET;
|
return SPUIComponetIdProvider.DISTRIBUTION_DETAILS_TABSHEET;
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ import com.vaadin.ui.UI;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution set table.
|
* Distribution set table.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -111,9 +110,6 @@ public class DistributionTable extends AbstractTable {
|
|||||||
|
|
||||||
private Button distributinPinnedBtn;
|
private Button distributinPinnedBtn;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the distribution table.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
|
|||||||
@@ -58,9 +58,7 @@ public class DistributionTableHeader extends AbstractTableHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout;
|
private DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the component.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -81,54 +79,26 @@ public class DistributionTableHeader extends AbstractTableHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getHeaderCaption(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHeaderCaption() {
|
protected String getHeaderCaption() {
|
||||||
return i18n.get("header.dist.table");
|
return i18n.get("header.dist.table");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getSearchBoxId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchBoxId() {
|
protected String getSearchBoxId() {
|
||||||
return SPUIComponetIdProvider.DIST_SEARCH_TEXTFIELD;
|
return SPUIComponetIdProvider.DIST_SEARCH_TEXTFIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getSearchRestIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchRestIconId() {
|
protected String getSearchRestIconId() {
|
||||||
return SPUIComponetIdProvider.DIST_SEARCH_ICON;
|
return SPUIComponetIdProvider.DIST_SEARCH_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getAddIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getAddIconId() {
|
protected String getAddIconId() {
|
||||||
return SPUIComponetIdProvider.DIST_ADD_ICON;
|
return SPUIComponetIdProvider.DIST_ADD_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* onLoadSearchBoxValue()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String onLoadSearchBoxValue() {
|
protected String onLoadSearchBoxValue() {
|
||||||
if (managementUIState.getDistributionTableFilters().getSearchText().isPresent()) {
|
if (managementUIState.getDistributionTableFilters().getSearchText().isPresent()) {
|
||||||
@@ -137,157 +107,78 @@ public class DistributionTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getDropFilterId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getDropFilterId() {
|
protected String getDropFilterId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* hasCreatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreatePermission() {
|
protected boolean hasCreatePermission() {
|
||||||
return permChecker.hasCreateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isDropHintRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDropHintRequired() {
|
protected boolean isDropHintRequired() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isDropFilterRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDropFilterRequired() {
|
protected boolean isDropFilterRequired() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getShowFilterButtonLayoutId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getShowFilterButtonLayoutId() {
|
protected String getShowFilterButtonLayoutId() {
|
||||||
return "show.dist.tags.icon";
|
return "show.dist.tags.icon";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* showFilterButtonsLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void showFilterButtonsLayout() {
|
protected void showFilterButtonsLayout() {
|
||||||
managementUIState.setDistTagFilterClosed(false);
|
managementUIState.setDistTagFilterClosed(false);
|
||||||
eventbus.publish(this, ManagementUIEvent.SHOW_DISTRIBUTION_TAG_LAYOUT);
|
eventbus.publish(this, ManagementUIEvent.SHOW_DISTRIBUTION_TAG_LAYOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#resetSearchText()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
if( managementUIState.getDistributionTableFilters().getSearchText().isPresent()){
|
if (managementUIState.getDistributionTableFilters().getSearchText().isPresent()) {
|
||||||
managementUIState.getDistributionTableFilters().setSearchText(null);
|
managementUIState.getDistributionTableFilters().setSearchText(null);
|
||||||
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#getMaxMinIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getMaxMinIconId() {
|
protected String getMaxMinIconId() {
|
||||||
return SPUIComponetIdProvider.DS_MAX_MIN_TABLE_ICON;
|
return SPUIComponetIdProvider.DS_MAX_MIN_TABLE_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#maximizeTable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void maximizeTable() {
|
public void maximizeTable() {
|
||||||
managementUIState.setDsTableMaximized(Boolean.TRUE);
|
managementUIState.setDsTableMaximized(Boolean.TRUE);
|
||||||
eventbus.publish(this, new DistributionTableEvent(DistributionComponentEvent.MAXIMIZED, null));
|
eventbus.publish(this, new DistributionTableEvent(DistributionComponentEvent.MAXIMIZED, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#minimizeTable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void minimizeTable() {
|
public void minimizeTable() {
|
||||||
managementUIState.setDsTableMaximized(Boolean.FALSE);
|
managementUIState.setDsTableMaximized(Boolean.FALSE);
|
||||||
eventbus.publish(this, new DistributionTableEvent(DistributionComponentEvent.MINIMIZED, null));
|
eventbus.publish(this, new DistributionTableEvent(DistributionComponentEvent.MINIMIZED, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* onLoadIsTableMaximized()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTableMaximized() {
|
public Boolean onLoadIsTableMaximized() {
|
||||||
return managementUIState.isDsTableMaximized();
|
return managementUIState.isDsTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* onLoadIsShowFilterButtonDisplayed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
||||||
return managementUIState.isDistTagFilterClosed();
|
return managementUIState.isDistTagFilterClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#searchBy(java.
|
|
||||||
* lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void searchBy(final String newSearchText) {
|
protected void searchBy(final String newSearchText) {
|
||||||
managementUIState.getDistributionTableFilters().setSearchText(newSearchText);
|
managementUIState.getDistributionTableFilters().setSearchText(newSearchText);
|
||||||
eventbus.publish(this, DistributionTableFilterEvent.FILTER_BY_TEXT);
|
eventbus.publish(this, DistributionTableFilterEvent.FILTER_BY_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#addNewItem(com.
|
|
||||||
* vaadin.ui.Button.ClickEvent )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void addNewItem(final ClickEvent event) {
|
protected void addNewItem(final ClickEvent event) {
|
||||||
final Window newDistWindow = distributionAddUpdateWindowLayout.getWindow();
|
final Window newDistWindow = distributionAddUpdateWindowLayout.getWindow();
|
||||||
@@ -297,12 +188,6 @@ public class DistributionTableHeader extends AbstractTableHeader {
|
|||||||
eventbus.publish(this, DragEvent.HIDE_DROP_HINT);
|
eventbus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isAddNewItemAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isAddNewItemAllowed() {
|
protected Boolean isAddNewItemAllowed() {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
@@ -323,47 +208,21 @@ public class DistributionTableHeader extends AbstractTableHeader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* getBulkUploadIconId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBulkUploadIconId() {
|
protected String getBulkUploadIconId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.table.AbstractTableHeader#bulkUpload(com.
|
|
||||||
* vaadin.ui.Button.ClickEvent )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void bulkUpload(final ClickEvent event) {
|
protected void bulkUpload(final ClickEvent event) {
|
||||||
/**
|
// No implementation as no bulk upload is supported.
|
||||||
* No implementation as no bulk upload is supported.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadAllowed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isBulkUploadAllowed() {
|
protected Boolean isBulkUploadAllowed() {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.table.AbstractTableHeader#
|
|
||||||
* isBulkUploadInProgress()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isBulkUploadInProgress() {
|
protected boolean isBulkUploadInProgress() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -64,12 +64,6 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ManagementUIState managementUIState;
|
private ManagementUIState managementUIState;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize component.
|
|
||||||
*
|
|
||||||
* @param filterButtonClickBehaviour
|
|
||||||
* the clickable behaviour.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||||
super.init(filterButtonClickBehaviour);
|
super.init(filterButtonClickBehaviour);
|
||||||
@@ -99,7 +93,6 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||||
void onEvent(final DragEvent dragEvent) {
|
void onEvent(final DragEvent dragEvent) {
|
||||||
|
|
||||||
if (dragEvent == DragEvent.DISTRIBUTION_DRAG) {
|
if (dragEvent == DragEvent.DISTRIBUTION_DRAG) {
|
||||||
UI.getCurrent().access(() -> addStyleName(SPUIStyleDefinitions.SHOW_DROP_HINT_FILTER_BUTTON));
|
UI.getCurrent().access(() -> addStyleName(SPUIStyleDefinitions.SHOW_DROP_HINT_FILTER_BUTTON));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ public class DistributionTagHeader extends AbstractFilterHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CreateUpdateDistributionTagLayoutWindow createORUpdateDistributionTagLayout;
|
private CreateUpdateDistributionTagLayoutWindow createORUpdateDistributionTagLayout;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize the components.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -61,100 +59,45 @@ public class DistributionTagHeader extends AbstractFilterHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getHideButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHideButtonId() {
|
protected String getHideButtonId() {
|
||||||
return "hide.distribution.tags";
|
return "hide.distribution.tags";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hasCreateUpdatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreateUpdatePermission() {
|
protected boolean hasCreateUpdatePermission() {
|
||||||
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
return permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#getTitle(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
return i18n.get("header.filter.tag", new Object[] {});
|
return i18n.get("header.filter.tag", new Object[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* settingsIconClicked(com.vaadin .ui.Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void settingsIconClicked(final ClickEvent event) {
|
protected void settingsIconClicked(final ClickEvent event) {
|
||||||
final Window addUpdateWindow = createORUpdateDistributionTagLayout.getWindow();
|
final Window addUpdateWindow = createORUpdateDistributionTagLayout.getWindow();
|
||||||
UI.getCurrent().addWindow(addUpdateWindow);
|
UI.getCurrent().addWindow(addUpdateWindow);
|
||||||
addUpdateWindow.setModal(true);
|
addUpdateWindow.setModal(true);
|
||||||
addUpdateWindow.setVisible(Boolean.TRUE);
|
addUpdateWindow.setVisible(Boolean.TRUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* dropHitsRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean dropHitsRequired() {
|
protected boolean dropHitsRequired() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hideFilterButtonLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void hideFilterButtonLayout() {
|
protected void hideFilterButtonLayout() {
|
||||||
managementUIState.setDistTagFilterClosed(true);
|
managementUIState.setDistTagFilterClosed(true);
|
||||||
eventbus.publish(this, ManagementUIEvent.HIDE_DISTRIBUTION_TAG_LAYOUT);
|
eventbus.publish(this, ManagementUIEvent.HIDE_DISTRIBUTION_TAG_LAYOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getConfigureFilterButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getConfigureFilterButtonId() {
|
protected String getConfigureFilterButtonId() {
|
||||||
return SPUIComponetIdProvider.ADD_DISTRIBUTION_TAG;
|
return SPUIComponetIdProvider.ADD_DISTRIBUTION_TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* isAddTagRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAddTagRequired() {
|
protected boolean isAddTagRequired() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -89,9 +89,6 @@ public class TargetTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
private Boolean isComplexFilterViewDisplayed = Boolean.FALSE;
|
private Boolean isComplexFilterViewDisplayed = Boolean.FALSE;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialization of Target Header Component.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ import com.vaadin.ui.Button.ClickEvent;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Target Tag filter by Tag Header.
|
* Target Tag filter by Tag Header.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@ViewScope
|
@ViewScope
|
||||||
@@ -50,9 +47,7 @@ public class TargetTagFilterHeader extends AbstractFilterHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ManagementUIState managementUIState;
|
private ManagementUIState managementUIState;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialize Tag Header.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -61,101 +56,45 @@ public class TargetTagFilterHeader extends AbstractFilterHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getHideButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getHideButtonId() {
|
protected String getHideButtonId() {
|
||||||
|
|
||||||
return SPUIComponetIdProvider.HIDE_TARGET_TAGS;
|
return SPUIComponetIdProvider.HIDE_TARGET_TAGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hasCreateUpdatePermission()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreateUpdatePermission() {
|
protected boolean hasCreateUpdatePermission() {
|
||||||
|
|
||||||
return permChecker.hasCreateTargetPermission() || permChecker.hasUpdateTargetPermission();
|
return permChecker.hasCreateTargetPermission() || permChecker.hasUpdateTargetPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#getTitle(
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
return i18n.get("header.target.filter.tag", new Object[] {});
|
return i18n.get("header.target.filter.tag", new Object[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* settingsIconClicked(com.vaadin .ui.Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void settingsIconClicked(final ClickEvent event) {
|
protected void settingsIconClicked(final ClickEvent event) {
|
||||||
/**
|
// Add tag icon not displayed.
|
||||||
* Add tag icon not displayed.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* dropHitsRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean dropHitsRequired() {
|
protected boolean dropHitsRequired() {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* hideFilterButtonLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void hideFilterButtonLayout() {
|
protected void hideFilterButtonLayout() {
|
||||||
managementUIState.setTargetTagFilterClosed(true);
|
managementUIState.setTargetTagFilterClosed(true);
|
||||||
eventbus.publish(this, ManagementUIEvent.HIDE_TARGET_TAG_LAYOUT);
|
eventbus.publish(this, ManagementUIEvent.HIDE_TARGET_TAG_LAYOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* getConfigureFilterButtonId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String getConfigureFilterButtonId() {
|
protected String getConfigureFilterButtonId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader#
|
|
||||||
* isAddTagRequired()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAddTagRequired() {
|
protected boolean isAddTagRequired() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ public class ProxyRollout extends Rollout {
|
|||||||
|
|
||||||
private String modifiedDate;
|
private String modifiedDate;
|
||||||
|
|
||||||
private String createdBy;
|
|
||||||
|
|
||||||
private String lastModifiedBy;
|
|
||||||
|
|
||||||
private Long numberOfGroups;
|
private Long numberOfGroups;
|
||||||
|
|
||||||
private Long runningTargetsCount;
|
private Long runningTargetsCount;
|
||||||
@@ -106,36 +102,6 @@ public class ProxyRollout extends Rollout {
|
|||||||
this.modifiedDate = modifiedDate;
|
this.modifiedDate = modifiedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the createdBy
|
|
||||||
*/
|
|
||||||
public String getCreatedBy() {
|
|
||||||
return createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param createdBy
|
|
||||||
* the createdBy to set
|
|
||||||
*/
|
|
||||||
public void setCreatedBy(final String createdBy) {
|
|
||||||
this.createdBy = createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the lastModifiedBy
|
|
||||||
*/
|
|
||||||
public String getLastModifiedBy() {
|
|
||||||
return lastModifiedBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastModifiedBy
|
|
||||||
* the lastModifiedBy to set
|
|
||||||
*/
|
|
||||||
public void setLastModifiedBy(final String lastModifiedBy) {
|
|
||||||
this.lastModifiedBy = lastModifiedBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the runningTargetsCount
|
* @return the runningTargetsCount
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,10 +22,6 @@ public class ProxyRolloutGroup extends RolloutGroup {
|
|||||||
|
|
||||||
private String modifiedDate;
|
private String modifiedDate;
|
||||||
|
|
||||||
private String createdBy;
|
|
||||||
|
|
||||||
private String lastModifiedBy;
|
|
||||||
|
|
||||||
private String finishedPercentage;
|
private String finishedPercentage;
|
||||||
|
|
||||||
private Long runningTargetsCount;
|
private Long runningTargetsCount;
|
||||||
@@ -74,36 +70,6 @@ public class ProxyRolloutGroup extends RolloutGroup {
|
|||||||
this.modifiedDate = modifiedDate;
|
this.modifiedDate = modifiedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the createdBy
|
|
||||||
*/
|
|
||||||
public String getCreatedBy() {
|
|
||||||
return createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param createdBy
|
|
||||||
* the createdBy to set
|
|
||||||
*/
|
|
||||||
public void setCreatedBy(final String createdBy) {
|
|
||||||
this.createdBy = createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the lastModifiedBy
|
|
||||||
*/
|
|
||||||
public String getLastModifiedBy() {
|
|
||||||
return lastModifiedBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastModifiedBy
|
|
||||||
* the lastModifiedBy to set
|
|
||||||
*/
|
|
||||||
public void setLastModifiedBy(final String lastModifiedBy) {
|
|
||||||
this.lastModifiedBy = lastModifiedBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the finishedPercentage
|
* @return the finishedPercentage
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class RolloutGroupTargetsListHeader extends AbstractSimpleTableHeader {
|
|||||||
private Button rolloutsGroupViewLink;
|
private Button rolloutsGroupViewLink;
|
||||||
private Label headerCaption;
|
private Label headerCaption;
|
||||||
|
|
||||||
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -78,8 +79,8 @@ public class RolloutGroupTargetsListHeader extends AbstractSimpleTableHeader {
|
|||||||
headerCaption.setCaption(rolloutGroup.getName());
|
headerCaption.setCaption(rolloutGroup.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
rolloutsGroupViewLink.setCaption(rolloutUiState.getRolloutName().isPresent() ? rolloutUiState.getRolloutName()
|
rolloutsGroupViewLink
|
||||||
.get() : "");
|
.setCaption(rolloutUiState.getRolloutName().isPresent() ? rolloutUiState.getRolloutName().get() : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -103,9 +104,7 @@ public class RolloutGroupTargetsListHeader extends AbstractSimpleTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void searchBy(final String newSearchText) {
|
protected void searchBy(final String newSearchText) {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,12 +161,6 @@ public class RolloutGroupTargetsListHeader extends AbstractSimpleTableHeader {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.rollout.AbstractSimpleTableHeader#
|
|
||||||
* getHeaderCaptionLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected HorizontalLayout getHeaderCaptionLayout() {
|
protected HorizontalLayout getHeaderCaptionLayout() {
|
||||||
headerCaption = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_WIDGET_CAPTION);
|
headerCaption = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_WIDGET_CAPTION);
|
||||||
@@ -204,12 +197,6 @@ public class RolloutGroupTargetsListHeader extends AbstractSimpleTableHeader {
|
|||||||
eventBus.publish(this, RolloutEvent.SHOW_ROLLOUTS);
|
eventBus.publish(this, RolloutEvent.SHOW_ROLLOUTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.ui.rollout.AbstractSimpleTableHeader#restoreCaption()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void restoreCaption() {
|
protected void restoreCaption() {
|
||||||
setCaptionDetails();
|
setCaptionDetails();
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private transient RolloutUIState rolloutUIState;
|
private transient RolloutUIState rolloutUIState;
|
||||||
|
|
||||||
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -88,8 +89,8 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.15f));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.15f));
|
||||||
columnList
|
columnList
|
||||||
.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.15f));
|
.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.15f));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"),
|
columnList.add(
|
||||||
0.15f));
|
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.15f));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.15f));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.15f));
|
||||||
|
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_TARGET_STATUS, i18n.get("header.status"), 0.1f));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_TARGET_STATUS, i18n.get("header.status"), 0.1f));
|
||||||
@@ -101,15 +102,16 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
final BeanQueryFactory<RolloutGroupTargetsBeanQuery> rolloutgrouBeanQueryFactory = new BeanQueryFactory<>(
|
final BeanQueryFactory<RolloutGroupTargetsBeanQuery> rolloutgrouBeanQueryFactory = new BeanQueryFactory<>(
|
||||||
RolloutGroupTargetsBeanQuery.class);
|
RolloutGroupTargetsBeanQuery.class);
|
||||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE,
|
return new LazyQueryContainer(
|
||||||
SPUILabelDefinitions.VAR_ID), rolloutgrouBeanQueryFactory);
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_ID),
|
||||||
|
rolloutgrouBeanQueryFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addContainerProperties(final Container container) {
|
protected void addContainerProperties(final Container container) {
|
||||||
final LazyQueryContainer rolloutGroupTargetTableContainer = (LazyQueryContainer) container;
|
final LazyQueryContainer rolloutGroupTargetTableContainer = (LazyQueryContainer) container;
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_CONT_ID, String.class, "",
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_CONT_ID, String.class, "", false,
|
||||||
false, false);
|
false);
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, "", false,
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, "", false,
|
||||||
true);
|
true);
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_STATUS, Status.class,
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_STATUS, Status.class,
|
||||||
@@ -124,10 +126,10 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
false, true);
|
false, true);
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class,
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class,
|
||||||
null, false, true);
|
null, false, true);
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, String.class,
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, String.class, null,
|
||||||
|
false, true);
|
||||||
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, String.class,
|
||||||
null, false, true);
|
null, false, true);
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE,
|
|
||||||
String.class, null, false, true);
|
|
||||||
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false,
|
rolloutGroupTargetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
@@ -140,23 +142,20 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onValueChange() {
|
protected void onValueChange() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addCustomGeneratedColumns() {
|
protected void addCustomGeneratedColumns() {
|
||||||
addGeneratedColumn(SPUILabelDefinitions.VAR_TARGET_STATUS, (source, itemId, columnId) -> getStatusLabel(itemId));
|
addGeneratedColumn(SPUILabelDefinitions.VAR_TARGET_STATUS,
|
||||||
|
(source, itemId, columnId) -> getStatusLabel(itemId));
|
||||||
setColumnAlignment(SPUILabelDefinitions.VAR_TARGET_STATUS, Align.CENTER);
|
setColumnAlignment(SPUILabelDefinitions.VAR_TARGET_STATUS, Align.CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setCollapsiblecolumns() {
|
protected void setCollapsiblecolumns() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Label getStatusLabel(final Object itemId) {
|
private Label getStatusLabel(final Object itemId) {
|
||||||
@@ -171,8 +170,8 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
|
|
||||||
private void setStatusIcon(final Object itemId, final Label statusLabel) {
|
private void setStatusIcon(final Object itemId, final Label statusLabel) {
|
||||||
final Item item = getItem(itemId);
|
final Item item = getItem(itemId);
|
||||||
final RolloutGroup rolloutGroup = rolloutUIState.getRolloutGroup().isPresent() ? rolloutUIState
|
final RolloutGroup rolloutGroup = rolloutUIState.getRolloutGroup().isPresent()
|
||||||
.getRolloutGroup().get() : null;
|
? rolloutUIState.getRolloutGroup().get() : null;
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
final Status status = (Status) item.getItemProperty(SPUILabelDefinitions.VAR_STATUS).getValue();
|
final Status status = (Status) item.getItemProperty(SPUILabelDefinitions.VAR_STATUS).getValue();
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
@@ -184,10 +183,10 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
statusLabel.setValue(FontAwesome.MINUS_CIRCLE.getHtml());
|
statusLabel.setValue(FontAwesome.MINUS_CIRCLE.getHtml());
|
||||||
statusLabel.addStyleName("statusIconBlue");
|
statusLabel.addStyleName("statusIconBlue");
|
||||||
|
|
||||||
final String dsNameVersion = (String) item.getItemProperty(
|
final String dsNameVersion = (String) item
|
||||||
SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER).getValue();
|
.getItemProperty(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER).getValue();
|
||||||
statusLabel.setDescription(i18n
|
statusLabel
|
||||||
.get("message.dist.already.assigned", new Object[] { dsNameVersion }));
|
.setDescription(i18n.get("message.dist.already.assigned", new Object[] { dsNameVersion }));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setRolloutStatusIcon(status, statusLabel);
|
setRolloutStatusIcon(status, statusLabel);
|
||||||
@@ -197,36 +196,36 @@ public class RolloutGroupTargetsListTable extends AbstractSimpleTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setRolloutStatusIcon(final Status targetUpdateStatus, final Label statusLabel) {
|
private void setRolloutStatusIcon(final Status targetUpdateStatus, final Label statusLabel) {
|
||||||
switch (targetUpdateStatus) {
|
switch (targetUpdateStatus) {
|
||||||
case ERROR:
|
case ERROR:
|
||||||
statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
|
statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
|
||||||
statusLabel.addStyleName("statusIconRed");
|
statusLabel.addStyleName("statusIconRed");
|
||||||
break;
|
break;
|
||||||
case SCHEDULED:
|
case SCHEDULED:
|
||||||
statusLabel.setValue(FontAwesome.BULLSEYE.getHtml());
|
statusLabel.setValue(FontAwesome.BULLSEYE.getHtml());
|
||||||
statusLabel.addStyleName("statusIconBlue");
|
statusLabel.addStyleName("statusIconBlue");
|
||||||
break;
|
break;
|
||||||
case FINISHED:
|
case FINISHED:
|
||||||
statusLabel.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
statusLabel.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
||||||
statusLabel.addStyleName("statusIconGreen");
|
statusLabel.addStyleName("statusIconGreen");
|
||||||
break;
|
break;
|
||||||
case RUNNING:
|
case RUNNING:
|
||||||
case RETRIEVED:
|
case RETRIEVED:
|
||||||
case WARNING:
|
case WARNING:
|
||||||
case DOWNLOAD:
|
case DOWNLOAD:
|
||||||
statusLabel.setValue(FontAwesome.ADJUST.getHtml());
|
statusLabel.setValue(FontAwesome.ADJUST.getHtml());
|
||||||
statusLabel.addStyleName("statusIconYellow");
|
statusLabel.addStyleName("statusIconYellow");
|
||||||
break;
|
break;
|
||||||
case CANCELED:
|
case CANCELED:
|
||||||
statusLabel.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
|
statusLabel.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
|
||||||
statusLabel.addStyleName("statusIconGreen");
|
statusLabel.addStyleName("statusIconGreen");
|
||||||
break;
|
break;
|
||||||
case CANCELING:
|
case CANCELING:
|
||||||
statusLabel.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
|
statusLabel.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
|
||||||
statusLabel.addStyleName("statusIconPending");
|
statusLabel.addStyleName("statusIconPending");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public class RolloutGroupsListHeader extends AbstractSimpleTableHeader {
|
|||||||
|
|
||||||
private Label headerCaption;
|
private Label headerCaption;
|
||||||
|
|
||||||
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -71,54 +72,42 @@ public class RolloutGroupsListHeader extends AbstractSimpleTableHeader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setCaptionDetails() {
|
private void setCaptionDetails() {
|
||||||
headerCaption.setCaption(rolloutUiState.getRolloutName().isPresent() ? rolloutUiState.getRolloutName().get()
|
headerCaption
|
||||||
: "");
|
.setCaption(rolloutUiState.getRolloutName().isPresent() ? rolloutUiState.getRolloutName().get() : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchBoxId() {
|
protected String getSearchBoxId() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSearchRestIconId() {
|
protected String getSearchRestIconId() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void searchBy(final String newSearchText) {
|
protected void searchBy(final String newSearchText) {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getAddIconId() {
|
protected String getAddIconId() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addNewItem(final ClickEvent event) {
|
protected void addNewItem(final ClickEvent event) {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -129,7 +118,6 @@ public class RolloutGroupsListHeader extends AbstractSimpleTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasCreatePermission() {
|
protected boolean hasCreatePermission() {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +128,6 @@ public class RolloutGroupsListHeader extends AbstractSimpleTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean showCloseButton() {
|
protected boolean showCloseButton() {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,12 +146,6 @@ public class RolloutGroupsListHeader extends AbstractSimpleTableHeader {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.rollout.AbstractSimpleTableHeader#
|
|
||||||
* getHeaderCaptionLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected HorizontalLayout getHeaderCaptionLayout() {
|
protected HorizontalLayout getHeaderCaptionLayout() {
|
||||||
headerCaption = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_WIDGET_CAPTION);
|
headerCaption = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_WIDGET_CAPTION);
|
||||||
@@ -184,12 +165,6 @@ public class RolloutGroupsListHeader extends AbstractSimpleTableHeader {
|
|||||||
return headerCaptionLayout;
|
return headerCaptionLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.ui.rollout.AbstractSimpleTableHeader#restoreCaption()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void restoreCaption() {
|
protected void restoreCaption() {
|
||||||
setCaptionDetails();
|
setCaptionDetails();
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ public class RolloutListHeader extends AbstractSimpleTableHeader {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AddUpdateRolloutWindowLayout addUpdateRolloutWindow;
|
private AddUpdateRolloutWindowLayout addUpdateRolloutWindow;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Initialization of Target Header Component.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -101,9 +99,7 @@ public class RolloutListHeader extends AbstractSimpleTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onClose(final ClickEvent event) {
|
protected void onClose(final ClickEvent event) {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -133,16 +129,9 @@ public class RolloutListHeader extends AbstractSimpleTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isRollout() {
|
protected boolean isRollout() {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.ui.rollout.AbstractSimpleTableHeader#
|
|
||||||
* getHeaderCaptionLayout()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected HorizontalLayout getHeaderCaptionLayout() {
|
protected HorizontalLayout getHeaderCaptionLayout() {
|
||||||
final Label headerCaption = SPUIComponentProvider.getLabel(getHeaderCaption(),
|
final Label headerCaption = SPUIComponentProvider.getLabel(getHeaderCaption(),
|
||||||
@@ -153,17 +142,9 @@ public class RolloutListHeader extends AbstractSimpleTableHeader {
|
|||||||
return headerCaptionLayout;
|
return headerCaptionLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.ui.rollout.AbstractSimpleTableHeader#restoreCaption()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void restoreCaption() {
|
protected void restoreCaption() {
|
||||||
/**
|
// No implementation required.
|
||||||
* No implementation required.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user