Rename simple ui package com -> org (#1541)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -7,16 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui;
|
||||
package org.eclipse.hawkbit.ui;
|
||||
|
||||
import com.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import com.vaadin.flow.component.UI;
|
||||
import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import feign.Client;
|
||||
import feign.Contract;
|
||||
import feign.Feign;
|
||||
import feign.FeignException;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.Response;
|
||||
import feign.codec.Decoder;
|
||||
import feign.codec.Encoder;
|
||||
import feign.codec.ErrorDecoder;
|
||||
@@ -7,14 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui;
|
||||
package org.eclipse.hawkbit.ui;
|
||||
|
||||
import com.eclipse.hawkbit.ui.view.RolloutView;
|
||||
import com.eclipse.hawkbit.ui.view.TargetView;
|
||||
import com.eclipse.hawkbit.ui.security.AuthenticatedUser;
|
||||
import com.eclipse.hawkbit.ui.view.AboutView;
|
||||
import com.eclipse.hawkbit.ui.view.DistributionSetView;
|
||||
import com.eclipse.hawkbit.ui.view.SoftwareModuleView;
|
||||
import org.eclipse.hawkbit.ui.view.RolloutView;
|
||||
import org.eclipse.hawkbit.ui.view.TargetView;
|
||||
import org.eclipse.hawkbit.ui.security.AuthenticatedUser;
|
||||
import org.eclipse.hawkbit.ui.view.AboutView;
|
||||
import org.eclipse.hawkbit.ui.view.DistributionSetView;
|
||||
import org.eclipse.hawkbit.ui.view.SoftwareModuleView;
|
||||
import com.vaadin.flow.component.Unit;
|
||||
import com.vaadin.flow.component.applayout.AppLayout;
|
||||
import com.vaadin.flow.component.applayout.DrawerToggle;
|
||||
@@ -38,6 +38,7 @@ import com.vaadin.flow.component.sidenav.SideNavItem;
|
||||
import com.vaadin.flow.router.PageTitle;
|
||||
import com.vaadin.flow.server.auth.AccessAnnotationChecker;
|
||||
import com.vaadin.flow.theme.lumo.LumoUtility;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui;
|
||||
package org.eclipse.hawkbit.ui;
|
||||
|
||||
import com.vaadin.flow.component.page.AppShellConfigurator;
|
||||
import com.vaadin.flow.server.PWA;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.security;
|
||||
package org.eclipse.hawkbit.ui.security;
|
||||
|
||||
import com.vaadin.flow.spring.security.AuthenticationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -7,9 +7,9 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.security;
|
||||
package org.eclipse.hawkbit.ui.security;
|
||||
|
||||
import com.eclipse.hawkbit.ui.view.LoginView;
|
||||
import org.eclipse.hawkbit.ui.view.LoginView;
|
||||
import com.vaadin.flow.spring.security.VaadinWebSecurity;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -7,9 +7,9 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import com.eclipse.hawkbit.ui.MainLayout;
|
||||
import org.eclipse.hawkbit.ui.MainLayout;
|
||||
import com.vaadin.flow.component.html.H2;
|
||||
import com.vaadin.flow.component.html.Image;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
public interface Constants {
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import com.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import com.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import com.eclipse.hawkbit.ui.MainLayout;
|
||||
import com.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import com.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import com.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import org.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import org.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import org.eclipse.hawkbit.ui.MainLayout;
|
||||
import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import org.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.Key;
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
@@ -65,10 +65,10 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
|
||||
@Override
|
||||
protected void addColumns(Grid<MgmtDistributionSet> grid) {
|
||||
grid.addColumn(MgmtDistributionSet::getDsId).setHeader(ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getName).setHeader(NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getVersion).setHeader(VERSION).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getTypeName).setHeader(TYPE).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getDsId).setHeader(Constants.ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getName).setHeader(Constants.NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getVersion).setHeader(Constants.VERSION).setAutoWidth(true);
|
||||
grid.addColumn(MgmtDistributionSet::getTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
|
||||
|
||||
grid.setItemDetailsRenderer(new ComponentRenderer<>(
|
||||
() -> details, DistributionSetDetails::setItem));
|
||||
@@ -76,7 +76,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
},
|
||||
(query, rsqlFilter) -> hawkbitClient.getDistributionSetRestApi()
|
||||
.getDistributionSets(
|
||||
query.getOffset(), query.getPageSize(), NAME_ASC, rsqlFilter)
|
||||
query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter)
|
||||
.getBody()
|
||||
.getContent()
|
||||
.stream(),
|
||||
@@ -95,11 +95,11 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
MgmtSoftwareModule.class, MgmtSoftwareModule::getModuleId) {
|
||||
@Override
|
||||
protected void addColumns(Grid<MgmtSoftwareModule> grid) {
|
||||
grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getName).setHeader(NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(VERSION).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(TYPE).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(VENDOR).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(Constants.ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getName).setHeader(Constants.NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(Constants.VERSION).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(Constants.VENDOR).setAutoWidth(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -115,13 +115,13 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
type.setItemLabelGenerator(MgmtDistributionSetType::getName);
|
||||
type.setItems(
|
||||
hawkbitClient.getDistributionSetTypeRestApi()
|
||||
.getDistributionSetTypes(0, 20, NAME_ASC, null)
|
||||
.getDistributionSetTypes(0, 20, Constants.NAME_ASC, null)
|
||||
.getBody()
|
||||
.getContent());
|
||||
tag.setItemLabelGenerator(MgmtTag::getName);
|
||||
tag.setItems(
|
||||
hawkbitClient.getDistributionSetTagRestApi()
|
||||
.getDistributionSetTags(0, 20, NAME_ASC, null)
|
||||
.getDistributionSetTags(0, 20, Constants.NAME_ASC, null)
|
||||
.getBody()
|
||||
.getContent());
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
hawkbitClient.getDistributionSetRestApi()
|
||||
.getAssignedSoftwareModules(
|
||||
distributionSet.getDsId(),
|
||||
query.getOffset(), query.getLimit(), NAME_ASC)
|
||||
query.getOffset(), query.getLimit(), Constants.NAME_ASC)
|
||||
.getBody()
|
||||
.getContent()
|
||||
.stream());
|
||||
@@ -210,7 +210,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
"Type",
|
||||
this::readyToCreate,
|
||||
hawkbitClient.getDistributionSetTypeRestApi()
|
||||
.getDistributionSetTypes(0, 30, NAME_ASC, null)
|
||||
.getDistributionSetTypes(0, 30, Constants.NAME_ASC, null)
|
||||
.getBody()
|
||||
.getContent()
|
||||
.toArray(new MgmtDistributionSetType[0]));
|
||||
@@ -218,10 +218,10 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
type.setWidthFull();
|
||||
type.setRequiredIndicatorVisible(true);
|
||||
type.setItemLabelGenerator(MgmtDistributionSetType::getName);
|
||||
name = Utils.textField(NAME, this::readyToCreate);
|
||||
version = Utils.textField(VERSION, this::readyToCreate);
|
||||
final TextField vendor = Utils.textField(VENDOR);
|
||||
description = new TextArea(DESCRIPTION);
|
||||
name = Utils.textField(Constants.NAME, this::readyToCreate);
|
||||
version = Utils.textField(Constants.VERSION, this::readyToCreate);
|
||||
final TextField vendor = Utils.textField(Constants.VENDOR);
|
||||
description = new TextArea(Constants.DESCRIPTION);
|
||||
description.setWidthFull();
|
||||
description.setMinLength(2);
|
||||
requiredMigrationStep = new Checkbox("Required Migration Step");
|
||||
@@ -7,9 +7,9 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import com.eclipse.hawkbit.ui.security.AuthenticatedUser;
|
||||
import org.eclipse.hawkbit.ui.security.AuthenticatedUser;
|
||||
import com.vaadin.flow.component.login.LoginI18n;
|
||||
import com.vaadin.flow.component.login.LoginOverlay;
|
||||
import com.vaadin.flow.router.BeforeEnterEvent;
|
||||
@@ -7,14 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import com.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import com.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import com.eclipse.hawkbit.ui.MainLayout;
|
||||
import com.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import com.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import com.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import org.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import org.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import org.eclipse.hawkbit.ui.MainLayout;
|
||||
import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import org.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.Key;
|
||||
import com.vaadin.flow.component.Text;
|
||||
@@ -7,14 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import com.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import com.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import com.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import com.eclipse.hawkbit.ui.MainLayout;
|
||||
import com.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import com.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import org.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import org.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import org.eclipse.hawkbit.ui.MainLayout;
|
||||
import org.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.Key;
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
@@ -60,7 +60,7 @@ import java.util.stream.Stream;
|
||||
@Route(value = "software_modules", layout = MainLayout.class)
|
||||
@RolesAllowed({"SOFTWARE_MODULE_READ"})
|
||||
@Uses(Icon.class)
|
||||
public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
|
||||
@Autowired
|
||||
public SoftwareModuleView(final HawkbitClient hawkbitClient) {
|
||||
@@ -75,11 +75,11 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
private final SoftwareModuleDetails details = new SoftwareModuleDetails(hawkbitClient);
|
||||
@Override
|
||||
protected void addColumns(final Grid<MgmtSoftwareModule> grid) {
|
||||
grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getName).setHeader(NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(VERSION).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(TYPE).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(VENDOR).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(Constants.ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getName).setHeader(Constants.NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(Constants.VERSION).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
|
||||
grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(Constants.VENDOR).setAutoWidth(true);
|
||||
|
||||
grid.setItemDetailsRenderer(new ComponentRenderer<>(
|
||||
() -> details, SoftwareModuleDetails::setItem));
|
||||
@@ -88,7 +88,7 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
},
|
||||
(query, rsqlFilter) -> hawkbitClient.getSoftwareModuleRestApi()
|
||||
.getSoftwareModules(
|
||||
query.getOffset(), query.getPageSize(), NAME_ASC, rsqlFilter)
|
||||
query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter)
|
||||
.getBody()
|
||||
.getContent()
|
||||
.stream(),
|
||||
@@ -110,8 +110,8 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
new SelectionGrid.EntityRepresentation<>(MgmtArtifact.class, MgmtArtifact::getArtifactId) {
|
||||
@Override
|
||||
protected void addColumns(final Grid<MgmtArtifact> grid) {
|
||||
grid.addColumn(MgmtArtifact::getArtifactId).setHeader(ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtArtifact::getProvidedFilename).setHeader(NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtArtifact::getArtifactId).setHeader(Constants.ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtArtifact::getProvidedFilename).setHeader(Constants.NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtArtifact::getSize).setHeader("Size").setAutoWidth(true);
|
||||
}
|
||||
});
|
||||
@@ -119,15 +119,15 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
|
||||
private static class SoftwareModuleFilter implements Filter.Rsql {
|
||||
|
||||
private final TextField name = Utils.textField(NAME);
|
||||
private final CheckboxGroup<MgmtSoftwareModuleType> type = new CheckboxGroup<>(TYPE);
|
||||
private final TextField name = Utils.textField(Constants.NAME);
|
||||
private final CheckboxGroup<MgmtSoftwareModuleType> type = new CheckboxGroup<>(Constants.TYPE);
|
||||
|
||||
private SoftwareModuleFilter(final HawkbitClient hawkbitClient) {
|
||||
name.setPlaceholder("<name filter>");
|
||||
type.setItemLabelGenerator(MgmtSoftwareModuleType::getName);
|
||||
type.setItems(
|
||||
hawkbitClient.getSoftwareModuleTypeRestApi()
|
||||
.getTypes(0, 20, NAME_ASC, null)
|
||||
.getTypes(0, 20, Constants.NAME_ASC, null)
|
||||
.getBody()
|
||||
.getContent());
|
||||
}
|
||||
@@ -152,11 +152,11 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
|
||||
private final transient HawkbitClient hawkbitClient;
|
||||
|
||||
private final TextArea description = new TextArea(DESCRIPTION);
|
||||
private final TextField createdBy = Utils.textField(CREATED_BY);
|
||||
private final TextField createdAt = Utils.textField(CREATED_AT);
|
||||
private final TextField lastModifiedBy = Utils.textField(LAST_MODIFIED_BY);
|
||||
private final TextField lastModifiedAt = Utils.textField(LAST_MODIFIED_AT);
|
||||
private final TextArea description = new TextArea(Constants.DESCRIPTION);
|
||||
private final TextField createdBy = Utils.textField(Constants.CREATED_BY);
|
||||
private final TextField createdAt = Utils.textField(Constants.CREATED_AT);
|
||||
private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
|
||||
private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
|
||||
private final SelectionGrid<MgmtArtifact, Long> artifactGrid;
|
||||
|
||||
private SoftwareModuleDetails(final HawkbitClient hawkbitClient) {
|
||||
@@ -211,10 +211,10 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
super("Create Software Module");
|
||||
|
||||
type = new Select<>(
|
||||
TYPE,
|
||||
Constants.TYPE,
|
||||
this::readyToCreate,
|
||||
hawkbitClient.getSoftwareModuleTypeRestApi()
|
||||
.getTypes(0, 30, NAME_ASC, null)
|
||||
.getTypes(0, 30, Constants.NAME_ASC, null)
|
||||
.getBody()
|
||||
.getContent()
|
||||
.toArray(new MgmtSoftwareModuleType[0]));
|
||||
@@ -222,10 +222,10 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
|
||||
type.setRequiredIndicatorVisible(true);
|
||||
type.setItemLabelGenerator(MgmtSoftwareModuleType::getName);
|
||||
type.focus();
|
||||
name = Utils.textField(NAME, this::readyToCreate);
|
||||
version = Utils.textField(VERSION, this::readyToCreate);
|
||||
vendor = Utils.textField(VENDOR);
|
||||
description = new TextArea(DESCRIPTION);
|
||||
name = Utils.textField(Constants.NAME, this::readyToCreate);
|
||||
version = Utils.textField(Constants.VERSION, this::readyToCreate);
|
||||
vendor = Utils.textField(Constants.VENDOR);
|
||||
description = new TextArea(Constants.DESCRIPTION);
|
||||
description.setWidthFull();
|
||||
description.setMinLength(2);
|
||||
enableArtifactEncryption = new Checkbox("Enable artifact encryption");
|
||||
@@ -7,14 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view;
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import com.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import com.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import com.eclipse.hawkbit.ui.MainLayout;
|
||||
import com.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import com.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import com.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import org.eclipse.hawkbit.ui.HawkbitClient;
|
||||
import org.eclipse.hawkbit.ui.view.util.Filter;
|
||||
import org.eclipse.hawkbit.ui.MainLayout;
|
||||
import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
|
||||
import org.eclipse.hawkbit.ui.view.util.TableView;
|
||||
import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.Key;
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
@@ -68,8 +68,8 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
@Override
|
||||
protected void addColumns(final Grid<MgmtTarget> grid) {
|
||||
grid.addColumn(MgmtTarget::getControllerId).setHeader(CONTROLLER_ID).setAutoWidth(true);
|
||||
grid.addColumn(MgmtTarget::getName).setHeader(NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtTarget::getTargetTypeName).setHeader(TYPE).setAutoWidth(true);
|
||||
grid.addColumn(MgmtTarget::getName).setHeader(Constants.NAME).setAutoWidth(true);
|
||||
grid.addColumn(MgmtTarget::getTargetTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
|
||||
|
||||
grid.setItemDetailsRenderer(new ComponentRenderer<>(
|
||||
TargetDetails::new, TargetDetails::setItem));
|
||||
@@ -77,7 +77,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
},
|
||||
(query, filter) -> hawkbitClient.getTargetRestApi()
|
||||
.getTargets(
|
||||
query.getOffset(), query.getPageSize(), NAME_ASC,
|
||||
query.getOffset(), query.getPageSize(), Constants.NAME_ASC,
|
||||
filter)
|
||||
.getBody()
|
||||
.getContent()
|
||||
@@ -103,7 +103,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
|
||||
controllerId = Utils.textField(CONTROLLER_ID);
|
||||
controllerId.setPlaceholder("<controller id filter>");
|
||||
type = new CheckboxGroup<>(TYPE);
|
||||
type = new CheckboxGroup<>(Constants.TYPE);
|
||||
type.setItemLabelGenerator(MgmtTargetType::getName);
|
||||
tag = new CheckboxGroup<>(TAG);
|
||||
tag.setItemLabelGenerator(MgmtTag::getName);
|
||||
@@ -113,11 +113,11 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
public List<Component> components() {
|
||||
final List<Component> components = new LinkedList<>();
|
||||
components.add(controllerId);
|
||||
type.setItems(hawkbitClient.getTargetTypeRestApi().getTargetTypes(0, 20, NAME_ASC, null).getBody().getContent());
|
||||
type.setItems(hawkbitClient.getTargetTypeRestApi().getTargetTypes(0, 20, Constants.NAME_ASC, null).getBody().getContent());
|
||||
if (!type.getValue().isEmpty()) {
|
||||
components.add(type);
|
||||
}
|
||||
tag.setItems(hawkbitClient.getTargetTagRestApi().getTargetTags(0, 20, NAME_ASC, null).getBody().getContent());
|
||||
tag.setItems(hawkbitClient.getTargetTagRestApi().getTargetTags(0, 20, Constants.NAME_ASC, null).getBody().getContent());
|
||||
if (!tag.isEmpty()) {
|
||||
components.add(tag);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
setHeight("40%");
|
||||
final Button finishBtn = Utils.tooltip(new Button("Save"), "Save (Enter)");
|
||||
final TextField name = Utils.textField(
|
||||
NAME,
|
||||
Constants.NAME,
|
||||
e -> finishBtn.setEnabled(!e.getHasValue().isEmpty()));
|
||||
name.focus();
|
||||
finishBtn.addClickShortcut(Key.ENTER);
|
||||
@@ -206,11 +206,11 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
|
||||
private static class TargetDetails extends FormLayout {
|
||||
|
||||
private final TextArea description = new TextArea(DESCRIPTION);
|
||||
private final TextField createdBy = Utils.textField(CREATED_BY);
|
||||
private final TextField createdAt = Utils.textField(CREATED_AT);
|
||||
private final TextField lastModifiedBy = Utils.textField(LAST_MODIFIED_BY);
|
||||
private final TextField lastModifiedAt = Utils.textField(LAST_MODIFIED_AT);
|
||||
private final TextArea description = new TextArea(Constants.DESCRIPTION);
|
||||
private final TextField createdBy = Utils.textField(Constants.CREATED_BY);
|
||||
private final TextField createdAt = Utils.textField(Constants.CREATED_AT);
|
||||
private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
|
||||
private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
|
||||
|
||||
private TargetDetails() {
|
||||
description.setMinLength(2);
|
||||
@@ -251,7 +251,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
"Type",
|
||||
e -> {},
|
||||
hawkbitClient.getTargetTypeRestApi()
|
||||
.getTargetTypes(0, 30, NAME_ASC, null)
|
||||
.getTargetTypes(0, 30, Constants.NAME_ASC, null)
|
||||
.getBody()
|
||||
.getContent()
|
||||
.toArray(new MgmtTargetType[0]));
|
||||
@@ -261,9 +261,9 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
controllerId = Utils.textField(CONTROLLER_ID,
|
||||
e -> register.setEnabled(!e.getHasValue().isEmpty()));
|
||||
controllerId.focus();
|
||||
name = Utils.textField(NAME);
|
||||
name = Utils.textField(Constants.NAME);
|
||||
name.setWidthFull();
|
||||
description = new TextArea(DESCRIPTION);
|
||||
description = new TextArea(Constants.DESCRIPTION);
|
||||
description.setMinLength(2);
|
||||
description.setWidthFull();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view.util;
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.HasValue;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view.util;
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import com.google.common.collect.Streams;
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
@@ -7,9 +7,9 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view.util;
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import com.eclipse.hawkbit.ui.view.Constants;
|
||||
import org.eclipse.hawkbit.ui.view.Constants;
|
||||
import com.vaadin.flow.component.html.Div;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.data.provider.Query;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package com.eclipse.hawkbit.ui.view.util;
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.HasValue;
|
||||
@@ -30,7 +30,6 @@ import com.vaadin.flow.theme.lumo.LumoUtility;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
@@ -20,5 +20,5 @@ spring.mustache.check-template-location = false
|
||||
vaadin.launch-browser=true
|
||||
# To improve the performance during development.
|
||||
# For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters
|
||||
vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.eclipse.hawkbit
|
||||
vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,org.eclipse.hawkbit
|
||||
### Vaadin end ###
|
||||
Reference in New Issue
Block a user