RedirectController into auto config as default and null pointer fix. (#621)
* Vaadin patch and redirect controller to auto config. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix potential null pointer. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * revert Vaadin update. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Conditional on missing bean. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix on permission checks. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix permission checks. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix nested cascade on delete. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -31,7 +31,7 @@ import org.vaadin.spring.security.annotation.EnableVaadinSecurity;
|
||||
import com.vaadin.spring.annotation.UIScope;
|
||||
|
||||
/**
|
||||
* The hawkbit-ui autoconfiguration.
|
||||
* The Management UI auto configuration.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableVaadinSecurity
|
||||
@@ -41,13 +41,19 @@ import com.vaadin.spring.annotation.UIScope;
|
||||
@Import(MgmtUiConfiguration.class)
|
||||
public class MgmtUiAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
RedirectController uiRedirectController() {
|
||||
return new RedirectController();
|
||||
}
|
||||
|
||||
/**
|
||||
* A message source bean to add distributed message sources.
|
||||
*
|
||||
* @return the message bean.
|
||||
*/
|
||||
@Bean(name = "messageSource")
|
||||
public DistributedResourceBundleMessageSource messageSource() {
|
||||
DistributedResourceBundleMessageSource messageSource() {
|
||||
return new DistributedResourceBundleMessageSource();
|
||||
}
|
||||
|
||||
@@ -58,7 +64,7 @@ public class MgmtUiAutoConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public UIEventProvider eventProvider() {
|
||||
UIEventProvider eventProvider() {
|
||||
return new HawkbitEventProvider();
|
||||
}
|
||||
|
||||
@@ -81,7 +87,7 @@ public class MgmtUiAutoConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@UIScope
|
||||
public EventPushStrategy eventPushStrategy(final ConfigurableApplicationContext applicationContext,
|
||||
EventPushStrategy eventPushStrategy(final ConfigurableApplicationContext applicationContext,
|
||||
final ScheduledExecutorService executorService, final UIEventBus eventBus,
|
||||
final UIEventProvider eventProvider, final UiProperties uiProperties) {
|
||||
final DelayedEventBusPushStrategy delayedEventBusPushStrategy = new DelayedEventBusPushStrategy(executorService,
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.autoconfigure.mgmt.ui;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* Redirects for convenience. hawkBit's management UI is by default not
|
||||
* listening on / but on /UI.
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class RedirectController {
|
||||
|
||||
/**
|
||||
* @return redirect to the Management UI
|
||||
*/
|
||||
@RequestMapping("/")
|
||||
public ModelAndView home() {
|
||||
return new ModelAndView("redirect:/UI/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user