Rename simple ui package com -> org (#1541)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-01-11 18:07:24 +02:00
committed by GitHub
parent ff015fd0e9
commit d1bdca04a1
18 changed files with 111 additions and 113 deletions

View File

@@ -24,7 +24,7 @@
<relativePath/> <relativePath/>
</parent> </parent>
<groupId>com.eclipse.hawkbit</groupId> <groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-simple-ui</artifactId> <artifactId>hawkbit-simple-ui</artifactId>
<version>${revision}</version> <version>${revision}</version>
<packaging>jar</packaging> <packaging>jar</packaging>
@@ -272,7 +272,7 @@
<configuration> <configuration>
<serverId>ossrh</serverId> <serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl> <nexusUrl>https://oss.sonatype.org/</nexusUrl>
<stagingProfileId>1d2b23f380235e</stagingProfileId> <!-- <stagingProfileId>1d2b23f380235e</stagingProfileId>-->
<autoReleaseAfterClose>false</autoReleaseAfterClose> <autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration> </configuration>
</plugin> </plugin>

View File

@@ -7,16 +7,14 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 org.eclipse.hawkbit.ui.view.util.Utils;
import com.vaadin.flow.component.UI;
import feign.Client; import feign.Client;
import feign.Contract; import feign.Contract;
import feign.Feign; import feign.Feign;
import feign.FeignException; import feign.FeignException;
import feign.RequestInterceptor; import feign.RequestInterceptor;
import feign.Response;
import feign.codec.Decoder; import feign.codec.Decoder;
import feign.codec.Encoder; import feign.codec.Encoder;
import feign.codec.ErrorDecoder; import feign.codec.ErrorDecoder;

View File

@@ -7,14 +7,14 @@
* *
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*/ */
package com.eclipse.hawkbit.ui; package org.eclipse.hawkbit.ui;
import com.eclipse.hawkbit.ui.view.RolloutView; import org.eclipse.hawkbit.ui.view.RolloutView;
import com.eclipse.hawkbit.ui.view.TargetView; import org.eclipse.hawkbit.ui.view.TargetView;
import com.eclipse.hawkbit.ui.security.AuthenticatedUser; import org.eclipse.hawkbit.ui.security.AuthenticatedUser;
import com.eclipse.hawkbit.ui.view.AboutView; import org.eclipse.hawkbit.ui.view.AboutView;
import com.eclipse.hawkbit.ui.view.DistributionSetView; import org.eclipse.hawkbit.ui.view.DistributionSetView;
import com.eclipse.hawkbit.ui.view.SoftwareModuleView; import org.eclipse.hawkbit.ui.view.SoftwareModuleView;
import com.vaadin.flow.component.Unit; import com.vaadin.flow.component.Unit;
import com.vaadin.flow.component.applayout.AppLayout; import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.applayout.DrawerToggle; 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.router.PageTitle;
import com.vaadin.flow.server.auth.AccessAnnotationChecker; import com.vaadin.flow.server.auth.AccessAnnotationChecker;
import com.vaadin.flow.theme.lumo.LumoUtility; import com.vaadin.flow.theme.lumo.LumoUtility;
import java.util.Optional; import java.util.Optional;
/** /**

View File

@@ -7,7 +7,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.component.page.AppShellConfigurator;
import com.vaadin.flow.server.PWA; import com.vaadin.flow.server.PWA;

View File

@@ -7,7 +7,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 com.vaadin.flow.spring.security.AuthenticationContext;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@@ -7,9 +7,9 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 com.vaadin.flow.spring.security.VaadinWebSecurity;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@@ -7,9 +7,9 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.H2;
import com.vaadin.flow.component.html.Image; import com.vaadin.flow.component.html.Image;
import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.component.orderedlayout.VerticalLayout;

View File

@@ -7,7 +7,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*/ */
package com.eclipse.hawkbit.ui.view; package org.eclipse.hawkbit.ui.view;
public interface Constants { public interface Constants {

View File

@@ -7,14 +7,14 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 org.eclipse.hawkbit.ui.HawkbitClient;
import com.eclipse.hawkbit.ui.view.util.Filter; import org.eclipse.hawkbit.ui.view.util.Filter;
import com.eclipse.hawkbit.ui.MainLayout; import org.eclipse.hawkbit.ui.MainLayout;
import com.eclipse.hawkbit.ui.view.util.SelectionGrid; import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
import com.eclipse.hawkbit.ui.view.util.TableView; import org.eclipse.hawkbit.ui.view.util.TableView;
import com.eclipse.hawkbit.ui.view.util.Utils; import org.eclipse.hawkbit.ui.view.util.Utils;
import com.vaadin.flow.component.Component; import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Key; import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.Button;
@@ -65,10 +65,10 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
@Override @Override
protected void addColumns(Grid<MgmtDistributionSet> grid) { protected void addColumns(Grid<MgmtDistributionSet> grid) {
grid.addColumn(MgmtDistributionSet::getDsId).setHeader(ID).setAutoWidth(true); grid.addColumn(MgmtDistributionSet::getDsId).setHeader(Constants.ID).setAutoWidth(true);
grid.addColumn(MgmtDistributionSet::getName).setHeader(NAME).setAutoWidth(true); grid.addColumn(MgmtDistributionSet::getName).setHeader(Constants.NAME).setAutoWidth(true);
grid.addColumn(MgmtDistributionSet::getVersion).setHeader(VERSION).setAutoWidth(true); grid.addColumn(MgmtDistributionSet::getVersion).setHeader(Constants.VERSION).setAutoWidth(true);
grid.addColumn(MgmtDistributionSet::getTypeName).setHeader(TYPE).setAutoWidth(true); grid.addColumn(MgmtDistributionSet::getTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
grid.setItemDetailsRenderer(new ComponentRenderer<>( grid.setItemDetailsRenderer(new ComponentRenderer<>(
() -> details, DistributionSetDetails::setItem)); () -> details, DistributionSetDetails::setItem));
@@ -76,7 +76,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
}, },
(query, rsqlFilter) -> hawkbitClient.getDistributionSetRestApi() (query, rsqlFilter) -> hawkbitClient.getDistributionSetRestApi()
.getDistributionSets( .getDistributionSets(
query.getOffset(), query.getPageSize(), NAME_ASC, rsqlFilter) query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter)
.getBody() .getBody()
.getContent() .getContent()
.stream(), .stream(),
@@ -95,11 +95,11 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
MgmtSoftwareModule.class, MgmtSoftwareModule::getModuleId) { MgmtSoftwareModule.class, MgmtSoftwareModule::getModuleId) {
@Override @Override
protected void addColumns(Grid<MgmtSoftwareModule> grid) { protected void addColumns(Grid<MgmtSoftwareModule> grid) {
grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(ID).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(Constants.ID).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getName).setHeader(NAME).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getName).setHeader(Constants.NAME).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(VERSION).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(Constants.VERSION).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(TYPE).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(VENDOR).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.setItemLabelGenerator(MgmtDistributionSetType::getName);
type.setItems( type.setItems(
hawkbitClient.getDistributionSetTypeRestApi() hawkbitClient.getDistributionSetTypeRestApi()
.getDistributionSetTypes(0, 20, NAME_ASC, null) .getDistributionSetTypes(0, 20, Constants.NAME_ASC, null)
.getBody() .getBody()
.getContent()); .getContent());
tag.setItemLabelGenerator(MgmtTag::getName); tag.setItemLabelGenerator(MgmtTag::getName);
tag.setItems( tag.setItems(
hawkbitClient.getDistributionSetTagRestApi() hawkbitClient.getDistributionSetTagRestApi()
.getDistributionSetTags(0, 20, NAME_ASC, null) .getDistributionSetTags(0, 20, Constants.NAME_ASC, null)
.getBody() .getBody()
.getContent()); .getContent());
} }
@@ -183,7 +183,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
hawkbitClient.getDistributionSetRestApi() hawkbitClient.getDistributionSetRestApi()
.getAssignedSoftwareModules( .getAssignedSoftwareModules(
distributionSet.getDsId(), distributionSet.getDsId(),
query.getOffset(), query.getLimit(), NAME_ASC) query.getOffset(), query.getLimit(), Constants.NAME_ASC)
.getBody() .getBody()
.getContent() .getContent()
.stream()); .stream());
@@ -210,7 +210,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
"Type", "Type",
this::readyToCreate, this::readyToCreate,
hawkbitClient.getDistributionSetTypeRestApi() hawkbitClient.getDistributionSetTypeRestApi()
.getDistributionSetTypes(0, 30, NAME_ASC, null) .getDistributionSetTypes(0, 30, Constants.NAME_ASC, null)
.getBody() .getBody()
.getContent() .getContent()
.toArray(new MgmtDistributionSetType[0])); .toArray(new MgmtDistributionSetType[0]));
@@ -218,10 +218,10 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
type.setWidthFull(); type.setWidthFull();
type.setRequiredIndicatorVisible(true); type.setRequiredIndicatorVisible(true);
type.setItemLabelGenerator(MgmtDistributionSetType::getName); type.setItemLabelGenerator(MgmtDistributionSetType::getName);
name = Utils.textField(NAME, this::readyToCreate); name = Utils.textField(Constants.NAME, this::readyToCreate);
version = Utils.textField(VERSION, this::readyToCreate); version = Utils.textField(Constants.VERSION, this::readyToCreate);
final TextField vendor = Utils.textField(VENDOR); final TextField vendor = Utils.textField(Constants.VENDOR);
description = new TextArea(DESCRIPTION); description = new TextArea(Constants.DESCRIPTION);
description.setWidthFull(); description.setWidthFull();
description.setMinLength(2); description.setMinLength(2);
requiredMigrationStep = new Checkbox("Required Migration Step"); requiredMigrationStep = new Checkbox("Required Migration Step");

View File

@@ -7,9 +7,9 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.LoginI18n;
import com.vaadin.flow.component.login.LoginOverlay; import com.vaadin.flow.component.login.LoginOverlay;
import com.vaadin.flow.router.BeforeEnterEvent; import com.vaadin.flow.router.BeforeEnterEvent;

View File

@@ -7,14 +7,14 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 org.eclipse.hawkbit.ui.HawkbitClient;
import com.eclipse.hawkbit.ui.view.util.Filter; import org.eclipse.hawkbit.ui.view.util.Filter;
import com.eclipse.hawkbit.ui.MainLayout; import org.eclipse.hawkbit.ui.MainLayout;
import com.eclipse.hawkbit.ui.view.util.SelectionGrid; import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
import com.eclipse.hawkbit.ui.view.util.TableView; import org.eclipse.hawkbit.ui.view.util.TableView;
import com.eclipse.hawkbit.ui.view.util.Utils; import org.eclipse.hawkbit.ui.view.util.Utils;
import com.vaadin.flow.component.Component; import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Key; import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.Text; import com.vaadin.flow.component.Text;

View File

@@ -7,14 +7,14 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 org.eclipse.hawkbit.ui.HawkbitClient;
import com.eclipse.hawkbit.ui.view.util.Filter; import org.eclipse.hawkbit.ui.view.util.Filter;
import com.eclipse.hawkbit.ui.view.util.SelectionGrid; import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
import com.eclipse.hawkbit.ui.MainLayout; import org.eclipse.hawkbit.ui.MainLayout;
import com.eclipse.hawkbit.ui.view.util.TableView; import org.eclipse.hawkbit.ui.view.util.TableView;
import com.eclipse.hawkbit.ui.view.util.Utils; import org.eclipse.hawkbit.ui.view.util.Utils;
import com.vaadin.flow.component.Component; import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Key; import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.Button;
@@ -60,7 +60,7 @@ import java.util.stream.Stream;
@Route(value = "software_modules", layout = MainLayout.class) @Route(value = "software_modules", layout = MainLayout.class)
@RolesAllowed({"SOFTWARE_MODULE_READ"}) @RolesAllowed({"SOFTWARE_MODULE_READ"})
@Uses(Icon.class) @Uses(Icon.class)
public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
@Autowired @Autowired
public SoftwareModuleView(final HawkbitClient hawkbitClient) { public SoftwareModuleView(final HawkbitClient hawkbitClient) {
@@ -75,11 +75,11 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
private final SoftwareModuleDetails details = new SoftwareModuleDetails(hawkbitClient); private final SoftwareModuleDetails details = new SoftwareModuleDetails(hawkbitClient);
@Override @Override
protected void addColumns(final Grid<MgmtSoftwareModule> grid) { protected void addColumns(final Grid<MgmtSoftwareModule> grid) {
grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(ID).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getModuleId).setHeader(Constants.ID).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getName).setHeader(NAME).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getName).setHeader(Constants.NAME).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(VERSION).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getVersion).setHeader(Constants.VERSION).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(TYPE).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(VENDOR).setAutoWidth(true); grid.addColumn(MgmtSoftwareModule::getVendor).setHeader(Constants.VENDOR).setAutoWidth(true);
grid.setItemDetailsRenderer(new ComponentRenderer<>( grid.setItemDetailsRenderer(new ComponentRenderer<>(
() -> details, SoftwareModuleDetails::setItem)); () -> details, SoftwareModuleDetails::setItem));
@@ -88,7 +88,7 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
}, },
(query, rsqlFilter) -> hawkbitClient.getSoftwareModuleRestApi() (query, rsqlFilter) -> hawkbitClient.getSoftwareModuleRestApi()
.getSoftwareModules( .getSoftwareModules(
query.getOffset(), query.getPageSize(), NAME_ASC, rsqlFilter) query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter)
.getBody() .getBody()
.getContent() .getContent()
.stream(), .stream(),
@@ -110,8 +110,8 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
new SelectionGrid.EntityRepresentation<>(MgmtArtifact.class, MgmtArtifact::getArtifactId) { new SelectionGrid.EntityRepresentation<>(MgmtArtifact.class, MgmtArtifact::getArtifactId) {
@Override @Override
protected void addColumns(final Grid<MgmtArtifact> grid) { protected void addColumns(final Grid<MgmtArtifact> grid) {
grid.addColumn(MgmtArtifact::getArtifactId).setHeader(ID).setAutoWidth(true); grid.addColumn(MgmtArtifact::getArtifactId).setHeader(Constants.ID).setAutoWidth(true);
grid.addColumn(MgmtArtifact::getProvidedFilename).setHeader(NAME).setAutoWidth(true); grid.addColumn(MgmtArtifact::getProvidedFilename).setHeader(Constants.NAME).setAutoWidth(true);
grid.addColumn(MgmtArtifact::getSize).setHeader("Size").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 static class SoftwareModuleFilter implements Filter.Rsql {
private final TextField name = Utils.textField(NAME); private final TextField name = Utils.textField(Constants.NAME);
private final CheckboxGroup<MgmtSoftwareModuleType> type = new CheckboxGroup<>(TYPE); private final CheckboxGroup<MgmtSoftwareModuleType> type = new CheckboxGroup<>(Constants.TYPE);
private SoftwareModuleFilter(final HawkbitClient hawkbitClient) { private SoftwareModuleFilter(final HawkbitClient hawkbitClient) {
name.setPlaceholder("<name filter>"); name.setPlaceholder("<name filter>");
type.setItemLabelGenerator(MgmtSoftwareModuleType::getName); type.setItemLabelGenerator(MgmtSoftwareModuleType::getName);
type.setItems( type.setItems(
hawkbitClient.getSoftwareModuleTypeRestApi() hawkbitClient.getSoftwareModuleTypeRestApi()
.getTypes(0, 20, NAME_ASC, null) .getTypes(0, 20, Constants.NAME_ASC, null)
.getBody() .getBody()
.getContent()); .getContent());
} }
@@ -152,11 +152,11 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
private final transient HawkbitClient hawkbitClient; private final transient HawkbitClient hawkbitClient;
private final TextArea description = new TextArea(DESCRIPTION); private final TextArea description = new TextArea(Constants.DESCRIPTION);
private final TextField createdBy = Utils.textField(CREATED_BY); private final TextField createdBy = Utils.textField(Constants.CREATED_BY);
private final TextField createdAt = Utils.textField(CREATED_AT); private final TextField createdAt = Utils.textField(Constants.CREATED_AT);
private final TextField lastModifiedBy = Utils.textField(LAST_MODIFIED_BY); private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
private final TextField lastModifiedAt = Utils.textField(LAST_MODIFIED_AT); private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
private final SelectionGrid<MgmtArtifact, Long> artifactGrid; private final SelectionGrid<MgmtArtifact, Long> artifactGrid;
private SoftwareModuleDetails(final HawkbitClient hawkbitClient) { private SoftwareModuleDetails(final HawkbitClient hawkbitClient) {
@@ -211,10 +211,10 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
super("Create Software Module"); super("Create Software Module");
type = new Select<>( type = new Select<>(
TYPE, Constants.TYPE,
this::readyToCreate, this::readyToCreate,
hawkbitClient.getSoftwareModuleTypeRestApi() hawkbitClient.getSoftwareModuleTypeRestApi()
.getTypes(0, 30, NAME_ASC, null) .getTypes(0, 30, Constants.NAME_ASC, null)
.getBody() .getBody()
.getContent() .getContent()
.toArray(new MgmtSoftwareModuleType[0])); .toArray(new MgmtSoftwareModuleType[0]));
@@ -222,10 +222,10 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long>{
type.setRequiredIndicatorVisible(true); type.setRequiredIndicatorVisible(true);
type.setItemLabelGenerator(MgmtSoftwareModuleType::getName); type.setItemLabelGenerator(MgmtSoftwareModuleType::getName);
type.focus(); type.focus();
name = Utils.textField(NAME, this::readyToCreate); name = Utils.textField(Constants.NAME, this::readyToCreate);
version = Utils.textField(VERSION, this::readyToCreate); version = Utils.textField(Constants.VERSION, this::readyToCreate);
vendor = Utils.textField(VENDOR); vendor = Utils.textField(Constants.VENDOR);
description = new TextArea(DESCRIPTION); description = new TextArea(Constants.DESCRIPTION);
description.setWidthFull(); description.setWidthFull();
description.setMinLength(2); description.setMinLength(2);
enableArtifactEncryption = new Checkbox("Enable artifact encryption"); enableArtifactEncryption = new Checkbox("Enable artifact encryption");

View File

@@ -7,14 +7,14 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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 org.eclipse.hawkbit.ui.HawkbitClient;
import com.eclipse.hawkbit.ui.view.util.Filter; import org.eclipse.hawkbit.ui.view.util.Filter;
import com.eclipse.hawkbit.ui.MainLayout; import org.eclipse.hawkbit.ui.MainLayout;
import com.eclipse.hawkbit.ui.view.util.SelectionGrid; import org.eclipse.hawkbit.ui.view.util.SelectionGrid;
import com.eclipse.hawkbit.ui.view.util.TableView; import org.eclipse.hawkbit.ui.view.util.TableView;
import com.eclipse.hawkbit.ui.view.util.Utils; import org.eclipse.hawkbit.ui.view.util.Utils;
import com.vaadin.flow.component.Component; import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Key; import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.Button;
@@ -68,8 +68,8 @@ public class TargetView extends TableView<MgmtTarget, String> {
@Override @Override
protected void addColumns(final Grid<MgmtTarget> grid) { protected void addColumns(final Grid<MgmtTarget> grid) {
grid.addColumn(MgmtTarget::getControllerId).setHeader(CONTROLLER_ID).setAutoWidth(true); grid.addColumn(MgmtTarget::getControllerId).setHeader(CONTROLLER_ID).setAutoWidth(true);
grid.addColumn(MgmtTarget::getName).setHeader(NAME).setAutoWidth(true); grid.addColumn(MgmtTarget::getName).setHeader(Constants.NAME).setAutoWidth(true);
grid.addColumn(MgmtTarget::getTargetTypeName).setHeader(TYPE).setAutoWidth(true); grid.addColumn(MgmtTarget::getTargetTypeName).setHeader(Constants.TYPE).setAutoWidth(true);
grid.setItemDetailsRenderer(new ComponentRenderer<>( grid.setItemDetailsRenderer(new ComponentRenderer<>(
TargetDetails::new, TargetDetails::setItem)); TargetDetails::new, TargetDetails::setItem));
@@ -77,7 +77,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
}, },
(query, filter) -> hawkbitClient.getTargetRestApi() (query, filter) -> hawkbitClient.getTargetRestApi()
.getTargets( .getTargets(
query.getOffset(), query.getPageSize(), NAME_ASC, query.getOffset(), query.getPageSize(), Constants.NAME_ASC,
filter) filter)
.getBody() .getBody()
.getContent() .getContent()
@@ -103,7 +103,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
controllerId = Utils.textField(CONTROLLER_ID); controllerId = Utils.textField(CONTROLLER_ID);
controllerId.setPlaceholder("<controller id filter>"); controllerId.setPlaceholder("<controller id filter>");
type = new CheckboxGroup<>(TYPE); type = new CheckboxGroup<>(Constants.TYPE);
type.setItemLabelGenerator(MgmtTargetType::getName); type.setItemLabelGenerator(MgmtTargetType::getName);
tag = new CheckboxGroup<>(TAG); tag = new CheckboxGroup<>(TAG);
tag.setItemLabelGenerator(MgmtTag::getName); tag.setItemLabelGenerator(MgmtTag::getName);
@@ -113,11 +113,11 @@ public class TargetView extends TableView<MgmtTarget, String> {
public List<Component> components() { public List<Component> components() {
final List<Component> components = new LinkedList<>(); final List<Component> components = new LinkedList<>();
components.add(controllerId); 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()) { if (!type.getValue().isEmpty()) {
components.add(type); 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()) { if (!tag.isEmpty()) {
components.add(tag); components.add(tag);
} }
@@ -166,7 +166,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
setHeight("40%"); setHeight("40%");
final Button finishBtn = Utils.tooltip(new Button("Save"), "Save (Enter)"); final Button finishBtn = Utils.tooltip(new Button("Save"), "Save (Enter)");
final TextField name = Utils.textField( final TextField name = Utils.textField(
NAME, Constants.NAME,
e -> finishBtn.setEnabled(!e.getHasValue().isEmpty())); e -> finishBtn.setEnabled(!e.getHasValue().isEmpty()));
name.focus(); name.focus();
finishBtn.addClickShortcut(Key.ENTER); finishBtn.addClickShortcut(Key.ENTER);
@@ -206,11 +206,11 @@ public class TargetView extends TableView<MgmtTarget, String> {
private static class TargetDetails extends FormLayout { private static class TargetDetails extends FormLayout {
private final TextArea description = new TextArea(DESCRIPTION); private final TextArea description = new TextArea(Constants.DESCRIPTION);
private final TextField createdBy = Utils.textField(CREATED_BY); private final TextField createdBy = Utils.textField(Constants.CREATED_BY);
private final TextField createdAt = Utils.textField(CREATED_AT); private final TextField createdAt = Utils.textField(Constants.CREATED_AT);
private final TextField lastModifiedBy = Utils.textField(LAST_MODIFIED_BY); private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
private final TextField lastModifiedAt = Utils.textField(LAST_MODIFIED_AT); private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
private TargetDetails() { private TargetDetails() {
description.setMinLength(2); description.setMinLength(2);
@@ -251,7 +251,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
"Type", "Type",
e -> {}, e -> {},
hawkbitClient.getTargetTypeRestApi() hawkbitClient.getTargetTypeRestApi()
.getTargetTypes(0, 30, NAME_ASC, null) .getTargetTypes(0, 30, Constants.NAME_ASC, null)
.getBody() .getBody()
.getContent() .getContent()
.toArray(new MgmtTargetType[0])); .toArray(new MgmtTargetType[0]));
@@ -261,9 +261,9 @@ public class TargetView extends TableView<MgmtTarget, String> {
controllerId = Utils.textField(CONTROLLER_ID, controllerId = Utils.textField(CONTROLLER_ID,
e -> register.setEnabled(!e.getHasValue().isEmpty())); e -> register.setEnabled(!e.getHasValue().isEmpty()));
controllerId.focus(); controllerId.focus();
name = Utils.textField(NAME); name = Utils.textField(Constants.NAME);
name.setWidthFull(); name.setWidthFull();
description = new TextArea(DESCRIPTION); description = new TextArea(Constants.DESCRIPTION);
description.setMinLength(2); description.setMinLength(2);
description.setWidthFull(); description.setWidthFull();

View File

@@ -7,7 +7,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.Component;
import com.vaadin.flow.component.HasValue; import com.vaadin.flow.component.HasValue;

View File

@@ -7,7 +7,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.google.common.collect.Streams;
import com.vaadin.flow.component.grid.Grid; import com.vaadin.flow.component.grid.Grid;

View File

@@ -7,9 +7,9 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.html.Div;
import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.data.provider.Query; import com.vaadin.flow.data.provider.Query;

View File

@@ -7,7 +7,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * 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.Component;
import com.vaadin.flow.component.HasValue; import com.vaadin.flow.component.HasValue;
@@ -30,7 +30,6 @@ import com.vaadin.flow.theme.lumo.LumoUtility;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage; import java.util.concurrent.CompletionStage;

View File

@@ -20,5 +20,5 @@ spring.mustache.check-template-location = false
vaadin.launch-browser=true vaadin.launch-browser=true
# To improve the performance during development. # To improve the performance during development.
# For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters # 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 ### ### Vaadin end ###