Removed dependency injection where not necessary
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -10,10 +10,13 @@ package org.eclipse.hawkbit.app;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.ui.login.HawkbitLoginUI;
|
import org.eclipse.hawkbit.ui.login.HawkbitLoginUI;
|
||||||
import org.eclipse.hawkbit.ui.themes.HawkbitTheme;
|
import org.eclipse.hawkbit.ui.themes.HawkbitTheme;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
import com.vaadin.annotations.Theme;
|
import com.vaadin.annotations.Theme;
|
||||||
import com.vaadin.annotations.Title;
|
import com.vaadin.annotations.Title;
|
||||||
import com.vaadin.spring.annotation.SpringUI;
|
import com.vaadin.spring.annotation.SpringUI;
|
||||||
|
import com.vaadin.spring.navigator.SpringViewProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example hawkBit login UI implementation.
|
* Example hawkBit login UI implementation.
|
||||||
@@ -31,4 +34,9 @@ public class MyLoginUI extends HawkbitLoginUI {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected MyLoginUI(final SpringViewProvider viewProvider, final ApplicationContext context) {
|
||||||
|
super(viewProvider, context);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ package org.eclipse.hawkbit.app;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
||||||
import org.vaadin.spring.events.EventBus.SessionEventBus;
|
|
||||||
|
|
||||||
import com.vaadin.annotations.Push;
|
import com.vaadin.annotations.Push;
|
||||||
import com.vaadin.annotations.Theme;
|
import com.vaadin.annotations.Theme;
|
||||||
@@ -43,7 +42,7 @@ public class MyUI extends HawkbitUI {
|
|||||||
* @param eventBus
|
* @param eventBus
|
||||||
* the event bus
|
* the event bus
|
||||||
*/
|
*/
|
||||||
public MyUI(final EventPushStrategy pushStrategy, final SessionEventBus eventBus) {
|
public MyUI(final EventPushStrategy pushStrategy) {
|
||||||
super(pushStrategy, eventBus);
|
super(pushStrategy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ package org.eclipse.hawkbit.app;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.ui.login.HawkbitLoginUI;
|
import org.eclipse.hawkbit.ui.login.HawkbitLoginUI;
|
||||||
import org.eclipse.hawkbit.ui.themes.HawkbitTheme;
|
import org.eclipse.hawkbit.ui.themes.HawkbitTheme;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringUI;
|
import com.vaadin.spring.annotation.SpringUI;
|
||||||
|
import com.vaadin.spring.navigator.SpringViewProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example hawkBit login UI implementation.
|
* Example hawkBit login UI implementation.
|
||||||
@@ -27,6 +30,11 @@ import com.vaadin.spring.annotation.SpringUI;
|
|||||||
@SuppressWarnings({ "squid:MaximumInheritanceDepth" })
|
@SuppressWarnings({ "squid:MaximumInheritanceDepth" })
|
||||||
public class MyLoginUI extends HawkbitLoginUI {
|
public class MyLoginUI extends HawkbitLoginUI {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected MyLoginUI(final SpringViewProvider viewProvider, final ApplicationContext context) {
|
||||||
|
super(viewProvider, context);
|
||||||
|
}
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ package org.eclipse.hawkbit.app;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
||||||
import org.vaadin.spring.events.EventBus.SessionEventBus;
|
|
||||||
|
|
||||||
import com.vaadin.annotations.Push;
|
import com.vaadin.annotations.Push;
|
||||||
import com.vaadin.shared.communication.PushMode;
|
import com.vaadin.shared.communication.PushMode;
|
||||||
@@ -41,8 +40,8 @@ public class MyUI extends HawkbitUI {
|
|||||||
* @param eventBus
|
* @param eventBus
|
||||||
* the event bus
|
* the event bus
|
||||||
*/
|
*/
|
||||||
public MyUI(final EventPushStrategy pushStrategy, final SessionEventBus eventBus) {
|
public MyUI(final EventPushStrategy pushStrategy) {
|
||||||
super(pushStrategy, eventBus);
|
super(pushStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,9 +69,6 @@ public class ConfigurableScenario {
|
|||||||
|
|
||||||
private final MgmtSoftwareModuleClientResource uploadSoftwareModule;
|
private final MgmtSoftwareModuleClientResource uploadSoftwareModule;
|
||||||
|
|
||||||
// Exception - squid:S00107 - this is a simulator that leverages multiple
|
|
||||||
// resouces/feign beans.
|
|
||||||
@SuppressWarnings("squid:S00107")
|
|
||||||
public ConfigurableScenario(final MgmtDistributionSetClientResource distributionSetResource,
|
public ConfigurableScenario(final MgmtDistributionSetClientResource distributionSetResource,
|
||||||
final MgmtSoftwareModuleClientResource softwareModuleResource,
|
final MgmtSoftwareModuleClientResource softwareModuleResource,
|
||||||
final MgmtSoftwareModuleClientResource uploadSoftwareModule, final MgmtTargetClientResource targetResource,
|
final MgmtSoftwareModuleClientResource uploadSoftwareModule, final MgmtTargetClientResource targetResource,
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.autoconfigure.ui;
|
package org.eclipse.hawkbit.autoconfigure.ui;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.DistributedResourceBundleMessageSource;
|
import org.eclipse.hawkbit.DistributedResourceBundleMessageSource;
|
||||||
import org.eclipse.hawkbit.ui.push.DelayedEventBusPushStrategy;
|
import org.eclipse.hawkbit.ui.push.DelayedEventBusPushStrategy;
|
||||||
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
||||||
@@ -18,6 +20,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.vaadin.spring.annotation.EnableVaadinExtensions;
|
import org.vaadin.spring.annotation.EnableVaadinExtensions;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
import org.vaadin.spring.events.annotation.EnableEventBus;
|
import org.vaadin.spring.events.annotation.EnableEventBus;
|
||||||
import org.vaadin.spring.security.annotation.EnableVaadinSecurity;
|
import org.vaadin.spring.security.annotation.EnableVaadinSecurity;
|
||||||
|
|
||||||
@@ -65,8 +68,11 @@ public class UIAutoConfiguration {
|
|||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean
|
@ConditionalOnMissingBean
|
||||||
@UIScope
|
@UIScope
|
||||||
public EventPushStrategy eventPushStrategy(final ConfigurableApplicationContext applicationContext) {
|
public EventPushStrategy eventPushStrategy(final ConfigurableApplicationContext applicationContext,
|
||||||
final DelayedEventBusPushStrategy delayedEventBusPushStrategy = new DelayedEventBusPushStrategy();
|
final ScheduledExecutorService executorService, final UIEventBus eventBus,
|
||||||
|
final UIEventProvider eventProvider) {
|
||||||
|
final DelayedEventBusPushStrategy delayedEventBusPushStrategy = new DelayedEventBusPushStrategy(executorService,
|
||||||
|
eventBus, eventProvider);
|
||||||
applicationContext.addApplicationListener(delayedEventBusPushStrategy);
|
applicationContext.addApplicationListener(delayedEventBusPushStrategy);
|
||||||
return delayedEventBusPushStrategy;
|
return delayedEventBusPushStrategy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit;
|
package org.eclipse.hawkbit;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
|
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.context.EnvironmentAware;
|
import org.springframework.context.EnvironmentAware;
|
||||||
@@ -25,7 +27,8 @@ import org.springframework.stereotype.Component;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(prefix = "hawkbit.controller")
|
@ConfigurationProperties(prefix = "hawkbit.controller")
|
||||||
public class ControllerPollProperties {
|
public class ControllerPollProperties implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum polling time that can be configured by a tenant in HH:MM:SS
|
* Maximum polling time that can be configured by a tenant in HH:MM:SS
|
||||||
|
|||||||
@@ -14,23 +14,22 @@ import org.eclipse.hawkbit.im.authentication.PermissionService;
|
|||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean which contains all SP permissions.
|
* Bean which contains all SP permissions.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Validated
|
|
||||||
@Service
|
@Service
|
||||||
public class SpPermissionChecker implements Serializable {
|
public class SpPermissionChecker implements Serializable {
|
||||||
private static final long serialVersionUID = 2757865286212875704L;
|
private static final long serialVersionUID = 2757865286212875704L;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient PermissionService permissionService;
|
private transient PermissionService permissionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SpPermissionChecker(final PermissionService permissionService) {
|
||||||
|
this.permissionService = permissionService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the SP monitor View Permission.
|
* Gets the SP monitor View Permission.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -32,23 +32,22 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
*
|
*
|
||||||
* @see Navigator#setErrorView(Class)
|
* @see Navigator#setErrorView(Class)
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@UIScope
|
@UIScope
|
||||||
class ErrorView extends VerticalLayout implements View {
|
class ErrorView extends VerticalLayout implements View {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final Label message;
|
private final Label message;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
private final DashboardMenu dashboardMenu;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DashboardMenu dashboardMenu;
|
ErrorView(final I18N i18n, final DashboardMenu dashboardMenu) {
|
||||||
|
this.i18n = i18n;
|
||||||
/**
|
this.dashboardMenu = dashboardMenu;
|
||||||
* Constructor.
|
|
||||||
*/
|
|
||||||
public ErrorView() {
|
|
||||||
setMargin(true);
|
setMargin(true);
|
||||||
message = new Label();
|
message = new Label();
|
||||||
addComponent(message);
|
addComponent(message);
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ public class HawkbitUI extends DefaultHawkbitUI implements DetachListener {
|
|||||||
|
|
||||||
private transient EventPushStrategy pushStrategy;
|
private transient EventPushStrategy pushStrategy;
|
||||||
|
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
@Autowired
|
||||||
|
protected transient EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SpringViewProvider viewProvider;
|
private SpringViewProvider viewProvider;
|
||||||
@@ -80,23 +81,13 @@ public class HawkbitUI extends DefaultHawkbitUI implements DetachListener {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ErrorView errorview;
|
private ErrorView errorview;
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
public HawkbitUI(final EventBus.SessionEventBus eventBus) {
|
|
||||||
this.eventBus = eventBus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor taking the push strategy.
|
* Constructor taking the push strategy.
|
||||||
*
|
*
|
||||||
* @param pushStrategy
|
* @param pushStrategy
|
||||||
* the strategy to push events from the backend to the UI
|
* the strategy to push events from the backend to the UI
|
||||||
*/
|
*/
|
||||||
@Autowired
|
public HawkbitUI(final EventPushStrategy pushStrategy) {
|
||||||
public HawkbitUI(final EventPushStrategy pushStrategy, final EventBus.SessionEventBus eventBus) {
|
|
||||||
this(eventBus);
|
|
||||||
this.pushStrategy = pushStrategy;
|
this.pushStrategy = pushStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui;
|
package org.eclipse.hawkbit.ui;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -17,13 +19,15 @@ import org.springframework.stereotype.Component;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties("hawkbit.server.ui")
|
@ConfigurationProperties("hawkbit.server.ui")
|
||||||
public class UiProperties {
|
public class UiProperties implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demo account login information.
|
* Demo account login information.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static class Demo {
|
public static class Demo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demo tenant.
|
* Demo tenant.
|
||||||
@@ -72,12 +76,15 @@ public class UiProperties {
|
|||||||
* documentation etc.).
|
* documentation etc.).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static class Links {
|
public static class Links implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration of UI documentation links.
|
* Configuration of UI documentation links.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static class Documentation {
|
public static class Documentation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
/**
|
/**
|
||||||
* Link to root of documentation and user guides.
|
* Link to root of documentation and user guides.
|
||||||
*/
|
*/
|
||||||
@@ -235,13 +242,15 @@ public class UiProperties {
|
|||||||
* Configuration of login view.
|
* Configuration of login view.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static class Login {
|
public static class Login implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cookie configuration for login credential cookie.
|
* Cookie configuration for login credential cookie.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static class Cookie {
|
public static class Cookie implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
/**
|
/**
|
||||||
* Secure cookie enabled.
|
* Secure cookie enabled.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -8,13 +8,18 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.artifacts;
|
package org.eclipse.hawkbit.ui.artifacts;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.details.ArtifactDetailsLayout;
|
import org.eclipse.hawkbit.ui.artifacts.details.ArtifactDetailsLayout;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.ArtifactDetailsEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.ArtifactDetailsEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.footer.SMDeleteActionsLayout;
|
import org.eclipse.hawkbit.ui.artifacts.footer.SMDeleteActionsLayout;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleTableLayout;
|
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleTableLayout;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.smtype.SMTypeFilterLayout;
|
import org.eclipse.hawkbit.ui.artifacts.smtype.SMTypeFilterLayout;
|
||||||
@@ -25,8 +30,10 @@ import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
|||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.eclipse.hawkbit.util.SPInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -57,35 +64,25 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
|
|||||||
public static final String VIEW_NAME = "spUpload";
|
public static final String VIEW_NAME = "spUpload";
|
||||||
private static final long serialVersionUID = 8754632011301553682L;
|
private static final long serialVersionUID = 8754632011301553682L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permChecker;
|
||||||
private SpPermissionChecker permChecker;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uiNotification;
|
||||||
private transient UINotification uiNotification;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SMTypeFilterLayout filterByTypeLayout;
|
||||||
private SMTypeFilterLayout filterByTypeLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleTableLayout smTableLayout;
|
||||||
private SoftwareModuleTableLayout smTableLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactDetailsLayout artifactDetailsLayout;
|
||||||
private ArtifactDetailsLayout artifactDetailsLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final UploadLayout uploadLayout;
|
||||||
private UploadLayout uploadLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final SMDeleteActionsLayout deleteActionsLayout;
|
||||||
private SMDeleteActionsLayout deleteActionsLayout;
|
|
||||||
|
|
||||||
private VerticalLayout detailAndUploadLayout;
|
private VerticalLayout detailAndUploadLayout;
|
||||||
|
|
||||||
@@ -94,8 +91,29 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
|
|||||||
private GridLayout mainLayout;
|
private GridLayout mainLayout;
|
||||||
private DragAndDropWrapper dadw;
|
private DragAndDropWrapper dadw;
|
||||||
|
|
||||||
@Override
|
@Autowired
|
||||||
public void enter(final ViewChangeEvent event) {
|
UploadArtifactView(final UIEventBus eventBus, final SpPermissionChecker permChecker, final I18N i18n,
|
||||||
|
final UINotification uiNotification, final ArtifactUploadState artifactUploadState,
|
||||||
|
final TagManagement tagManagement, final EntityFactory entityFactory,
|
||||||
|
final SoftwareManagement softwareManagement, final UploadViewAcceptCriteria uploadViewAcceptCriteria,
|
||||||
|
final SPInfo spInfo) {
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.permChecker = permChecker;
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uiNotification = uiNotification;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.filterByTypeLayout = new SMTypeFilterLayout(artifactUploadState, i18n, permChecker, eventBus,
|
||||||
|
tagManagement, entityFactory, uiNotification, softwareManagement, uploadViewAcceptCriteria);
|
||||||
|
this.smTableLayout = new SoftwareModuleTableLayout(i18n, permChecker, artifactUploadState, uiNotification,
|
||||||
|
eventBus, softwareManagement, entityFactory, uploadViewAcceptCriteria);
|
||||||
|
this.artifactDetailsLayout = new ArtifactDetailsLayout(i18n, eventBus, artifactUploadState, uiNotification);
|
||||||
|
this.uploadLayout = new UploadLayout(i18n, uiNotification, eventBus, artifactUploadState, spInfo);
|
||||||
|
this.deleteActionsLayout = new SMDeleteActionsLayout(i18n, permChecker, eventBus, uiNotification,
|
||||||
|
artifactUploadState, softwareManagement, uploadViewAcceptCriteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
void init() {
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
restoreState();
|
||||||
checkNoDataAvaialble();
|
checkNoDataAvaialble();
|
||||||
@@ -109,7 +127,7 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
|
|||||||
eventBus.unsubscribe(this);
|
eventBus.unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent event) {
|
void onEvent(final SoftwareModuleEvent event) {
|
||||||
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
||||||
minimizeSwTable();
|
minimizeSwTable();
|
||||||
@@ -118,7 +136,7 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final ArtifactDetailsEvent event) {
|
void onEvent(final ArtifactDetailsEvent event) {
|
||||||
if (event == ArtifactDetailsEvent.MINIMIZED) {
|
if (event == ArtifactDetailsEvent.MINIMIZED) {
|
||||||
minimizeArtifactoryDetails();
|
minimizeArtifactoryDetails();
|
||||||
@@ -272,4 +290,9 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enter(final ViewChangeEvent event) {
|
||||||
|
// This view is constructed in the init() method()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.ArtifactDetailsEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.ArtifactDetailsEvent;
|
||||||
@@ -37,11 +34,11 @@ 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.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -50,8 +47,6 @@ import com.google.common.collect.Maps;
|
|||||||
import com.vaadin.data.Container;
|
import com.vaadin.data.Container;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.HorizontalLayout;
|
import com.vaadin.ui.HorizontalLayout;
|
||||||
@@ -65,12 +60,7 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the details of the artifacts for a selected software module.
|
* Display the details of the artifacts for a selected software module.
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class ArtifactDetailsLayout extends VerticalLayout {
|
public class ArtifactDetailsLayout extends VerticalLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5189069028037133891L;
|
private static final long serialVersionUID = -5189069028037133891L;
|
||||||
@@ -91,17 +81,13 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
|
|
||||||
private static final String MD5HASH = "md5Hash";
|
private static final String MD5HASH = "md5Hash";
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uINotification;
|
||||||
private transient UINotification uINotification;
|
|
||||||
|
|
||||||
private Label titleOfArtifactDetails;
|
private Label titleOfArtifactDetails;
|
||||||
|
|
||||||
@@ -111,15 +97,17 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
|
|
||||||
private Table maxArtifactDetailsTable;
|
private Table maxArtifactDetailsTable;
|
||||||
|
|
||||||
private boolean fullWindowMode = false;
|
private boolean fullWindowMode;
|
||||||
|
|
||||||
private boolean readOnly = false;
|
private boolean readOnly;
|
||||||
|
|
||||||
|
public ArtifactDetailsLayout(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final ArtifactUploadState artifactUploadState, final UINotification uINotification) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.uINotification = uINotification;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the artifact details layout.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
private void init() {
|
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
@@ -140,9 +128,9 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
* @param readOnly
|
* @param readOnly
|
||||||
* value true for read only.
|
* value true for read only.
|
||||||
*/
|
*/
|
||||||
|
// TODO kaizimmerm: fix this
|
||||||
public void init(final boolean readOnly) {
|
public void init(final boolean readOnly) {
|
||||||
this.readOnly = readOnly;
|
this.readOnly = readOnly;
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createComponents() {
|
private void createComponents() {
|
||||||
@@ -192,7 +180,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
header.addComponents(titleOfArtifactDetails, maxMinButton);
|
header.addComponents(titleOfArtifactDetails, maxMinButton);
|
||||||
header.setComponentAlignment(titleOfArtifactDetails, Alignment.TOP_LEFT);
|
header.setComponentAlignment(titleOfArtifactDetails, Alignment.TOP_LEFT);
|
||||||
header.setComponentAlignment(maxMinButton, Alignment.TOP_RIGHT);
|
header.setComponentAlignment(maxMinButton, Alignment.TOP_RIGHT);
|
||||||
header.setExpandRatio(titleOfArtifactDetails, 1.0f);
|
header.setExpandRatio(titleOfArtifactDetails, 1.0F);
|
||||||
|
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
@@ -202,7 +190,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
setComponentAlignment(header, Alignment.MIDDLE_CENTER);
|
setComponentAlignment(header, Alignment.MIDDLE_CENTER);
|
||||||
addComponent(artifactDetailsTable);
|
addComponent(artifactDetailsTable);
|
||||||
setComponentAlignment(artifactDetailsTable, Alignment.MIDDLE_CENTER);
|
setComponentAlignment(artifactDetailsTable, Alignment.MIDDLE_CENTER);
|
||||||
setExpandRatio(artifactDetailsTable, 1.0f);
|
setExpandRatio(artifactDetailsTable, 1.0F);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,15 +296,15 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
table.setColumnHeader(ACTION, i18n.get("upload.action"));
|
table.setColumnHeader(ACTION, i18n.get("upload.action"));
|
||||||
}
|
}
|
||||||
|
|
||||||
table.setColumnExpandRatio(PROVIDED_FILE_NAME, 3.5f);
|
table.setColumnExpandRatio(PROVIDED_FILE_NAME, 3.5F);
|
||||||
table.setColumnExpandRatio(SIZE, 2f);
|
table.setColumnExpandRatio(SIZE, 2f);
|
||||||
if (fullWindowMode) {
|
if (fullWindowMode) {
|
||||||
table.setColumnExpandRatio(SHA1HASH, 2.8f);
|
table.setColumnExpandRatio(SHA1HASH, 2.8F);
|
||||||
table.setColumnExpandRatio(MD5HASH, 2.4f);
|
table.setColumnExpandRatio(MD5HASH, 2.4F);
|
||||||
}
|
}
|
||||||
table.setColumnExpandRatio(CREATE_MODIFIED_DATE_UPLOAD, 3f);
|
table.setColumnExpandRatio(CREATE_MODIFIED_DATE_UPLOAD, 3F);
|
||||||
if (!readOnly) {
|
if (!readOnly) {
|
||||||
table.setColumnExpandRatio(ACTION, 2.5f);
|
table.setColumnExpandRatio(ACTION, 2.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
table.setVisibleColumns(getVisbleColumns().toArray());
|
table.setVisibleColumns(getVisbleColumns().toArray());
|
||||||
@@ -460,7 +448,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
||||||
if (BaseEntityEventType.SELECTED_ENTITY == softwareModuleEvent.getEventType()) {
|
if (BaseEntityEventType.SELECTED_ENTITY == softwareModuleEvent.getEventType()) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
@@ -486,14 +474,6 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this); // It's good manners to do this, even though
|
|
||||||
// we should be
|
|
||||||
// automatically unsubscribed when the UI is
|
|
||||||
// garbage collected
|
|
||||||
}
|
|
||||||
|
|
||||||
public Table getArtifactDetailsTable() {
|
public Table getArtifactDetailsTable() {
|
||||||
return artifactDetailsTable;
|
return artifactDetailsTable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.ui.common.AbstractAcceptCriteria;
|
import org.eclipse.hawkbit.ui.common.AbstractAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import com.vaadin.spring.annotation.SpringComponent;
|
||||||
@@ -34,6 +37,11 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
|||||||
|
|
||||||
private static final Map<String, Object> DROP_HINTS_CONFIGS = createDropHintConfigurations();
|
private static final Map<String, Object> DROP_HINTS_CONFIGS = createDropHintConfigurations();
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
UploadViewAcceptCriteria(final UINotification uiNotification, final UIEventBus eventBus) {
|
||||||
|
super(uiNotification, eventBus);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getComponentId(final Component component) {
|
protected String getComponentId(final Component component) {
|
||||||
String id = component.getId();
|
String id = component.getId();
|
||||||
|
|||||||
@@ -10,22 +10,24 @@ package org.eclipse.hawkbit.ui.artifacts.footer;
|
|||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadViewAcceptCriteria;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout;
|
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
||||||
|
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.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Component;
|
import com.vaadin.ui.Component;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.Table.TableTransferable;
|
import com.vaadin.ui.Table.TableTransferable;
|
||||||
@@ -33,24 +35,30 @@ import com.vaadin.ui.UI;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload view footer layout implementation.
|
* Upload view footer layout implementation.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3273982053389866299L;
|
private static final long serialVersionUID = -3273982053389866299L;
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final UploadViewConfirmationWindowLayout uploadViewConfirmationWindowLayout;
|
||||||
private UploadViewConfirmationWindowLayout uploadViewConfirmationWindowLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
public SMDeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
|
||||||
|
final UINotification notification, final ArtifactUploadState artifactUploadState,
|
||||||
|
final SoftwareManagement softwareManagement, final UploadViewAcceptCriteria uploadViewAcceptCriteria) {
|
||||||
|
super(i18n, permChecker, eventBus, notification);
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.uploadViewConfirmationWindowLayout = new UploadViewConfirmationWindowLayout(i18n, eventBus,
|
||||||
|
softwareManagement, artifactUploadState);
|
||||||
|
this.uploadViewAcceptCriteria = uploadViewAcceptCriteria;
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadArtifactUIEvent event) {
|
void onEvent(final UploadArtifactUIEvent event) {
|
||||||
|
|
||||||
if (isSoftwareEvent(event) || isSoftwareTypeEvent(event)) {
|
if (isSoftwareEvent(event) || isSoftwareTypeEvent(event)) {
|
||||||
@@ -84,7 +92,7 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
|| event == UploadArtifactUIEvent.DISCARD_DELETE_SOFTWARE_TYPE;
|
|| event == UploadArtifactUIEvent.DISCARD_DELETE_SOFTWARE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DragEvent event) {
|
void onEvent(final DragEvent event) {
|
||||||
if (event == DragEvent.HIDE_DROP_HINT) {
|
if (event == DragEvent.HIDE_DROP_HINT) {
|
||||||
UI.getCurrent().access(() -> hideDropHints());
|
UI.getCurrent().access(() -> hideDropHints());
|
||||||
@@ -134,9 +142,8 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
|
|
||||||
final String swModuleTypeName = sourceComponent.getId()
|
final String swModuleTypeName = sourceComponent.getId()
|
||||||
.replace(UIComponentIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, "");
|
.replace(UIComponentIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, "");
|
||||||
if (artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType().isPresent()
|
if (artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||||
&& artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType().get().getName()
|
.map(type -> type.getName().equalsIgnoreCase(swModuleTypeName)).orElse(false)) {
|
||||||
.equalsIgnoreCase(swModuleTypeName)) {
|
|
||||||
notification.displayValidationError(
|
notification.displayValidationError(
|
||||||
i18n.get("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
|
i18n.get("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -20,30 +20,24 @@ import org.eclipse.hawkbit.ui.artifacts.state.CustomFile;
|
|||||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
|
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
|
||||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.ConfirmationTab;
|
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.ConfirmationTab;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.vaadin.data.Container;
|
import com.vaadin.data.Container;
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickListener;
|
import com.vaadin.ui.Button.ClickListener;
|
||||||
import com.vaadin.ui.Table.Align;
|
import com.vaadin.ui.Table.Align;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract layout of confirm actions window.
|
* Abstract layout of confirm actions window.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWindowLayout {
|
public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWindowLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1804036019105286988L;
|
private static final long serialVersionUID = 1804036019105286988L;
|
||||||
@@ -56,11 +50,16 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
|
|||||||
|
|
||||||
private static final String DISCARD = "Discard";
|
private static final String DISCARD = "Discard";
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
public UploadViewConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final SoftwareManagement softwareManagement, final ArtifactUploadState artifactUploadState) {
|
||||||
|
super(i18n, eventBus);
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, ConfirmationTab> getConfimrationTabs() {
|
protected Map<String, ConfirmationTab> getConfimrationTabs() {
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.artifacts.smtable;
|
package org.eclipse.hawkbit.ui.artifacts.smtable;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
@@ -29,12 +27,10 @@ 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.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.ComboBox;
|
import com.vaadin.ui.ComboBox;
|
||||||
import com.vaadin.ui.CustomComponent;
|
import com.vaadin.ui.CustomComponent;
|
||||||
import com.vaadin.ui.FormLayout;
|
import com.vaadin.ui.FormLayout;
|
||||||
@@ -46,26 +42,19 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
/**
|
/**
|
||||||
* Generates window for Software module add or update.
|
* Generates window for Software module add or update.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SoftwareModuleAddUpdateWindow extends CustomComponent {
|
public class SoftwareModuleAddUpdateWindow extends CustomComponent {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5217675246477211483L;
|
private static final long serialVersionUID = -5217675246477211483L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uiNotifcation;
|
||||||
private transient UINotification uiNotifcation;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final EntityFactory entityFactory;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
private TextField nameTextField;
|
private TextField nameTextField;
|
||||||
|
|
||||||
@@ -83,6 +72,17 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
|
|||||||
|
|
||||||
private FormLayout formLayout;
|
private FormLayout formLayout;
|
||||||
|
|
||||||
|
public SoftwareModuleAddUpdateWindow(final I18N i18n, final UINotification uiNotifcation, final UIEventBus eventBus,
|
||||||
|
final SoftwareManagement softwareManagement, final EntityFactory entityFactory) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uiNotifcation = uiNotifcation;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
|
||||||
|
createRequiredComponents();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save or update the sw module.
|
* Save or update the sw module.
|
||||||
*/
|
*/
|
||||||
@@ -102,14 +102,6 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize Distribution Add and Edit Window.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
void init() {
|
|
||||||
createRequiredComponents();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create window for new software module.
|
* Create window for new software module.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.ui.artifacts.smtable;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.MetaData;
|
import org.eclipse.hawkbit.repository.model.MetaData;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
@@ -20,13 +21,12 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
|
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.TabSheet;
|
import com.vaadin.ui.TabSheet;
|
||||||
@@ -39,41 +39,39 @@ import com.vaadin.ui.Window;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDetailsLayout<SoftwareModule> {
|
public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDetailsLayout<SoftwareModule> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4900381301076646366L;
|
private static final long serialVersionUID = -4900381301076646366L;
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
||||||
private SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final SwMetadataPopupLayout swMetadataPopupLayout;
|
||||||
private SwMetadataPopupLayout swMetadataPopupLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
private SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
public SoftwareModuleDetails(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final SpPermissionChecker permissionChecker,
|
||||||
|
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow,
|
||||||
|
final ArtifactUploadState artifactUploadState, final SoftwareManagement softwareManagement,
|
||||||
|
final SwMetadataPopupLayout swMetadataPopupLayout, final EntityFactory entityFactory) {
|
||||||
|
super(i18n, eventBus, permissionChecker, null);
|
||||||
|
this.softwareModuleAddUpdateWindow = softwareModuleAddUpdateWindow;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.swMetadataPopupLayout = swMetadataPopupLayout;
|
||||||
|
|
||||||
/**
|
|
||||||
* softwareLayout Initialize the component.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void init() {
|
|
||||||
swmMetadataTable = new SoftwareModuleMetadatadetailslayout();
|
swmMetadataTable = new SoftwareModuleMetadatadetailslayout();
|
||||||
swmMetadataTable.init(getI18n(), getPermissionChecker(), softwareManagement, swMetadataPopupLayout,
|
swmMetadataTable.init(getI18n(), getPermissionChecker(), softwareManagement, swMetadataPopupLayout,
|
||||||
entityFactory);
|
entityFactory);
|
||||||
super.init();
|
addTabs(detailsTab);
|
||||||
|
restoreState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final MetadataEvent event) {
|
void onEvent(final MetadataEvent event) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
final MetaData softwareModuleMetadata = event.getMetaData();
|
final MetaData softwareModuleMetadata = event.getMetaData();
|
||||||
@@ -168,7 +166,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
|||||||
return artifactUploadState.isSwModuleTableMaximized();
|
return artifactUploadState.isSwModuleTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
||||||
onBaseEntityEvent(softwareModuleEvent);
|
onBaseEntityEvent(softwareModuleEvent);
|
||||||
}
|
}
|
||||||
@@ -194,8 +192,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSoftwareModuleSelected(final SoftwareModule softwareModule) {
|
private boolean isSoftwareModuleSelected(final SoftwareModule softwareModule) {
|
||||||
final SoftwareModule selectedUploadSWModule = artifactUploadState.getSelectedBaseSoftwareModule().isPresent()
|
final SoftwareModule selectedUploadSWModule = artifactUploadState.getSelectedBaseSoftwareModule().orElse(null);
|
||||||
? artifactUploadState.getSelectedBaseSoftwareModule().get() : null;
|
|
||||||
return softwareModule != null && selectedUploadSWModule != null
|
return softwareModule != null && selectedUploadSWModule != null
|
||||||
&& selectedUploadSWModule.getName().equals(softwareModule.getName())
|
&& selectedUploadSWModule.getName().equals(softwareModule.getName())
|
||||||
&& selectedUploadSWModule.getVersion().equals(softwareModule.getVersion());
|
&& selectedUploadSWModule.getVersion().equals(softwareModule.getVersion());
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ package org.eclipse.hawkbit.ui.artifacts.smtable;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
@@ -24,15 +26,17 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
|||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
|
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -42,34 +46,41 @@ import com.vaadin.data.Item;
|
|||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Header of Software module table.
|
* The Software module table.
|
||||||
*/
|
*/
|
||||||
@UIScope
|
|
||||||
@SpringComponent
|
|
||||||
public class SoftwareModuleTable extends AbstractNamedVersionTable<SoftwareModule, Long> {
|
public class SoftwareModuleTable extends AbstractNamedVersionTable<SoftwareModule, Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6469417305487144809L;
|
private static final long serialVersionUID = 6469417305487144809L;
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
|
||||||
|
|
||||||
@Autowired
|
private final SwMetadataPopupLayout swMetadataPopupLayout;
|
||||||
private SwMetadataPopupLayout swMetadataPopupLayout;
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
public SoftwareModuleTable(final UIEventBus eventBus, final I18N i18n, final UINotification uiNotification,
|
||||||
|
final ArtifactUploadState artifactUploadState, final SoftwareManagement softwareManagement,
|
||||||
|
final UploadViewAcceptCriteria uploadViewAcceptCriteria, final EntityFactory entityFactory,
|
||||||
|
final SpPermissionChecker permChecker, final SwMetadataPopupLayout swMetadataPopupLayout) {
|
||||||
|
super(eventBus, i18n, uiNotification);
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.uploadViewAcceptCriteria = uploadViewAcceptCriteria;
|
||||||
|
this.swMetadataPopupLayout = swMetadataPopupLayout;
|
||||||
|
|
||||||
|
addNewContainerDS();
|
||||||
|
setColumnProperties();
|
||||||
|
setDataAvailable(getContainerDataSource().size() != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SMFilterEvent filterEvent) {
|
void onEvent(final SMFilterEvent filterEvent) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
|
|
||||||
@@ -153,12 +164,12 @@ public class SoftwareModuleTable extends AbstractNamedVersionTable<SoftwareModul
|
|||||||
eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.SELECTED_ENTITY, lastSoftwareModule));
|
eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.SELECTED_ENTITY, lastSoftwareModule));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent event) {
|
void onEvent(final SoftwareModuleEvent event) {
|
||||||
onBaseEntityEvent(event);
|
onBaseEntityEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadArtifactUIEvent event) {
|
void onEvent(final UploadArtifactUIEvent event) {
|
||||||
if (event == UploadArtifactUIEvent.DELETED_ALL_SOFWARE) {
|
if (event == UploadArtifactUIEvent.DELETED_ALL_SOFWARE) {
|
||||||
UI.getCurrent().access(this::refreshFilter);
|
UI.getCurrent().access(this::refreshFilter);
|
||||||
|
|||||||
@@ -8,43 +8,45 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.artifacts.smtable;
|
package org.eclipse.hawkbit.ui.artifacts.smtable;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
|
import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.Window;
|
import com.vaadin.ui.Window;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Header of Software module table.
|
* Header of Software module table.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
||||||
|
|
||||||
private static final long serialVersionUID = 242961845006626297L;
|
private static final long serialVersionUID = 242961845006626297L;
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
public SoftwareModuleTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
|
||||||
private SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
final ArtifactUploadState artifactUploadState, final UINotification uiNotifcation,
|
||||||
|
final UIEventBus eventBus, final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
|
||||||
|
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow) {
|
||||||
|
super(i18n, permChecker, eventbus, null, null, artifactUploadState);
|
||||||
|
this.softwareModuleAddUpdateWindow = softwareModuleAddUpdateWindow;
|
||||||
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadArtifactUIEvent event) {
|
void onEvent(final UploadArtifactUIEvent event) {
|
||||||
if (event == UploadArtifactUIEvent.HIDE_FILTER_BY_TYPE) {
|
if (event == UploadArtifactUIEvent.HIDE_FILTER_BY_TYPE) {
|
||||||
setFilterButtonsIconVisible(true);
|
setFilterButtonsIconVisible(true);
|
||||||
@@ -73,10 +75,7 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String onLoadSearchBoxValue() {
|
protected String onLoadSearchBoxValue() {
|
||||||
if (artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()) {
|
return artifactUploadState.getSoftwareModuleFilters().getSearchText().orElse(null);
|
||||||
return artifactUploadState.getSoftwareModuleFilters().getSearchText().get();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,38 +8,42 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.artifacts.smtable;
|
package org.eclipse.hawkbit.ui.artifacts.smtable;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadViewAcceptCriteria;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
|
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Software module table layout. (Upload Management)
|
* Software module table layout. (Upload Management)
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SoftwareModuleTableLayout extends AbstractTableLayout {
|
public class SoftwareModuleTableLayout extends AbstractTableLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6464291374980641235L;
|
private static final long serialVersionUID = 6464291374980641235L;
|
||||||
|
|
||||||
@Autowired
|
public SoftwareModuleTableLayout(final I18N i18n, final SpPermissionChecker permChecker,
|
||||||
private SoftwareModuleDetails softwareModuleDetails;
|
final ArtifactUploadState artifactUploadState, final UINotification uiNotification,
|
||||||
|
final UIEventBus eventBus, final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
|
||||||
|
final UploadViewAcceptCriteria uploadViewAcceptCriteria) {
|
||||||
|
|
||||||
@Autowired
|
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow = new SoftwareModuleAddUpdateWindow(i18n,
|
||||||
private SoftwareModuleTableHeader smTableHeader;
|
uiNotification, eventBus, softwareManagement, entityFactory);
|
||||||
|
|
||||||
@Autowired
|
final SwMetadataPopupLayout swMetadataPopupLayout = new SwMetadataPopupLayout(i18n, uiNotification, eventBus,
|
||||||
private SoftwareModuleTable smTable;
|
softwareManagement, entityFactory, permChecker);
|
||||||
|
|
||||||
/**
|
super.init(
|
||||||
* Initialize the filter layout.
|
new SoftwareModuleTableHeader(i18n, permChecker, eventBus, artifactUploadState, uiNotification,
|
||||||
*/
|
eventBus, softwareManagement, entityFactory, softwareModuleAddUpdateWindow),
|
||||||
@PostConstruct
|
new SoftwareModuleTable(eventBus, i18n, uiNotification, artifactUploadState, softwareManagement,
|
||||||
void init() {
|
uploadViewAcceptCriteria, entityFactory, permChecker, swMetadataPopupLayout),
|
||||||
super.init(smTableHeader, smTable, softwareModuleDetails);
|
new SoftwareModuleDetails(i18n, eventBus, permChecker, softwareModuleAddUpdateWindow,
|
||||||
|
artifactUploadState, softwareManagement, swMetadataPopupLayout, entityFactory));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ package org.eclipse.hawkbit.ui.artifacts.smtype;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent.SoftwareModuleTypeEnum;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent.SoftwareModuleTypeEnum;
|
||||||
@@ -23,17 +26,17 @@ import org.eclipse.hawkbit.ui.common.builder.TextAreaBuilder;
|
|||||||
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
||||||
import org.eclipse.hawkbit.ui.layouts.CreateUpdateTypeLayout;
|
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.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Property.ValueChangeEvent;
|
import com.vaadin.data.Property.ValueChangeEvent;
|
||||||
import com.vaadin.shared.ui.colorpicker.Color;
|
import com.vaadin.shared.ui.colorpicker.Color;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.OptionGroup;
|
import com.vaadin.ui.OptionGroup;
|
||||||
import com.vaadin.ui.TextField;
|
import com.vaadin.ui.TextField;
|
||||||
@@ -44,15 +47,12 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
* Layout for the create or update software module type.
|
* Layout for the create or update software module type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<SoftwareModuleType> {
|
public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<SoftwareModuleType> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(CreateUpdateSoftwareTypeLayout.class);
|
private static final Logger LOG = LoggerFactory.getLogger(CreateUpdateSoftwareTypeLayout.class);
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement swTypeManagementService;
|
||||||
private transient SoftwareManagement swTypeManagementService;
|
|
||||||
|
|
||||||
private String singleAssignStr;
|
private String singleAssignStr;
|
||||||
private String multiAssignStr;
|
private String multiAssignStr;
|
||||||
@@ -60,6 +60,13 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
|
|||||||
private Label multiAssign;
|
private Label multiAssign;
|
||||||
private OptionGroup assignOptiongroup;
|
private OptionGroup assignOptiongroup;
|
||||||
|
|
||||||
|
public CreateUpdateSoftwareTypeLayout(final I18N i18n, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
|
||||||
|
final UINotification uiNotification, final SoftwareManagement swTypeManagementService) {
|
||||||
|
super(i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
|
||||||
|
this.swTypeManagementService = swTypeManagementService;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addListeners() {
|
protected void addListeners() {
|
||||||
super.addListeners();
|
super.addListeners();
|
||||||
|
|||||||
@@ -15,52 +15,37 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
|||||||
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterSingleButtonClick;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterSingleButtonClick;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single button click behaviour of filter buttons layout.
|
* Single button click behaviour of filter buttons layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SMTypeFilterButtonClick extends AbstractFilterSingleButtonClick implements Serializable {
|
public class SMTypeFilterButtonClick extends AbstractFilterSingleButtonClick implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3707945900524967887L;
|
private static final long serialVersionUID = 3707945900524967887L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
public SMTypeFilterButtonClick(final UIEventBus eventBus, final ArtifactUploadState artifactUploadState,
|
||||||
|
final SoftwareManagement softwareManagement) {
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterButtonClickBehaviour#
|
|
||||||
* filterUnClicked(com.vaadin.ui. Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void filterUnClicked(final Button clickedButton) {
|
protected void filterUnClicked(final Button clickedButton) {
|
||||||
artifactUploadState.getSoftwareModuleFilters().setSoftwareModuleType(null);
|
artifactUploadState.getSoftwareModuleFilters().setSoftwareModuleType(null);
|
||||||
eventBus.publish(this, SMFilterEvent.FILTER_BY_TYPE);
|
eventBus.publish(this, SMFilterEvent.FILTER_BY_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see hawkbit.server.ui.layouts.SPFilterButtonClickBehaviour#filterClicked
|
|
||||||
* (com.vaadin.ui.Button )
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void filterClicked(final Button clickedButton) {
|
protected void filterClicked(final Button clickedButton) {
|
||||||
final SoftwareModuleType softwareModuleType = softwareManagement
|
final SoftwareModuleType softwareModuleType = softwareManagement
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.ui.artifacts.smtype;
|
|||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent.SoftwareModuleTypeEnum;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent.SoftwareModuleTypeEnum;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
@@ -19,35 +20,36 @@ import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery;
|
|||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
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;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Software module type filter buttons.
|
* Software module type filter buttons.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SMTypeFilterButtons extends AbstractFilterButtons {
|
public class SMTypeFilterButtons extends AbstractFilterButtons {
|
||||||
|
|
||||||
private static final long serialVersionUID = 169198312654380358L;
|
private static final long serialVersionUID = 169198312654380358L;
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
public SMTypeFilterButtons(final UIEventBus eventBus, final ArtifactUploadState artifactUploadState,
|
||||||
|
final UploadViewAcceptCriteria uploadViewAcceptCriteria, final SoftwareManagement softwareManagement) {
|
||||||
|
super(eventBus, new SMTypeFilterButtonClick(eventBus, artifactUploadState, softwareManagement));
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.uploadViewAcceptCriteria = uploadViewAcceptCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleTypeEvent event) {
|
void onEvent(final SoftwareModuleTypeEvent event) {
|
||||||
if (event.getSoftwareModuleType() != null
|
if (event.getSoftwareModuleType() != null
|
||||||
&& EnumSet.allOf(SoftwareModuleTypeEnum.class).contains(event.getSoftwareModuleTypeEnum())) {
|
&& EnumSet.allOf(SoftwareModuleTypeEnum.class).contains(event.getSoftwareModuleTypeEnum())) {
|
||||||
@@ -56,7 +58,7 @@ public class SMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadArtifactUIEvent event) {
|
void onEvent(final UploadArtifactUIEvent event) {
|
||||||
if (event == UploadArtifactUIEvent.DELETED_ALL_SOFWARE_TYPE) {
|
if (event == UploadArtifactUIEvent.DELETED_ALL_SOFWARE_TYPE) {
|
||||||
refreshTable();
|
refreshTable();
|
||||||
@@ -70,14 +72,13 @@ public class SMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||||
return HawkbitCommonUtil.createLazyQueryContainer(
|
return HawkbitCommonUtil.createLazyQueryContainer(new BeanQueryFactory<>(SoftwareModuleTypeBeanQuery.class));
|
||||||
new BeanQueryFactory<SoftwareModuleTypeBeanQuery>(SoftwareModuleTypeBeanQuery.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isClickedByDefault(final String typeName) {
|
protected boolean isClickedByDefault(final String typeName) {
|
||||||
return artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType().isPresent() && artifactUploadState
|
return artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||||
.getSoftwareModuleFilters().getSoftwareModuleType().get().getName().equals(typeName);
|
.map(type -> type.getName().equals(typeName)).orElse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,18 +8,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.artifacts.smtype;
|
package org.eclipse.hawkbit.ui.artifacts.smtype;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.Window;
|
import com.vaadin.ui.Window;
|
||||||
@@ -27,25 +29,22 @@ import com.vaadin.ui.Window;
|
|||||||
/**
|
/**
|
||||||
* Software module type filter buttons header.
|
* Software module type filter buttons header.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SMTypeFilterHeader extends AbstractFilterHeader {
|
public class SMTypeFilterHeader extends AbstractFilterHeader {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4855810338059032342L;
|
private static final long serialVersionUID = -4855810338059032342L;
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
private final CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
|
||||||
|
|
||||||
@Autowired
|
public SMTypeFilterHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
|
||||||
private CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
|
final ArtifactUploadState artifactUploadState, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UINotification uiNotification,
|
||||||
|
final SoftwareManagement softwareManagement) {
|
||||||
|
super(permChecker, eventBus, i18n);
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.createUpdateSWTypeLayout = new CreateUpdateSoftwareTypeLayout(i18n, tagManagement, entityFactory, eventBus,
|
||||||
|
permChecker, uiNotification, softwareManagement);
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the components.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@PostConstruct
|
|
||||||
protected void init() {
|
|
||||||
super.init();
|
|
||||||
if (permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission()) {
|
if (permChecker.hasCreateDistributionPermission() || permChecker.hasUpdateDistributionPermission()) {
|
||||||
createUpdateSWTypeLayout.init();
|
createUpdateSWTypeLayout.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,57 +8,44 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.artifacts.smtype;
|
package org.eclipse.hawkbit.ui.artifacts.smtype;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import javax.annotation.PreDestroy;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Software module type filter buttons layout.
|
* Software module type filter buttons layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SMTypeFilterLayout extends AbstractFilterLayout {
|
public class SMTypeFilterLayout extends AbstractFilterLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1581066345157393665L;
|
private static final long serialVersionUID = 1581066345157393665L;
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private transient EventBus.SessionEventBus eventbus;
|
|
||||||
|
|
||||||
@Autowired
|
public SMTypeFilterLayout(final ArtifactUploadState artifactUploadState, final I18N i18n,
|
||||||
private SMTypeFilterHeader smTypeFilterHeader;
|
final SpPermissionChecker permChecker, final UIEventBus eventBus, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UINotification uiNotification,
|
||||||
|
final SoftwareManagement softwareManagement, final UploadViewAcceptCriteria uploadViewAcceptCriteria) {
|
||||||
|
super(new SMTypeFilterHeader(i18n, permChecker, eventBus, artifactUploadState, tagManagement, entityFactory,
|
||||||
|
uiNotification, softwareManagement),
|
||||||
|
new SMTypeFilterButtons(eventBus, artifactUploadState, uploadViewAcceptCriteria, softwareManagement));
|
||||||
|
|
||||||
@Autowired
|
this.artifactUploadState = artifactUploadState;
|
||||||
private SMTypeFilterButtons smTypeFilterButtons;
|
restoreState();
|
||||||
|
|
||||||
@Autowired
|
eventBus.subscribe(this);
|
||||||
private SMTypeFilterButtonClick smTypeFilterButtonClick;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the filter layout.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
void init() {
|
|
||||||
super.init(smTypeFilterHeader, smTypeFilterButtons, smTypeFilterButtonClick);
|
|
||||||
eventbus.subscribe(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadArtifactUIEvent event) {
|
void onEvent(final UploadArtifactUIEvent event) {
|
||||||
if (event == UploadArtifactUIEvent.HIDE_FILTER_BY_TYPE) {
|
if (event == UploadArtifactUIEvent.HIDE_FILTER_BY_TYPE) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
@@ -68,21 +55,6 @@ public class SMTypeFilterLayout extends AbstractFilterLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
/*
|
|
||||||
* It's good manners to do this, even though vaadin-spring will
|
|
||||||
* automatically unsubscribe when this UI is garbage collected.
|
|
||||||
*/
|
|
||||||
eventbus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.SPFilterLayout#
|
|
||||||
* onLoadIsTypeFilterIsClosed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTypeFilterIsClosed() {
|
public Boolean onLoadIsTypeFilterIsClosed() {
|
||||||
return artifactUploadState.isSwTypeFilterClosed();
|
return artifactUploadState.isSwTypeFilterClosed();
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ public class ArtifactUploadState implements ManagmentEntityState<Long>, Serializ
|
|||||||
|
|
||||||
private static final long serialVersionUID = 8273440375917450859L;
|
private static final long serialVersionUID = 8273440375917450859L;
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleFilters softwareModuleFilters;
|
||||||
private SoftwareModuleFilters softwareModuleFilters;
|
|
||||||
|
|
||||||
private final Map<Long, String> deleteSofwareModules = new HashMap<>();
|
private final Map<Long, String> deleteSofwareModules = new HashMap<>();
|
||||||
|
|
||||||
@@ -75,6 +74,11 @@ public class ArtifactUploadState implements ManagmentEntityState<Long>, Serializ
|
|||||||
|
|
||||||
private final AtomicInteger numberOfFileUploadsFailed = new AtomicInteger();
|
private final AtomicInteger numberOfFileUploadsFailed = new AtomicInteger();
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ArtifactUploadState(final SoftwareModuleFilters softwareModuleFilters) {
|
||||||
|
this.softwareModuleFilters = softwareModuleFilters;
|
||||||
|
}
|
||||||
|
|
||||||
public AtomicInteger getNumberOfFileUploadsFailed() {
|
public AtomicInteger getNumberOfFileUploadsFailed() {
|
||||||
return numberOfFileUploadsFailed;
|
return numberOfFileUploadsFailed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ package org.eclipse.hawkbit.ui.artifacts.upload;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException;
|
import org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadFileStatus;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadFileStatus;
|
||||||
@@ -68,7 +66,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
|
|||||||
|
|
||||||
private String failureReason;
|
private String failureReason;
|
||||||
private final I18N i18n;
|
private final I18N i18n;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
private transient EventBus.UIEventBus eventBus;
|
||||||
private final SoftwareModule selectedSw;
|
private final SoftwareModule selectedSw;
|
||||||
private SoftwareModule selectedSwForUpload;
|
private SoftwareModule selectedSwForUpload;
|
||||||
private final ArtifactUploadState artifactUploadState;
|
private final ArtifactUploadState artifactUploadState;
|
||||||
@@ -85,21 +83,12 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
|
|||||||
this.mimeType = mimeType;
|
this.mimeType = mimeType;
|
||||||
this.selectedSw = selectedSw;
|
this.selectedSw = selectedSw;
|
||||||
this.i18n = SpringContextHelper.getBean(I18N.class);
|
this.i18n = SpringContextHelper.getBean(I18N.class);
|
||||||
this.eventBus = SpringContextHelper.getBean(EventBus.SessionEventBus.class);
|
this.eventBus = SpringContextHelper.getBean(EventBus.UIEventBus.class);
|
||||||
this.artifactUploadState = SpringContextHelper.getBean(ArtifactUploadState.class);
|
this.artifactUploadState = SpringContextHelper.getBean(ArtifactUploadState.class);
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
/*
|
|
||||||
* It's good manners to do this, even though vaadin-spring will
|
|
||||||
* automatically unsubscribe when this UI is garbage collected.
|
|
||||||
*/
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final UploadStatusEventType event) {
|
void onEvent(final UploadStatusEventType event) {
|
||||||
if (event == UploadStatusEventType.ABORT_UPLOAD) {
|
if (event == UploadStatusEventType.ABORT_UPLOAD) {
|
||||||
aborted = true;
|
aborted = true;
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException;
|
import org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
@@ -43,9 +40,9 @@ import org.eclipse.hawkbit.ui.utils.UINotification;
|
|||||||
import org.eclipse.hawkbit.util.SPInfo;
|
import org.eclipse.hawkbit.util.SPInfo;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -58,8 +55,6 @@ import com.vaadin.server.FontAwesome;
|
|||||||
import com.vaadin.server.Page;
|
import com.vaadin.server.Page;
|
||||||
import com.vaadin.server.StreamVariable;
|
import com.vaadin.server.StreamVariable;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.DragAndDropWrapper;
|
import com.vaadin.ui.DragAndDropWrapper;
|
||||||
@@ -74,36 +69,24 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
/**
|
/**
|
||||||
* Upload files layout.
|
* Upload files layout.
|
||||||
*/
|
*/
|
||||||
@UIScope
|
|
||||||
@SpringComponent
|
|
||||||
public class UploadLayout extends VerticalLayout {
|
public class UploadLayout extends VerticalLayout {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final String HTML_DIV = "</div>";
|
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);
|
||||||
|
|
||||||
@Autowired
|
private final UploadStatusInfoWindow uploadInfoWindow;
|
||||||
private UploadStatusInfoWindow uploadInfoWindow;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uiNotification;
|
||||||
private transient UINotification uiNotification;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SPInfo spInfo;
|
||||||
private transient SPInfo spInfo;
|
|
||||||
|
|
||||||
private final List<String> duplicateFileNamesList = new ArrayList<>();
|
private final List<String> duplicateFileNamesList = new ArrayList<>();
|
||||||
|
|
||||||
@@ -115,7 +98,7 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
|
|
||||||
private VerticalLayout dropAreaLayout;
|
private VerticalLayout dropAreaLayout;
|
||||||
|
|
||||||
private UI ui;
|
private final UI ui;
|
||||||
|
|
||||||
private HorizontalLayout fileUploadLayout;
|
private HorizontalLayout fileUploadLayout;
|
||||||
|
|
||||||
@@ -125,11 +108,15 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
|
|
||||||
private Button uploadStatusButton;
|
private Button uploadStatusButton;
|
||||||
|
|
||||||
/**
|
public UploadLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
|
||||||
* Initialize the upload layout.
|
final ArtifactUploadState artifactUploadState, final SPInfo spInfo) {
|
||||||
*/
|
this.uploadInfoWindow = new UploadStatusInfoWindow(eventBus, artifactUploadState, i18n);
|
||||||
@PostConstruct
|
this.i18n = i18n;
|
||||||
void init() {
|
this.uiNotification = uiNotification;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
|
this.spInfo = spInfo;
|
||||||
|
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
restoreState();
|
||||||
@@ -137,7 +124,7 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
ui = UI.getCurrent();
|
ui = UI.getCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadArtifactUIEvent event) {
|
void onEvent(final UploadArtifactUIEvent event) {
|
||||||
if (event == UploadArtifactUIEvent.DELETED_ALL_SOFWARE) {
|
if (event == UploadArtifactUIEvent.DELETED_ALL_SOFWARE) {
|
||||||
ui.access(() -> updateActionCount());
|
ui.access(() -> updateActionCount());
|
||||||
@@ -150,32 +137,23 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadStatusEvent event) {
|
void onEvent(final UploadStatusEvent event) {
|
||||||
if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_STARTED) {
|
if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_STARTED) {
|
||||||
ui.access(() -> onStartOfUpload());
|
ui.access(this::onStartOfUpload);
|
||||||
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_FAILED) {
|
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_FAILED) {
|
||||||
ui.access(() -> onUploadFailure(event));
|
ui.access(() -> onUploadFailure(event));
|
||||||
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_FINISHED) {
|
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_FINISHED) {
|
||||||
ui.access(() -> onUploadCompletion());
|
ui.access(this::onUploadCompletion);
|
||||||
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_SUCCESSFUL) {
|
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_SUCCESSFUL) {
|
||||||
ui.access(() -> onUploadSuccess(event));
|
ui.access(() -> onUploadSuccess(event));
|
||||||
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_STREAMING_FAILED) {
|
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_STREAMING_FAILED) {
|
||||||
ui.access(() -> onUploadStreamingFailure(event));
|
ui.access(() -> onUploadStreamingFailure(event));
|
||||||
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_STREAMING_FINISHED) {
|
} else if (event.getUploadProgressEventType() == UploadStatusEventType.UPLOAD_STREAMING_FINISHED) {
|
||||||
ui.access(() -> onUploadStreamingSuccess());
|
ui.access(this::onUploadStreamingSuccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
/*
|
|
||||||
* It's good manners to do this, even though vaadin-spring will
|
|
||||||
* automatically unsubscribe when this UI is garbage collected.
|
|
||||||
*/
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createComponents() {
|
private void createComponents() {
|
||||||
createUploadStatusButton();
|
createUploadStatusButton();
|
||||||
createProcessButton();
|
createProcessButton();
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class UploadResultWindow implements Button.ClickListener {
|
|||||||
|
|
||||||
private static final String REASON = "reason";
|
private static final String REASON = "reason";
|
||||||
|
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
private transient EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,7 +81,7 @@ public class UploadResultWindow implements Button.ClickListener {
|
|||||||
public UploadResultWindow(final List<UploadStatus> uploadResultList, final I18N i18n) {
|
public UploadResultWindow(final List<UploadStatus> uploadResultList, final I18N i18n) {
|
||||||
this.uploadResultList = uploadResultList;
|
this.uploadResultList = uploadResultList;
|
||||||
this.i18n = i18n;
|
this.i18n = i18n;
|
||||||
eventBus = SpringContextHelper.getBean( EventBus.SessionEventBus.class);
|
eventBus = SpringContextHelper.getBean( EventBus.UIEventBus.class);
|
||||||
createComponents();
|
createComponents();
|
||||||
createLayout();
|
createLayout();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ package org.eclipse.hawkbit.ui.artifacts.upload;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadFileStatus;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadFileStatus;
|
||||||
@@ -28,8 +25,8 @@ 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.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -38,8 +35,6 @@ import com.vaadin.data.Item;
|
|||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.window.WindowMode;
|
import com.vaadin.shared.ui.window.WindowMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.Grid;
|
import com.vaadin.ui.Grid;
|
||||||
@@ -58,18 +53,13 @@ import elemental.json.JsonValue;
|
|||||||
/**
|
/**
|
||||||
* Shows upload status during upload.
|
* Shows upload status during upload.
|
||||||
*/
|
*/
|
||||||
@UIScope
|
|
||||||
@SpringComponent
|
|
||||||
public class UploadStatusInfoWindow extends Window {
|
public class UploadStatusInfoWindow extends Window {
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactUploadState artifactUploadState;
|
||||||
private ArtifactUploadState artifactUploadState;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
private static final String PROGRESS = "Progress";
|
private static final String PROGRESS = "Progress";
|
||||||
|
|
||||||
@@ -81,9 +71,9 @@ public class UploadStatusInfoWindow extends Window {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Grid grid;
|
private final Grid grid;
|
||||||
|
|
||||||
private IndexedContainer uploads;
|
private final IndexedContainer uploads;
|
||||||
|
|
||||||
private volatile boolean errorOccured = false;
|
private volatile boolean errorOccured = false;
|
||||||
|
|
||||||
@@ -91,7 +81,7 @@ public class UploadStatusInfoWindow extends Window {
|
|||||||
|
|
||||||
private Button minimizeButton;
|
private Button minimizeButton;
|
||||||
|
|
||||||
private VerticalLayout mainLayout;
|
private final VerticalLayout mainLayout;
|
||||||
|
|
||||||
private Label windowCaption;
|
private Label windowCaption;
|
||||||
|
|
||||||
@@ -99,15 +89,15 @@ public class UploadStatusInfoWindow extends Window {
|
|||||||
|
|
||||||
private Button resizeButton;
|
private Button resizeButton;
|
||||||
|
|
||||||
private UI ui;
|
private final UI ui;
|
||||||
|
|
||||||
private ConfirmationDialog confirmDialog;
|
private ConfirmationDialog confirmDialog;
|
||||||
|
|
||||||
/**
|
public UploadStatusInfoWindow(final UIEventBus eventBus, final ArtifactUploadState artifactUploadState,
|
||||||
* Default Constructor.
|
final I18N i18n) {
|
||||||
*/
|
this.eventBus = eventBus;
|
||||||
@PostConstruct
|
this.artifactUploadState = artifactUploadState;
|
||||||
void init() {
|
this.i18n = i18n;
|
||||||
|
|
||||||
setPopupProperties();
|
setPopupProperties();
|
||||||
createStatusPopupHeaderComponents();
|
createStatusPopupHeaderComponents();
|
||||||
@@ -130,7 +120,7 @@ public class UploadStatusInfoWindow extends Window {
|
|||||||
createConfirmDialog();
|
createConfirmDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final UploadStatusEvent event) {
|
void onEvent(final UploadStatusEvent event) {
|
||||||
|
|
||||||
final UploadFileStatus uploadStatus = event.getUploadStatus();
|
final UploadFileStatus uploadStatus = event.getUploadStatus();
|
||||||
@@ -166,15 +156,6 @@ public class UploadStatusInfoWindow extends Window {
|
|||||||
uploadStarted(event.getUploadStatus().getFileName(), event.getUploadStatus().getSoftwareModule());
|
uploadStarted(event.getUploadStatus().getFileName(), event.getUploadStatus().getSoftwareModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
/*
|
|
||||||
* It's good manners to do this, even though vaadin-spring will
|
|
||||||
* automatically unsubscribe when this UI is garbage collected.
|
|
||||||
*/
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void restoreState() {
|
private void restoreState() {
|
||||||
final Indexed container = grid.getContainerDataSource();
|
final Indexed container = grid.getContainerDataSource();
|
||||||
if (container.getItemIds().isEmpty()) {
|
if (container.getItemIds().isEmpty()) {
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ 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.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
|
import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
|
||||||
@@ -39,11 +39,14 @@ public abstract class AbstractAcceptCriteria extends ServerSideCriterion {
|
|||||||
|
|
||||||
private int previousRowCount;
|
private int previousRowCount;
|
||||||
|
|
||||||
@Autowired
|
protected UINotification uiNotification;
|
||||||
protected transient UINotification uiNotification;
|
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
protected AbstractAcceptCriteria(final UINotification uiNotification, final UIEventBus eventBus) {
|
||||||
|
this.uiNotification = uiNotification;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(final DragAndDropEvent dragEvent) {
|
public boolean accept(final DragAndDropEvent dragEvent) {
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ package org.eclipse.hawkbit.ui.common;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||||
import org.eclipse.hawkbit.repository.model.MetaData;
|
import org.eclipse.hawkbit.repository.model.MetaData;
|
||||||
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
||||||
@@ -30,8 +29,8 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
@@ -73,14 +72,11 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
|
|||||||
|
|
||||||
private static final String KEY = "key";
|
private static final String KEY = "key";
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uiNotification;
|
||||||
private UINotification uiNotification;
|
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
private TextField keyTextField;
|
private TextField keyTextField;
|
||||||
|
|
||||||
@@ -97,6 +93,18 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
|
|||||||
private E selectedEntity;
|
private E selectedEntity;
|
||||||
|
|
||||||
private HorizontalLayout mainLayout;
|
private HorizontalLayout mainLayout;
|
||||||
|
protected SpPermissionChecker permChecker;
|
||||||
|
|
||||||
|
protected AbstractMetadataPopupLayout(final I18N i18n, final UINotification uiNotification,
|
||||||
|
final UIEventBus eventBus, final SpPermissionChecker permChecker) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uiNotification = uiNotification;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.permChecker = permChecker;
|
||||||
|
|
||||||
|
createComponents();
|
||||||
|
buildLayout();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the metadata and never close the window after saving.
|
* Save the metadata and never close the window after saving.
|
||||||
@@ -119,13 +127,6 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
void init() {
|
|
||||||
createComponents();
|
|
||||||
buildLayout();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns metadata popup.
|
* Returns metadata popup.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ package org.eclipse.hawkbit.ui.common.confirmwindow.layout;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
@@ -20,8 +18,8 @@ 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.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.ui.Accordion;
|
import com.vaadin.ui.Accordion;
|
||||||
@@ -46,16 +44,15 @@ public abstract class AbstractConfirmationWindowLayout extends VerticalLayout {
|
|||||||
|
|
||||||
private String consolidatedMessage;
|
private String consolidatedMessage;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
protected AbstractConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* PostConstruct.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
removeAllComponents();
|
removeAllComponents();
|
||||||
consolidatedMessage = "";
|
consolidatedMessage = "";
|
||||||
@@ -69,8 +66,7 @@ public abstract class AbstractConfirmationWindowLayout extends VerticalLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createActionMessgaeLabel() {
|
private void createActionMessgaeLabel() {
|
||||||
actionMessage = new LabelBuilder().name("").id(UIComponentIdProvider.ACTION_LABEL).visible(false)
|
actionMessage = new LabelBuilder().name("").id(UIComponentIdProvider.ACTION_LABEL).visible(false).buildLabel();
|
||||||
.buildLabel();
|
|
||||||
actionMessage.addStyleName(SPUIStyleDefinitions.CONFIRM_WINDOW_INFO_BOX);
|
actionMessage.addStyleName(SPUIStyleDefinitions.CONFIRM_WINDOW_INFO_BOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.detailslayout;
|
package org.eclipse.hawkbit.ui.common.detailslayout;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -20,6 +24,11 @@ public abstract class AbstractNamedVersionedEntityTableDetailsLayout<T extends N
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
protected AbstractNamedVersionedEntityTableDetailsLayout(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final SpPermissionChecker permissionChecker, final ManagementUIState managementUIState) {
|
||||||
|
super(i18n, eventBus, permissionChecker, managementUIState);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getName() {
|
protected String getName() {
|
||||||
return HawkbitCommonUtil.getFormattedNameVersion(getSelectedBaseEntity().getName(),
|
return HawkbitCommonUtil.getFormattedNameVersion(getSelectedBaseEntity().getName(),
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ package org.eclipse.hawkbit.ui.common.detailslayout;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||||
@@ -22,13 +19,14 @@ import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
|||||||
import org.eclipse.hawkbit.ui.common.table.BaseUIEntityEvent;
|
import org.eclipse.hawkbit.ui.common.table.BaseUIEntityEvent;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
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.SPDateTimeUtil;
|
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
@@ -48,14 +46,11 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
|
|
||||||
private static final long serialVersionUID = 4862529368471627190L;
|
private static final long serialVersionUID = 4862529368471627190L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permissionChecker;
|
||||||
private SpPermissionChecker permissionChecker;
|
|
||||||
|
|
||||||
private T selectedBaseEntity;
|
private T selectedBaseEntity;
|
||||||
|
|
||||||
@@ -65,37 +60,38 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
|
|
||||||
private Button manageMetadataBtn;
|
private Button manageMetadataBtn;
|
||||||
|
|
||||||
private TabSheet detailsTab;
|
protected TabSheet detailsTab;
|
||||||
|
|
||||||
private VerticalLayout detailsLayout;
|
private final VerticalLayout detailsLayout;
|
||||||
|
|
||||||
private VerticalLayout descriptionLayout;
|
private final VerticalLayout descriptionLayout;
|
||||||
|
|
||||||
private VerticalLayout logLayout;
|
private final VerticalLayout logLayout;
|
||||||
|
|
||||||
private VerticalLayout attributesLayout;
|
private final VerticalLayout attributesLayout;
|
||||||
|
|
||||||
/**
|
protected final ManagementUIState managementUIState;
|
||||||
* Initialize components.
|
|
||||||
*/
|
protected AbstractTableDetailsLayout(final I18N i18n, final UIEventBus eventBus,
|
||||||
@PostConstruct
|
final SpPermissionChecker permissionChecker, final ManagementUIState managementUIState) {
|
||||||
protected void init() {
|
this.i18n = i18n;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
this.managementUIState = managementUIState;
|
||||||
|
detailsLayout = getTabLayout();
|
||||||
|
descriptionLayout = getTabLayout();
|
||||||
|
logLayout = getTabLayout();
|
||||||
|
attributesLayout = getTabLayout();
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected SpPermissionChecker getPermissionChecker() {
|
protected SpPermissionChecker getPermissionChecker() {
|
||||||
return permissionChecker;
|
return permissionChecker;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EventBus.SessionEventBus getEventBus() {
|
protected EventBus.UIEventBus getEventBus() {
|
||||||
return eventBus;
|
return eventBus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +149,6 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
detailsTab.setHeight(90, Unit.PERCENTAGE);
|
detailsTab.setHeight(90, Unit.PERCENTAGE);
|
||||||
detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE);
|
detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE);
|
||||||
detailsTab.setId(getTabSheetId());
|
detailsTab.setId(getTabSheetId());
|
||||||
addTabs(detailsTab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildLayout() {
|
private void buildLayout() {
|
||||||
@@ -196,7 +191,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
caption.setValue(HawkbitCommonUtil.getSoftwareModuleName(headerCaption, value));
|
caption.setValue(HawkbitCommonUtil.getSoftwareModuleName(headerCaption, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restoreState() {
|
protected void restoreState() {
|
||||||
if (onLoadIsTableRowSelected()) {
|
if (onLoadIsTableRowSelected()) {
|
||||||
populateData(null);
|
populateData(null);
|
||||||
editButton.setEnabled(true);
|
editButton.setEnabled(true);
|
||||||
@@ -276,22 +271,18 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected VerticalLayout createLogLayout() {
|
protected VerticalLayout createLogLayout() {
|
||||||
logLayout = getTabLayout();
|
|
||||||
return logLayout;
|
return logLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected VerticalLayout createAttributesLayout() {
|
protected VerticalLayout createAttributesLayout() {
|
||||||
attributesLayout = getTabLayout();
|
|
||||||
return attributesLayout;
|
return attributesLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected VerticalLayout createDetailsLayout() {
|
protected VerticalLayout createDetailsLayout() {
|
||||||
detailsLayout = getTabLayout();
|
|
||||||
return detailsLayout;
|
return detailsLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected VerticalLayout createDescriptionLayout() {
|
protected VerticalLayout createDescriptionLayout() {
|
||||||
descriptionLayout = getTabLayout();
|
|
||||||
return descriptionLayout;
|
return descriptionLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
|||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
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.SessionEventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
@@ -46,9 +46,6 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
/**
|
/**
|
||||||
* Software module details table.
|
* Software module details table.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SoftwareModuleDetailsTable extends Table {
|
public class SoftwareModuleDetailsTable extends Table {
|
||||||
|
|
||||||
@@ -67,15 +64,15 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
private boolean isUnassignSoftModAllowed;
|
private boolean isUnassignSoftModAllowed;
|
||||||
private SpPermissionChecker permissionChecker;
|
private SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
private DistributionSetManagement distributionSetManagement;
|
||||||
|
|
||||||
private I18N i18n;
|
private I18N i18n;
|
||||||
|
|
||||||
private transient SessionEventBus eventBus;
|
private EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
private transient ManageDistUIState manageDistUIState;
|
private ManageDistUIState manageDistUIState;
|
||||||
|
|
||||||
private transient UINotification uiNotification;
|
private UINotification uiNotification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize software module table- to be displayed in details layout.
|
* Initialize software module table- to be displayed in details layout.
|
||||||
@@ -96,7 +93,7 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
*/
|
*/
|
||||||
public void init(final I18N i18n, final boolean isUnassignSoftModAllowed,
|
public void init(final I18N i18n, final boolean isUnassignSoftModAllowed,
|
||||||
final SpPermissionChecker permissionChecker, final DistributionSetManagement distributionSetManagement,
|
final SpPermissionChecker permissionChecker, final DistributionSetManagement distributionSetManagement,
|
||||||
final SessionEventBus eventBus, final ManageDistUIState manageDistUIState) {
|
final EventBus.UIEventBus eventBus, final ManageDistUIState manageDistUIState) {
|
||||||
this.i18n = i18n;
|
this.i18n = i18n;
|
||||||
this.isUnassignSoftModAllowed = isUnassignSoftModAllowed;
|
this.isUnassignSoftModAllowed = isUnassignSoftModAllowed;
|
||||||
this.permissionChecker = permissionChecker;
|
this.permissionChecker = permissionChecker;
|
||||||
|
|||||||
@@ -14,10 +14,6 @@ import com.vaadin.ui.Button;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract button click behaviour of filter buttons layout.
|
* Abstract button click behaviour of filter buttons layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractFilterButtonClickBehaviour implements Serializable {
|
public abstract class AbstractFilterButtonClickBehaviour implements Serializable {
|
||||||
|
|
||||||
|
|||||||
@@ -13,17 +13,15 @@ import static org.eclipse.hawkbit.ui.utils.SPUIDefinitions.NO_TAG_BUTTON_ID;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUITagButtonStyle;
|
import org.eclipse.hawkbit.ui.decorators.SPUITagButtonStyle;
|
||||||
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.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
@@ -45,28 +43,19 @@ public abstract class AbstractFilterButtons extends Table {
|
|||||||
|
|
||||||
protected static final String FILTER_BUTTON_COLUMN = "filterButton";
|
protected static final String FILTER_BUTTON_COLUMN = "filterButton";
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
private AbstractFilterButtonClickBehaviour filterButtonClickBehaviour;
|
protected final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour;
|
||||||
|
|
||||||
|
protected AbstractFilterButtons(final UIEventBus eventBus,
|
||||||
|
final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize layout of filter buttons.
|
|
||||||
*
|
|
||||||
* @param filterButtonClickBehaviour
|
|
||||||
* click behaviour of filter buttons.
|
|
||||||
*/
|
|
||||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
|
||||||
this.filterButtonClickBehaviour = filterButtonClickBehaviour;
|
this.filterButtonClickBehaviour = filterButtonClickBehaviour;
|
||||||
createTable();
|
createTable();
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createTable() {
|
private void createTable() {
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
setId(getButtonsTableId());
|
setId(getButtonsTableId());
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
|||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
@@ -25,20 +26,14 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parent class for filter button header layout.
|
* Parent class for filter button header layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractFilterHeader extends VerticalLayout {
|
public abstract class AbstractFilterHeader extends VerticalLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1388340600522323332L;
|
private static final long serialVersionUID = -1388340600522323332L;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected SpPermissionChecker permChecker;
|
protected SpPermissionChecker permChecker;
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
private Label title;
|
private Label title;
|
||||||
|
|
||||||
@@ -46,10 +41,12 @@ public abstract class AbstractFilterHeader extends VerticalLayout {
|
|||||||
|
|
||||||
private Button hideIcon;
|
private Button hideIcon;
|
||||||
|
|
||||||
/**
|
protected final I18N i18n;
|
||||||
* Initialize the header layout.
|
|
||||||
*/
|
protected AbstractFilterHeader(final SpPermissionChecker permChecker, final UIEventBus eventBus, final I18N i18n) {
|
||||||
protected void init() {
|
this.permChecker = permChecker;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.i18n = i18n;
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,35 +15,25 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parent class for filter button layout.
|
* Parent class for filter button layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractFilterLayout extends VerticalLayout {
|
public abstract class AbstractFilterLayout extends VerticalLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 9190616426688385851L;
|
private static final long serialVersionUID = 9190616426688385851L;
|
||||||
|
|
||||||
private AbstractFilterHeader filterHeader;
|
private final AbstractFilterHeader filterHeader;
|
||||||
|
|
||||||
private AbstractFilterButtons filterButtons;
|
private final AbstractFilterButtons filterButtons;
|
||||||
|
|
||||||
/**
|
protected AbstractFilterLayout(final AbstractFilterHeader filterHeader, final AbstractFilterButtons filterButtons) {
|
||||||
* Initialize the artifact details layout.
|
|
||||||
*/
|
|
||||||
protected void init(final AbstractFilterHeader filterHeader, final AbstractFilterButtons filterButtons,
|
|
||||||
final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
|
||||||
this.filterHeader = filterHeader;
|
this.filterHeader = filterHeader;
|
||||||
this.filterButtons = filterButtons;
|
this.filterButtons = filterButtons;
|
||||||
filterButtons.init(filterButtonClickBehaviour);
|
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildLayout() {
|
private void buildLayout() {
|
||||||
setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS);
|
setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS);
|
||||||
setStyleName("filter-btns-main-layout");
|
setStyleName("filter-btns-main-layout");
|
||||||
setHeight(100.0f, Unit.PERCENTAGE);
|
setHeight(100.0F, Unit.PERCENTAGE);
|
||||||
setSpacing(false);
|
setSpacing(false);
|
||||||
setMargin(false);
|
setMargin(false);
|
||||||
|
|
||||||
@@ -52,10 +42,10 @@ public abstract class AbstractFilterLayout extends VerticalLayout {
|
|||||||
setComponentAlignment(filterHeader, Alignment.TOP_CENTER);
|
setComponentAlignment(filterHeader, Alignment.TOP_CENTER);
|
||||||
setComponentAlignment(filterButtons, Alignment.TOP_CENTER);
|
setComponentAlignment(filterButtons, Alignment.TOP_CENTER);
|
||||||
|
|
||||||
setExpandRatio(filterButtons, 1.0f);
|
setExpandRatio(filterButtons, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restoreState() {
|
protected void restoreState() {
|
||||||
if (onLoadIsTypeFilterIsClosed()) {
|
if (onLoadIsTypeFilterIsClosed()) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,12 +25,6 @@ public abstract class AbstractFilterMultiButtonClick extends AbstractFilterButto
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
protected final transient Set<Button> alreadyClickedButtons = new HashSet<>();
|
protected final transient Set<Button> alreadyClickedButtons = new HashSet<>();
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterButtonClick#
|
|
||||||
* processFilterButtonClick(com.vaadin.ui. Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void processFilterButtonClick(final ClickEvent event) {
|
public void processFilterButtonClick(final ClickEvent event) {
|
||||||
final Button clickedButton = (Button) event.getComponent();
|
final Button clickedButton = (Button) event.getComponent();
|
||||||
@@ -46,12 +40,6 @@ public abstract class AbstractFilterMultiButtonClick extends AbstractFilterButto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterButtonClickBehaviour#
|
|
||||||
* setDefaultClickedButton(com.vaadin .ui.Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void setDefaultClickedButton(final Button button) {
|
protected void setDefaultClickedButton(final Button button) {
|
||||||
if (button != null) {
|
if (button != null) {
|
||||||
@@ -60,10 +48,6 @@ public abstract class AbstractFilterMultiButtonClick extends AbstractFilterButto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param clickedButton
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private boolean isButtonUnClicked(final Button clickedButton) {
|
private boolean isButtonUnClicked(final Button clickedButton) {
|
||||||
return !alreadyClickedButtons.isEmpty() && alreadyClickedButtons.contains(clickedButton);
|
return !alreadyClickedButtons.isEmpty() && alreadyClickedButtons.contains(clickedButton);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ import com.vaadin.ui.Button.ClickEvent;
|
|||||||
/**
|
/**
|
||||||
* Abstract Single button click behaviour of filter buttons layout.
|
* Abstract Single button click behaviour of filter buttons layout.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractFilterSingleButtonClick extends AbstractFilterButtonClickBehaviour {
|
public abstract class AbstractFilterSingleButtonClick extends AbstractFilterButtonClickBehaviour {
|
||||||
|
|
||||||
@@ -26,12 +23,6 @@ public abstract class AbstractFilterSingleButtonClick extends AbstractFilterButt
|
|||||||
|
|
||||||
private Button alreadyClickedButton;
|
private Button alreadyClickedButton;
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterButtonClick#
|
|
||||||
* processFilterButtonClick(com.vaadin.ui. Button.ClickEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void processFilterButtonClick(final ClickEvent event) {
|
protected void processFilterButtonClick(final ClickEvent event) {
|
||||||
final Button clickedButton = (Button) event.getComponent();
|
final Button clickedButton = (Button) event.getComponent();
|
||||||
@@ -54,20 +45,10 @@ public abstract class AbstractFilterSingleButtonClick extends AbstractFilterButt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param clickedButton
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private boolean isButtonUnClicked(final Button clickedButton) {
|
private boolean isButtonUnClicked(final Button clickedButton) {
|
||||||
return alreadyClickedButton != null && alreadyClickedButton.equals(clickedButton);
|
return alreadyClickedButton != null && alreadyClickedButton.equals(clickedButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.layouts.SPFilterButtonClickBehaviour#
|
|
||||||
* setDefaultClickedButton(com.vaadin .ui.Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void setDefaultClickedButton(final Button button) {
|
protected void setDefaultClickedButton(final Button button) {
|
||||||
alreadyClickedButton = button;
|
alreadyClickedButton = button;
|
||||||
@@ -76,17 +57,10 @@ public abstract class AbstractFilterSingleButtonClick extends AbstractFilterButt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the alreadyClickedButton
|
|
||||||
*/
|
|
||||||
public Button getAlreadyClickedButton() {
|
public Button getAlreadyClickedButton() {
|
||||||
return alreadyClickedButton;
|
return alreadyClickedButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param alreadyClickedButton
|
|
||||||
* the alreadyClickedButton to set
|
|
||||||
*/
|
|
||||||
public void setAlreadyClickedButton(final Button alreadyClickedButton) {
|
public void setAlreadyClickedButton(final Button alreadyClickedButton) {
|
||||||
this.alreadyClickedButton = alreadyClickedButton;
|
this.alreadyClickedButton = alreadyClickedButton;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.footer;
|
package org.eclipse.hawkbit.ui.common.footer;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
@@ -21,8 +18,8 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
@@ -48,17 +45,13 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
|
|||||||
|
|
||||||
private static final long serialVersionUID = -6047975388519155509L;
|
private static final long serialVersionUID = -6047975388519155509L;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected SpPermissionChecker permChecker;
|
protected SpPermissionChecker permChecker;
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
protected UINotification notification;
|
||||||
protected transient UINotification notification;
|
|
||||||
|
|
||||||
private DragAndDropWrapper deleteWrapper;
|
private DragAndDropWrapper deleteWrapper;
|
||||||
|
|
||||||
@@ -68,30 +61,30 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
|
|||||||
|
|
||||||
private Button bulkUploadStatusButton;
|
private Button bulkUploadStatusButton;
|
||||||
|
|
||||||
/**
|
protected AbstractDeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker,
|
||||||
* Initialize.
|
final UIEventBus eventBus, final UINotification notification) {
|
||||||
*/
|
this.i18n = i18n;
|
||||||
@PostConstruct
|
this.permChecker = permChecker;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.notification = notification;
|
||||||
|
|
||||||
|
eventBus.subscribe(this);
|
||||||
|
}
|
||||||
|
|
||||||
protected void init() {
|
protected void init() {
|
||||||
if (hasCountMessage() || hasDeletePermission() || hasUpdatePermission() || hasBulkUploadPermission()) {
|
if (hasCountMessage() || hasDeletePermission() || hasUpdatePermission() || hasBulkUploadPermission()) {
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
eventBus.subscribe(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
protected void reload() {
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void reload() {
|
|
||||||
restoreActionCount();
|
restoreActionCount();
|
||||||
restoreBulkUploadStatusCount();
|
restoreBulkUploadStatusCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createComponents() {
|
protected void createComponents() {
|
||||||
if (hasDeletePermission()) {
|
if (hasDeletePermission()) {
|
||||||
deleteWrapper = createDeleteWrapperLayout();
|
deleteWrapper = createDeleteWrapperLayout();
|
||||||
}
|
}
|
||||||
@@ -103,7 +96,7 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildLayout() {
|
protected void buildLayout() {
|
||||||
final HorizontalLayout dropHintLayout = new HorizontalLayout();
|
final HorizontalLayout dropHintLayout = new HorizontalLayout();
|
||||||
if (hasCountMessage()) {
|
if (hasCountMessage()) {
|
||||||
dropHintLayout.addComponent(getCountMessageLabel());
|
dropHintLayout.addComponent(getCountMessageLabel());
|
||||||
|
|||||||
@@ -8,13 +8,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.grid;
|
package org.eclipse.hawkbit.ui.common.grid;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Container;
|
import com.vaadin.data.Container;
|
||||||
import com.vaadin.data.Container.Indexed;
|
import com.vaadin.data.Container.Indexed;
|
||||||
@@ -28,18 +26,17 @@ public abstract class AbstractGrid extends Grid {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 4856562746502217630L;
|
private static final long serialVersionUID = 4856562746502217630L;
|
||||||
|
|
||||||
@Autowired
|
protected final I18N i18n;
|
||||||
protected I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
protected final EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
|
protected final SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
|
protected AbstractGrid(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the components.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
protected void init() {
|
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
setId(getGridId());
|
setId(getGridId());
|
||||||
@@ -49,12 +46,7 @@ public abstract class AbstractGrid extends Grid {
|
|||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
private void addNewContainerDS() {
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addNewContainerDS() {
|
|
||||||
final Container container = createContainer();
|
final Container container = createContainer();
|
||||||
setContainerDataSource((Indexed) container);
|
setContainerDataSource((Indexed) container);
|
||||||
addContainerProperties();
|
addContainerProperties();
|
||||||
|
|||||||
@@ -8,10 +8,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.grid;
|
package org.eclipse.hawkbit.ui.common.grid;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
|
|
||||||
@@ -42,7 +45,17 @@ public abstract class AbstractGridHeader extends VerticalLayout {
|
|||||||
|
|
||||||
private Button closeButton;
|
private Button closeButton;
|
||||||
|
|
||||||
protected void init() {
|
protected final SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
|
protected final RolloutUIState rolloutUIState;
|
||||||
|
|
||||||
|
protected final I18N i18n;
|
||||||
|
|
||||||
|
protected AbstractGridHeader(final SpPermissionChecker permissionChecker, final RolloutUIState rolloutUIState,
|
||||||
|
final I18N i18n) {
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
this.rolloutUIState = rolloutUIState;
|
||||||
|
this.i18n = i18n;
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
restoreState();
|
||||||
|
|||||||
@@ -18,27 +18,24 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Abstract grid layout class which builds layout with grid
|
* Abstract grid layout class which builds layout with grid {@link AbstractGrid}
|
||||||
* {@link AbstractGrid} and table header
|
* and table header {@link AbstractGridHeader}.
|
||||||
* {@link AbstractGridHeader}.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractGridLayout extends VerticalLayout {
|
public abstract class AbstractGridLayout extends VerticalLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8611248179949245460L;
|
private static final long serialVersionUID = 8611248179949245460L;
|
||||||
|
|
||||||
private AbstractGridHeader tableHeader;
|
private final AbstractGridHeader tableHeader;
|
||||||
|
|
||||||
private AbstractGrid grid;
|
protected final AbstractGrid grid;
|
||||||
|
|
||||||
|
protected AbstractGridLayout(final AbstractGridHeader tableHeader, final AbstractGrid grid) {
|
||||||
protected void init(final AbstractGridHeader tableHeader,final AbstractGrid grid) {
|
|
||||||
this.tableHeader = tableHeader;
|
this.tableHeader = tableHeader;
|
||||||
this.grid = grid;
|
this.grid = grid;
|
||||||
buildLayout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildLayout() {
|
protected void buildLayout() {
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setSpacing(true);
|
setSpacing(true);
|
||||||
setMargin(false);
|
setMargin(false);
|
||||||
@@ -54,12 +51,11 @@ public abstract class AbstractGridLayout extends VerticalLayout {
|
|||||||
tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER);
|
tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER);
|
||||||
tableHeaderLayout.addComponent(grid);
|
tableHeaderLayout.addComponent(grid);
|
||||||
tableHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
|
tableHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
|
||||||
tableHeaderLayout.setExpandRatio(grid, 1.0f);
|
tableHeaderLayout.setExpandRatio(grid, 1.0F);
|
||||||
|
|
||||||
|
|
||||||
addComponent(tableHeaderLayout);
|
addComponent(tableHeaderLayout);
|
||||||
setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
|
setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
|
||||||
setExpandRatio(tableHeaderLayout, 1.0f);
|
setExpandRatio(tableHeaderLayout, 1.0F);
|
||||||
if (hasCountMessage()) {
|
if (hasCountMessage()) {
|
||||||
final HorizontalLayout rolloutGroupTargetsCountLayout = createCountMessageComponent();
|
final HorizontalLayout rolloutGroupTargetsCountLayout = createCountMessageComponent();
|
||||||
addComponent(rolloutGroupTargetsCountLayout);
|
addComponent(rolloutGroupTargetsCountLayout);
|
||||||
|
|||||||
@@ -11,8 +11,11 @@ package org.eclipse.hawkbit.ui.common.table;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
||||||
|
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.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
@@ -30,12 +33,8 @@ public abstract class AbstractNamedVersionTable<E extends NamedVersionedEntity,
|
|||||||
|
|
||||||
private static final long serialVersionUID = 780050712209750719L;
|
private static final long serialVersionUID = 780050712209750719L;
|
||||||
|
|
||||||
/**
|
protected AbstractNamedVersionTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification) {
|
||||||
* Initialize the component.
|
super(eventBus, i18n, notification);
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void init() {
|
|
||||||
super.init();
|
|
||||||
setMultiSelect(true);
|
setMultiSelect(true);
|
||||||
setSelectable(true);
|
setSelectable(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
||||||
@@ -28,8 +25,8 @@ 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.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
@@ -61,20 +58,16 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
|
|
||||||
protected static final String ACTION_NOT_ALLOWED_MSG = "message.action.not.allowed";
|
protected static final String ACTION_NOT_ALLOWED_MSG = "message.action.not.allowed";
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected UINotification notification;
|
protected UINotification notification;
|
||||||
|
|
||||||
/**
|
protected AbstractTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification) {
|
||||||
* Initialize the components.
|
this.eventBus = eventBus;
|
||||||
*/
|
this.i18n = i18n;
|
||||||
@PostConstruct
|
this.notification = notification;
|
||||||
protected void init() {
|
|
||||||
setStyleName("sp-table");
|
setStyleName("sp-table");
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
@@ -84,22 +77,13 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
setSortEnabled(false);
|
setSortEnabled(false);
|
||||||
setId(getTableId());
|
setId(getTableId());
|
||||||
addCustomGeneratedColumns();
|
addCustomGeneratedColumns();
|
||||||
addNewContainerDS();
|
|
||||||
setColumnProperties();
|
|
||||||
setDefault();
|
setDefault();
|
||||||
addValueChangeListener(event -> onValueChange());
|
addValueChangeListener(event -> onValueChange());
|
||||||
selectRow();
|
|
||||||
setPageLength(SPUIDefinitions.PAGE_SIZE);
|
setPageLength(SPUIDefinitions.PAGE_SIZE);
|
||||||
|
|
||||||
setDataAvailable(getContainerDataSource().size() != 0);
|
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
protected void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the selected item id or in multiselect mode a set of selected ids.
|
* Gets the selected item id or in multiselect mode a set of selected ids.
|
||||||
*
|
*
|
||||||
@@ -148,7 +132,7 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
setDropHandler(getTableDropHandler());
|
setDropHandler(getTableDropHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNewContainerDS() {
|
protected void addNewContainerDS() {
|
||||||
final Container container = createContainer();
|
final Container container = createContainer();
|
||||||
addContainerProperties(container);
|
addContainerProperties(container);
|
||||||
setContainerDataSource(container);
|
setContainerDataSource(container);
|
||||||
@@ -178,7 +162,7 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setColumnProperties() {
|
protected void setColumnProperties() {
|
||||||
final List<TableColumn> columnList = getTableVisibleColumns();
|
final List<TableColumn> columnList = getTableVisibleColumns();
|
||||||
final List<Object> swColumnIds = new ArrayList<>();
|
final List<Object> swColumnIds = new ArrayList<>();
|
||||||
for (final TableColumn column : columnList) {
|
for (final TableColumn column : columnList) {
|
||||||
@@ -249,9 +233,9 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
|
|
||||||
protected void onBaseEntityEvent(final BaseUIEntityEvent<E> event) {
|
protected void onBaseEntityEvent(final BaseUIEntityEvent<E> event) {
|
||||||
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
||||||
UI.getCurrent().access(() -> applyMinTableSettings());
|
UI.getCurrent().access(this::applyMinTableSettings);
|
||||||
} else if (BaseEntityEventType.MAXIMIZED == event.getEventType()) {
|
} else if (BaseEntityEventType.MAXIMIZED == event.getEventType()) {
|
||||||
UI.getCurrent().access(() -> applyMaxTableSettings());
|
UI.getCurrent().access(this::applyMaxTableSettings);
|
||||||
} else if (BaseEntityEventType.NEW_ENTITY == event.getEventType()) {
|
} else if (BaseEntityEventType.NEW_ENTITY == event.getEventType()) {
|
||||||
UI.getCurrent().access(() -> addEntity(event.getEntity()));
|
UI.getCurrent().access(() -> addEntity(event.getEntity()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,21 +8,21 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.table;
|
package org.eclipse.hawkbit.ui.common.table;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
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.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -41,14 +41,11 @@ public abstract class AbstractTableHeader extends VerticalLayout {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 4881626370291837175L;
|
private static final long serialVersionUID = 4881626370291837175L;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected SpPermissionChecker permChecker;
|
protected SpPermissionChecker permChecker;
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventbus;
|
||||||
protected transient EventBus.SessionEventBus eventbus;
|
|
||||||
|
|
||||||
private Label headerCaption;
|
private Label headerCaption;
|
||||||
|
|
||||||
@@ -64,26 +61,27 @@ public abstract class AbstractTableHeader extends VerticalLayout {
|
|||||||
|
|
||||||
private HorizontalLayout filterDroppedInfo;
|
private HorizontalLayout filterDroppedInfo;
|
||||||
|
|
||||||
private DragAndDropWrapper dropFilterLayout;
|
|
||||||
|
|
||||||
private Button bulkUploadIcon;
|
private Button bulkUploadIcon;
|
||||||
|
|
||||||
/**
|
protected final ManagementUIState managementUIState;
|
||||||
* Initialze components.
|
protected final ManageDistUIState manageDistUIstate;
|
||||||
*/
|
protected final ArtifactUploadState artifactUploadState;
|
||||||
@PostConstruct
|
|
||||||
protected void init() {
|
protected AbstractTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
|
||||||
|
final ManagementUIState managementUIState, final ManageDistUIState manageDistUIstate,
|
||||||
|
final ArtifactUploadState artifactUploadState) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.permChecker = permChecker;
|
||||||
|
this.eventbus = eventbus;
|
||||||
|
this.managementUIState = managementUIState;
|
||||||
|
this.manageDistUIstate = manageDistUIstate;
|
||||||
|
this.artifactUploadState = artifactUploadState;
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
restoreState();
|
||||||
eventbus.subscribe(this);
|
eventbus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
eventbus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createComponents() {
|
private void createComponents() {
|
||||||
headerCaption = createHeaderCaption();
|
headerCaption = createHeaderCaption();
|
||||||
searchField = new TextFieldBuilder(getSearchBoxId()).createSearchField(event -> searchBy(event.getText()));
|
searchField = new TextFieldBuilder(getSearchBoxId()).createSearchField(event -> searchBy(event.getText()));
|
||||||
@@ -181,7 +179,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
|
|||||||
filterDroppedInfo.setHeightUndefined();
|
filterDroppedInfo.setHeightUndefined();
|
||||||
filterDroppedInfo.setSizeUndefined();
|
filterDroppedInfo.setSizeUndefined();
|
||||||
displayFilterDropedInfoOnLoad();
|
displayFilterDropedInfoOnLoad();
|
||||||
dropFilterLayout = new DragAndDropWrapper(filterDroppedInfo);
|
final DragAndDropWrapper dropFilterLayout = new DragAndDropWrapper(filterDroppedInfo);
|
||||||
dropFilterLayout.setId(getDropFilterId());
|
dropFilterLayout.setId(getDropFilterId());
|
||||||
dropFilterLayout.setDropHandler(getDropFilterHandler());
|
dropFilterLayout.setDropHandler(getDropFilterHandler());
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public abstract class AbstractTableLayout extends VerticalLayout {
|
|||||||
this.table = table;
|
this.table = table;
|
||||||
this.detailsLayout = detailsLayout;
|
this.detailsLayout = detailsLayout;
|
||||||
buildLayout();
|
buildLayout();
|
||||||
|
|
||||||
|
table.selectRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildLayout() {
|
private void buildLayout() {
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.BaseEntity;
|
import org.eclipse.hawkbit.repository.model.BaseEntity;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
@@ -25,8 +22,8 @@ import org.eclipse.hawkbit.ui.utils.I18N;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
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.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
import org.vaadin.tokenfield.TokenField;
|
import org.vaadin.tokenfield.TokenField;
|
||||||
import org.vaadin.tokenfield.TokenField.InsertPosition;
|
import org.vaadin.tokenfield.TokenField.InsertPosition;
|
||||||
|
|
||||||
@@ -65,19 +62,14 @@ public abstract class AbstractTagToken<T extends BaseEntity> implements Serializ
|
|||||||
|
|
||||||
protected CssLayout tokenLayout = new CssLayout();
|
protected CssLayout tokenLayout = new CssLayout();
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected SpPermissionChecker checker;
|
protected SpPermissionChecker checker;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected UINotification uinotification;
|
protected UINotification uinotification;
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected ManagementUIState managementUIState;
|
protected ManagementUIState managementUIState;
|
||||||
|
|
||||||
// BaseEntity implements Serializable so this entity is serializable. Maybe
|
// BaseEntity implements Serializable so this entity is serializable. Maybe
|
||||||
@@ -85,18 +77,18 @@ public abstract class AbstractTagToken<T extends BaseEntity> implements Serializ
|
|||||||
@SuppressWarnings("squid:S1948")
|
@SuppressWarnings("squid:S1948")
|
||||||
protected T selectedEntity;
|
protected T selectedEntity;
|
||||||
|
|
||||||
@PostConstruct
|
protected AbstractTagToken(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
|
||||||
protected void init() {
|
final UIEventBus eventBus, final ManagementUIState managementUIState) {
|
||||||
|
this.checker = checker;
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uinotification = uinotification;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.managementUIState = managementUIState;
|
||||||
createTokenField();
|
createTokenField();
|
||||||
checkIfTagAssignedIsAllowed();
|
checkIfTagAssignedIsAllowed();
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
protected void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onBaseEntityEvent(final BaseUIEntityEvent<T> baseEntityEvent) {
|
protected void onBaseEntityEvent(final BaseUIEntityEvent<T> baseEntityEvent) {
|
||||||
if (BaseEntityEventType.SELECTED_ENTITY != baseEntityEvent.getEventType()) {
|
if (BaseEntityEventType.SELECTED_ENTITY != baseEntityEvent.getEventType()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -10,12 +10,16 @@ package org.eclipse.hawkbit.ui.common.tagdetails;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.TagManagement;
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.event.remote.entity.TargetTagUpdateEvent;
|
import org.eclipse.hawkbit.repository.event.remote.entity.TargetTagUpdateEvent;
|
||||||
import org.eclipse.hawkbit.repository.model.BaseEntity;
|
import org.eclipse.hawkbit.repository.model.BaseEntity;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.push.TargetTagCreatedEventContainer;
|
import org.eclipse.hawkbit.ui.push.TargetTagCreatedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.push.TargetTagDeletedEventContainer;
|
import org.eclipse.hawkbit.ui.push.TargetTagDeletedEventContainer;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -31,22 +35,28 @@ public abstract class AbstractTargetTagToken<T extends BaseEntity> extends Abstr
|
|||||||
|
|
||||||
private static final long serialVersionUID = 7772876588903171201L;
|
private static final long serialVersionUID = 7772876588903171201L;
|
||||||
|
|
||||||
@Autowired
|
protected final TagManagement tagManagement;
|
||||||
protected transient TagManagement tagManagement;
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
protected AbstractTargetTagToken(final SpPermissionChecker checker, final I18N i18n,
|
||||||
|
final UINotification uinotification, final UIEventBus eventBus, final ManagementUIState managementUIState,
|
||||||
|
final TagManagement tagManagement) {
|
||||||
|
super(checker, i18n, uinotification, eventBus, managementUIState);
|
||||||
|
this.tagManagement = tagManagement;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEventTargetTagCreated(final TargetTagCreatedEventContainer container) {
|
void onEventTargetTagCreated(final TargetTagCreatedEventContainer container) {
|
||||||
container.getEvents().stream().map(event -> event.getEntity())
|
container.getEvents().stream().map(event -> event.getEntity())
|
||||||
.forEach(tag -> setContainerPropertValues(tag.getId(), tag.getName(), tag.getColour()));
|
.forEach(tag -> setContainerPropertValues(tag.getId(), tag.getName(), tag.getColour()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onTargetTagDeletedEvent(final TargetTagDeletedEventContainer container) {
|
void onTargetTagDeletedEvent(final TargetTagDeletedEventContainer container) {
|
||||||
container.getEvents().stream().map(event -> getTagIdByTagName(event.getEntityId()))
|
container.getEvents().stream().map(event -> getTagIdByTagName(event.getEntityId()))
|
||||||
.forEach(this::removeTagFromCombo);
|
.forEach(this::removeTagFromCombo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onTargetTagUpdateEvent(final List<TargetTagUpdateEvent> events) {
|
void onTargetTagUpdateEvent(final List<TargetTagUpdateEvent> events) {
|
||||||
events.stream().map(event -> event.getEntity()).forEach(entity -> {
|
events.stream().map(event -> event.getEntity()).forEach(entity -> {
|
||||||
final Item item = container.getItem(entity.getId());
|
final Item item = container.getItem(entity.getId());
|
||||||
|
|||||||
@@ -12,43 +12,50 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.TagManagement;
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetTagAssignmentResult;
|
import org.eclipse.hawkbit.repository.model.DistributionSetTagAssignmentResult;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.push.DistributionSetTagCreatedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionSetTagCreatedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.push.DistributionSetTagDeletedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionSetTagDeletedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.push.DistributionSetTagUpdatedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionSetTagUpdatedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of target/ds tag token layout.
|
* Implementation of target/ds tag token layout.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionTagToken extends AbstractTagToken<DistributionSet> {
|
public class DistributionTagToken extends AbstractTagToken<DistributionSet> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8022738301736043396L;
|
private static final long serialVersionUID = -8022738301736043396L;
|
||||||
@Autowired
|
|
||||||
private transient TagManagement tagManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final TagManagement tagManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
|
|
||||||
// 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;
|
||||||
|
|
||||||
|
public DistributionTagToken(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
|
||||||
|
final UIEventBus eventBus, final ManagementUIState managementUIState, final TagManagement tagManagement,
|
||||||
|
final DistributionSetManagement distributionSetManagement) {
|
||||||
|
super(checker, i18n, uinotification, eventBus, managementUIState);
|
||||||
|
this.tagManagement = tagManagement;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTagStyleName() {
|
protected String getTagStyleName() {
|
||||||
return "distribution-tag-";
|
return "distribution-tag-";
|
||||||
@@ -111,25 +118,25 @@ public class DistributionTagToken extends AbstractTagToken<DistributionSet> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
||||||
onBaseEntityEvent(distributionTableEvent);
|
onBaseEntityEvent(distributionTableEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionSetTagCreatedBulkEvent(final DistributionSetTagCreatedEventContainer eventContainer) {
|
void onDistributionSetTagCreatedBulkEvent(final DistributionSetTagCreatedEventContainer eventContainer) {
|
||||||
eventContainer.getEvents().stream().map(event -> event.getEntity())
|
eventContainer.getEvents().stream().map(event -> event.getEntity())
|
||||||
.forEach(distributionSetTag -> setContainerPropertValues(distributionSetTag.getId(),
|
.forEach(distributionSetTag -> setContainerPropertValues(distributionSetTag.getId(),
|
||||||
distributionSetTag.getName(), distributionSetTag.getColour()));
|
distributionSetTag.getName(), distributionSetTag.getColour()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionSetTagDeletedEvent(final DistributionSetTagDeletedEventContainer eventContainer) {
|
void onDistributionSetTagDeletedEvent(final DistributionSetTagDeletedEventContainer eventContainer) {
|
||||||
eventContainer.getEvents().stream().map(event -> getTagIdByTagName(event.getEntityId()))
|
eventContainer.getEvents().stream().map(event -> getTagIdByTagName(event.getEntityId()))
|
||||||
.forEach(this::removeTagFromCombo);
|
.forEach(this::removeTagFromCombo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionSetTagUpdateEvent(final DistributionSetTagUpdatedEventContainer eventContainer) {
|
void onDistributionSetTagUpdateEvent(final DistributionSetTagUpdatedEventContainer eventContainer) {
|
||||||
eventContainer.getEvents().stream().map(event -> event.getEntity()).forEach(entity -> {
|
eventContainer.getEvents().stream().map(event -> event.getEntity()).forEach(entity -> {
|
||||||
final Item item = container.getItem(entity.getId());
|
final Item item = container.getItem(entity.getId());
|
||||||
|
|||||||
@@ -11,27 +11,27 @@ package org.eclipse.hawkbit.ui.common.tagdetails;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.Target;
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||||
import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult;
|
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.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of Target tag token.
|
* Implementation of Target tag token.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class TargetTagToken extends AbstractTargetTagToken<Target> {
|
public class TargetTagToken extends AbstractTargetTagToken<Target> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7124887018280196721L;
|
private static final long serialVersionUID = 7124887018280196721L;
|
||||||
@@ -39,8 +39,14 @@ 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 final TargetManagement targetManagement;
|
||||||
private transient TargetManagement targetManagement;
|
|
||||||
|
public TargetTagToken(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
|
||||||
|
final UIEventBus eventBus, final ManagementUIState managementUIState, final TagManagement tagManagement,
|
||||||
|
final TargetManagement targetManagement) {
|
||||||
|
super(checker, i18n, uinotification, eventBus, managementUIState, tagManagement);
|
||||||
|
this.targetManagement = targetManagement;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTagStyleName() {
|
protected String getTagStyleName() {
|
||||||
@@ -136,7 +142,7 @@ public class TargetTagToken extends AbstractTargetTagToken<Target> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final TargetTableEvent targetTableEvent) {
|
void onEvent(final TargetTableEvent targetTableEvent) {
|
||||||
onBaseEntityEvent(targetTableEvent);
|
onBaseEntityEvent(targetTableEvent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,23 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions;
|
package org.eclipse.hawkbit.ui.distributions;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
import org.eclipse.hawkbit.ui.distributions.disttype.DSTypeFilterLayout;
|
import org.eclipse.hawkbit.ui.distributions.disttype.DSTypeFilterLayout;
|
||||||
import org.eclipse.hawkbit.ui.distributions.dstable.DistributionSetTableLayout;
|
import org.eclipse.hawkbit.ui.distributions.dstable.DistributionSetTableLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DragEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DragEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.footer.DSDeleteActionsLayout;
|
import org.eclipse.hawkbit.ui.distributions.footer.DSDeleteActionsLayout;
|
||||||
import org.eclipse.hawkbit.ui.distributions.smtable.SwModuleTableLayout;
|
import org.eclipse.hawkbit.ui.distributions.smtable.SwModuleTableLayout;
|
||||||
@@ -27,6 +36,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
|||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
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.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -45,9 +55,6 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage distributions and distributions type view.
|
* Manage distributions and distributions type view.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringView(name = DistributionsView.VIEW_NAME, ui = HawkbitUI.class)
|
@SpringView(name = DistributionsView.VIEW_NAME, ui = HawkbitUI.class)
|
||||||
@UIScope
|
@UIScope
|
||||||
@@ -56,47 +63,57 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
public static final String VIEW_NAME = "distributions";
|
public static final String VIEW_NAME = "distributions";
|
||||||
private static final long serialVersionUID = 3887435076372276300L;
|
private static final long serialVersionUID = 3887435076372276300L;
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permChecker;
|
||||||
private SpPermissionChecker permChecker;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uiNotification;
|
||||||
private transient UINotification uiNotification;
|
|
||||||
|
|
||||||
@Autowired
|
private final DSTypeFilterLayout filterByDSTypeLayout;
|
||||||
private DSTypeFilterLayout filterByDSTypeLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetTableLayout distributionTableLayout;
|
||||||
private DistributionSetTableLayout distributionTableLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final SwModuleTableLayout softwareModuleTableLayout;
|
||||||
private SwModuleTableLayout softwareModuleTableLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistSMTypeFilterLayout filterBySMTypeLayout;
|
||||||
private DistSMTypeFilterLayout filterBySMTypeLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DSDeleteActionsLayout deleteActionsLayout;
|
||||||
private DSDeleteActionsLayout deleteActionsLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
private GridLayout mainLayout;
|
private GridLayout mainLayout;
|
||||||
|
|
||||||
/*
|
@Autowired
|
||||||
* (non-Javadoc)
|
DistributionsView(final SpPermissionChecker permChecker, final UIEventBus eventBus, final I18N i18n,
|
||||||
*
|
final UINotification uiNotification, final ManageDistUIState manageDistUIState,
|
||||||
* @see
|
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
|
||||||
* com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.
|
final TargetManagement targetManagement, final EntityFactory entityFactory,
|
||||||
* ViewChangeEvent)
|
final TagManagement tagManagement, final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
*/
|
final ArtifactUploadState artifactUploadState, final SystemManagement systemManagement) {
|
||||||
@Override
|
this.permChecker = permChecker;
|
||||||
public void enter(final ViewChangeEvent event) {
|
this.eventBus = eventBus;
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uiNotification = uiNotification;
|
||||||
|
this.filterByDSTypeLayout = new DSTypeFilterLayout(manageDistUIState, i18n, permChecker, eventBus,
|
||||||
|
tagManagement, entityFactory, uiNotification, softwareManagement, distributionSetManagement,
|
||||||
|
distributionsViewAcceptCriteria);
|
||||||
|
this.distributionTableLayout = new DistributionSetTableLayout(i18n, eventBus, permChecker, manageDistUIState,
|
||||||
|
softwareManagement, distributionSetManagement, targetManagement, entityFactory, uiNotification,
|
||||||
|
tagManagement, distributionsViewAcceptCriteria, systemManagement);
|
||||||
|
this.softwareModuleTableLayout = new SwModuleTableLayout(i18n, uiNotification, eventBus, softwareManagement,
|
||||||
|
entityFactory, manageDistUIState, permChecker, distributionsViewAcceptCriteria, artifactUploadState);
|
||||||
|
this.filterBySMTypeLayout = new DistSMTypeFilterLayout(eventBus, i18n, permChecker, manageDistUIState,
|
||||||
|
tagManagement, entityFactory, uiNotification, softwareManagement, distributionsViewAcceptCriteria);
|
||||||
|
this.deleteActionsLayout = new DSDeleteActionsLayout(i18n, permChecker, eventBus, uiNotification,
|
||||||
|
systemManagement, manageDistUIState, distributionsViewAcceptCriteria, distributionSetManagement,
|
||||||
|
softwareManagement);
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
void init() {
|
||||||
// Build the Distributions view layout with all the required components.
|
// Build the Distributions view layout with all the required components.
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
restoreState();
|
||||||
@@ -142,9 +159,9 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
mainLayout.addComponent(softwareModuleTableLayout, 2, 0);
|
mainLayout.addComponent(softwareModuleTableLayout, 2, 0);
|
||||||
mainLayout.addComponent(filterBySMTypeLayout, 3, 0);
|
mainLayout.addComponent(filterBySMTypeLayout, 3, 0);
|
||||||
mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
|
mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
|
||||||
mainLayout.setRowExpandRatio(0, 1.0f);
|
mainLayout.setRowExpandRatio(0, 1.0F);
|
||||||
mainLayout.setColumnExpandRatio(1, 0.5f);
|
mainLayout.setColumnExpandRatio(1, 0.5F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0.5f);
|
mainLayout.setColumnExpandRatio(2, 0.5F);
|
||||||
mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
|
mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +174,7 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent event) {
|
void onEvent(final DistributionTableEvent event) {
|
||||||
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
||||||
minimizeDistTable();
|
minimizeDistTable();
|
||||||
@@ -166,7 +183,7 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent event) {
|
void onEvent(final SoftwareModuleEvent event) {
|
||||||
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
||||||
minimizeSwTable();
|
minimizeSwTable();
|
||||||
@@ -179,17 +196,17 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
mainLayout.removeComponent(filterByDSTypeLayout);
|
mainLayout.removeComponent(filterByDSTypeLayout);
|
||||||
mainLayout.removeComponent(distributionTableLayout);
|
mainLayout.removeComponent(distributionTableLayout);
|
||||||
mainLayout.removeComponent(deleteActionsLayout);
|
mainLayout.removeComponent(deleteActionsLayout);
|
||||||
mainLayout.setColumnExpandRatio(2, 1f);
|
mainLayout.setColumnExpandRatio(2, 1F);
|
||||||
mainLayout.setColumnExpandRatio(0, 0f);
|
mainLayout.setColumnExpandRatio(0, 0F);
|
||||||
mainLayout.setColumnExpandRatio(1, 0f);
|
mainLayout.setColumnExpandRatio(1, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void minimizeSwTable() {
|
private void minimizeSwTable() {
|
||||||
mainLayout.addComponent(filterByDSTypeLayout, 0, 0);
|
mainLayout.addComponent(filterByDSTypeLayout, 0, 0);
|
||||||
mainLayout.addComponent(distributionTableLayout, 1, 0);
|
mainLayout.addComponent(distributionTableLayout, 1, 0);
|
||||||
mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
|
mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
|
||||||
mainLayout.setColumnExpandRatio(1, 0.5f);
|
mainLayout.setColumnExpandRatio(1, 0.5F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0.5f);
|
mainLayout.setColumnExpandRatio(2, 0.5F);
|
||||||
mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
|
mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,8 +214,8 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
mainLayout.addComponent(softwareModuleTableLayout, 2, 0);
|
mainLayout.addComponent(softwareModuleTableLayout, 2, 0);
|
||||||
mainLayout.addComponent(filterBySMTypeLayout, 3, 0);
|
mainLayout.addComponent(filterBySMTypeLayout, 3, 0);
|
||||||
mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
|
mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
|
||||||
mainLayout.setColumnExpandRatio(1, 0.5f);
|
mainLayout.setColumnExpandRatio(1, 0.5F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0.5f);
|
mainLayout.setColumnExpandRatio(2, 0.5F);
|
||||||
mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
|
mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,9 +223,9 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
mainLayout.removeComponent(softwareModuleTableLayout);
|
mainLayout.removeComponent(softwareModuleTableLayout);
|
||||||
mainLayout.removeComponent(filterBySMTypeLayout);
|
mainLayout.removeComponent(filterBySMTypeLayout);
|
||||||
mainLayout.removeComponent(deleteActionsLayout);
|
mainLayout.removeComponent(deleteActionsLayout);
|
||||||
mainLayout.setColumnExpandRatio(1, 1f);
|
mainLayout.setColumnExpandRatio(1, 1F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0f);
|
mainLayout.setColumnExpandRatio(2, 0F);
|
||||||
mainLayout.setColumnExpandRatio(3, 0f);
|
mainLayout.setColumnExpandRatio(3, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkNoDataAvaialble() {
|
private void checkNoDataAvaialble() {
|
||||||
@@ -243,4 +260,9 @@ public class DistributionsView extends VerticalLayout implements View, BrowserWi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enter(final ViewChangeEvent event) {
|
||||||
|
// This view is constructed in the init() method()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ import java.util.Set;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.builder.DistributionSetTypeUpdate;
|
import org.eclipse.hawkbit.repository.builder.DistributionSetTypeUpdate;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||||
@@ -28,21 +31,21 @@ import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent.DistributionSetTypeEnum;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent.DistributionSetTypeEnum;
|
||||||
import org.eclipse.hawkbit.ui.layouts.CreateUpdateTypeLayout;
|
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.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.data.Property.ValueChangeEvent;
|
import com.vaadin.data.Property.ValueChangeEvent;
|
||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.colorpicker.Color;
|
import com.vaadin.shared.ui.colorpicker.Color;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
|
import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
@@ -57,8 +60,6 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
/**
|
/**
|
||||||
* Window for create update Distribution Set Type.
|
* Window for create update Distribution Set Type.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<DistributionSetType> {
|
public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<DistributionSetType> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -67,11 +68,9 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
|
|||||||
private static final String DIST_TYPE_MANDATORY = "mandatory";
|
private static final String DIST_TYPE_MANDATORY = "mandatory";
|
||||||
private static final String STAR = " * ";
|
private static final String STAR = " * ";
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
private HorizontalLayout distTypeSelectLayout;
|
private HorizontalLayout distTypeSelectLayout;
|
||||||
private Table sourceTable;
|
private Table sourceTable;
|
||||||
@@ -82,6 +81,15 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
|
|||||||
|
|
||||||
private IndexedContainer originalSelectedTableContainer;
|
private IndexedContainer originalSelectedTableContainer;
|
||||||
|
|
||||||
|
public CreateUpdateDistSetTypeLayout(final I18N i18n, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
|
||||||
|
final UINotification uiNotification, final SoftwareManagement softwareManagement,
|
||||||
|
final DistributionSetManagement distributionSetManagement) {
|
||||||
|
super(i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createRequiredComponents() {
|
protected void createRequiredComponents() {
|
||||||
|
|
||||||
|
|||||||
@@ -15,41 +15,31 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
|||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterSingleButtonClick;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterSingleButtonClick;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single button click behaviour of filter buttons layout.
|
* Single button click behaviour of filter buttons layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DSTypeFilterButtonClick extends AbstractFilterSingleButtonClick implements Serializable {
|
public class DSTypeFilterButtonClick extends AbstractFilterSingleButtonClick implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -584783755917528648L;
|
private static final long serialVersionUID = -584783755917528648L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
public DSTypeFilterButtonClick(final UIEventBus eventBus, final ManageDistUIState manageDistUIState,
|
||||||
|
final DistributionSetManagement distributionSetManagement) {
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.
|
|
||||||
* AbstractFilterButtonClickBehaviour#filterUnClicked (com.vaadin.ui.Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void filterUnClicked(final Button clickedButton) {
|
protected void filterUnClicked(final Button clickedButton) {
|
||||||
manageDistUIState.getManageDistFilters().setClickedDistSetType(null);
|
manageDistUIState.getManageDistFilters().setClickedDistSetType(null);
|
||||||
@@ -57,12 +47,6 @@ public class DSTypeFilterButtonClick extends AbstractFilterSingleButtonClick imp
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.
|
|
||||||
* AbstractFilterButtonClickBehaviour#filterClicked (com.vaadin.ui.Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void filterClicked(final Button clickedButton) {
|
protected void filterClicked(final Button clickedButton) {
|
||||||
final DistributionSetType distSetType = distributionSetManagement
|
final DistributionSetType distSetType = distributionSetManagement
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.disttype;
|
package org.eclipse.hawkbit.ui.distributions.disttype;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
import org.eclipse.hawkbit.ui.common.DistributionSetTypeBeanQuery;
|
import org.eclipse.hawkbit.ui.common.DistributionSetTypeBeanQuery;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent;
|
||||||
@@ -17,32 +18,34 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
|||||||
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.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
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;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution Set Type filter buttons.
|
* Distribution Set Type filter buttons.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DSTypeFilterButtons extends AbstractFilterButtons {
|
public class DSTypeFilterButtons extends AbstractFilterButtons {
|
||||||
|
|
||||||
private static final long serialVersionUID = 771251569981876005L;
|
private static final long serialVersionUID = 771251569981876005L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
||||||
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
|
||||||
|
public DSTypeFilterButtons(final UIEventBus eventBus, final ManageDistUIState manageDistUIState,
|
||||||
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
|
final DistributionSetManagement distributionSetManagement) {
|
||||||
|
super(eventBus, new DSTypeFilterButtonClick(eventBus, manageDistUIState, distributionSetManagement));
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.distributionsViewAcceptCriteria = distributionsViewAcceptCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButtonsTableId() {
|
protected String getButtonsTableId() {
|
||||||
@@ -52,8 +55,7 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||||
return HawkbitCommonUtil.createLazyQueryContainer(
|
return HawkbitCommonUtil.createLazyQueryContainer(new BeanQueryFactory<>(DistributionSetTypeBeanQuery.class));
|
||||||
new BeanQueryFactory<DistributionSetTypeBeanQuery>(DistributionSetTypeBeanQuery.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,7 +99,7 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
return SPUIDefinitions.DISTRIBUTION_SET_TYPE_ID_PREFIXS;
|
return SPUIDefinitions.DISTRIBUTION_SET_TYPE_ID_PREFIXS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionSetTypeEvent event) {
|
void onEvent(final DistributionSetTypeEvent event) {
|
||||||
if (event.getDistributionSetTypeEnum() == DistributionSetTypeEvent.DistributionSetTypeEnum.ADD_DIST_SET_TYPE
|
if (event.getDistributionSetTypeEnum() == DistributionSetTypeEvent.DistributionSetTypeEnum.ADD_DIST_SET_TYPE
|
||||||
|| event.getDistributionSetTypeEnum() == DistributionSetTypeEvent.DistributionSetTypeEnum.UPDATE_DIST_SET_TYPE) {
|
|| event.getDistributionSetTypeEnum() == DistributionSetTypeEvent.DistributionSetTypeEnum.UPDATE_DIST_SET_TYPE) {
|
||||||
@@ -106,7 +108,7 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent event) {
|
void onEvent(final SaveActionWindowEvent event) {
|
||||||
if (event == SaveActionWindowEvent.SAVED_DELETE_DIST_SET_TYPES) {
|
if (event == SaveActionWindowEvent.SAVED_DELETE_DIST_SET_TYPES) {
|
||||||
refreshTypeTable();
|
refreshTypeTable();
|
||||||
|
|||||||
@@ -8,42 +8,43 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.disttype;
|
package org.eclipse.hawkbit.ui.distributions.disttype;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.common.CommonDialogWindow;
|
import org.eclipse.hawkbit.ui.common.CommonDialogWindow;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution Set Type filter buttons header.
|
* Distribution Set Type filter buttons header.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DSTypeFilterHeader extends AbstractFilterHeader {
|
public class DSTypeFilterHeader extends AbstractFilterHeader {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3433417459392880222L;
|
private static final long serialVersionUID = 3433417459392880222L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final CreateUpdateDistSetTypeLayout createUpdateDistSetTypeLayout;
|
||||||
private CreateUpdateDistSetTypeLayout createUpdateDistSetTypeLayout;
|
|
||||||
|
|
||||||
private CommonDialogWindow addUpdateWindow;
|
public DSTypeFilterHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
|
||||||
|
final ManageDistUIState manageDistUIState, final TagManagement tagManagement,
|
||||||
@Override
|
final EntityFactory entityFactory, final UINotification uiNotification,
|
||||||
@PostConstruct
|
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) {
|
||||||
public void init() {
|
super(permChecker, eventBus, i18n);
|
||||||
super.init();
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.createUpdateDistSetTypeLayout = new CreateUpdateDistSetTypeLayout(i18n, tagManagement, entityFactory,
|
||||||
|
eventBus, permChecker, uiNotification, softwareManagement, distributionSetManagement);
|
||||||
if (hasCreateUpdatePermission()) {
|
if (hasCreateUpdatePermission()) {
|
||||||
createUpdateDistSetTypeLayout.init();
|
createUpdateDistSetTypeLayout.init();
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,7 @@ public class DSTypeFilterHeader extends AbstractFilterHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void settingsIconClicked(final ClickEvent event) {
|
protected void settingsIconClicked(final ClickEvent event) {
|
||||||
addUpdateWindow = createUpdateDistSetTypeLayout.getWindow();
|
final CommonDialogWindow addUpdateWindow = createUpdateDistSetTypeLayout.getWindow();
|
||||||
UI.getCurrent().addWindow(addUpdateWindow);
|
UI.getCurrent().addWindow(addUpdateWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,58 +8,46 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.disttype;
|
package org.eclipse.hawkbit.ui.distributions.disttype;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
import javax.annotation.PreDestroy;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution Set Type filter buttons layout.
|
* Distribution Set Type filter buttons layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DSTypeFilterLayout extends AbstractFilterLayout {
|
public class DSTypeFilterLayout extends AbstractFilterLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2689002932344750781L;
|
private static final long serialVersionUID = 2689002932344750781L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private transient EventBus.SessionEventBus eventbus;
|
|
||||||
|
|
||||||
@Autowired
|
public DSTypeFilterLayout(final ManageDistUIState manageDistUIState, final I18N i18n,
|
||||||
private DSTypeFilterHeader dsTypeFilterHeader;
|
final SpPermissionChecker permChecker, final UIEventBus eventBus, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UINotification uiNotification,
|
||||||
|
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
|
||||||
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria) {
|
||||||
|
super(new DSTypeFilterHeader(i18n, permChecker, eventBus, manageDistUIState, tagManagement, entityFactory,
|
||||||
|
uiNotification, softwareManagement, distributionSetManagement),
|
||||||
|
new DSTypeFilterButtons(eventBus, manageDistUIState, distributionsViewAcceptCriteria,
|
||||||
|
distributionSetManagement));
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
|
||||||
@Autowired
|
restoreState();
|
||||||
private DSTypeFilterButtons dsTypeFilterButtons;
|
eventBus.subscribe(this);
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DSTypeFilterButtonClick dsTypeFilterButtonClick;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the filter layout.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
super.init(dsTypeFilterHeader, dsTypeFilterButtons, dsTypeFilterButtonClick);
|
|
||||||
eventbus.subscribe(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionsUIEvent event) {
|
void onEvent(final DistributionsUIEvent event) {
|
||||||
if (event == DistributionsUIEvent.HIDE_DIST_FILTER_BY_TYPE) {
|
if (event == DistributionsUIEvent.HIDE_DIST_FILTER_BY_TYPE) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
@@ -69,22 +57,6 @@ public class DSTypeFilterLayout extends AbstractFilterLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
/*
|
|
||||||
* It's good manners to do this, even though vaadin-spring will
|
|
||||||
* automatically unsubscribe when this UI is garbage collected.
|
|
||||||
*/
|
|
||||||
eventbus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterLayout#
|
|
||||||
* onLoadIsTypeFilterIsClosed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTypeFilterIsClosed() {
|
public Boolean onLoadIsTypeFilterIsClosed() {
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import java.util.Set;
|
|||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
@@ -34,16 +36,17 @@ import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
|
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.HorizontalLayout;
|
import com.vaadin.ui.HorizontalLayout;
|
||||||
@@ -55,41 +58,28 @@ import com.vaadin.ui.Window;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Distribution set details layout.
|
* Distribution set details layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDetailsLayout<DistributionSet> {
|
public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDetailsLayout<DistributionSet> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4595004466943546669L;
|
private static final long serialVersionUID = -4595004466943546669L;
|
||||||
|
|
||||||
private static final String SOFT_MODULE = "softwareModule";
|
private static final String SOFT_MODULE = "softwareModule";
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout;
|
||||||
private DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionTagToken distributionTagToken;
|
||||||
private DistributionTagToken distributionTagToken;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetManagement targetManagement;
|
||||||
private transient TargetManagement targetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DsMetadataPopupLayout dsMetadataPopupLayout;
|
||||||
private DsMetadataPopupLayout dsMetadataPopupLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final EntityFactory entityFactory;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
private SoftwareModuleDetailsTable softwareModuleTable;
|
private SoftwareModuleDetailsTable softwareModuleTable;
|
||||||
|
|
||||||
@@ -101,11 +91,29 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
|
|
||||||
private Map<String, StringBuilder> assignedSWModule;
|
private Map<String, StringBuilder> assignedSWModule;
|
||||||
|
|
||||||
/**
|
public DistributionSetDetails(final I18N i18n, final UIEventBus eventBus,
|
||||||
* softwareLayout Initialize the component.
|
final SpPermissionChecker permissionChecker, final ManageDistUIState manageDistUIState,
|
||||||
*/
|
final ManagementUIState managementUIState,
|
||||||
@Override
|
final DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout,
|
||||||
protected void init() {
|
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
|
||||||
|
final TargetManagement targetManagement, final EntityFactory entityFactory,
|
||||||
|
final UINotification uinotification, final TagManagement tagManagement,
|
||||||
|
final DsMetadataPopupLayout popupLayout) {
|
||||||
|
super(i18n, eventBus, permissionChecker, managementUIState);
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.distributionAddUpdateWindowLayout = distributionAddUpdateWindowLayout;
|
||||||
|
this.distributionTagToken = new DistributionTagToken(permissionChecker, i18n, uinotification, eventBus,
|
||||||
|
managementUIState, tagManagement, distributionSetManagement);
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
this.targetManagement = targetManagement;
|
||||||
|
this.dsMetadataPopupLayout = popupLayout;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
softwareModuleTable = new SoftwareModuleDetailsTable();
|
softwareModuleTable = new SoftwareModuleDetailsTable();
|
||||||
softwareModuleTable.init(getI18n(), true, getPermissionChecker(), distributionSetManagement, getEventBus(),
|
softwareModuleTable.init(getI18n(), true, getPermissionChecker(), distributionSetManagement, getEventBus(),
|
||||||
manageDistUIState);
|
manageDistUIState);
|
||||||
@@ -116,8 +124,8 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
|
|
||||||
tfqDetailsTable = new TargetFilterQueryDetailsTable();
|
tfqDetailsTable = new TargetFilterQueryDetailsTable();
|
||||||
tfqDetailsTable.init(getI18n());
|
tfqDetailsTable.init(getI18n());
|
||||||
|
addTabs(detailsTab);
|
||||||
super.init();
|
restoreState();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected VerticalLayout createTagsLayout() {
|
protected VerticalLayout createTagsLayout() {
|
||||||
@@ -355,19 +363,19 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
return getPermissionChecker().hasUpdateDistributionPermission();
|
return getPermissionChecker().hasUpdateDistributionPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent event) {
|
void onEvent(final SoftwareModuleEvent event) {
|
||||||
if (event.getSoftwareModuleEventType() == SoftwareModuleEventType.ASSIGN_SOFTWARE_MODULE) {
|
if (event.getSoftwareModuleEventType() == SoftwareModuleEventType.ASSIGN_SOFTWARE_MODULE) {
|
||||||
UI.getCurrent().access(() -> updateSoftwareModule(event.getEntity()));
|
UI.getCurrent().access(() -> updateSoftwareModule(event.getEntity()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
||||||
onBaseEntityEvent(distributionTableEvent);
|
onBaseEntityEvent(distributionTableEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent saveActionWindowEvent) {
|
void onEvent(final SaveActionWindowEvent saveActionWindowEvent) {
|
||||||
if ((saveActionWindowEvent == SaveActionWindowEvent.SAVED_ASSIGNMENTS
|
if ((saveActionWindowEvent == SaveActionWindowEvent.SAVED_ASSIGNMENTS
|
||||||
|| saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS)
|
|| saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS)
|
||||||
@@ -377,11 +385,11 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
}
|
}
|
||||||
setSelectedBaseEntity(
|
setSelectedBaseEntity(
|
||||||
distributionSetManagement.findDistributionSetByIdWithDetails(getSelectedBaseEntityId()));
|
distributionSetManagement.findDistributionSetByIdWithDetails(getSelectedBaseEntityId()));
|
||||||
UI.getCurrent().access(() -> populateModule());
|
UI.getCurrent().access(this::populateModule);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEventDiscard(final SaveActionWindowEvent saveActionWindowEvent) {
|
void onEventDiscard(final SaveActionWindowEvent saveActionWindowEvent) {
|
||||||
if (saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ASSIGNMENT
|
if (saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ASSIGNMENT
|
||||||
|| saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS
|
|| saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS
|
||||||
|
|||||||
@@ -45,17 +45,19 @@ import org.eclipse.hawkbit.ui.push.DistributionCreatedEventContainer;
|
|||||||
import org.eclipse.hawkbit.ui.push.DistributionDeletedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionDeletedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
|
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.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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -65,8 +67,6 @@ import com.vaadin.data.Item;
|
|||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Component;
|
import com.vaadin.ui.Component;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
@@ -75,8 +75,6 @@ import com.vaadin.ui.UI;
|
|||||||
/**
|
/**
|
||||||
* Distribution set table.
|
* Distribution set table.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionSetTable extends AbstractNamedVersionTable<DistributionSet, DistributionSetIdName> {
|
public class DistributionSetTable extends AbstractNamedVersionTable<DistributionSet, DistributionSetIdName> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7731776093470487988L;
|
private static final long serialVersionUID = -7731776093470487988L;
|
||||||
@@ -86,37 +84,41 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
private static final List<Object> DISPLAY_DROP_HINT_EVENTS = new ArrayList<>(
|
private static final List<Object> DISPLAY_DROP_HINT_EVENTS = new ArrayList<>(
|
||||||
Arrays.asList(DragEvent.SOFTWAREMODULE_DRAG));
|
Arrays.asList(DragEvent.SOFTWAREMODULE_DRAG));
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permissionChecker;
|
||||||
private SpPermissionChecker permissionChecker;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
||||||
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetManagement targetManagement;
|
||||||
private transient TargetManagement targetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DsMetadataPopupLayout dsMetadataPopupLayout;
|
||||||
private DsMetadataPopupLayout dsMetadataPopupLayout;
|
|
||||||
|
|
||||||
/**
|
public DistributionSetTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification,
|
||||||
* Initialize the component.
|
final SpPermissionChecker permissionChecker, final ManageDistUIState manageDistUIState,
|
||||||
*/
|
final DistributionSetManagement distributionSetManagement, final SoftwareManagement softwareManagement,
|
||||||
@Override
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
protected void init() {
|
final TargetManagement targetManagement, final DsMetadataPopupLayout dsMetadataPopupLayout) {
|
||||||
super.init();
|
super(eventBus, i18n, notification);
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.distributionsViewAcceptCriteria = distributionsViewAcceptCriteria;
|
||||||
|
this.targetManagement = targetManagement;
|
||||||
|
this.dsMetadataPopupLayout = dsMetadataPopupLayout;
|
||||||
addTableStyleGenerator();
|
addTableStyleGenerator();
|
||||||
|
|
||||||
|
addNewContainerDS();
|
||||||
|
setColumnProperties();
|
||||||
|
setDataAvailable(getContainerDataSource().size() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DragEvent event) {
|
void onEvent(final DragEvent event) {
|
||||||
if (event == DragEvent.HIDE_DROP_HINT) {
|
if (event == DragEvent.HIDE_DROP_HINT) {
|
||||||
UI.getCurrent().access(() -> removeStyleName(SPUIStyleDefinitions.SHOW_DROP_HINT_TABLE));
|
UI.getCurrent().access(() -> removeStyleName(SPUIStyleDefinitions.SHOW_DROP_HINT_TABLE));
|
||||||
@@ -125,7 +127,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionSetUpdateEvents(final DistributionSetUpdatedEventContainer eventContainer) {
|
void onDistributionSetUpdateEvents(final DistributionSetUpdatedEventContainer eventContainer) {
|
||||||
|
|
||||||
final List<DistributionSetIdName> visibleItemIds = (List<DistributionSetIdName>) getVisibleItemIds();
|
final List<DistributionSetIdName> visibleItemIds = (List<DistributionSetIdName>) getVisibleItemIds();
|
||||||
@@ -150,12 +152,12 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
.forEach(event -> updateDistributionInTable(event.getEntity()));
|
.forEach(event -> updateDistributionInTable(event.getEntity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionCreatedEvents(final DistributionCreatedEventContainer eventContainer) {
|
void onDistributionCreatedEvents(final DistributionCreatedEventContainer eventContainer) {
|
||||||
refreshDistributions();
|
refreshDistributions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionDeletedEvents(final DistributionDeletedEventContainer eventContainer) {
|
void onDistributionDeletedEvents(final DistributionDeletedEventContainer eventContainer) {
|
||||||
final LazyQueryContainer dsContainer = (LazyQueryContainer) getContainerDataSource();
|
final LazyQueryContainer dsContainer = (LazyQueryContainer) getContainerDataSource();
|
||||||
final List<Object> visibleItemIds = (List<Object>) getVisibleItemIds();
|
final List<Object> visibleItemIds = (List<Object>) getVisibleItemIds();
|
||||||
@@ -470,7 +472,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent event) {
|
void onEvent(final DistributionTableEvent event) {
|
||||||
onBaseEntityEvent(event);
|
onBaseEntityEvent(event);
|
||||||
if (BaseEntityEventType.UPDATED_ENTITY != event.getEventType()) {
|
if (BaseEntityEventType.UPDATED_ENTITY != event.getEventType()) {
|
||||||
@@ -479,7 +481,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
UI.getCurrent().access(() -> updateDistributionInTable(event.getEntity()));
|
UI.getCurrent().access(() -> updateDistributionInTable(event.getEntity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent event) {
|
void onEvent(final SaveActionWindowEvent event) {
|
||||||
if (event == SaveActionWindowEvent.DELETED_DISTRIBUTIONS || event == SaveActionWindowEvent.SAVED_ASSIGNMENTS) {
|
if (event == SaveActionWindowEvent.DELETED_DISTRIBUTIONS || event == SaveActionWindowEvent.SAVED_ASSIGNMENTS) {
|
||||||
UI.getCurrent().access(this::refreshFilter);
|
UI.getCurrent().access(this::refreshFilter);
|
||||||
@@ -492,7 +494,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
|||||||
* @param event
|
* @param event
|
||||||
* as instance of {@link DistributionTableFilterEvent}
|
* as instance of {@link DistributionTableFilterEvent}
|
||||||
*/
|
*/
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
public void onEvent(final DistributionTableFilterEvent event) {
|
public void onEvent(final DistributionTableFilterEvent event) {
|
||||||
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
||||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.dstable;
|
package org.eclipse.hawkbit.ui.distributions.dstable;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
|
import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||||
@@ -16,14 +17,13 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
|||||||
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
|
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.Window;
|
import com.vaadin.ui.Window;
|
||||||
@@ -31,19 +31,19 @@ import com.vaadin.ui.Window;
|
|||||||
/**
|
/**
|
||||||
* Distribution table header.
|
* Distribution table header.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionSetTableHeader extends AbstractTableHeader {
|
public class DistributionSetTableHeader extends AbstractTableHeader {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3483238438474530748L;
|
private static final long serialVersionUID = -3483238438474530748L;
|
||||||
|
|
||||||
@Autowired
|
private final DistributionAddUpdateWindowLayout addUpdateWindowLayout;
|
||||||
private ManageDistUIState manageDistUIstate;
|
|
||||||
|
|
||||||
@Autowired
|
public DistributionSetTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
|
||||||
private DistributionAddUpdateWindowLayout addUpdateWindowLayout;
|
final ManageDistUIState manageDistUIstate, final DistributionAddUpdateWindowLayout addUpdateWindowLayout) {
|
||||||
|
super(i18n, permChecker, eventbus, null, manageDistUIstate, null);
|
||||||
|
this.addUpdateWindowLayout = addUpdateWindowLayout;
|
||||||
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionsUIEvent event) {
|
void onEvent(final DistributionsUIEvent event) {
|
||||||
if (event == DistributionsUIEvent.HIDE_DIST_FILTER_BY_TYPE) {
|
if (event == DistributionsUIEvent.HIDE_DIST_FILTER_BY_TYPE) {
|
||||||
setFilterButtonsIconVisible(true);
|
setFilterButtonsIconVisible(true);
|
||||||
|
|||||||
@@ -8,42 +8,51 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.dstable;
|
package org.eclipse.hawkbit.ui.distributions.dstable;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
|
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteria;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DistributionSet table layout
|
* DistributionSet table layout
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionSetTableLayout extends AbstractTableLayout {
|
public class DistributionSetTableLayout extends AbstractTableLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6464291374980641235L;
|
private static final long serialVersionUID = 6464291374980641235L;
|
||||||
|
|
||||||
/**
|
public DistributionSetTableLayout(final I18N i18n, final UIEventBus eventBus,
|
||||||
* Details to be autowired before table as details listens to value change
|
final SpPermissionChecker permissionChecker, final ManageDistUIState manageDistUIState,
|
||||||
* of table.
|
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
|
||||||
*/
|
final TargetManagement targetManagement, final EntityFactory entityFactory,
|
||||||
@Autowired
|
final UINotification uiNotification, final TagManagement tagManagement,
|
||||||
private DistributionSetDetails distributionDetails;
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
|
final SystemManagement systemManagement) {
|
||||||
|
|
||||||
@Autowired
|
final DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout = new DistributionAddUpdateWindowLayout(
|
||||||
private DistributionSetTableHeader dsTableHeader;
|
i18n, uiNotification, eventBus, distributionSetManagement, systemManagement, entityFactory);
|
||||||
|
|
||||||
@Autowired
|
final DsMetadataPopupLayout popupLayout = new DsMetadataPopupLayout(i18n, uiNotification, eventBus,
|
||||||
private DistributionSetTable dsTable;
|
distributionSetManagement, entityFactory, permissionChecker);
|
||||||
|
|
||||||
/**
|
super.init(
|
||||||
* Initialize the filter layout.
|
new DistributionSetTableHeader(i18n, permissionChecker, eventBus, manageDistUIState,
|
||||||
*/
|
distributionAddUpdateWindowLayout),
|
||||||
@PostConstruct
|
new DistributionSetTable(eventBus, i18n, uiNotification, permissionChecker, manageDistUIState,
|
||||||
void init() {
|
distributionSetManagement, softwareManagement, distributionsViewAcceptCriteria,
|
||||||
super.init(dsTableHeader, dsTable, distributionDetails);
|
targetManagement, popupLayout),
|
||||||
|
new DistributionSetDetails(i18n, eventBus, permissionChecker, manageDistUIState, null,
|
||||||
|
distributionAddUpdateWindowLayout, softwareManagement, distributionSetManagement,
|
||||||
|
targetManagement, entityFactory, uiNotification, tagManagement, popupLayout));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,29 +18,30 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
|
|||||||
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||||
import org.eclipse.hawkbit.repository.model.MetaData;
|
import org.eclipse.hawkbit.repository.model.MetaData;
|
||||||
import org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout;
|
import org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pop up layout to display distribution metadata.
|
* Pop up layout to display distribution metadata.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DsMetadataPopupLayout extends AbstractMetadataPopupLayout<DistributionSet, MetaData> {
|
public class DsMetadataPopupLayout extends AbstractMetadataPopupLayout<DistributionSet, MetaData> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7778944849012048106L;
|
private static final long serialVersionUID = -7778944849012048106L;
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final EntityFactory entityFactory;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
@Autowired
|
public DsMetadataPopupLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
|
||||||
protected SpPermissionChecker permChecker;
|
final DistributionSetManagement distributionSetManagement, final EntityFactory entityFactory,
|
||||||
|
final SpPermissionChecker permChecker) {
|
||||||
|
super(i18n, uiNotification, eventBus, permChecker);
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void checkForDuplicate(final DistributionSet entity, final String value) {
|
protected void checkForDuplicate(final DistributionSet entity, final String value) {
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import java.util.Map;
|
|||||||
import org.eclipse.hawkbit.ui.common.AbstractAcceptCriteria;
|
import org.eclipse.hawkbit.ui.common.AbstractAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import com.vaadin.spring.annotation.SpringComponent;
|
||||||
@@ -35,6 +38,11 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
|||||||
|
|
||||||
private static final Map<String, List<String>> DROP_CONFIGS = createDropConfigurations();
|
private static final Map<String, List<String>> DROP_CONFIGS = createDropConfigurations();
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
DistributionsViewAcceptCriteria(final UINotification uiNotification, final UIEventBus eventBus) {
|
||||||
|
super(uiNotification, eventBus);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getComponentId(final Component component) {
|
protected String getComponentId(final Component component) {
|
||||||
String id = component.getId();
|
String id = component.getId();
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import java.util.List;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.SystemManagement;
|
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||||
@@ -27,16 +30,17 @@ import org.eclipse.hawkbit.ui.distributions.event.DragEvent;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Component;
|
import com.vaadin.ui.Component;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.Table.TableTransferable;
|
import com.vaadin.ui.Table.TableTransferable;
|
||||||
@@ -44,12 +48,7 @@ import com.vaadin.ui.UI;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Distributions footer layout implementation.
|
* Distributions footer layout implementation.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@org.springframework.stereotype.Component
|
|
||||||
@UIScope
|
|
||||||
public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3494052985006132714L;
|
private static final long serialVersionUID = 3494052985006132714L;
|
||||||
@@ -58,19 +57,30 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
Arrays.asList(DragEvent.DISTRIBUTION_TYPE_DRAG, DragEvent.DISTRIBUTION_DRAG, DragEvent.SOFTWAREMODULE_DRAG,
|
Arrays.asList(DragEvent.DISTRIBUTION_TYPE_DRAG, DragEvent.DISTRIBUTION_DRAG, DragEvent.SOFTWAREMODULE_DRAG,
|
||||||
DragEvent.SOFTWAREMODULE_TYPE_DRAG));
|
DragEvent.SOFTWAREMODULE_TYPE_DRAG));
|
||||||
|
|
||||||
@Autowired
|
private final SystemManagement systemManagement;
|
||||||
private transient SystemManagement systemManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionsConfirmationWindowLayout distConfirmationWindowLayout;
|
||||||
private DistributionsConfirmationWindowLayout distConfirmationWindowLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
||||||
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
public DSDeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
|
||||||
|
final UINotification notification, final SystemManagement systemManagement,
|
||||||
|
final ManageDistUIState manageDistUIState,
|
||||||
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
|
final DistributionSetManagement dsManagement, final SoftwareManagement softwareManagement) {
|
||||||
|
super(i18n, permChecker, eventBus, notification);
|
||||||
|
this.systemManagement = systemManagement;
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.distConfirmationWindowLayout = new DistributionsConfirmationWindowLayout(i18n, eventBus, dsManagement,
|
||||||
|
softwareManagement, manageDistUIState);
|
||||||
|
this.distributionsViewAcceptCriteria = distributionsViewAcceptCriteria;
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DragEvent event) {
|
void onEvent(final DragEvent event) {
|
||||||
if (event == DragEvent.HIDE_DROP_HINT) {
|
if (event == DragEvent.HIDE_DROP_HINT) {
|
||||||
hideDropHints();
|
hideDropHints();
|
||||||
@@ -79,7 +89,7 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent event) {
|
void onEvent(final SaveActionWindowEvent event) {
|
||||||
if (event != null) {
|
if (event != null) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
@@ -253,7 +263,7 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
|
|||||||
* @param event
|
* @param event
|
||||||
* as instance of {@link DistributionsUIEvent}
|
* as instance of {@link DistributionsUIEvent}
|
||||||
*/
|
*/
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
public void onEvent(final DistributionsUIEvent event) {
|
public void onEvent(final DistributionsUIEvent event) {
|
||||||
if (event == DistributionsUIEvent.UPDATE_COUNT) {
|
if (event == DistributionsUIEvent.UPDATE_COUNT) {
|
||||||
updateDSActionCount();
|
updateDSActionCount();
|
||||||
|
|||||||
@@ -26,11 +26,12 @@ import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -39,7 +40,6 @@ import com.vaadin.data.Container;
|
|||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickListener;
|
import com.vaadin.ui.Button.ClickListener;
|
||||||
import com.vaadin.ui.Table.Align;
|
import com.vaadin.ui.Table.Align;
|
||||||
@@ -48,11 +48,7 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
/**
|
/**
|
||||||
* Abstract layout of confirm actions window.
|
* Abstract layout of confirm actions window.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@org.springframework.stereotype.Component
|
|
||||||
@UIScope
|
|
||||||
public class DistributionsConfirmationWindowLayout extends AbstractConfirmationWindowLayout {
|
public class DistributionsConfirmationWindowLayout extends AbstractConfirmationWindowLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3641621131320823058L;
|
private static final long serialVersionUID = 3641621131320823058L;
|
||||||
@@ -77,14 +73,20 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
|
|||||||
|
|
||||||
private ConfirmationTab assignmnetTab;
|
private ConfirmationTab assignmnetTab;
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetManagement dsManagement;
|
||||||
private transient DistributionSetManagement dsManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
public DistributionsConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final DistributionSetManagement dsManagement, final SoftwareManagement softwareManagement,
|
||||||
|
final ManageDistUIState manageDistUIState) {
|
||||||
|
super(i18n, eventBus);
|
||||||
|
this.dsManagement = dsManagement;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, ConfirmationTab> getConfimrationTabs() {
|
protected Map<String, ConfirmationTab> getConfimrationTabs() {
|
||||||
@@ -630,7 +632,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEventDiscard(final SaveActionWindowEvent saveActionWindowEvent) {
|
void onEventDiscard(final SaveActionWindowEvent saveActionWindowEvent) {
|
||||||
if (saveActionWindowEvent == SaveActionWindowEvent.DELETE_ALL_SOFWARE) {
|
if (saveActionWindowEvent == SaveActionWindowEvent.DELETE_ALL_SOFWARE) {
|
||||||
getSWAssignmentsTableContainer();
|
getSWAssignmentsTableContainer();
|
||||||
|
|||||||
@@ -20,28 +20,28 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
|
|||||||
import org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout;
|
import org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent.MetadataUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent.MetadataUIEvent;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pop up layout to display software module metadata.
|
* Pop up layout to display software module metadata.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SwMetadataPopupLayout extends AbstractMetadataPopupLayout<SoftwareModule, MetaData> {
|
public class SwMetadataPopupLayout extends AbstractMetadataPopupLayout<SoftwareModule, MetaData> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1252090014161012563L;
|
private static final long serialVersionUID = -1252090014161012563L;
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final EntityFactory entityFactory;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
@Autowired
|
public SwMetadataPopupLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
|
||||||
protected SpPermissionChecker permChecker;
|
final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
|
||||||
|
final SpPermissionChecker permChecker) {
|
||||||
|
super(i18n, uiNotification, eventBus, permChecker);
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void checkForDuplicate(final SoftwareModule entity, final String value) {
|
protected void checkForDuplicate(final SoftwareModule entity, final String value) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
|
|||||||
super(definition, queryConfig, sortIds, sortStates);
|
super(definition, queryConfig, sortIds, sortStates);
|
||||||
if (HawkbitCommonUtil.isNotNullOrEmpty(queryConfig)) {
|
if (HawkbitCommonUtil.isNotNullOrEmpty(queryConfig)) {
|
||||||
type = Optional.ofNullable((SoftwareModuleType) queryConfig.get(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE))
|
type = Optional.ofNullable((SoftwareModuleType) queryConfig.get(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE))
|
||||||
.map(t -> t.getId()).orElse(null);
|
.map(SoftwareModuleType::getId).orElse(null);
|
||||||
final String text = (String) queryConfig.get(SPUIDefinitions.FILTER_BY_TEXT);
|
final String text = (String) queryConfig.get(SPUIDefinitions.FILTER_BY_TEXT);
|
||||||
if (!Strings.isNullOrEmpty(text)) {
|
if (!Strings.isNullOrEmpty(text)) {
|
||||||
searchText = String.format("%%%s%%", text);
|
searchText = String.format("%%%s%%", text);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.ui.distributions.smtable;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.MetaData;
|
import org.eclipse.hawkbit.repository.model.MetaData;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
@@ -20,8 +21,9 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -44,32 +46,31 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
|
|
||||||
private static final long serialVersionUID = -1052279281066089812L;
|
private static final long serialVersionUID = -1052279281066089812L;
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
||||||
private SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final SwMetadataPopupLayout swMetadataPopupLayout;
|
||||||
private SwMetadataPopupLayout swMetadataPopupLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
private SoftwareModuleMetadatadetailslayout swmMetadataTable;
|
public SwModuleDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
|
||||||
|
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow,
|
||||||
|
final ManageDistUIState manageDistUIState, final SoftwareManagement softwareManagement,
|
||||||
|
final SwMetadataPopupLayout swMetadataPopupLayout, final EntityFactory entityFactory) {
|
||||||
|
super(i18n, eventBus, permissionChecker, null);
|
||||||
|
this.softwareModuleAddUpdateWindow = softwareModuleAddUpdateWindow;
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.swMetadataPopupLayout = swMetadataPopupLayout;
|
||||||
|
|
||||||
/**
|
|
||||||
* softwareLayout Initialize the component.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void init() {
|
|
||||||
swmMetadataTable = new SoftwareModuleMetadatadetailslayout();
|
swmMetadataTable = new SoftwareModuleMetadatadetailslayout();
|
||||||
swmMetadataTable.init(getI18n(), getPermissionChecker(), softwareManagement, swMetadataPopupLayout,
|
swmMetadataTable.init(getI18n(), getPermissionChecker(), softwareManagement, swMetadataPopupLayout,
|
||||||
entityFactory);
|
entityFactory);
|
||||||
super.init();
|
addTabs(detailsTab);
|
||||||
|
restoreState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,7 +80,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
* as instance of {@link MetadataEvent}
|
* as instance of {@link MetadataEvent}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final MetadataEvent event) {
|
void onEvent(final MetadataEvent event) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
final MetaData softwareModuleMetadata = event.getMetaData();
|
final MetaData softwareModuleMetadata = event.getMetaData();
|
||||||
@@ -94,7 +95,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
|
||||||
onBaseEntityEvent(softwareModuleEvent);
|
onBaseEntityEvent(softwareModuleEvent);
|
||||||
}
|
}
|
||||||
@@ -203,10 +204,12 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSoftwareModuleSelected(final SoftwareModule softwareModule) {
|
private boolean isSoftwareModuleSelected(final SoftwareModule softwareModule) {
|
||||||
final Long selectedDistSWModuleId = manageDistUIState.getSelectedBaseSwModuleId().isPresent()
|
if (softwareModule == null) {
|
||||||
? manageDistUIState.getSelectedBaseSwModuleId().get() : null;
|
return false;
|
||||||
return softwareModule != null && selectedDistSWModuleId != null
|
}
|
||||||
&& selectedDistSWModuleId.equals(softwareModule.getId());
|
|
||||||
|
return manageDistUIState.getSelectedBaseSwModuleId().map(module -> module.equals(softwareModule.getId()))
|
||||||
|
.orElse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
|||||||
import org.eclipse.hawkbit.ui.artifacts.details.ArtifactDetailsLayout;
|
import org.eclipse.hawkbit.ui.artifacts.details.ArtifactDetailsLayout;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractNamedVersionTable;
|
import org.eclipse.hawkbit.ui.common.table.AbstractNamedVersionTable;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
@@ -27,15 +28,17 @@ import org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteri
|
|||||||
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -47,8 +50,6 @@ import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
|||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.server.Page;
|
import com.vaadin.server.Page;
|
||||||
import com.vaadin.shared.ui.window.WindowMode;
|
import com.vaadin.shared.ui.window.WindowMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.HorizontalLayout;
|
import com.vaadin.ui.HorizontalLayout;
|
||||||
import com.vaadin.ui.JavaScript;
|
import com.vaadin.ui.JavaScript;
|
||||||
@@ -60,39 +61,40 @@ import com.vaadin.ui.Window;
|
|||||||
* Implementation of software module table using generic abstract table styles .
|
* Implementation of software module table using generic abstract table styles .
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Long> {
|
public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6785314784507424750L;
|
private static final long serialVersionUID = 6785314784507424750L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
||||||
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
|
||||||
|
|
||||||
@Autowired
|
private final ArtifactDetailsLayout artifactDetailsLayout;
|
||||||
private ArtifactDetailsLayout artifactDetailsLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final SwMetadataPopupLayout swMetadataPopupLayout;
|
||||||
private SwMetadataPopupLayout swMetadataPopupLayout;
|
|
||||||
|
|
||||||
/**
|
public SwModuleTable(final UIEventBus eventBus, final I18N i18n, final UINotification uiNotification,
|
||||||
* Initialize the filter layout.
|
final ManageDistUIState manageDistUIState, final SoftwareManagement softwareManagement,
|
||||||
*/
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
@Override
|
final SwMetadataPopupLayout swMetadataPopupLayout, final ArtifactUploadState artifactUploadState) {
|
||||||
protected void init() {
|
super(eventBus, i18n, uiNotification);
|
||||||
super.init();
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
this.distributionsViewAcceptCriteria = distributionsViewAcceptCriteria;
|
||||||
|
this.artifactDetailsLayout = new ArtifactDetailsLayout(i18n, eventBus, artifactUploadState, uiNotification);
|
||||||
|
this.swMetadataPopupLayout = swMetadataPopupLayout;
|
||||||
|
|
||||||
|
addNewContainerDS();
|
||||||
|
setColumnProperties();
|
||||||
|
setDataAvailable(getContainerDataSource().size() != 0);
|
||||||
styleTableOnDistSelection();
|
styleTableOnDistSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All event Listeners */
|
/* All event Listeners */
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SMFilterEvent filterEvent) {
|
void onEvent(final SMFilterEvent filterEvent) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
|
|
||||||
@@ -105,7 +107,7 @@ public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Lon
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionsUIEvent event) {
|
void onEvent(final DistributionsUIEvent event) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
if (event == DistributionsUIEvent.ORDER_BY_DISTRIBUTION) {
|
if (event == DistributionsUIEvent.ORDER_BY_DISTRIBUTION) {
|
||||||
@@ -115,14 +117,14 @@ public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Lon
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent event) {
|
void onEvent(final SaveActionWindowEvent event) {
|
||||||
if (event == SaveActionWindowEvent.DELETE_ALL_SOFWARE) {
|
if (event == SaveActionWindowEvent.DELETE_ALL_SOFWARE) {
|
||||||
UI.getCurrent().access(this::refreshFilter);
|
UI.getCurrent().access(this::refreshFilter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleEvent event) {
|
void onEvent(final SoftwareModuleEvent event) {
|
||||||
onBaseEntityEvent(event);
|
onBaseEntityEvent(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.smtable;
|
package org.eclipse.hawkbit.ui.distributions.smtable;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
||||||
@@ -15,14 +16,13 @@ import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
|
|||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.Window;
|
import com.vaadin.ui.Window;
|
||||||
@@ -31,19 +31,20 @@ 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
|
|
||||||
@UIScope
|
|
||||||
public class SwModuleTableHeader extends AbstractTableHeader {
|
public class SwModuleTableHeader extends AbstractTableHeader {
|
||||||
|
|
||||||
private static final long serialVersionUID = 242961845006626297L;
|
private static final long serialVersionUID = 242961845006626297L;
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
public SwModuleTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
|
||||||
private SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
|
final ManageDistUIState manageDistUIstate,
|
||||||
|
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow) {
|
||||||
|
super(i18n, permChecker, eventbus, null, manageDistUIstate, null);
|
||||||
|
this.softwareModuleAddUpdateWindow = softwareModuleAddUpdateWindow;
|
||||||
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionsUIEvent event) {
|
void onEvent(final DistributionsUIEvent event) {
|
||||||
if (event == DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE) {
|
if (event == DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE) {
|
||||||
setFilterButtonsIconVisible(true);
|
setFilterButtonsIconVisible(true);
|
||||||
@@ -72,10 +73,7 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String onLoadSearchBoxValue() {
|
protected String onLoadSearchBoxValue() {
|
||||||
if (manageDistUIState.getSoftwareModuleFilters().getSearchText().isPresent()) {
|
return manageDistUIstate.getSoftwareModuleFilters().getSearchText().orElse(null);
|
||||||
return manageDistUIState.getSoftwareModuleFilters().getSearchText().get();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -102,14 +100,14 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,30 +119,30 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void maximizeTable() {
|
public void maximizeTable() {
|
||||||
manageDistUIState.setSwModuleTableMaximized(Boolean.TRUE);
|
manageDistUIstate.setSwModuleTableMaximized(Boolean.TRUE);
|
||||||
eventbus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.MAXIMIZED, null));
|
eventbus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.MAXIMIZED, null));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void minimizeTable() {
|
public void minimizeTable() {
|
||||||
manageDistUIState.setSwModuleTableMaximized(Boolean.FALSE);
|
manageDistUIstate.setSwModuleTableMaximized(Boolean.FALSE);
|
||||||
eventbus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.MINIMIZED, null));
|
eventbus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.MINIMIZED, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTableMaximized() {
|
public Boolean onLoadIsTableMaximized() {
|
||||||
return manageDistUIState.isSwModuleTableMaximized();
|
return manageDistUIstate.isSwModuleTableMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
public Boolean onLoadIsShowFilterButtonDisplayed() {
|
||||||
return manageDistUIState.isSwTypeFilterClosed();
|
return manageDistUIstate.isSwTypeFilterClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,37 +8,42 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.smtable;
|
package org.eclipse.hawkbit.ui.distributions.smtable;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
||||||
|
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
|
||||||
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
|
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteria;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of software module Layout
|
* Implementation of software module Layout
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class SwModuleTableLayout extends AbstractTableLayout {
|
public class SwModuleTableLayout extends AbstractTableLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6464291374980641235L;
|
private static final long serialVersionUID = 6464291374980641235L;
|
||||||
|
|
||||||
@Autowired
|
public SwModuleTableLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
|
||||||
private SwModuleTableHeader swModuleTableHeader;
|
final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
|
||||||
|
final ManageDistUIState manageDistUIState, final SpPermissionChecker permChecker,
|
||||||
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
|
final ArtifactUploadState artifactUploadState) {
|
||||||
|
|
||||||
@Autowired
|
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow = new SoftwareModuleAddUpdateWindow(i18n,
|
||||||
private SwModuleDetails swModuleDetails;
|
uiNotification, eventBus, softwareManagement, entityFactory);
|
||||||
|
|
||||||
@Autowired
|
final SwMetadataPopupLayout swMetadataPopupLayout = new SwMetadataPopupLayout(i18n, uiNotification, eventBus,
|
||||||
private SwModuleTable swModuleTable;
|
softwareManagement, entityFactory, permChecker);
|
||||||
|
|
||||||
/**
|
super.init(
|
||||||
* Initialize the filter layout.
|
new SwModuleTableHeader(i18n, permChecker, eventBus, manageDistUIState, softwareModuleAddUpdateWindow),
|
||||||
*/
|
new SwModuleTable(eventBus, i18n, uiNotification, manageDistUIState, softwareManagement,
|
||||||
@PostConstruct
|
distributionsViewAcceptCriteria, swMetadataPopupLayout, artifactUploadState),
|
||||||
void init() {
|
new SwModuleDetails(i18n, eventBus, permChecker, softwareModuleAddUpdateWindow, manageDistUIState,
|
||||||
super.init(swModuleTableHeader, swModuleTable, swModuleDetails);
|
softwareManagement, swMetadataPopupLayout, entityFactory));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,54 +15,37 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
|||||||
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SMFilterEvent;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterSingleButtonClick;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterSingleButtonClick;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single button click behaviour of filter buttons layout.
|
* Single button click behaviour of filter buttons layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistSMTypeFilterButtonClick extends AbstractFilterSingleButtonClick implements Serializable {
|
public class DistSMTypeFilterButtonClick extends AbstractFilterSingleButtonClick implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4166632002904286983L;
|
private static final long serialVersionUID = -4166632002904286983L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SoftwareManagement softwareManagement;
|
||||||
private transient SoftwareManagement softwareManagement;
|
|
||||||
|
public DistSMTypeFilterButtonClick(final UIEventBus eventBus, final ManageDistUIState manageDistUIState,
|
||||||
|
final SoftwareManagement softwareManagement) {
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.softwareManagement = softwareManagement;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.
|
|
||||||
* AbstractFilterButtonClickBehaviour#filterUnClicked (com.vaadin.ui.Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void filterUnClicked(final Button clickedButton) {
|
protected void filterUnClicked(final Button clickedButton) {
|
||||||
manageDistUIState.getSoftwareModuleFilters().setSoftwareModuleType(null);
|
manageDistUIState.getSoftwareModuleFilters().setSoftwareModuleType(null);
|
||||||
eventBus.publish(this, SMFilterEvent.FILTER_BY_TYPE);
|
eventBus.publish(this, SMFilterEvent.FILTER_BY_TYPE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.hawkbit.server.ui.common.filterlayout.
|
|
||||||
* AbstractFilterButtonClickBehaviour#filterClicked (com.vaadin.ui.Button)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void filterClicked(final Button clickedButton) {
|
protected void filterClicked(final Button clickedButton) {
|
||||||
final SoftwareModuleType smType = softwareManagement
|
final SoftwareModuleType smType = softwareManagement
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import static org.eclipse.hawkbit.ui.utils.UIComponentIdProvider.SW_MODULE_TYPE_
|
|||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
||||||
import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery;
|
import org.eclipse.hawkbit.ui.common.SoftwareModuleTypeBeanQuery;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
||||||
@@ -23,33 +24,35 @@ import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.DropHandler;
|
import com.vaadin.event.dd.DropHandler;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Software Module Type filter buttons.
|
* Software Module Type filter buttons.
|
||||||
*/
|
*/
|
||||||
@UIScope
|
|
||||||
@SpringComponent
|
|
||||||
public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6804534533362387433L;
|
private static final long serialVersionUID = 6804534533362387433L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
||||||
private DistributionsViewAcceptCriteria distributionsViewAcceptCriteria;
|
|
||||||
|
public DistSMTypeFilterButtons(final UIEventBus eventBus, final ManageDistUIState manageDistUIState,
|
||||||
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria,
|
||||||
|
final SoftwareManagement softwareManagement) {
|
||||||
|
super(eventBus, new DistSMTypeFilterButtonClick(eventBus, manageDistUIState, softwareManagement));
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.distributionsViewAcceptCriteria = distributionsViewAcceptCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getButtonsTableId() {
|
protected String getButtonsTableId() {
|
||||||
@@ -103,7 +106,7 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
return SPUIDefinitions.SOFTWARE_MODULE_TAG_ID_PREFIXS;
|
return SPUIDefinitions.SOFTWARE_MODULE_TAG_ID_PREFIXS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SoftwareModuleTypeEvent event) {
|
void onEvent(final SoftwareModuleTypeEvent event) {
|
||||||
if (isCreateOrUpdate(event) && event.getSoftwareModuleType() != null) {
|
if (isCreateOrUpdate(event) && event.getSoftwareModuleType() != null) {
|
||||||
refreshTypeTable();
|
refreshTypeTable();
|
||||||
@@ -115,7 +118,7 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
|||||||
|| event.getSoftwareModuleTypeEnum() == UPDATE_SOFTWARE_MODULE_TYPE;
|
|| event.getSoftwareModuleTypeEnum() == UPDATE_SOFTWARE_MODULE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent event) {
|
void onEvent(final SaveActionWindowEvent event) {
|
||||||
if (event == SaveActionWindowEvent.SAVED_DELETE_SW_MODULE_TYPES) {
|
if (event == SaveActionWindowEvent.SAVED_DELETE_SW_MODULE_TYPES) {
|
||||||
refreshTypeTable();
|
refreshTypeTable();
|
||||||
|
|||||||
@@ -8,19 +8,21 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.smtype;
|
package org.eclipse.hawkbit.ui.distributions.smtype;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.smtype.CreateUpdateSoftwareTypeLayout;
|
import org.eclipse.hawkbit.ui.artifacts.smtype.CreateUpdateSoftwareTypeLayout;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.Window;
|
import com.vaadin.ui.Window;
|
||||||
@@ -28,22 +30,21 @@ import com.vaadin.ui.Window;
|
|||||||
/**
|
/**
|
||||||
* Software Module Type filter buttons header.
|
* Software Module Type filter buttons header.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistSMTypeFilterHeader extends AbstractFilterHeader {
|
public class DistSMTypeFilterHeader extends AbstractFilterHeader {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8763788280848718344L;
|
private static final long serialVersionUID = -8763788280848718344L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private ManageDistUIState manageDistUIState;
|
private final CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
|
||||||
|
|
||||||
@Autowired
|
public DistSMTypeFilterHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
|
||||||
private CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
|
final ManageDistUIState manageDistUIState, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UINotification uiNotification,
|
||||||
|
final SoftwareManagement swTypeManagementService) {
|
||||||
|
super(permChecker, eventBus, i18n);
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
this.createUpdateSWTypeLayout = new CreateUpdateSoftwareTypeLayout(i18n, tagManagement, entityFactory, eventBus,
|
||||||
|
permChecker, uiNotification, swTypeManagementService);
|
||||||
|
|
||||||
@Override
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
super.init();
|
|
||||||
if (hasCreateUpdatePermission()) {
|
if (hasCreateUpdatePermission()) {
|
||||||
createUpdateSWTypeLayout.init();
|
createUpdateSWTypeLayout.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,58 +8,45 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.distributions.smtype;
|
package org.eclipse.hawkbit.ui.distributions.smtype;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import javax.annotation.PreDestroy;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
|
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
|
||||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Software Module Type filter layout.
|
* Software Module Type filter layout.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistSMTypeFilterLayout extends AbstractFilterLayout {
|
public class DistSMTypeFilterLayout extends AbstractFilterLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3042297420534417538L;
|
private static final long serialVersionUID = 3042297420534417538L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private transient EventBus.SessionEventBus eventbus;
|
|
||||||
|
|
||||||
@Autowired
|
public DistSMTypeFilterLayout(final UIEventBus eventBus, final I18N i18n, final SpPermissionChecker permChecker,
|
||||||
private DistSMTypeFilterHeader smTypeFilterHeader;
|
final ManageDistUIState manageDistUIState, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UINotification uiNotification,
|
||||||
|
final SoftwareManagement softwareManagement,
|
||||||
|
final DistributionsViewAcceptCriteria distributionsViewAcceptCriteria) {
|
||||||
|
super(new DistSMTypeFilterHeader(i18n, permChecker, eventBus, manageDistUIState, tagManagement, entityFactory,
|
||||||
|
uiNotification, softwareManagement),
|
||||||
|
new DistSMTypeFilterButtons(eventBus, manageDistUIState, distributionsViewAcceptCriteria,
|
||||||
|
softwareManagement));
|
||||||
|
this.manageDistUIState = manageDistUIState;
|
||||||
|
|
||||||
@Autowired
|
restoreState();
|
||||||
private DistSMTypeFilterButtons smTypeFilterButtons;
|
eventBus.subscribe(this);
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DistSMTypeFilterButtonClick smTypeFilterButtonClick;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the filter layout.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
super.init(smTypeFilterHeader, smTypeFilterButtons, smTypeFilterButtonClick);
|
|
||||||
eventbus.subscribe(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionsUIEvent event) {
|
void onEvent(final DistributionsUIEvent event) {
|
||||||
if (event == DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE) {
|
if (event == DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
@@ -69,22 +56,6 @@ public class DistSMTypeFilterLayout extends AbstractFilterLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
/*
|
|
||||||
* It's good manners to do this, even though vaadin-spring will
|
|
||||||
* automatically unsubscribe when this UI is garbage collected.
|
|
||||||
*/
|
|
||||||
eventbus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterLayout#
|
|
||||||
* onLoadIsTypeFilterIsClosed()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean onLoadIsTypeFilterIsClosed() {
|
public Boolean onLoadIsTypeFilterIsClosed() {
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,9 @@ public class ManageDistUIState implements ManagmentEntityState<DistributionSetId
|
|||||||
|
|
||||||
private static final long serialVersionUID = -7569047247017742928L;
|
private static final long serialVersionUID = -7569047247017742928L;
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistFilters manageDistFilters;
|
||||||
private ManageDistFilters manageDistFilters;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageSoftwareModuleFilters softwareModuleFilters;
|
||||||
private ManageSoftwareModuleFilters softwareModuleFilters;
|
|
||||||
|
|
||||||
private final Map<DistributionSetIdName, HashSet<SoftwareModuleIdName>> assignedList = new HashMap<>();
|
private final Map<DistributionSetIdName, HashSet<SoftwareModuleIdName>> assignedList = new HashMap<>();
|
||||||
|
|
||||||
@@ -76,6 +74,13 @@ public class ManageDistUIState implements ManagmentEntityState<DistributionSetId
|
|||||||
|
|
||||||
private boolean noDataAvailableDist;
|
private boolean noDataAvailableDist;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ManageDistUIState(final ManageDistFilters manageDistFilters,
|
||||||
|
final ManageSoftwareModuleFilters softwareModuleFilters) {
|
||||||
|
this.manageDistFilters = manageDistFilters;
|
||||||
|
this.softwareModuleFilters = softwareModuleFilters;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the manageDistFilters
|
* @return the manageDistFilters
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -49,28 +50,34 @@ public class AutoCompleteTextFieldComponent extends HorizontalLayout {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Autowired
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
private final EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
|
private final RsqlValidationOracle rsqlValidationOracle;
|
||||||
|
|
||||||
|
private final Executor executor;
|
||||||
|
|
||||||
|
private final List<FilterQueryChangeListener> listeners = new LinkedList<>();
|
||||||
|
|
||||||
|
private Label validationIcon;
|
||||||
|
private TextField queryTextField;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
public AutoCompleteTextFieldComponent(final FilterManagementUIState filterManagementUIState,
|
||||||
|
final UIEventBus eventBus, final RsqlValidationOracle rsqlValidationOracle,
|
||||||
@Autowired
|
@Qualifier("uiExecutor") final Executor executor) {
|
||||||
private transient RsqlValidationOracle rsqlValidationOracle;
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
|
this.eventBus = eventBus;
|
||||||
@Autowired
|
this.rsqlValidationOracle = rsqlValidationOracle;
|
||||||
@Qualifier("uiExecutor")
|
this.executor = executor;
|
||||||
private transient Executor executor;
|
}
|
||||||
|
|
||||||
private transient List<FilterQueryChangeListener> listeners = new LinkedList<>();
|
|
||||||
|
|
||||||
private final Label validationIcon;
|
|
||||||
private final TextField queryTextField;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public AutoCompleteTextFieldComponent() {
|
@PostConstruct
|
||||||
|
void init() {
|
||||||
|
|
||||||
queryTextField = createSearchField();
|
queryTextField = createSearchField();
|
||||||
validationIcon = createStatusIcon();
|
validationIcon = createStatusIcon();
|
||||||
@@ -80,13 +87,7 @@ public class AutoCompleteTextFieldComponent extends HorizontalLayout {
|
|||||||
addStyleName("custom-search-layout");
|
addStyleName("custom-search-layout");
|
||||||
addComponents(validationIcon, queryTextField);
|
addComponents(validationIcon, queryTextField);
|
||||||
setComponentAlignment(validationIcon, Alignment.TOP_CENTER);
|
setComponentAlignment(validationIcon, Alignment.TOP_CENTER);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the spring-framework when this bean has be post-constructed.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void postConstruct() {
|
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
new TextFieldSuggestionBox(rsqlValidationOracle, this).extend(queryTextField);
|
new TextFieldSuggestionBox(rsqlValidationOracle, this).extend(queryTextField);
|
||||||
}
|
}
|
||||||
@@ -96,7 +97,7 @@ public class AutoCompleteTextFieldComponent extends HorizontalLayout {
|
|||||||
eventBus.unsubscribe(this);
|
eventBus.unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
||||||
if (custFUIEvent == CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON) {
|
if (custFUIEvent == CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON) {
|
||||||
validationIcon.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
validationIcon.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ package org.eclipse.hawkbit.ui.filtermanagement;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||||
@@ -30,8 +27,8 @@ 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.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -40,8 +37,6 @@ import com.vaadin.event.FieldEvents.BlurListener;
|
|||||||
import com.vaadin.event.FieldEvents.TextChangeEvent;
|
import com.vaadin.event.FieldEvents.TextChangeEvent;
|
||||||
import com.vaadin.event.LayoutEvents.LayoutClickListener;
|
import com.vaadin.event.LayoutEvents.LayoutClickListener;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
@@ -56,40 +51,29 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
/**
|
/**
|
||||||
* A Vaadin layout for create or update the target filter.
|
* A Vaadin layout for create or update the target filter.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button.ClickListener {
|
public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button.ClickListener {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7474232427119031474L;
|
private static final long serialVersionUID = 7474232427119031474L;
|
||||||
|
|
||||||
private static final String BREADCRUMB_CUSTOM_FILTERS = "breadcrumb.target.filter.custom.filters";
|
private static final String BREADCRUMB_CUSTOM_FILTERS = "breadcrumb.target.filter.custom.filters";
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
||||||
private transient TargetFilterQueryManagement targetFilterQueryManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permissionChecker;
|
||||||
private SpPermissionChecker permissionChecker;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification notification;
|
||||||
private UINotification notification;
|
|
||||||
|
|
||||||
@Autowired
|
private final UiProperties uiProperties;
|
||||||
private transient UiProperties uiProperties;
|
|
||||||
|
|
||||||
@Autowired
|
private final EntityFactory entityFactory;
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
@Autowired
|
private final AutoCompleteTextFieldComponent queryTextField;
|
||||||
private AutoCompleteTextFieldComponent queryTextField;
|
|
||||||
|
|
||||||
private Button breadcrumbButton;
|
private Button breadcrumbButton;
|
||||||
|
|
||||||
@@ -121,11 +105,21 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
|||||||
|
|
||||||
private LayoutClickListener nameLayoutClickListner;
|
private LayoutClickListener nameLayoutClickListner;
|
||||||
|
|
||||||
/**
|
public CreateOrUpdateFilterHeader(final I18N i18n, final UIEventBus eventBus,
|
||||||
* Initialize the Campaign Status History Header.
|
final FilterManagementUIState filterManagementUIState,
|
||||||
*/
|
final TargetFilterQueryManagement targetFilterQueryManagement, final SpPermissionChecker permissionChecker,
|
||||||
@PostConstruct
|
final UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,
|
||||||
public void init() {
|
final AutoCompleteTextFieldComponent queryTextField) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
|
this.targetFilterQueryManagement = targetFilterQueryManagement;
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
this.notification = notification;
|
||||||
|
this.uiProperties = uiProperties;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
this.queryTextField = queryTextField;
|
||||||
|
|
||||||
createComponents();
|
createComponents();
|
||||||
createListeners();
|
createListeners();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
@@ -140,12 +134,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
||||||
if (custFUIEvent == CustomFilterUIEvent.TARGET_FILTER_DETAIL_VIEW) {
|
if (custFUIEvent == CustomFilterUIEvent.TARGET_FILTER_DETAIL_VIEW) {
|
||||||
populateComponents();
|
populateComponents();
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
@@ -27,21 +24,20 @@ 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.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
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;
|
||||||
@@ -52,38 +48,34 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class CreateOrUpdateFilterTable extends Table {
|
public class CreateOrUpdateFilterTable extends Table {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6887304217281629713L;
|
private static final long serialVersionUID = 6887304217281629713L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
|
||||||
private LazyQueryContainer container;
|
private LazyQueryContainer container;
|
||||||
|
|
||||||
|
private final EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
private static final int PROPERTY_DEPT = 3;
|
private static final int PROPERTY_DEPT = 3;
|
||||||
|
|
||||||
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
|
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
|
||||||
|
|
||||||
private static final String INSTALL_DIST_SET = "installedDistributionSet";
|
private static final String INSTALL_DIST_SET = "installedDistributionSet";
|
||||||
|
|
||||||
/**
|
public CreateOrUpdateFilterTable(final I18N i18n, final UIEventBus eventBus,
|
||||||
* Initialize the Action History Table.
|
final FilterManagementUIState filterManagementUIState) {
|
||||||
*/
|
this.i18n = i18n;
|
||||||
@PostConstruct
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
public void init() {
|
this.eventBus = eventBus;
|
||||||
|
|
||||||
setStyleName("sp-table");
|
setStyleName("sp-table");
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
setHeight(100.0f, Unit.PERCENTAGE);
|
setHeight(100.0F, Unit.PERCENTAGE);
|
||||||
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
|
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
|
||||||
addStyleName(ValoTheme.TABLE_SMALL);
|
addStyleName(ValoTheme.TABLE_SMALL);
|
||||||
setColumnCollapsingAllowed(true);
|
setColumnCollapsingAllowed(true);
|
||||||
@@ -96,18 +88,13 @@ public class CreateOrUpdateFilterTable extends Table {
|
|||||||
setItemDescriptionGenerator(new AssignInstalledDSTooltipGenerator());
|
setItemDescriptionGenerator(new AssignInstalledDSTooltipGenerator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
||||||
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
||||||
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK) {
|
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK) {
|
||||||
UI.getCurrent().access(() -> populateTableData());
|
UI.getCurrent().access(this::populateTableData);
|
||||||
} else if (custFUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) {
|
} else if (custFUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) {
|
||||||
UI.getCurrent().access(() -> onQuery());
|
UI.getCurrent().access(this::onQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,9 +179,9 @@ public class CreateOrUpdateFilterTable extends Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<TableColumn> getVisbleColumns() {
|
private List<TableColumn> getVisbleColumns() {
|
||||||
final List<TableColumn> columnList = new ArrayList<>();
|
final List<TableColumn> columnList = Lists.newArrayListWithExpectedSize(7);
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.15f));
|
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.15F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1f));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.1F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.1F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
|
||||||
columnList.add(
|
columnList.add(
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.event.remote.DistributionSetDeletedEvent;
|
import org.eclipse.hawkbit.repository.event.remote.DistributionSetDeletedEvent;
|
||||||
import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetCreatedEvent;
|
import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetCreatedEvent;
|
||||||
import org.eclipse.hawkbit.ui.distributions.dstable.ManageDistBeanQuery;
|
import org.eclipse.hawkbit.ui.distributions.dstable.ManageDistBeanQuery;
|
||||||
@@ -25,45 +22,34 @@ 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.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.data.Container;
|
import com.vaadin.data.Container;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.themes.ValoTheme;
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for selecting a distribution set.
|
* Table for selecting a distribution set.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionSetSelectTable extends Table {
|
public class DistributionSetSelectTable extends Table {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4307487829435471759L;
|
private static final long serialVersionUID = -4307487829435471759L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManageDistUIState manageDistUIState;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ManageDistUIState manageDistUIState;
|
|
||||||
|
|
||||||
private Container container;
|
private Container container;
|
||||||
|
|
||||||
/**
|
public DistributionSetSelectTable(final I18N i18n, final UIEventBus eventBus,
|
||||||
* Initialize the component.
|
final ManageDistUIState manageDistUIState) {
|
||||||
*/
|
this.i18n = i18n;
|
||||||
@PostConstruct
|
this.manageDistUIState = manageDistUIState;
|
||||||
protected void init() {
|
|
||||||
setStyleName("sp-table");
|
setStyleName("sp-table");
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setSelectable(true);
|
setSelectable(true);
|
||||||
@@ -78,12 +64,7 @@ public class DistributionSetSelectTable extends Table {
|
|||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvents(final List<?> events) {
|
void onEvents(final List<?> events) {
|
||||||
final Object firstEvent = events.get(0);
|
final Object firstEvent = events.get(0);
|
||||||
if (DistributionSetCreatedEvent.class.isInstance(firstEvent)
|
if (DistributionSetCreatedEvent.class.isInstance(firstEvent)
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ package org.eclipse.hawkbit.ui.filtermanagement;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
|
||||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
@@ -20,18 +19,17 @@ import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
|||||||
import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Property;
|
import com.vaadin.data.Property;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.server.Sizeable;
|
import com.vaadin.server.Sizeable;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.CheckBox;
|
import com.vaadin.ui.CheckBox;
|
||||||
@@ -45,36 +43,36 @@ import com.vaadin.ui.Window;
|
|||||||
* Creates a dialog window to select the distribution set for a target filter
|
* Creates a dialog window to select the distribution set for a target filter
|
||||||
* query.
|
* query.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionSetSelectWindow
|
public class DistributionSetSelectWindow
|
||||||
implements CommonDialogWindow.SaveDialogCloseListener, Property.ValueChangeListener {
|
implements CommonDialogWindow.SaveDialogCloseListener, Property.ValueChangeListener {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4752345414134989396L;
|
private static final long serialVersionUID = 4752345414134989396L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetSelectTable dsTable;
|
||||||
private DistributionSetSelectTable dsTable;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetManagement targetManagement;
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
||||||
private transient TargetManagement targetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient TargetFilterQueryManagement targetFilterQueryManagement;
|
|
||||||
|
|
||||||
private CommonDialogWindow window;
|
private CommonDialogWindow window;
|
||||||
private CheckBox checkBox;
|
private CheckBox checkBox;
|
||||||
private Long tfqId;
|
private Long tfqId;
|
||||||
|
|
||||||
private void init() {
|
public DistributionSetSelectWindow(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final TargetManagement targetManagement, final TargetFilterQueryManagement targetFilterQueryManagement,
|
||||||
|
final ManageDistUIState manageDistUIState) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.dsTable = new DistributionSetSelectTable(i18n, eventBus, manageDistUIState);
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.targetManagement = targetManagement;
|
||||||
|
this.targetFilterQueryManagement = targetFilterQueryManagement;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initLocal() {
|
||||||
final Label label = new Label(i18n.get("label.auto.assign.description"));
|
final Label label = new Label(i18n.get("label.auto.assign.description"));
|
||||||
|
|
||||||
checkBox = new CheckBox(i18n.get("label.auto.assign.enable"));
|
checkBox = new CheckBox(i18n.get("label.auto.assign.enable"));
|
||||||
@@ -120,7 +118,7 @@ public class DistributionSetSelectWindow
|
|||||||
throw new IllegalStateException("TargetFilterQuery does not exist for the given id");
|
throw new IllegalStateException("TargetFilterQuery does not exist for the given id");
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
initLocal();
|
||||||
|
|
||||||
final DistributionSet distributionSet = tfq.getAutoAssignDistributionSet();
|
final DistributionSet distributionSet = tfq.getAutoAssignDistributionSet();
|
||||||
if (distributionSet != null) {
|
if (distributionSet != null) {
|
||||||
|
|||||||
@@ -8,15 +8,25 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.filtermanagement;
|
package org.eclipse.hawkbit.ui.filtermanagement;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
|
import org.eclipse.hawkbit.ui.UiProperties;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.footer.TargetFilterCountMessageLabel;
|
import org.eclipse.hawkbit.ui.filtermanagement.footer.TargetFilterCountMessageLabel;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
|
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.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -30,11 +40,8 @@ import com.vaadin.ui.UI;
|
|||||||
import com.vaadin.ui.VerticalLayout;
|
import com.vaadin.ui.VerticalLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* View for custom target filter management.
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringView(name = FilterManagementView.VIEW_NAME, ui = HawkbitUI.class)
|
@SpringView(name = FilterManagementView.VIEW_NAME, ui = HawkbitUI.class)
|
||||||
@UIScope
|
@UIScope
|
||||||
public class FilterManagementView extends VerticalLayout implements View {
|
public class FilterManagementView extends VerticalLayout implements View {
|
||||||
@@ -43,29 +50,41 @@ public class FilterManagementView extends VerticalLayout implements View {
|
|||||||
|
|
||||||
public static final String VIEW_NAME = "targetFilters";
|
public static final String VIEW_NAME = "targetFilters";
|
||||||
|
|
||||||
@Autowired
|
private final TargetFilterHeader targetFilterHeader;
|
||||||
private TargetFilterHeader targetFilterHeader;
|
|
||||||
|
private final TargetFilterTable targetFilterTable;
|
||||||
|
|
||||||
|
private final CreateOrUpdateFilterHeader createNewFilterHeader;
|
||||||
|
|
||||||
|
private final CreateOrUpdateFilterTable createNewFilterTable;
|
||||||
|
|
||||||
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
|
|
||||||
|
private final TargetFilterCountMessageLabel targetFilterCountMessageLabel;
|
||||||
|
|
||||||
|
private final EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TargetFilterTable targetFilterTable;
|
FilterManagementView(final I18N i18n, final UIEventBus eventBus,
|
||||||
|
final FilterManagementUIState filterManagementUIState,
|
||||||
|
final TargetFilterQueryManagement targetFilterQueryManagement, final SpPermissionChecker permissionChecker,
|
||||||
|
final UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,
|
||||||
|
final AutoCompleteTextFieldComponent queryTextField, final ManageDistUIState manageDistUIState,
|
||||||
|
final TargetManagement targetManagement) {
|
||||||
|
this.targetFilterHeader = new TargetFilterHeader(eventBus, filterManagementUIState, permissionChecker);
|
||||||
|
this.targetFilterTable = new TargetFilterTable(i18n, notification, eventBus, filterManagementUIState,
|
||||||
|
targetFilterQueryManagement, manageDistUIState, targetManagement);
|
||||||
|
this.createNewFilterHeader = new CreateOrUpdateFilterHeader(i18n, eventBus, filterManagementUIState,
|
||||||
|
targetFilterQueryManagement, permissionChecker, notification, uiProperties, entityFactory,
|
||||||
|
queryTextField);
|
||||||
|
this.createNewFilterTable = new CreateOrUpdateFilterTable(i18n, eventBus, filterManagementUIState);
|
||||||
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
|
this.targetFilterCountMessageLabel = new TargetFilterCountMessageLabel(filterManagementUIState, i18n, eventBus);
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
}
|
||||||
|
|
||||||
@Autowired
|
@PostConstruct
|
||||||
private CreateOrUpdateFilterHeader createNewFilterHeader;
|
void init() {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CreateOrUpdateFilterTable createNewFilterTable;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TargetFilterCountMessageLabel targetFilterCountMessageLabel;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void enter(final ViewChangeEvent event) {
|
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
buildLayout();
|
buildLayout();
|
||||||
@@ -90,7 +109,7 @@ public class FilterManagementView extends VerticalLayout implements View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final CustomFilterUIEvent custFilterUIEvent) {
|
void onEvent(final CustomFilterUIEvent custFilterUIEvent) {
|
||||||
if (custFilterUIEvent == CustomFilterUIEvent.TARGET_FILTER_DETAIL_VIEW) {
|
if (custFilterUIEvent == CustomFilterUIEvent.TARGET_FILTER_DETAIL_VIEW) {
|
||||||
viewTargetFilterDetailLayout();
|
viewTargetFilterDetailLayout();
|
||||||
@@ -156,4 +175,9 @@ public class FilterManagementView extends VerticalLayout implements View {
|
|||||||
return messageLabelLayout;
|
return messageLabelLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enter(final ViewChangeEvent event) {
|
||||||
|
// This view is constructed in the init() method()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.filtermanagement;
|
package org.eclipse.hawkbit.ui.filtermanagement;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
||||||
@@ -21,12 +19,10 @@ import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.HorizontalLayout;
|
import com.vaadin.ui.HorizontalLayout;
|
||||||
@@ -38,20 +34,15 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class TargetFilterHeader extends VerticalLayout {
|
public class TargetFilterHeader extends VerticalLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7022704971955491673L;
|
private static final long serialVersionUID = -7022704971955491673L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permissionChecker;
|
||||||
private SpPermissionChecker permissionChecker;
|
|
||||||
|
|
||||||
private Label headerCaption;
|
private Label headerCaption;
|
||||||
|
|
||||||
@@ -61,11 +52,12 @@ public class TargetFilterHeader extends VerticalLayout {
|
|||||||
|
|
||||||
private SPUIButton searchResetIcon;
|
private SPUIButton searchResetIcon;
|
||||||
|
|
||||||
/**
|
public TargetFilterHeader(final UIEventBus eventBus, final FilterManagementUIState filterManagementUIState,
|
||||||
* Initialize the Campaign Status History Header.
|
final SpPermissionChecker permissionChecker) {
|
||||||
*/
|
this.eventBus = eventBus;
|
||||||
@PostConstruct
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
public void init() {
|
this.permissionChecker = permissionChecker;
|
||||||
|
|
||||||
createComponents();
|
createComponents();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,15 +13,14 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||||
import org.eclipse.hawkbit.ui.common.ConfirmationDialog;
|
import org.eclipse.hawkbit.ui.common.ConfirmationDialog;
|
||||||
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
|
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
|
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
@@ -30,11 +29,11 @@ import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
|||||||
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -42,8 +41,6 @@ import com.google.common.collect.Maps;
|
|||||||
import com.vaadin.data.Container;
|
import com.vaadin.data.Container;
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.Link;
|
import com.vaadin.ui.Link;
|
||||||
@@ -55,39 +52,38 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
* Displays list of target filter queries
|
* Displays list of target filter queries
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class TargetFilterTable extends Table {
|
public class TargetFilterTable extends Table {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4307487829435474759L;
|
private static final long serialVersionUID = -4307487829435474759L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification notification;
|
||||||
private UINotification notification;
|
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
||||||
private transient TargetFilterQueryManagement targetFilterQueryManagement;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionSetSelectWindow dsSelectWindow;
|
||||||
private DistributionSetSelectWindow dsSelectWindow;
|
|
||||||
|
|
||||||
private Container container;
|
private Container container;
|
||||||
|
|
||||||
private static final int PROPERTY_DEPT = 3;
|
private static final int PROPERTY_DEPT = 3;
|
||||||
|
|
||||||
/**
|
public TargetFilterTable(final I18N i18n, final UINotification notification, final UIEventBus eventBus,
|
||||||
* Initialize the Action History Table.
|
final FilterManagementUIState filterManagementUIState,
|
||||||
*/
|
final TargetFilterQueryManagement targetFilterQueryManagement, final ManageDistUIState manageDistUIState,
|
||||||
@PostConstruct
|
final TargetManagement targetManagement) {
|
||||||
public void init() {
|
this.i18n = i18n;
|
||||||
|
this.notification = notification;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
|
this.targetFilterQueryManagement = targetFilterQueryManagement;
|
||||||
|
this.dsSelectWindow = new DistributionSetSelectWindow(i18n, eventBus, targetManagement,
|
||||||
|
targetFilterQueryManagement, manageDistUIState);
|
||||||
|
|
||||||
setStyleName("sp-table");
|
setStyleName("sp-table");
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
@@ -102,12 +98,7 @@ public class TargetFilterTable extends Table {
|
|||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final CustomFilterUIEvent filterEvent) {
|
void onEvent(final CustomFilterUIEvent filterEvent) {
|
||||||
if (filterEvent == CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT
|
if (filterEvent == CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT
|
||||||
|| filterEvent == CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT_REMOVE
|
|| filterEvent == CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT_REMOVE
|
||||||
@@ -155,7 +146,8 @@ public class TargetFilterTable extends Table {
|
|||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.2F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.2F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.2F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.2F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET, i18n.get("header.auto.assignment.ds"), 0.1F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET,
|
||||||
|
i18n.get("header.auto.assignment.ds"), 0.1F));
|
||||||
columnList.add(new TableColumn(SPUIDefinitions.CUSTOM_FILTER_DELETE, i18n.get("header.delete"), 0.1F));
|
columnList.add(new TableColumn(SPUIDefinitions.CUSTOM_FILTER_DELETE, i18n.get("header.delete"), 0.1F));
|
||||||
return columnList;
|
return columnList;
|
||||||
|
|
||||||
@@ -232,10 +224,11 @@ public class TargetFilterTable extends Table {
|
|||||||
|
|
||||||
private Button customFilterDistributionSetButton(final Long itemId) {
|
private Button customFilterDistributionSetButton(final Long itemId) {
|
||||||
final Item row1 = getItem(itemId);
|
final Item row1 = getItem(itemId);
|
||||||
final ProxyDistribution distSet = (ProxyDistribution) row1.getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET).getValue();
|
final ProxyDistribution distSet = (ProxyDistribution) row1
|
||||||
|
.getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET).getValue();
|
||||||
final String buttonId = "distSetButton";
|
final String buttonId = "distSetButton";
|
||||||
Button updateIcon;
|
Button updateIcon;
|
||||||
if(distSet == null) {
|
if (distSet == null) {
|
||||||
updateIcon = SPUIComponentProvider.getButton(buttonId, i18n.get("button.no.auto.assignment"),
|
updateIcon = SPUIComponentProvider.getButton(buttonId, i18n.get("button.no.auto.assignment"),
|
||||||
i18n.get("button.auto.assignment.desc"), null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
i18n.get("button.auto.assignment.desc"), null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
||||||
} else {
|
} else {
|
||||||
@@ -252,7 +245,7 @@ public class TargetFilterTable extends Table {
|
|||||||
|
|
||||||
private void onClickOfDistributionSetButton(final ClickEvent event) {
|
private void onClickOfDistributionSetButton(final ClickEvent event) {
|
||||||
final Item item = (Item) ((Button) event.getComponent()).getData();
|
final Item item = (Item) ((Button) event.getComponent()).getData();
|
||||||
final Long tfqId = (Long)item.getItemProperty(SPUILabelDefinitions.VAR_ID).getValue();
|
final Long tfqId = (Long) item.getItemProperty(SPUILabelDefinitions.VAR_ID).getValue();
|
||||||
|
|
||||||
dsSelectWindow.showForTargetFilter(tfqId);
|
dsSelectWindow.showForTargetFilter(tfqId);
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.filtermanagement.footer;
|
package org.eclipse.hawkbit.ui.filtermanagement.footer;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
||||||
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
@@ -18,15 +15,12 @@ import org.eclipse.hawkbit.ui.utils.I18N;
|
|||||||
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.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
import org.vaadin.spring.events.EventBus;
|
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
|
|
||||||
@@ -36,37 +30,25 @@ import com.vaadin.ui.UI;
|
|||||||
* Count message label which display current filter details and details
|
* Count message label which display current filter details and details
|
||||||
* on pinning.
|
* on pinning.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class TargetFilterCountMessageLabel extends Label {
|
public class TargetFilterCountMessageLabel extends Label {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7188528790042766877L;
|
private static final long serialVersionUID = -7188528790042766877L;
|
||||||
|
|
||||||
@Autowired
|
private final FilterManagementUIState filterManagementUIState;
|
||||||
private FilterManagementUIState filterManagementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
public TargetFilterCountMessageLabel(final FilterManagementUIState filterManagementUIState, final I18N i18n,
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
final UIEventBus eventBus) {
|
||||||
|
this.filterManagementUIState = filterManagementUIState;
|
||||||
|
this.i18n = i18n;
|
||||||
|
|
||||||
/**
|
|
||||||
* PostConstruct method called by spring after bean has been initialized.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void postConstruct() {
|
|
||||||
applyStyle();
|
applyStyle();
|
||||||
displayTargetFilterMessage();
|
displayTargetFilterMessage();
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
||||||
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
||||||
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK
|
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.layouts;
|
package org.eclipse.hawkbit.ui.layouts;
|
||||||
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.TagManagement;
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
@@ -33,8 +31,8 @@ import org.eclipse.hawkbit.ui.utils.I18N;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Property.ValueChangeEvent;
|
import com.vaadin.data.Property.ValueChangeEvent;
|
||||||
import com.vaadin.data.Property.ValueChangeListener;
|
import com.vaadin.data.Property.ValueChangeListener;
|
||||||
@@ -73,23 +71,17 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
|
|||||||
protected static final String TAG_DYNAMIC_STYLE = "tag-color-preview";
|
protected static final String TAG_DYNAMIC_STYLE = "tag-color-preview";
|
||||||
protected static final String MESSAGE_ERROR_MISSING_TAGNAME = "message.error.missing.tagname";
|
protected static final String MESSAGE_ERROR_MISSING_TAGNAME = "message.error.missing.tagname";
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected I18N i18n;
|
protected I18N i18n;
|
||||||
|
|
||||||
@Autowired
|
protected TagManagement tagManagement;
|
||||||
protected transient TagManagement tagManagement;
|
|
||||||
|
|
||||||
@Autowired
|
protected EntityFactory entityFactory;
|
||||||
protected transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
@Autowired
|
protected EventBus.UIEventBus eventBus;
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
protected SpPermissionChecker permChecker;
|
protected SpPermissionChecker permChecker;
|
||||||
|
|
||||||
@Autowired
|
protected UINotification uiNotification;
|
||||||
protected transient UINotification uiNotification;
|
|
||||||
|
|
||||||
private final FormLayout formLayout = new FormLayout();
|
private final FormLayout formLayout = new FormLayout();
|
||||||
|
|
||||||
@@ -116,6 +108,17 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
|
|||||||
protected String tagNameValue;
|
protected String tagNameValue;
|
||||||
protected String tagDescValue;
|
protected String tagDescValue;
|
||||||
|
|
||||||
|
public AbstractCreateUpdateTagLayout(final I18N i18n, final TagManagement tagManagement,
|
||||||
|
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
|
||||||
|
final UINotification uiNotification) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.tagManagement = tagManagement;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.permChecker = permChecker;
|
||||||
|
this.uiNotification = uiNotification;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Save or update the entity.
|
* Save or update the entity.
|
||||||
@@ -169,11 +172,6 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
|
|||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void createRequiredComponents() {
|
protected void createRequiredComponents() {
|
||||||
|
|
||||||
createTagStr = i18n.get("label.create.tag");
|
createTagStr = i18n.get("label.create.tag");
|
||||||
|
|||||||
@@ -8,14 +8,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.layouts;
|
package org.eclipse.hawkbit.ui.layouts;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||||
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants;
|
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants;
|
||||||
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper;
|
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper;
|
||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.data.Property.ValueChangeEvent;
|
import com.vaadin.data.Property.ValueChangeEvent;
|
||||||
import com.vaadin.server.Page;
|
import com.vaadin.server.Page;
|
||||||
@@ -39,6 +45,11 @@ public abstract class CreateUpdateTypeLayout<E extends NamedEntity> extends Abst
|
|||||||
public static final String TYPE_NAME_DYNAMIC_STYLE = "new-tag-name";
|
public static final String TYPE_NAME_DYNAMIC_STYLE = "new-tag-name";
|
||||||
private static final String TYPE_DESC_DYNAMIC_STYLE = "new-tag-desc";
|
private static final String TYPE_DESC_DYNAMIC_STYLE = "new-tag-desc";
|
||||||
|
|
||||||
|
public CreateUpdateTypeLayout(final I18N i18n, final TagManagement tagManagement, final EntityFactory entityFactory,
|
||||||
|
final UIEventBus eventBus, final SpPermissionChecker permChecker, final UINotification uiNotification) {
|
||||||
|
super(i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addListeners() {
|
protected void addListeners() {
|
||||||
super.addListeners();
|
super.addListeners();
|
||||||
|
|||||||
@@ -33,23 +33,22 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
/**
|
/**
|
||||||
* Login UI window that is independent of the {@link HawkbitUI} itself.
|
* Login UI window that is independent of the {@link HawkbitUI} itself.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Title("hawkBit UI - Login")
|
@Title("hawkBit UI - Login")
|
||||||
public class HawkbitLoginUI extends DefaultHawkbitUI {
|
public class HawkbitLoginUI extends DefaultHawkbitUI {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(HawkbitLoginUI.class);
|
private static final Logger LOG = LoggerFactory.getLogger(HawkbitLoginUI.class);
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Autowired
|
private final SpringViewProvider viewProvider;
|
||||||
private SpringViewProvider viewProvider;
|
|
||||||
|
private final ApplicationContext context;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient ApplicationContext context;
|
protected HawkbitLoginUI(final SpringViewProvider viewProvider, final ApplicationContext context) {
|
||||||
|
this.viewProvider = viewProvider;
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init(final VaadinRequest request) {
|
protected void init(final VaadinRequest request) {
|
||||||
|
|||||||
@@ -71,17 +71,13 @@ public class LoginView extends VerticalLayout implements View {
|
|||||||
private static final String SP_LOGIN_USER = "sp-login-user";
|
private static final String SP_LOGIN_USER = "sp-login-user";
|
||||||
private static final String SP_LOGIN_TENANT = "sp-login-tenant";
|
private static final String SP_LOGIN_TENANT = "sp-login-tenant";
|
||||||
|
|
||||||
@Autowired
|
private final VaadinSecurity vaadinSecurity;
|
||||||
private transient VaadinSecurity vaadinSecurity;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UiProperties uiProperties;
|
||||||
private transient UiProperties uiProperties;
|
|
||||||
|
|
||||||
@Autowired
|
private final MultitenancyIndicator multiTenancyIndicator;
|
||||||
private transient MultitenancyIndicator multiTenancyIndicator;
|
|
||||||
|
|
||||||
private final transient AntPathMatcher matcher = new AntPathMatcher();
|
private final transient AntPathMatcher matcher = new AntPathMatcher();
|
||||||
private boolean useCookie = true;
|
private boolean useCookie = true;
|
||||||
@@ -91,6 +87,15 @@ public class LoginView extends VerticalLayout implements View {
|
|||||||
private PasswordField password;
|
private PasswordField password;
|
||||||
private Button signin;
|
private Button signin;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LoginView(final VaadinSecurity vaadinSecurity, final I18N i18n, final UiProperties uiProperties,
|
||||||
|
final MultitenancyIndicator multiTenancyIndicator) {
|
||||||
|
this.vaadinSecurity = vaadinSecurity;
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uiProperties = uiProperties;
|
||||||
|
this.multiTenancyIndicator = multiTenancyIndicator;
|
||||||
|
}
|
||||||
|
|
||||||
void loginAuthenticationFailedNotification() {
|
void loginAuthenticationFailedNotification() {
|
||||||
final Notification notification = new Notification(i18n.get("notification.login.failed.title"));
|
final Notification notification = new Notification(i18n.get("notification.login.failed.title"));
|
||||||
notification.setDescription(i18n.get("notification.login.failed.description"));
|
notification.setDescription(i18n.get("notification.login.failed.description"));
|
||||||
|
|||||||
@@ -8,10 +8,19 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.management;
|
package org.eclipse.hawkbit.ui.management;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
|
import org.eclipse.hawkbit.ui.UiProperties;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
import org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryComponent;
|
import org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryComponent;
|
||||||
import org.eclipse.hawkbit.ui.management.dstable.DistributionTableLayout;
|
import org.eclipse.hawkbit.ui.management.dstable.DistributionTableLayout;
|
||||||
@@ -19,16 +28,21 @@ import org.eclipse.hawkbit.ui.management.dstag.DistributionTagLayout;
|
|||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.management.event.ManagementViewAcceptCriteria;
|
||||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.footer.DeleteActionsLayout;
|
import org.eclipse.hawkbit.ui.management.footer.DeleteActionsLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.DistributionTableFilters;
|
||||||
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.management.targettable.TargetTable;
|
||||||
import org.eclipse.hawkbit.ui.management.targettable.TargetTableLayout;
|
import org.eclipse.hawkbit.ui.management.targettable.TargetTableLayout;
|
||||||
|
import org.eclipse.hawkbit.ui.management.targettag.CreateUpdateTargetTagLayoutWindow;
|
||||||
import org.eclipse.hawkbit.ui.management.targettag.TargetTagFilterLayout;
|
import org.eclipse.hawkbit.ui.management.targettag.TargetTagFilterLayout;
|
||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
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.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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,7 +60,7 @@ import com.vaadin.ui.UI;
|
|||||||
import com.vaadin.ui.VerticalLayout;
|
import com.vaadin.ui.VerticalLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Target status and deployment management view.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringView(name = DeploymentView.VIEW_NAME, ui = HawkbitUI.class)
|
@SpringView(name = DeploymentView.VIEW_NAME, ui = HawkbitUI.class)
|
||||||
@@ -56,43 +70,71 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
public static final String VIEW_NAME = "deployment";
|
public static final String VIEW_NAME = "deployment";
|
||||||
private static final long serialVersionUID = 1847434723456644998L;
|
private static final long serialVersionUID = 1847434723456644998L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventbus;
|
||||||
private transient EventBus.SessionEventBus eventbus;
|
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permChecker;
|
||||||
private SpPermissionChecker permChecker;
|
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
|
||||||
|
|
||||||
@Autowired
|
private final UINotification uiNotification;
|
||||||
private transient UINotification uiNotification;
|
|
||||||
|
|
||||||
@Autowired
|
private final ManagementUIState managementUIState;
|
||||||
private ManagementUIState managementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
private final ActionHistoryComponent actionHistoryComponent;
|
||||||
private ActionHistoryComponent actionHistoryComponent;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetTagFilterLayout targetTagFilterLayout;
|
||||||
private TargetTagFilterLayout targetTagFilterLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final TargetTableLayout targetTableLayout;
|
||||||
private TargetTableLayout targetTableLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionTagLayout distributionTagLayout;
|
||||||
private DistributionTagLayout distributionTagLayout;
|
|
||||||
|
|
||||||
@Autowired
|
private final DistributionTableLayout distributionTableLayoutNew;
|
||||||
private DistributionTableLayout distributionTableLayoutNew;
|
|
||||||
|
|
||||||
@Autowired
|
private final DeleteActionsLayout deleteAndActionsLayout;
|
||||||
private DeleteActionsLayout deleteAndActionsLayout;
|
|
||||||
|
|
||||||
private GridLayout mainLayout;
|
private GridLayout mainLayout;
|
||||||
|
|
||||||
@Override
|
@Autowired
|
||||||
public void enter(final ViewChangeEvent event) {
|
DeploymentView(final UIEventBus eventbus, final SpPermissionChecker permChecker, final I18N i18n,
|
||||||
|
final UINotification uiNotification, final ManagementUIState managementUIState,
|
||||||
|
final DeploymentManagement deploymentManagement, final UIEventBus eventBus,
|
||||||
|
final DistributionTableFilters distFilterParameters,
|
||||||
|
final DistributionSetManagement distributionSetManagement, final TargetManagement targetManagement,
|
||||||
|
final EntityFactory entityFactory, final UiProperties uiproperties,
|
||||||
|
final ManagementViewAcceptCriteria managementViewAcceptCriteria, final TagManagement tagManagement,
|
||||||
|
final TargetFilterQueryManagement targetFilterQueryManagement, final SystemManagement systemManagement) {
|
||||||
|
this.eventbus = eventbus;
|
||||||
|
this.permChecker = permChecker;
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.uiNotification = uiNotification;
|
||||||
|
this.managementUIState = managementUIState;
|
||||||
|
this.actionHistoryComponent = new ActionHistoryComponent(i18n, deploymentManagement, eventBus, uiNotification,
|
||||||
|
managementUIState);
|
||||||
|
final CreateUpdateTargetTagLayoutWindow createUpdateTargetTagLayout = new CreateUpdateTargetTagLayoutWindow(
|
||||||
|
i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
|
||||||
|
this.targetTagFilterLayout = new TargetTagFilterLayout(i18n, createUpdateTargetTagLayout, managementUIState,
|
||||||
|
managementViewAcceptCriteria, permChecker, eventBus, uiNotification, entityFactory, targetManagement,
|
||||||
|
targetFilterQueryManagement);
|
||||||
|
final TargetTable targetTable = new TargetTable(eventBus, i18n, uiNotification, targetManagement,
|
||||||
|
managementUIState, permChecker, managementViewAcceptCriteria);
|
||||||
|
|
||||||
|
this.targetTableLayout = new TargetTableLayout(eventbus, targetTable, targetManagement, uiNotification,
|
||||||
|
entityFactory, i18n, eventBus, uiNotification, managementUIState, managementViewAcceptCriteria,
|
||||||
|
deploymentManagement, uiproperties, permChecker, uiNotification, tagManagement);
|
||||||
|
|
||||||
|
this.distributionTagLayout = new DistributionTagLayout(eventbus, managementUIState, i18n, permChecker, eventBus,
|
||||||
|
tagManagement, entityFactory, uiNotification, distFilterParameters, distributionSetManagement,
|
||||||
|
managementViewAcceptCriteria);
|
||||||
|
this.distributionTableLayoutNew = new DistributionTableLayout(i18n, eventBus, permChecker, managementUIState,
|
||||||
|
distributionSetManagement, managementViewAcceptCriteria, entityFactory, uiNotification,
|
||||||
|
systemManagement, tagManagement, targetManagement);
|
||||||
|
this.deleteAndActionsLayout = new DeleteActionsLayout(i18n, permChecker, eventBus, uiNotification,
|
||||||
|
tagManagement, managementViewAcceptCriteria, managementUIState, targetManagement, targetTable,
|
||||||
|
deploymentManagement, distributionSetManagement);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
void init() {
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restoreState();
|
restoreState();
|
||||||
checkNoDataAvaialble();
|
checkNoDataAvaialble();
|
||||||
@@ -107,7 +149,7 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
eventbus.unsubscribe(this);
|
eventbus.unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent event) {
|
void onEvent(final DistributionTableEvent event) {
|
||||||
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
||||||
minimizeDistTable();
|
minimizeDistTable();
|
||||||
@@ -116,7 +158,7 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final TargetTableEvent event) {
|
void onEvent(final TargetTableEvent event) {
|
||||||
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
|
||||||
minimizeTargetTable();
|
minimizeTargetTable();
|
||||||
@@ -125,13 +167,13 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final ManagementUIEvent mgmtUIEvent) {
|
void onEvent(final ManagementUIEvent mgmtUIEvent) {
|
||||||
if (mgmtUIEvent == ManagementUIEvent.MAX_ACTION_HISTORY) {
|
if (mgmtUIEvent == ManagementUIEvent.MAX_ACTION_HISTORY) {
|
||||||
UI.getCurrent().access(() -> maximizeActionHistory());
|
UI.getCurrent().access(this::maximizeActionHistory);
|
||||||
}
|
}
|
||||||
if (mgmtUIEvent == ManagementUIEvent.MIN_ACTION_HISTORY) {
|
if (mgmtUIEvent == ManagementUIEvent.MIN_ACTION_HISTORY) {
|
||||||
UI.getCurrent().access(() -> minimizeActionHistory());
|
UI.getCurrent().access(this::minimizeActionHistory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +205,7 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
layoutWidgets();
|
layoutWidgets();
|
||||||
mainLayout.setSizeFull();
|
mainLayout.setSizeFull();
|
||||||
mainLayout.setSpacing(true);
|
mainLayout.setSpacing(true);
|
||||||
mainLayout.setRowExpandRatio(0, 1f);
|
mainLayout.setRowExpandRatio(0, 1F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void layoutWidgets() {
|
private void layoutWidgets() {
|
||||||
@@ -185,9 +227,9 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
mainLayout.addComponent(actionHistoryComponent, 4, 0);
|
mainLayout.addComponent(actionHistoryComponent, 4, 0);
|
||||||
mainLayout.addComponent(distributionTableLayoutNew, 2, 0);
|
mainLayout.addComponent(distributionTableLayoutNew, 2, 0);
|
||||||
mainLayout.addComponent(distributionTagLayout, 3, 0);
|
mainLayout.addComponent(distributionTagLayout, 3, 0);
|
||||||
mainLayout.setColumnExpandRatio(1, 0.275f);
|
mainLayout.setColumnExpandRatio(1, 0.275F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0.275f);
|
mainLayout.setColumnExpandRatio(2, 0.275F);
|
||||||
mainLayout.setColumnExpandRatio(4, 0.45f);
|
mainLayout.setColumnExpandRatio(4, 0.45F);
|
||||||
if (showFooterLayout()) {
|
if (showFooterLayout()) {
|
||||||
mainLayout.addComponent(deleteAndActionsLayout, 1, 1, 2, 1);
|
mainLayout.addComponent(deleteAndActionsLayout, 1, 1, 2, 1);
|
||||||
mainLayout.setComponentAlignment(deleteAndActionsLayout, Alignment.BOTTOM_CENTER);
|
mainLayout.setComponentAlignment(deleteAndActionsLayout, Alignment.BOTTOM_CENTER);
|
||||||
@@ -199,7 +241,7 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
mainLayout.setRows(2);
|
mainLayout.setRows(2);
|
||||||
mainLayout.addComponent(distributionTableLayoutNew, 0, 0);
|
mainLayout.addComponent(distributionTableLayoutNew, 0, 0);
|
||||||
mainLayout.addComponent(distributionTagLayout, 1, 0);
|
mainLayout.addComponent(distributionTagLayout, 1, 0);
|
||||||
mainLayout.setColumnExpandRatio(0, 1f);
|
mainLayout.setColumnExpandRatio(0, 1F);
|
||||||
if (showFooterLayout()) {
|
if (showFooterLayout()) {
|
||||||
mainLayout.addComponent(deleteAndActionsLayout, 0, 1);
|
mainLayout.addComponent(deleteAndActionsLayout, 0, 1);
|
||||||
mainLayout.setComponentAlignment(deleteAndActionsLayout, Alignment.BOTTOM_CENTER);
|
mainLayout.setComponentAlignment(deleteAndActionsLayout, Alignment.BOTTOM_CENTER);
|
||||||
@@ -225,8 +267,8 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
mainLayout.addComponent(targetTagFilterLayout, 0, 0);
|
mainLayout.addComponent(targetTagFilterLayout, 0, 0);
|
||||||
mainLayout.addComponent(targetTableLayout, 1, 0);
|
mainLayout.addComponent(targetTableLayout, 1, 0);
|
||||||
mainLayout.addComponent(actionHistoryComponent, 2, 0);
|
mainLayout.addComponent(actionHistoryComponent, 2, 0);
|
||||||
mainLayout.setColumnExpandRatio(1, 0.4f);
|
mainLayout.setColumnExpandRatio(1, 0.4F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0.6f);
|
mainLayout.setColumnExpandRatio(2, 0.6F);
|
||||||
if (showFooterLayout()) {
|
if (showFooterLayout()) {
|
||||||
mainLayout.addComponent(deleteAndActionsLayout, 1, 1);
|
mainLayout.addComponent(deleteAndActionsLayout, 1, 1);
|
||||||
mainLayout.setComponentAlignment(deleteAndActionsLayout, Alignment.BOTTOM_CENTER);
|
mainLayout.setComponentAlignment(deleteAndActionsLayout, Alignment.BOTTOM_CENTER);
|
||||||
@@ -249,10 +291,10 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
}
|
}
|
||||||
mainLayout.removeComponent(actionHistoryComponent);
|
mainLayout.removeComponent(actionHistoryComponent);
|
||||||
mainLayout.removeComponent(deleteAndActionsLayout);
|
mainLayout.removeComponent(deleteAndActionsLayout);
|
||||||
mainLayout.setColumnExpandRatio(1, 1f);
|
mainLayout.setColumnExpandRatio(1, 1F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0f);
|
mainLayout.setColumnExpandRatio(2, 0F);
|
||||||
mainLayout.setColumnExpandRatio(3, 0f);
|
mainLayout.setColumnExpandRatio(3, 0F);
|
||||||
mainLayout.setColumnExpandRatio(4, 0f);
|
mainLayout.setColumnExpandRatio(4, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maximizeDistTable() {
|
private void maximizeDistTable() {
|
||||||
@@ -262,10 +304,10 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
mainLayout.removeComponent(actionHistoryComponent);
|
mainLayout.removeComponent(actionHistoryComponent);
|
||||||
}
|
}
|
||||||
mainLayout.removeComponent(deleteAndActionsLayout);
|
mainLayout.removeComponent(deleteAndActionsLayout);
|
||||||
mainLayout.setColumnExpandRatio(0, 0f);
|
mainLayout.setColumnExpandRatio(0, 0F);
|
||||||
mainLayout.setColumnExpandRatio(1, 0f);
|
mainLayout.setColumnExpandRatio(1, 0F);
|
||||||
mainLayout.setColumnExpandRatio(2, 1f);
|
mainLayout.setColumnExpandRatio(2, 1F);
|
||||||
mainLayout.setColumnExpandRatio(4, 0f);
|
mainLayout.setColumnExpandRatio(4, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maximizeActionHistory() {
|
private void maximizeActionHistory() {
|
||||||
@@ -276,11 +318,11 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
mainLayout.removeComponent(distributionTableLayoutNew);
|
mainLayout.removeComponent(distributionTableLayoutNew);
|
||||||
mainLayout.removeComponent(distributionTagLayout);
|
mainLayout.removeComponent(distributionTagLayout);
|
||||||
}
|
}
|
||||||
mainLayout.setColumnExpandRatio(0, 0f);
|
mainLayout.setColumnExpandRatio(0, 0F);
|
||||||
mainLayout.setColumnExpandRatio(1, 0f);
|
mainLayout.setColumnExpandRatio(1, 0F);
|
||||||
mainLayout.setColumnExpandRatio(2, 0f);
|
mainLayout.setColumnExpandRatio(2, 0F);
|
||||||
mainLayout.setColumnExpandRatio(3, 0f);
|
mainLayout.setColumnExpandRatio(3, 0F);
|
||||||
mainLayout.setColumnExpandRatio(4, 1f);
|
mainLayout.setColumnExpandRatio(4, 1F);
|
||||||
mainLayout.removeComponent(deleteAndActionsLayout);
|
mainLayout.removeComponent(deleteAndActionsLayout);
|
||||||
mainLayout.setComponentAlignment(actionHistoryComponent, Alignment.TOP_LEFT);
|
mainLayout.setComponentAlignment(actionHistoryComponent, Alignment.TOP_LEFT);
|
||||||
}
|
}
|
||||||
@@ -329,4 +371,9 @@ public class DeploymentView extends VerticalLayout implements View, BrowserWindo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enter(final ViewChangeEvent event) {
|
||||||
|
// This view is constructed in the init() method()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,20 +8,19 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.management.actionhistory;
|
package org.eclipse.hawkbit.ui.management.actionhistory;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.Target;
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
||||||
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.UI;
|
import com.vaadin.ui.UI;
|
||||||
import com.vaadin.ui.VerticalLayout;
|
import com.vaadin.ui.VerticalLayout;
|
||||||
@@ -30,37 +29,26 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class ActionHistoryComponent extends VerticalLayout {
|
public class ActionHistoryComponent extends VerticalLayout {
|
||||||
private static final long serialVersionUID = -3766179797384539821L;
|
private static final long serialVersionUID = -3766179797384539821L;
|
||||||
|
|
||||||
@Autowired
|
private final ActionHistoryHeader actionHistoryHeader;
|
||||||
private ActionHistoryHeader actionHistoryHeader;
|
private final ActionHistoryTable actionHistoryTable;
|
||||||
|
private final EventBus.UIEventBus eventBus;
|
||||||
|
|
||||||
@Autowired
|
public ActionHistoryComponent(final I18N i18n, final DeploymentManagement deploymentManagement,
|
||||||
private ActionHistoryTable actionHistoryTable;
|
final UIEventBus eventBus, final UINotification notification, final ManagementUIState managementUIState) {
|
||||||
|
this.actionHistoryHeader = new ActionHistoryHeader(eventBus, managementUIState);
|
||||||
@Autowired
|
this.actionHistoryTable = new ActionHistoryTable(i18n, deploymentManagement, eventBus, notification,
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
managementUIState);
|
||||||
|
this.eventBus = eventBus;
|
||||||
/**
|
|
||||||
* Initialize the Action History Component.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
buildLayout();
|
buildLayout();
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
setImmediate(true);
|
setImmediate(true);
|
||||||
eventBus.subscribe(this);
|
eventBus.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final TargetTableEvent targetUIEvent) {
|
void onEvent(final TargetTableEvent targetUIEvent) {
|
||||||
if (BaseEntityEventType.SELECTED_ENTITY == targetUIEvent.getEventType()) {
|
if (BaseEntityEventType.SELECTED_ENTITY == targetUIEvent.getEventType()) {
|
||||||
setData(SPUIDefinitions.DATA_AVAILABLE);
|
setData(SPUIDefinitions.DATA_AVAILABLE);
|
||||||
@@ -76,7 +64,7 @@ public class ActionHistoryComponent extends VerticalLayout {
|
|||||||
addComponents(actionHistoryHeader, actionHistoryTable);
|
addComponents(actionHistoryHeader, actionHistoryTable);
|
||||||
setComponentAlignment(actionHistoryHeader, Alignment.TOP_CENTER);
|
setComponentAlignment(actionHistoryHeader, Alignment.TOP_CENTER);
|
||||||
setComponentAlignment(actionHistoryTable, Alignment.TOP_CENTER);
|
setComponentAlignment(actionHistoryTable, Alignment.TOP_CENTER);
|
||||||
setExpandRatio(actionHistoryTable, 1.0f);
|
setExpandRatio(actionHistoryTable, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.management.actionhistory;
|
package org.eclipse.hawkbit.ui.management.actionhistory;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
@@ -19,13 +17,11 @@ import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
|||||||
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.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Alignment;
|
import com.vaadin.ui.Alignment;
|
||||||
import com.vaadin.ui.HorizontalLayout;
|
import com.vaadin.ui.HorizontalLayout;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
@@ -35,26 +31,18 @@ import com.vaadin.ui.VerticalLayout;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class ActionHistoryHeader extends VerticalLayout {
|
public class ActionHistoryHeader extends VerticalLayout {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6276188234115774351L;
|
private static final long serialVersionUID = -6276188234115774351L;
|
||||||
|
|
||||||
@Autowired
|
private final EventBus.UIEventBus eventBus;
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
private final ManagementUIState managementUIState;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ManagementUIState managementUIState;
|
|
||||||
|
|
||||||
private Label titleOfActionHistory;
|
private Label titleOfActionHistory;
|
||||||
private SPUIButton maxMinButton;
|
private SPUIButton maxMinButton;
|
||||||
|
|
||||||
/**
|
public ActionHistoryHeader(final UIEventBus eventBus, final ManagementUIState managementUIState) {
|
||||||
* Initialize the Action History Header.
|
this.eventBus = eventBus;
|
||||||
*/
|
this.managementUIState = managementUIState;
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
buildComponent();
|
buildComponent();
|
||||||
buildLayout();
|
buildLayout();
|
||||||
restorePreviousState();
|
restorePreviousState();
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ import java.util.Collection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.ActionStatusFields;
|
import org.eclipse.hawkbit.repository.ActionStatusFields;
|
||||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||||
import org.eclipse.hawkbit.repository.exception.CancelActionNotAllowedException;
|
import org.eclipse.hawkbit.repository.exception.CancelActionNotAllowedException;
|
||||||
@@ -40,13 +37,13 @@ import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
|||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
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.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.domain.Sort.Direction;
|
import org.springframework.data.domain.Sort.Direction;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -55,8 +52,6 @@ import com.vaadin.data.Item;
|
|||||||
import com.vaadin.data.util.HierarchicalContainer;
|
import com.vaadin.data.util.HierarchicalContainer;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.shared.ui.label.ContentMode;
|
import com.vaadin.shared.ui.label.ContentMode;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Component;
|
import com.vaadin.ui.Component;
|
||||||
import com.vaadin.ui.HorizontalLayout;
|
import com.vaadin.ui.HorizontalLayout;
|
||||||
@@ -71,42 +66,33 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
* Table for {@link Target#getActions()} history.
|
* Table for {@link Target#getActions()} history.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class ActionHistoryTable extends TreeTable {
|
public class ActionHistoryTable extends TreeTable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1631514704696786653L;
|
private static final long serialVersionUID = -1631514704696786653L;
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(ActionHistoryTable.class);
|
private static final Logger LOG = LoggerFactory.getLogger(ActionHistoryTable.class);
|
||||||
private static final String BUTTON_CANCEL = "button.cancel";
|
private static final String BUTTON_CANCEL = "button.cancel";
|
||||||
private static final String BUTTON_OK = "button.ok";
|
private static final String BUTTON_OK = "button.ok";
|
||||||
|
private static final String STATUS_ICON_GREEN = "statusIconGreen";
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
private final DeploymentManagement deploymentManagement;
|
||||||
|
private final EventBus.UIEventBus eventBus;
|
||||||
@Autowired
|
private final UINotification notification;
|
||||||
private transient DeploymentManagement deploymentManagement;
|
private final ManagementUIState managementUIState;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UINotification notification;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ManagementUIState managementUIState;
|
|
||||||
|
|
||||||
private Container hierarchicalContainer;
|
private Container hierarchicalContainer;
|
||||||
private boolean alreadyHasMessages;
|
private boolean alreadyHasMessages;
|
||||||
|
|
||||||
private Target target;
|
private Target target;
|
||||||
|
|
||||||
private static final String STATUS_ICON_GREEN = "statusIconGreen";
|
public ActionHistoryTable(final I18N i18n, final DeploymentManagement deploymentManagement,
|
||||||
|
final UIEventBus eventBus, final UINotification notification, final ManagementUIState managementUIState) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.deploymentManagement = deploymentManagement;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.notification = notification;
|
||||||
|
this.managementUIState = managementUIState;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the Action History Table.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
initializeTableSettings();
|
initializeTableSettings();
|
||||||
buildComponent();
|
buildComponent();
|
||||||
restorePreviousState();
|
restorePreviousState();
|
||||||
@@ -115,12 +101,7 @@ public class ActionHistoryTable extends TreeTable {
|
|||||||
setPageLength(SPUIDefinitions.PAGE_SIZE);
|
setPageLength(SPUIDefinitions.PAGE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void destroy() {
|
|
||||||
eventBus.unsubscribe(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
|
||||||
void onEvent(final ManagementUIEvent mgmtUIEvent) {
|
void onEvent(final ManagementUIEvent mgmtUIEvent) {
|
||||||
if (mgmtUIEvent == ManagementUIEvent.MAX_ACTION_HISTORY) {
|
if (mgmtUIEvent == ManagementUIEvent.MAX_ACTION_HISTORY) {
|
||||||
UI.getCurrent().access(() -> createTableContentForMax());
|
UI.getCurrent().access(() -> createTableContentForMax());
|
||||||
@@ -411,9 +392,9 @@ public class ActionHistoryTable extends TreeTable {
|
|||||||
actionCancel.setEnabled(isActionActive && !actionWithActiveStatus.isCancelingOrCanceled());
|
actionCancel.setEnabled(isActionActive && !actionWithActiveStatus.isCancelingOrCanceled());
|
||||||
actionCancel.addClickListener(event -> confirmAndCancelAction(actionId));
|
actionCancel.addClickListener(event -> confirmAndCancelAction(actionId));
|
||||||
|
|
||||||
final Button actionForce = SPUIComponentProvider.getButton(
|
final Button actionForce = SPUIComponentProvider.getButton(UIComponentIdProvider.ACTION_HISTORY_TABLE_FORCE_ID,
|
||||||
UIComponentIdProvider.ACTION_HISTORY_TABLE_FORCE_ID, "", i18n.get("message.force.action"),
|
"", i18n.get("message.force.action"), ValoTheme.BUTTON_TINY, true, FontAwesome.BOLT,
|
||||||
ValoTheme.BUTTON_TINY, true, FontAwesome.BOLT, SPUIButtonStyleSmallNoBorder.class);
|
SPUIButtonStyleSmallNoBorder.class);
|
||||||
actionForce.setEnabled(
|
actionForce.setEnabled(
|
||||||
isActionActive && !actionWithActiveStatus.isForce() && !actionWithActiveStatus.isCancelingOrCanceled());
|
isActionActive && !actionWithActiveStatus.isForce() && !actionWithActiveStatus.isCancelingOrCanceled());
|
||||||
actionForce.addClickListener(event -> confirmAndForceAction(actionId));
|
actionForce.addClickListener(event -> confirmAndForceAction(actionId));
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ package org.eclipse.hawkbit.ui.management.dstable;
|
|||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SystemManagement;
|
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||||
@@ -38,15 +36,13 @@ import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.CheckBox;
|
import com.vaadin.ui.CheckBox;
|
||||||
import com.vaadin.ui.ComboBox;
|
import com.vaadin.ui.ComboBox;
|
||||||
import com.vaadin.ui.CustomComponent;
|
import com.vaadin.ui.CustomComponent;
|
||||||
@@ -58,29 +54,16 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
/**
|
/**
|
||||||
* WindowContent for adding/editing a Distribution
|
* WindowContent for adding/editing a Distribution
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5602182034230568435L;
|
private static final long serialVersionUID = -5602182034230568435L;
|
||||||
|
|
||||||
@Autowired
|
private final I18N i18n;
|
||||||
private I18N i18n;
|
private final UINotification notificationMessage;
|
||||||
|
private final EventBus.UIEventBus eventBus;
|
||||||
@Autowired
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
private transient UINotification notificationMessage;
|
private final SystemManagement systemManagement;
|
||||||
|
private final EntityFactory entityFactory;
|
||||||
@Autowired
|
|
||||||
private transient EventBus.SessionEventBus eventBus;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient SystemManagement systemManagement;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
private TextField distNameTextField;
|
private TextField distNameTextField;
|
||||||
private TextField distVersionTextField;
|
private TextField distVersionTextField;
|
||||||
@@ -92,6 +75,19 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
private FormLayout formLayout;
|
private FormLayout formLayout;
|
||||||
|
|
||||||
|
public DistributionAddUpdateWindowLayout(final I18N i18n, final UINotification notificationMessage,
|
||||||
|
final UIEventBus eventBus, final DistributionSetManagement distributionSetManagement,
|
||||||
|
final SystemManagement systemManagement, final EntityFactory entityFactory) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
this.notificationMessage = notificationMessage;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
this.systemManagement = systemManagement;
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
createRequiredComponents();
|
||||||
|
buildLayout();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save or update distribution set.
|
* Save or update distribution set.
|
||||||
*
|
*
|
||||||
@@ -113,15 +109,6 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize Distribution Add and Edit Window.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
void init() {
|
|
||||||
createRequiredComponents();
|
|
||||||
buildLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buildLayout() {
|
private void buildLayout() {
|
||||||
addStyleName("lay-color");
|
addStyleName("lay-color");
|
||||||
setSizeUndefined();
|
setSizeUndefined();
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ package org.eclipse.hawkbit.ui.management.dstable;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
|
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TagManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||||
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
||||||
@@ -20,13 +23,13 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
|||||||
import org.eclipse.hawkbit.ui.distributions.dstable.DsMetadataPopupLayout;
|
import org.eclipse.hawkbit.ui.distributions.dstable.DsMetadataPopupLayout;
|
||||||
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
|
||||||
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.TabSheet;
|
import com.vaadin.ui.TabSheet;
|
||||||
@@ -37,47 +40,50 @@ import com.vaadin.ui.Window;
|
|||||||
/**
|
/**
|
||||||
* Distribution set details layout.
|
* Distribution set details layout.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionDetails extends AbstractNamedVersionedEntityTableDetailsLayout<DistributionSet> {
|
public class DistributionDetails extends AbstractNamedVersionedEntityTableDetailsLayout<DistributionSet> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 350360207334118826L;
|
private static final long serialVersionUID = 350360207334118826L;
|
||||||
|
|
||||||
@Autowired
|
private final DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout;
|
||||||
private ManagementUIState managementUIState;
|
private final DistributionTagToken distributionTagToken;
|
||||||
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
@Autowired
|
private final DsMetadataPopupLayout dsMetadataPopupLayout;
|
||||||
private DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout;
|
private final EntityFactory entityFactory;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DistributionTagToken distributionTagToken;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DsMetadataPopupLayout dsMetadataPopupLayout;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient EntityFactory entityFactory;
|
|
||||||
|
|
||||||
private SoftwareModuleDetailsTable softwareModuleTable;
|
private SoftwareModuleDetailsTable softwareModuleTable;
|
||||||
|
|
||||||
private DistributionSetMetadatadetailslayout dsMetadataTable;
|
private DistributionSetMetadatadetailslayout dsMetadataTable;
|
||||||
|
|
||||||
@Override
|
public DistributionDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
|
||||||
protected void init() {
|
final ManagementUIState managementUIState, final DistributionSetManagement distributionSetManagement,
|
||||||
|
final DsMetadataPopupLayout dsMetadataPopupLayout, final EntityFactory entityFactory,
|
||||||
|
final UINotification notificationMessage, final SystemManagement systemManagement,
|
||||||
|
final TagManagement tagManagement,
|
||||||
|
final DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout) {
|
||||||
|
super(i18n, eventBus, permissionChecker, managementUIState);
|
||||||
|
|
||||||
|
this.distributionTagToken = new DistributionTagToken(permissionChecker, i18n, notificationMessage, eventBus,
|
||||||
|
managementUIState, tagManagement, distributionSetManagement);
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
|
this.dsMetadataPopupLayout = new DsMetadataPopupLayout(i18n, notificationMessage, eventBus,
|
||||||
|
distributionSetManagement, entityFactory, permissionChecker);
|
||||||
|
this.entityFactory = entityFactory;
|
||||||
|
this.distributionAddUpdateWindowLayout = distributionAddUpdateWindowLayout;
|
||||||
|
buildComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildComponents() {
|
||||||
softwareModuleTable = new SoftwareModuleDetailsTable();
|
softwareModuleTable = new SoftwareModuleDetailsTable();
|
||||||
softwareModuleTable.init(getI18n(), false, getPermissionChecker(), null, null, null);
|
softwareModuleTable.init(getI18n(), false, getPermissionChecker(), null, null, null);
|
||||||
|
|
||||||
dsMetadataTable = new DistributionSetMetadatadetailslayout();
|
dsMetadataTable = new DistributionSetMetadatadetailslayout();
|
||||||
dsMetadataTable.init(getI18n(), getPermissionChecker(), distributionSetManagement, dsMetadataPopupLayout,
|
dsMetadataTable.init(getI18n(), getPermissionChecker(), distributionSetManagement, dsMetadataPopupLayout,
|
||||||
entityFactory);
|
entityFactory);
|
||||||
|
addTabs(detailsTab);
|
||||||
super.init();
|
restoreState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
void onEvent(final DistributionTableEvent distributionTableEvent) {
|
||||||
onBaseEntityEvent(distributionTableEvent);
|
onBaseEntityEvent(distributionTableEvent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,16 +45,17 @@ import org.eclipse.hawkbit.ui.push.DistributionCreatedEventContainer;
|
|||||||
import org.eclipse.hawkbit.ui.push.DistributionDeletedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionDeletedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
|
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
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.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
||||||
import org.eclipse.hawkbit.ui.utils.UINotification;
|
import org.eclipse.hawkbit.ui.utils.UINotification;
|
||||||
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;
|
||||||
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
||||||
|
import org.vaadin.spring.events.EventBus.UIEventBus;
|
||||||
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;
|
||||||
|
|
||||||
@@ -64,8 +65,6 @@ import com.vaadin.data.Item;
|
|||||||
import com.vaadin.event.dd.DragAndDropEvent;
|
import com.vaadin.event.dd.DragAndDropEvent;
|
||||||
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.spring.annotation.SpringComponent;
|
|
||||||
import com.vaadin.spring.annotation.UIScope;
|
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Button.ClickEvent;
|
import com.vaadin.ui.Button.ClickEvent;
|
||||||
import com.vaadin.ui.DragAndDropWrapper;
|
import com.vaadin.ui.DragAndDropWrapper;
|
||||||
@@ -76,53 +75,48 @@ import com.vaadin.ui.UI;
|
|||||||
/**
|
/**
|
||||||
* Distribution set table.
|
* Distribution set table.
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
|
||||||
@UIScope
|
|
||||||
public class DistributionTable extends AbstractNamedVersionTable<DistributionSet, DistributionSetIdName> {
|
public class DistributionTable extends AbstractNamedVersionTable<DistributionSet, DistributionSetIdName> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1928335256399519494L;
|
private static final long serialVersionUID = -1928335256399519494L;
|
||||||
|
|
||||||
@Autowired
|
private final SpPermissionChecker permissionChecker;
|
||||||
private SpPermissionChecker permissionChecker;
|
private final ManagementUIState managementUIState;
|
||||||
|
private final ManagementViewAcceptCriteria managementViewAcceptCriteria;
|
||||||
@Autowired
|
private final TargetManagement targetService;
|
||||||
private UINotification uiNotification;
|
private final DsMetadataPopupLayout dsMetadataPopupLayout;
|
||||||
|
private final DistributionSetManagement distributionSetManagement;
|
||||||
@Autowired
|
|
||||||
private ManagementUIState managementUIState;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ManagementViewAcceptCriteria managementViewAcceptCriteria;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient TargetManagement targetService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DsMetadataPopupLayout dsMetadataPopupLayout;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private transient DistributionSetManagement distributionSetManagement;
|
|
||||||
|
|
||||||
private String notAllowedMsg;
|
|
||||||
|
|
||||||
private Boolean isDistPinned = false;
|
|
||||||
|
|
||||||
|
private final String notAllowedMsg;
|
||||||
|
private boolean isDistPinned;
|
||||||
private Button distributinPinnedBtn;
|
private Button distributinPinnedBtn;
|
||||||
|
|
||||||
@Override
|
public DistributionTable(final UIEventBus eventBus, final I18N i18n, final SpPermissionChecker permissionChecker,
|
||||||
protected void init() {
|
final UINotification notification, final ManagementUIState managementUIState,
|
||||||
super.init();
|
final ManagementViewAcceptCriteria managementViewAcceptCriteria, final TargetManagement targetService,
|
||||||
|
final DsMetadataPopupLayout dsMetadataPopupLayout,
|
||||||
|
final DistributionSetManagement distributionSetManagement) {
|
||||||
|
super(eventBus, i18n, notification);
|
||||||
|
this.permissionChecker = permissionChecker;
|
||||||
|
this.managementUIState = managementUIState;
|
||||||
|
this.managementViewAcceptCriteria = managementViewAcceptCriteria;
|
||||||
|
this.targetService = targetService;
|
||||||
|
this.dsMetadataPopupLayout = dsMetadataPopupLayout;
|
||||||
|
this.distributionSetManagement = distributionSetManagement;
|
||||||
notAllowedMsg = i18n.get("message.action.not.allowed");
|
notAllowedMsg = i18n.get("message.action.not.allowed");
|
||||||
|
|
||||||
|
addNewContainerDS();
|
||||||
|
setColumnProperties();
|
||||||
|
setDataAvailable(getContainerDataSource().size() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionCreatedEvents(final DistributionCreatedEventContainer eventContainer) {
|
void onDistributionCreatedEvents(final DistributionCreatedEventContainer eventContainer) {
|
||||||
if (eventContainer.getEvents().stream().anyMatch(event -> event.getEntity().isComplete())) {
|
if (eventContainer.getEvents().stream().anyMatch(event -> event.getEntity().isComplete())) {
|
||||||
refreshDistributions();
|
refreshDistributions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionDeleteEvents(final DistributionDeletedEventContainer eventContainer) {
|
void onDistributionDeleteEvents(final DistributionDeletedEventContainer eventContainer) {
|
||||||
final LazyQueryContainer dsContainer = (LazyQueryContainer) getContainerDataSource();
|
final LazyQueryContainer dsContainer = (LazyQueryContainer) getContainerDataSource();
|
||||||
final List<Object> visibleItemIds = (List<Object>) getVisibleItemIds();
|
final List<Object> visibleItemIds = (List<Object>) getVisibleItemIds();
|
||||||
@@ -145,7 +139,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
reSelectItemsAfterDeletionEvent();
|
reSelectItemsAfterDeletionEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onDistributionSetUpdateEvents(final DistributionSetUpdatedEventContainer eventContainer) {
|
void onDistributionSetUpdateEvents(final DistributionSetUpdatedEventContainer eventContainer) {
|
||||||
|
|
||||||
final List<DistributionSetIdName> visibleItemIds = (List<DistributionSetIdName>) getVisibleItemIds();
|
final List<DistributionSetIdName> visibleItemIds = (List<DistributionSetIdName>) getVisibleItemIds();
|
||||||
@@ -213,7 +207,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
* @param event
|
* @param event
|
||||||
* as instance of {@link DistributionTableFilterEvent}
|
* as instance of {@link DistributionTableFilterEvent}
|
||||||
*/
|
*/
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableFilterEvent event) {
|
void onEvent(final DistributionTableFilterEvent event) {
|
||||||
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
||||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||||
@@ -222,7 +216,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DragEvent dragEvent) {
|
void onEvent(final DragEvent dragEvent) {
|
||||||
if (dragEvent == DragEvent.TARGET_DRAG || dragEvent == DragEvent.TARGET_TAG_DRAG
|
if (dragEvent == DragEvent.TARGET_DRAG || dragEvent == DragEvent.TARGET_TAG_DRAG
|
||||||
|| dragEvent == DragEvent.DISTRIBUTION_TAG_DRAG) {
|
|| dragEvent == DragEvent.DISTRIBUTION_TAG_DRAG) {
|
||||||
@@ -232,7 +226,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final DistributionTableEvent event) {
|
void onEvent(final DistributionTableEvent event) {
|
||||||
onBaseEntityEvent(event);
|
onBaseEntityEvent(event);
|
||||||
if (BaseEntityEventType.UPDATED_ENTITY != event.getEventType()) {
|
if (BaseEntityEventType.UPDATED_ENTITY != event.getEventType()) {
|
||||||
@@ -242,7 +236,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final PinUnpinEvent pinUnpinEvent) {
|
void onEvent(final PinUnpinEvent pinUnpinEvent) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
if (pinUnpinEvent == PinUnpinEvent.PIN_TARGET) {
|
if (pinUnpinEvent == PinUnpinEvent.PIN_TARGET) {
|
||||||
@@ -259,14 +253,14 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final SaveActionWindowEvent event) {
|
void onEvent(final SaveActionWindowEvent event) {
|
||||||
if (event == SaveActionWindowEvent.DELETED_DISTRIBUTIONS) {
|
if (event == SaveActionWindowEvent.DELETED_DISTRIBUTIONS) {
|
||||||
refreshFilter();
|
refreshFilter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.UI)
|
||||||
void onEvent(final ManagementUIEvent managementUIEvent) {
|
void onEvent(final ManagementUIEvent managementUIEvent) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
if (managementUIEvent == ManagementUIEvent.UNASSIGN_DISTRIBUTION_TAG
|
if (managementUIEvent == ManagementUIEvent.UNASSIGN_DISTRIBUTION_TAG
|
||||||
@@ -444,7 +438,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
final DistributionSetTagAssignmentResult result = distributionSetManagement.toggleTagAssignment(distList,
|
final DistributionSetTagAssignmentResult result = distributionSetManagement.toggleTagAssignment(distList,
|
||||||
distTagName);
|
distTagName);
|
||||||
|
|
||||||
uiNotification.displaySuccess(HawkbitCommonUtil.createAssignmentMessage(distTagName, result, i18n));
|
notification.displaySuccess(HawkbitCommonUtil.createAssignmentMessage(distTagName, result, i18n));
|
||||||
if (result.getAssigned() >= 1 && managementUIState.getDistributionTableFilters().isNoTagSelected()) {
|
if (result.getAssigned() >= 1 && managementUIState.getDistributionTableFilters().isNoTagSelected()) {
|
||||||
refreshFilter();
|
refreshFilter();
|
||||||
}
|
}
|
||||||
@@ -464,8 +458,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
.add(new TargetIdName(target.getId(), target.getControllerId(), target.getName())));
|
.add(new TargetIdName(target.getId(), target.getControllerId(), target.getName())));
|
||||||
assignTargetToDs(getItem(distItemId), targetDetailsList);
|
assignTargetToDs(getItem(distItemId), targetDetailsList);
|
||||||
} else {
|
} else {
|
||||||
uiNotification
|
notification.displaySuccess(i18n.get("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
|
||||||
.displaySuccess(i18n.get("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,13 +505,13 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
} else if (wrapperSource.getId().startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS)) {
|
} else if (wrapperSource.getId().startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS)) {
|
||||||
return !isNoTagButton(tagData, SPUIDefinitions.TARGET_TAG_BUTTON);
|
return !isNoTagButton(tagData, SPUIDefinitions.TARGET_TAG_BUTTON);
|
||||||
}
|
}
|
||||||
uiNotification.displayValidationError(notAllowedMsg);
|
notification.displayValidationError(notAllowedMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean isNoTagButton(final String tagData, final String targetNoTagData) {
|
private Boolean isNoTagButton(final String tagData, final String targetNoTagData) {
|
||||||
if (tagData.equals(targetNoTagData)) {
|
if (tagData.equals(targetNoTagData)) {
|
||||||
uiNotification.displayValidationError(
|
notification.displayValidationError(
|
||||||
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
|
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -556,7 +549,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
|||||||
eventBus.publish(this, ManagementUIEvent.UPDATE_COUNT);
|
eventBus.publish(this, ManagementUIEvent.UPDATE_COUNT);
|
||||||
}
|
}
|
||||||
if (null != message) {
|
if (null != message) {
|
||||||
uiNotification.displayValidationError(message);
|
notification.displayValidationError(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user