Correct method call for getting the installed distribution sets (#460)

* Fix row highlighting

* Make Sonar happy

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2017-03-21 14:53:23 +01:00
committed by Dennis Melzer
parent 84857960cb
commit dd25af482a
3 changed files with 16 additions and 10 deletions

View File

@@ -29,11 +29,11 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleTiny;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -423,7 +423,6 @@ public class UploadConfirmationWindow implements Button.ClickListener {
errorLabel = icon;
errorLabelCount++;
}
}
}
hideErrorIcon(warningLabel, errorLabelCount, duplicateCount, errorLabel, oldFileName, currentSwId);
@@ -435,6 +434,9 @@ public class UploadConfirmationWindow implements Button.ClickListener {
final Optional<Artifact> artifactList = artifactManagement.findByFilenameAndSoftwareModule(oldFileName,
currentSwId);
if (errorLabel == null) {
return;
}
errorLabel.removeStyleName(SPUIStyleDefinitions.ERROR_LABEL);
errorLabel.setDescription(i18n.getMessage(ALREADY_EXISTS_MSG));
if (!artifactList.isPresent()) {

View File

@@ -77,6 +77,7 @@ public abstract class AbstractNotificationView extends VerticalLayout implements
getDashboardMenuItem().setNotificationUnreadValue(viewUnreadNotifcations);
}
@SuppressWarnings("squid:UnusedPrivateMethod")
private boolean noEventMatch(final TenantAwareEvent tenantAwareEvent) {
return !skipUiEventsCache.asMap().keySet().stream()
.anyMatch(uiEvent -> uiEvent.matchRemoteEvent(tenantAwareEvent));

View File

@@ -43,13 +43,13 @@ import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.targettable.TargetTable;
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
@@ -89,8 +89,9 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private boolean isDistPinned;
private Button distributinPinnedBtn;
DistributionTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final SpPermissionChecker permissionChecker,
final UINotification notification, final ManagementUIState managementUIState,
DistributionTable(final UIEventBus eventBus, final VaadinMessageSource i18n,
final SpPermissionChecker permissionChecker, final UINotification notification,
final ManagementUIState managementUIState,
final ManagementViewClientCriterion managementViewClientCriterion, final TargetManagement targetManagement,
final DsMetadataPopupLayout dsMetadataPopupLayout,
final DistributionSetManagement distributionSetManagement,
@@ -399,7 +400,8 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
if (!assignedTargets.isEmpty()) {
assignTargetToDs(getItem(distItemId), assignedTargets);
} else {
notification.displaySuccess(i18n.getMessage("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
notification.displaySuccess(
i18n.getMessage("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
}
}
@@ -460,8 +462,8 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private Boolean isNoTagButton(final String tagData, final String targetNoTagData) {
if (tagData.equals(targetNoTagData)) {
notification.displayValidationError(
i18n.getMessage("message.tag.cannot.be.assigned", new Object[] { i18n.getMessage("label.no.tag.assigned") }));
notification.displayValidationError(i18n.getMessage("message.tag.cannot.be.assigned",
new Object[] { i18n.getMessage("label.no.tag.assigned") }));
return true;
}
return false;
@@ -489,7 +491,8 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
final String distNameVersion) {
String pendActionMsg = i18n.getMessage("message.target.assigned.pending");
if (null == message) {
pendActionMsg = i18n.getMessage("message.dist.pending.action", new Object[] { controllerId, distNameVersion });
pendActionMsg = i18n.getMessage("message.dist.pending.action",
new Object[] { controllerId, distNameVersion });
}
return pendActionMsg;
}
@@ -528,7 +531,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
managementUIState.getDistributionTableFilters().getPinnedTarget().map(TargetIdName::getControllerId)
.ifPresent(controllerId -> {
final Long installedDistId = deploymentManagement.getAssignedDistributionSet(controllerId)
final Long installedDistId = deploymentManagement.getInstalledDistributionSet(controllerId)
.map(DistributionSet::getId).orElse(null);
final Long assignedDistId = deploymentManagement.getAssignedDistributionSet(controllerId)
.map(DistributionSet::getId).orElse(null);