@@ -76,6 +76,11 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
@SpringComponent
|
@SpringComponent
|
||||||
public class UploadLayout extends VerticalLayout {
|
public class UploadLayout extends VerticalLayout {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final String HTML_DIV = "</div>";
|
||||||
|
|
||||||
private static final long serialVersionUID = -566164756606779220L;
|
private static final long serialVersionUID = -566164756606779220L;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(UploadLayout.class);
|
private static final Logger LOG = LoggerFactory.getLogger(UploadLayout.class);
|
||||||
@@ -408,18 +413,12 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
return checkIfSoftwareModuleIsSelected();
|
return checkIfSoftwareModuleIsSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isFilesDropped(final DragAndDropEvent event) {
|
private static boolean isFilesDropped(final DragAndDropEvent event) {
|
||||||
if (event.getTransferable() instanceof WrapperTransferable) {
|
if (event.getTransferable() instanceof WrapperTransferable) {
|
||||||
final Html5File[] files = ((WrapperTransferable) event.getTransferable()).getFiles();
|
final Html5File[] files = ((WrapperTransferable) event.getTransferable()).getFiles();
|
||||||
// other components can also be wrapped in WrapperTransferable , so
|
return files != null;
|
||||||
// additional check on files
|
|
||||||
if (files == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean checkIfSoftwareModuleIsSelected() {
|
Boolean checkIfSoftwareModuleIsSelected() {
|
||||||
@@ -443,6 +442,8 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* file name
|
* file name
|
||||||
|
* @param selectedSoftwareModule
|
||||||
|
* the current selected sm module
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
public Boolean checkIfFileIsDuplicate(final String name, final SoftwareModule selectedSoftwareModule) {
|
public Boolean checkIfFileIsDuplicate(final String name, final SoftwareModule selectedSoftwareModule) {
|
||||||
@@ -475,7 +476,7 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
void updateActionCount() {
|
void updateActionCount() {
|
||||||
if (!artifactUploadState.getFileSelected().isEmpty()) {
|
if (!artifactUploadState.getFileSelected().isEmpty()) {
|
||||||
processBtn.setCaption(SPUILabelDefinitions.PROCESS + "<div class='unread'>"
|
processBtn.setCaption(SPUILabelDefinitions.PROCESS + "<div class='unread'>"
|
||||||
+ artifactUploadState.getFileSelected().size() + "</div>");
|
+ artifactUploadState.getFileSelected().size() + HTML_DIV);
|
||||||
} else {
|
} else {
|
||||||
processBtn.setCaption(SPUILabelDefinitions.PROCESS);
|
processBtn.setCaption(SPUILabelDefinitions.PROCESS);
|
||||||
}
|
}
|
||||||
@@ -504,6 +505,9 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
return message.toString();
|
return message.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the duplicated message.
|
||||||
|
*/
|
||||||
public void showDuplicateMessage() {
|
public void showDuplicateMessage() {
|
||||||
uiNotification.displayValidationError(getDuplicateFileValidationMessage());
|
uiNotification.displayValidationError(getDuplicateFileValidationMessage());
|
||||||
}
|
}
|
||||||
@@ -810,13 +814,13 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
final StringBuilder builder = new StringBuilder("");
|
final StringBuilder builder = new StringBuilder("");
|
||||||
if (uploadsFailed != 0) {
|
if (uploadsFailed != 0) {
|
||||||
if (uploadsPending != 0) {
|
if (uploadsPending != 0) {
|
||||||
builder.append("<div class='error-count error-count-color'>" + uploadsFailed + "</div>");
|
builder.append("<div class='error-count error-count-color'>" + uploadsFailed + HTML_DIV);
|
||||||
} else {
|
} else {
|
||||||
builder.append("<div class='unread error-count-color'>" + uploadsFailed + "</div>");
|
builder.append("<div class='unread error-count-color'>" + uploadsFailed + HTML_DIV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (uploadsPending != 0) {
|
if (uploadsPending != 0) {
|
||||||
builder.append("<div class='unread'>" + uploadsPending + "</div>");
|
builder.append("<div class='unread'>" + uploadsPending + HTML_DIV);
|
||||||
}
|
}
|
||||||
uploadStatusButton.setCaption(builder.toString());
|
uploadStatusButton.setCaption(builder.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ import org.vaadin.spring.events.EventScope;
|
|||||||
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class for target tag token layout.
|
* /** Abstract class for target tag token layout.
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the entity type
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractTargetTagToken<T extends BaseEntity> extends AbstractTagToken<T> {
|
public abstract class AbstractTargetTagToken<T extends BaseEntity> extends AbstractTagToken<T> {
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.tagdetails;
|
package org.eclipse.hawkbit.ui.common.tagdetails;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -23,7 +22,6 @@ import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult;
|
|||||||
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.vaadin.spring.events.EventScope;
|
import org.vaadin.spring.events.EventScope;
|
||||||
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
||||||
@@ -46,9 +44,6 @@ public class TargetTagToken extends AbstractTargetTagToken<Target> {
|
|||||||
// To Be Done : have to set this value based on view???
|
// To Be Done : have to set this value based on view???
|
||||||
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
|
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UINotification uinotification;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient TargetManagement targetManagement;
|
private transient TargetManagement targetManagement;
|
||||||
|
|
||||||
@@ -85,23 +80,11 @@ public class TargetTagToken extends AbstractTargetTagToken<Target> {
|
|||||||
@Override
|
@Override
|
||||||
protected void unassignTag(final String tagName) {
|
protected void unassignTag(final String tagName) {
|
||||||
final TargetTagAssignmentResult result = toggleAssignment(tagName);
|
final TargetTagAssignmentResult result = toggleAssignment(tagName);
|
||||||
if (result.getUnassigned() >= 1 && (isClickedTagListEmpty() || getClickedTagList().contains(tagName))) {
|
if (result.getUnassigned() >= 1) {
|
||||||
eventBus.publish(this, ManagementUIEvent.UNASSIGN_TARGET_TAG);
|
eventBus.publish(this, ManagementUIEvent.UNASSIGN_TARGET_TAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean isClickedTagListEmpty() {
|
|
||||||
if (getClickedTagList() == null || getClickedTagList() != null && !getClickedTagList().isEmpty()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* To Be Done : this implementation will vary in views */
|
|
||||||
private List<String> getClickedTagList() {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isToggleTagAssignmentAllowed() {
|
protected Boolean isToggleTagAssignmentAllowed() {
|
||||||
return checker.hasUpdateTargetPermission();
|
return checker.hasUpdateTargetPermission();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
|
|||||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonDecorator;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonDecorator;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIComboBoxDecorator;
|
import org.eclipse.hawkbit.ui.decorators.SPUIComboBoxDecorator;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIHeaderLayoutDecorator;
|
import org.eclipse.hawkbit.ui.decorators.HeaderLayoutDecorator;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUILabelDecorator;
|
import org.eclipse.hawkbit.ui.decorators.SPUILabelDecorator;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUITextAreaDecorator;
|
import org.eclipse.hawkbit.ui.decorators.SPUITextAreaDecorator;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUITextFieldDecorator;
|
import org.eclipse.hawkbit.ui.decorators.SPUITextFieldDecorator;
|
||||||
@@ -104,7 +104,7 @@ public final class SPUIComponentProvider {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static HorizontalLayout getHeaderLayout(
|
public static HorizontalLayout getHeaderLayout(
|
||||||
final Class<? extends SPUIHeaderLayoutDecorator> tableHeaderLayoutDecorator) {
|
final Class<? extends HeaderLayoutDecorator> tableHeaderLayoutDecorator) {
|
||||||
// Do we really need this???
|
// Do we really need this???
|
||||||
HorizontalLayout hLayout = getHorizontalLayout(new SPUIHorizontalLayout().getUiHorizontalLayout().getClass());
|
HorizontalLayout hLayout = getHorizontalLayout(new SPUIHorizontalLayout().getUiHorizontalLayout().getClass());
|
||||||
|
|
||||||
@@ -113,11 +113,11 @@ public final class SPUIComponentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final SPUIHeaderLayoutDecorator layoutDecorator = tableHeaderLayoutDecorator.newInstance();
|
final HeaderLayoutDecorator layoutDecorator = tableHeaderLayoutDecorator.newInstance();
|
||||||
hLayout = layoutDecorator.decorate(hLayout);
|
hLayout = layoutDecorator.decorate(hLayout);
|
||||||
|
|
||||||
} catch (final InstantiationException | IllegalAccessException exception) {
|
} catch (final InstantiationException | IllegalAccessException exception) {
|
||||||
LOG.error("Error occured while creating horizontal decorator " + SPUIHeaderLayoutDecorator.class,
|
LOG.error("Error occured while creating horizontal decorator " + HeaderLayoutDecorator.class,
|
||||||
exception);
|
exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,13 +13,17 @@ import com.vaadin.ui.HorizontalLayout;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
* Ui header layout decorater.
|
||||||
*/
|
*/
|
||||||
public interface SPUIHeaderLayoutDecorator {
|
@FunctionalInterface
|
||||||
|
public interface HeaderLayoutDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* decorate the header
|
||||||
|
*
|
||||||
* @param layout
|
* @param layout
|
||||||
* @return
|
* the layout
|
||||||
|
* @return the decorated layout
|
||||||
*/
|
*/
|
||||||
HorizontalLayout decorate(HorizontalLayout layout);
|
HorizontalLayout decorate(HorizontalLayout layout);
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ import com.vaadin.ui.Button;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@FunctionalInterface
|
||||||
public interface SPUIButtonDecorator {
|
public interface SPUIButtonDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
package org.eclipse.hawkbit.ui.distributions.disttype;
|
package org.eclipse.hawkbit.ui.distributions.disttype;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
@@ -27,8 +26,6 @@ import org.eclipse.hawkbit.ui.layouts.CreateUpdateTypeLayout;
|
|||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
@@ -59,8 +56,6 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5169398523815877767L;
|
private static final long serialVersionUID = -5169398523815877767L;
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(CreateUpdateDistSetTypeLayout.class);
|
|
||||||
|
|
||||||
private static final String DIST_TYPE_NAME = "name";
|
private static final String DIST_TYPE_NAME = "name";
|
||||||
private static final String DIST_TYPE_DESCRIPTION = "description";
|
private static final String DIST_TYPE_DESCRIPTION = "description";
|
||||||
private static final String DIST_TYPE_MANDATORY = "mandatory";
|
private static final String DIST_TYPE_MANDATORY = "mandatory";
|
||||||
@@ -84,8 +79,6 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
|||||||
|
|
||||||
private IndexedContainer originalSelectedTableContainer;
|
private IndexedContainer originalSelectedTableContainer;
|
||||||
|
|
||||||
private Map<CheckBox, Boolean> mandatoryCheckboxMap;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createRequiredComponents() {
|
protected void createRequiredComponents() {
|
||||||
|
|
||||||
@@ -152,9 +145,9 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
|||||||
twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT);
|
twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT);
|
||||||
twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER);
|
twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER);
|
||||||
twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT);
|
twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT);
|
||||||
twinColumnLayout.setExpandRatio(sourceTable, 0.45f);
|
twinColumnLayout.setExpandRatio(sourceTable, 0.45F);
|
||||||
twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07f);
|
twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07F);
|
||||||
twinColumnLayout.setExpandRatio(selectedTable, 0.48f);
|
twinColumnLayout.setExpandRatio(selectedTable, 0.48F);
|
||||||
sourceTable.setVisibleColumns(new Object[] { DIST_TYPE_NAME });
|
sourceTable.setVisibleColumns(new Object[] { DIST_TYPE_NAME });
|
||||||
return twinColumnLayout;
|
return twinColumnLayout;
|
||||||
}
|
}
|
||||||
@@ -226,7 +219,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
|||||||
|
|
||||||
sourceTable.setVisibleColumns(new Object[] { DIST_TYPE_NAME });
|
sourceTable.setVisibleColumns(new Object[] { DIST_TYPE_NAME });
|
||||||
sourceTable.setColumnHeaders(i18n.get("header.dist.twintable.available"));
|
sourceTable.setColumnHeaders(i18n.get("header.dist.twintable.available"));
|
||||||
sourceTable.setColumnExpandRatio(DIST_TYPE_NAME, 1.0f);
|
sourceTable.setColumnExpandRatio(DIST_TYPE_NAME, 1.0F);
|
||||||
getSourceTableData();
|
getSourceTableData();
|
||||||
addTooltip();
|
addTooltip();
|
||||||
sourceTable.select(sourceTable.firstItemId());
|
sourceTable.select(sourceTable.firstItemId());
|
||||||
@@ -413,7 +406,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkMandatoryAndAddMandatoryModuleType(final DistributionSetType updateDistSetType,
|
private static void checkMandatoryAndAddMandatoryModuleType(final DistributionSetType updateDistSetType,
|
||||||
final Boolean isMandatory, final SoftwareModuleType swModuleType) {
|
final Boolean isMandatory, final SoftwareModuleType swModuleType) {
|
||||||
if (isMandatory) {
|
if (isMandatory) {
|
||||||
updateDistSetType.addMandatoryModuleType(swModuleType);
|
updateDistSetType.addMandatoryModuleType(swModuleType);
|
||||||
@@ -488,7 +481,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private LazyQueryContainer getDistSetTypeLazyQueryContainer() {
|
private static LazyQueryContainer getDistSetTypeLazyQueryContainer() {
|
||||||
|
|
||||||
final LazyQueryContainer disttypeContainer = HawkbitCommonUtil.createLazyQueryContainer(
|
final LazyQueryContainer disttypeContainer = HawkbitCommonUtil.createLazyQueryContainer(
|
||||||
new BeanQueryFactory<DistributionSetTypeBeanQuery>(DistributionSetTypeBeanQuery.class));
|
new BeanQueryFactory<DistributionSetTypeBeanQuery>(DistributionSetTypeBeanQuery.class));
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ package org.eclipse.hawkbit.ui.filter;
|
|||||||
* mechanism. The filter expression can evaluate if e.g. Targets should
|
* mechanism. The filter expression can evaluate if e.g. Targets should
|
||||||
* currently be added to the target list or if the current enabled filtered will
|
* currently be added to the target list or if the current enabled filtered will
|
||||||
* filter the target and not show the newly created target.
|
* filter the target and not show the newly created target.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@FunctionalInterface
|
||||||
public interface FilterExpression {
|
public interface FilterExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
|||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
@@ -83,9 +82,7 @@ public class BulkUploadHandler extends CustomComponent
|
|||||||
private final transient DeploymentManagement deploymentManagement;
|
private final transient DeploymentManagement deploymentManagement;
|
||||||
private final transient DistributionSetManagement distributionSetManagement;
|
private final transient DistributionSetManagement distributionSetManagement;
|
||||||
|
|
||||||
private final UINotification uINotification;
|
protected File tempFile;
|
||||||
|
|
||||||
protected File tempFile = null;
|
|
||||||
private Upload upload;
|
private Upload upload;
|
||||||
|
|
||||||
private final ProgressBar progressBar;
|
private final ProgressBar progressBar;
|
||||||
@@ -93,8 +90,8 @@ public class BulkUploadHandler extends CustomComponent
|
|||||||
private final TargetBulkTokenTags targetBulkTokenTags;
|
private final TargetBulkTokenTags targetBulkTokenTags;
|
||||||
|
|
||||||
private final Label targetsCountLabel;
|
private final Label targetsCountLabel;
|
||||||
private long failedTargetCount = 0;
|
private long failedTargetCount;
|
||||||
private long successfullTargetCount = 0;
|
private long successfullTargetCount;
|
||||||
|
|
||||||
private final transient Executor executor;
|
private final transient Executor executor;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
private transient EventBus.SessionEventBus eventBus;
|
||||||
@@ -109,12 +106,11 @@ public class BulkUploadHandler extends CustomComponent
|
|||||||
* @param targetManagement
|
* @param targetManagement
|
||||||
* @param managementUIState
|
* @param managementUIState
|
||||||
* @param deploymentManagement
|
* @param deploymentManagement
|
||||||
* @param uINotification
|
|
||||||
* @param i18n
|
* @param i18n
|
||||||
*/
|
*/
|
||||||
public BulkUploadHandler(final TargetBulkUpdateWindowLayout targetBulkUpdateWindowLayout,
|
public BulkUploadHandler(final TargetBulkUpdateWindowLayout targetBulkUpdateWindowLayout,
|
||||||
final TargetManagement targetManagement, final ManagementUIState managementUIState,
|
final TargetManagement targetManagement, final ManagementUIState managementUIState,
|
||||||
final DeploymentManagement deploymentManagement, final UINotification uINotification, final I18N i18n) {
|
final DeploymentManagement deploymentManagement, final I18N i18n) {
|
||||||
this.targetBulkUpdateWindowLayout = targetBulkUpdateWindowLayout;
|
this.targetBulkUpdateWindowLayout = targetBulkUpdateWindowLayout;
|
||||||
this.comboBox = targetBulkUpdateWindowLayout.getDsNamecomboBox();
|
this.comboBox = targetBulkUpdateWindowLayout.getDsNamecomboBox();
|
||||||
this.descTextArea = targetBulkUpdateWindowLayout.getDescTextArea();
|
this.descTextArea = targetBulkUpdateWindowLayout.getDescTextArea();
|
||||||
@@ -122,7 +118,6 @@ public class BulkUploadHandler extends CustomComponent
|
|||||||
this.progressBar = targetBulkUpdateWindowLayout.getProgressBar();
|
this.progressBar = targetBulkUpdateWindowLayout.getProgressBar();
|
||||||
this.managementUIState = managementUIState;
|
this.managementUIState = managementUIState;
|
||||||
this.deploymentManagement = deploymentManagement;
|
this.deploymentManagement = deploymentManagement;
|
||||||
this.uINotification = uINotification;
|
|
||||||
this.targetsCountLabel = targetBulkUpdateWindowLayout.getTargetsCountLabel();
|
this.targetsCountLabel = targetBulkUpdateWindowLayout.getTargetsCountLabel();
|
||||||
this.targetBulkTokenTags = targetBulkUpdateWindowLayout.getTargetBulkTokenTags();
|
this.targetBulkTokenTags = targetBulkUpdateWindowLayout.getTargetBulkTokenTags();
|
||||||
this.i18n = i18n;
|
this.i18n = i18n;
|
||||||
@@ -396,7 +391,7 @@ public class BulkUploadHandler extends CustomComponent
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTargetValues(final Target target, final String name, final String description) {
|
private static void setTargetValues(final Target target, final String name, final String description) {
|
||||||
if (null == name) {
|
if (null == name) {
|
||||||
target.setName(target.getControllerId());
|
target.setName(target.getControllerId());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
private BulkUploadHandler getBulkUploadHandler() {
|
private BulkUploadHandler getBulkUploadHandler() {
|
||||||
final BulkUploadHandler bulkUploadHandler = new BulkUploadHandler(this, targetManagement, managementUIState,
|
final BulkUploadHandler bulkUploadHandler = new BulkUploadHandler(this, targetManagement, managementUIState,
|
||||||
deploymentManagement, uINotification, i18n);
|
deploymentManagement, i18n);
|
||||||
bulkUploadHandler.buildLayout();
|
bulkUploadHandler.buildLayout();
|
||||||
bulkUploadHandler.addStyleName(SPUIStyleDefinitions.BULK_UPLOAD_BUTTON);
|
bulkUploadHandler.addStyleName(SPUIStyleDefinitions.BULK_UPLOAD_BUTTON);
|
||||||
return bulkUploadHandler;
|
return bulkUploadHandler;
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
@UIScope
|
@UIScope
|
||||||
public final class DashboardMenu extends CustomComponent {
|
public final class DashboardMenu extends CustomComponent {
|
||||||
|
|
||||||
|
private static final String STYLE_VISIBLE = "valo-menu-visible";
|
||||||
|
public static final String ID = "dashboard-menu";
|
||||||
|
public static final String REPORTS_BADGE_ID = "dashboard-menu-reports-badge";
|
||||||
|
public static final String NOTIFICATIONS_BADGE_ID = "dashboard-menu-notifications-badge";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private I18N i18n;
|
private I18N i18n;
|
||||||
|
|
||||||
@@ -67,11 +72,6 @@ public final class DashboardMenu extends CustomComponent {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 5394474618559481462L;
|
private static final long serialVersionUID = 5394474618559481462L;
|
||||||
|
|
||||||
public static final String ID = "dashboard-menu";
|
|
||||||
public static final String REPORTS_BADGE_ID = "dashboard-menu-reports-badge";
|
|
||||||
public static final String NOTIFICATIONS_BADGE_ID = "dashboard-menu-notifications-badge";
|
|
||||||
private static final String STYLE_VISIBLE = "valo-menu-visible";
|
|
||||||
|
|
||||||
// this should be resolved when we introduce event bus on UI to just inform
|
// this should be resolved when we introduce event bus on UI to just inform
|
||||||
// the buttons directly via events
|
// the buttons directly via events
|
||||||
private final List<ValoMenuItemButton> menuButtons = new ArrayList<>();
|
private final List<ValoMenuItemButton> menuButtons = new ArrayList<>();
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
||||||
@@ -80,8 +78,6 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 2999293468801479916L;
|
private static final long serialVersionUID = 2999293468801479916L;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(AddUpdateRolloutWindowLayout.class);
|
|
||||||
|
|
||||||
private static final String MESSAGE_ROLLOUT_FIELD_VALUE_RANGE = "message.rollout.field.value.range";
|
private static final String MESSAGE_ROLLOUT_FIELD_VALUE_RANGE = "message.rollout.field.value.range";
|
||||||
|
|
||||||
private static final String MESSAGE_ENTER_NUMBER = "message.enter.number";
|
private static final String MESSAGE_ENTER_NUMBER = "message.enter.number";
|
||||||
@@ -154,6 +150,13 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
|||||||
buildLayout();
|
buildLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the window.
|
||||||
|
*
|
||||||
|
* @param rolloutId
|
||||||
|
* the rollout id
|
||||||
|
* @return the window
|
||||||
|
*/
|
||||||
public CommonDialogWindow getWindow(final Long rolloutId) {
|
public CommonDialogWindow getWindow(final Long rolloutId) {
|
||||||
window = getWindow();
|
window = getWindow();
|
||||||
populateData(rolloutId);
|
populateData(rolloutId);
|
||||||
|
|||||||
Reference in New Issue
Block a user