Fix some compile warnings (#2919)
* Fix some compile warnings * Some classes made final * JPA entities made not serializable Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.ui;
|
||||
|
||||
import static feign.Util.ISO_8859_1;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Base64;
|
||||
@@ -53,6 +54,9 @@ import org.springframework.security.oauth2.core.oidc.user.OidcUser;
|
||||
@Import(FeignClientsConfiguration.class)
|
||||
public class HawkbitUiApp implements AppShellConfigurator {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String AUTHORIZATION_HEADER = "Authorization";
|
||||
private static final RequestInterceptor AUTHORIZATION = requestTemplate -> {
|
||||
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -49,10 +50,13 @@ import org.eclipse.hawkbit.ui.view.TargetView;
|
||||
/**
|
||||
* The main view is a top-level placeholder for other views.
|
||||
*/
|
||||
public class MainLayout extends AppLayout {
|
||||
public final class MainLayout extends AppLayout {
|
||||
|
||||
static final List<Class<? extends Component>> DEFAULT_VIEW_PRIORITY = List.of(TargetView.class, DistributionSetView.class,
|
||||
SoftwareModuleView.class, RolloutView.class);
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
static final List<Class<? extends Component>> DEFAULT_VIEW_PRIORITY = List.of(
|
||||
TargetView.class, DistributionSetView.class, SoftwareModuleView.class, RolloutView.class);
|
||||
private final transient AuthenticatedUser authenticatedUser;
|
||||
private final AccessAnnotationChecker accessChecker;
|
||||
private H2 viewTitle;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
package org.eclipse.hawkbit.ui;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -19,7 +20,10 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class SimpleI18NProvider extends DefaultI18NProvider {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
SimpleI18NProvider() {
|
||||
super(Arrays.stream(Locale.getAvailableLocales()).toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
package org.eclipse.hawkbit.ui;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import com.vaadin.flow.server.ServiceInitEvent;
|
||||
import com.vaadin.flow.server.VaadinServiceInitListener;
|
||||
import com.vaadin.flow.spring.annotation.SpringComponent;
|
||||
@@ -19,6 +21,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@SpringComponent
|
||||
public class VaadinServiceInit implements VaadinServiceInitListener {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public void serviceInit(ServiceInitEvent event) {
|
||||
// cache zoneId of client as soon as possible
|
||||
|
||||
@@ -12,6 +12,7 @@ package org.eclipse.hawkbit.ui.component;
|
||||
|
||||
import static org.eclipse.hawkbit.ui.view.Constants.STATUS;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -39,7 +40,10 @@ import org.eclipse.hawkbit.ui.view.TargetView;
|
||||
import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
|
||||
@Slf4j
|
||||
public class TargetActionsHistory extends Grid<TargetActionsHistory.ActionStatusEntry> {
|
||||
public final class TargetActionsHistory extends Grid<TargetActionsHistory.ActionStatusEntry> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
private transient MgmtTarget target;
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
|
||||
import com.vaadin.flow.component.html.H2;
|
||||
@@ -24,7 +26,10 @@ import org.eclipse.hawkbit.ui.MainLayout;
|
||||
@Route(value = "about", layout = MainLayout.class)
|
||||
@RouteAlias(value = "", layout = MainLayout.class)
|
||||
@RolesAllowed({ "ANONYMOUS" })
|
||||
public class AboutView extends VerticalLayout {
|
||||
public final class AboutView extends VerticalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AboutView() {
|
||||
setSpacing(false);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@@ -32,12 +33,15 @@ import org.eclipse.hawkbit.ui.MainLayout;
|
||||
@Route(value = "config", layout = MainLayout.class)
|
||||
@RolesAllowed({ "CONFIG_READ" })
|
||||
@Slf4j
|
||||
public class ConfigView extends VerticalLayout {
|
||||
public final class ConfigView extends VerticalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String WIDTH = "width";
|
||||
private static final String PX_300 = "300px";
|
||||
|
||||
private final Map<String, MgmtSystemTenantConfigurationValueRequest> configValue = new HashMap<>();
|
||||
private final transient Map<String, MgmtSystemTenantConfigurationValueRequest> configValue = new HashMap<>();
|
||||
|
||||
public ConfigView(final HawkbitMgmtClient hawkbitClient) {
|
||||
setSpacing(false);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -64,6 +65,9 @@ import org.eclipse.hawkbit.ui.view.util.Utils;
|
||||
@Uses(Icon.class)
|
||||
public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DistributionSetView(final HawkbitMgmtClient hawkbitClient) {
|
||||
super(
|
||||
new DistributionSetFilter(hawkbitClient),
|
||||
@@ -184,6 +188,9 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
|
||||
private static class DistributionSetDetails extends FormLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
|
||||
private final TextArea description = new TextArea("Description");
|
||||
@@ -238,6 +245,9 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
|
||||
private static class CreateDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
|
||||
private final Select<MgmtDistributionSetType> type;
|
||||
@@ -325,6 +335,9 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
@SuppressWarnings({ "java:S1171", "java:S3599" })
|
||||
private static class AddSoftwareModulesDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient Set<MgmtSoftwareModule> softwareModules = Collections.synchronizedSet(new HashSet<>());
|
||||
|
||||
private AddSoftwareModulesDialog(final long distributionSetId, final HawkbitMgmtClient hawkbitClient) {
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import com.vaadin.flow.component.login.LoginI18n;
|
||||
import com.vaadin.flow.component.login.LoginOverlay;
|
||||
import com.vaadin.flow.router.BeforeEnterEvent;
|
||||
@@ -23,7 +25,10 @@ import org.eclipse.hawkbit.ui.security.AuthenticatedUser;
|
||||
@AnonymousAllowed
|
||||
@PageTitle("Login")
|
||||
@Route(value = "login")
|
||||
public class LoginView extends LoginOverlay implements BeforeEnterObserver {
|
||||
public final class LoginView extends LoginOverlay implements BeforeEnterObserver {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient AuthenticatedUser authenticatedUser;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -63,7 +64,10 @@ import org.springframework.util.ObjectUtils;
|
||||
@RolesAllowed({ "ROLLOUT_READ" })
|
||||
@Uses(Icon.class)
|
||||
@SuppressWarnings({ "java:S1171", "java:S3599" })
|
||||
public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
||||
public final class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RolloutView(final HawkbitMgmtClient hawkbitClient) {
|
||||
super(
|
||||
@@ -105,6 +109,9 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
||||
|
||||
private static class Actions extends HorizontalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final long rolloutId;
|
||||
private final Grid<MgmtRolloutResponseBody> grid;
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
@@ -190,6 +197,9 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
||||
|
||||
private static class RolloutDetails extends FormLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
|
||||
private final TextArea description = new TextArea(Constants.DESCRIPTION);
|
||||
@@ -283,6 +293,9 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
||||
|
||||
private static class CreateDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final TextField name;
|
||||
private final ComboBox<MgmtDistributionSet> distributionSet;
|
||||
private final ComboBox<MgmtTargetFilterQuery> targetFilter;
|
||||
|
||||
@@ -12,6 +12,7 @@ package org.eclipse.hawkbit.ui.view;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serial;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -69,6 +70,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
@Slf4j
|
||||
public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
public SoftwareModuleView(final HawkbitMgmtClient hawkbitClient) {
|
||||
this(true, hawkbitClient);
|
||||
@@ -156,6 +160,9 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
|
||||
private static class SoftwareModuleDetails extends FormLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
|
||||
private final TextArea description = new TextArea(Constants.DESCRIPTION);
|
||||
@@ -202,6 +209,9 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
|
||||
private static class CreateDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Select<MgmtSoftwareModuleType> type;
|
||||
private final TextField name;
|
||||
private final TextField version;
|
||||
@@ -337,6 +347,9 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
|
||||
private static class AddArtifactsDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient Set<MgmtArtifact> artifacts = Collections.synchronizedSet(new HashSet<>());
|
||||
|
||||
private AddArtifactsDialog(
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -91,7 +92,10 @@ import org.springframework.util.ObjectUtils;
|
||||
@Route(value = "targets", layout = MainLayout.class)
|
||||
@RolesAllowed({ "TARGET_READ" })
|
||||
@Uses(Icon.class)
|
||||
public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
public final class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String STATUS = "Status";
|
||||
public static final String UPDATE = "Sync";
|
||||
@@ -344,6 +348,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
protected static class TargetDetailedView extends VerticalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Span targetId;
|
||||
private final TargetDetails targetDetails;
|
||||
private final TargetAssignedInstalled targetAssignedInstalled;
|
||||
@@ -383,6 +390,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class TargetDetails extends FormLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
private final TextArea description = new TextArea(Constants.DESCRIPTION);
|
||||
private final TextField createdBy = Utils.textField(Constants.CREATED_BY);
|
||||
@@ -444,6 +454,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class TargetAssignedInstalled extends FormLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
private final LinkedTextArea assigned = new LinkedTextArea("Assigned Distribution Set", "/distribution_sets?");
|
||||
private final LinkedTextArea installed = new LinkedTextArea("Installed Distribution Set", "/distribution_sets?");
|
||||
@@ -489,6 +502,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class TargetTags extends VerticalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
private final ComboBox<MgmtTag> tagSelector = new ComboBox<>(TAG);
|
||||
private final HorizontalLayout tagsArea = new HorizontalLayout();
|
||||
@@ -601,6 +617,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class TargetMetadata extends VerticalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KEY = "Key";
|
||||
public static final String VALUE = "Value";
|
||||
|
||||
@@ -672,7 +691,10 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
}
|
||||
}
|
||||
|
||||
public static class TargetActionsHistoryLayout extends VerticalLayout {
|
||||
public static final class TargetActionsHistoryLayout extends VerticalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final TargetActionsHistory targetActionsHistory;
|
||||
|
||||
@@ -689,6 +711,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
public static class ActionStepsGrid extends Grid<ActionStepsGrid.ActionStepEntry> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final transient HawkbitMgmtClient hawkbitClient;
|
||||
private transient MgmtTarget target;
|
||||
private transient Long actionId;
|
||||
@@ -775,6 +800,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class RegisterDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Select<MgmtTargetType> type;
|
||||
private final TextField controllerId;
|
||||
private final TextField name;
|
||||
@@ -850,6 +878,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class AssignDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final ComboBox<MgmtDistributionSet> distributionSet;
|
||||
private final Select<MgmtActionType> actionType;
|
||||
private final DateTimePicker forceTime = new DateTimePicker("Force Time");
|
||||
@@ -918,6 +949,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class CreateTagDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final TextField name;
|
||||
private final TextArea description = new TextArea(Constants.DESCRIPTION);
|
||||
|
||||
@@ -961,6 +995,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class AddMetadataDialog extends Utils.BaseDialog<Void> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final TextField key;
|
||||
private final TextField value;
|
||||
|
||||
@@ -1001,6 +1038,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class TargetStatusCell extends HorizontalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private TargetStatusCell(final MgmtTarget target) {
|
||||
final MgmtPollStatus pollStatus = target.getPollStatus();
|
||||
add(pollStatusIconMapper(pollStatus));
|
||||
@@ -1024,6 +1064,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
||||
|
||||
private static class TargetUpdateStatusCell extends HorizontalLayout {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private TargetUpdateStatusCell(final MgmtTarget target) {
|
||||
final String targetUpdateStatus = Optional.ofNullable(target.getUpdateStatus()).orElse("unknown");
|
||||
add(targetUpdateStatusMapper(targetUpdateStatus));
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -30,7 +31,10 @@ import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.theme.lumo.LumoUtility;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
public class Filter extends Div {
|
||||
public final class Filter extends Div {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private transient Rsql rsql;
|
||||
private final transient Rsql secondaryRsql;
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import com.vaadin.flow.component.card.Card;
|
||||
import com.vaadin.flow.component.card.CardVariant;
|
||||
import com.vaadin.flow.component.html.Anchor;
|
||||
@@ -17,27 +19,29 @@ import com.vaadin.flow.component.html.Span;
|
||||
|
||||
public class LinkedTextArea extends Div {
|
||||
|
||||
String queryPrefix;
|
||||
Card card;
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public LinkedTextArea(String title, String queryPrefix) {
|
||||
super();
|
||||
private final String queryPrefix;
|
||||
private final Card card;
|
||||
|
||||
public LinkedTextArea(final String title, final String queryPrefix) {
|
||||
this.queryPrefix = queryPrefix;
|
||||
card = new Card();
|
||||
card.setTitle(title);
|
||||
this.queryPrefix = queryPrefix;
|
||||
}
|
||||
|
||||
public void setValueWithLink(String value, String query) {
|
||||
var span = new Span(value);
|
||||
final Span span = new Span(value);
|
||||
span.setWhiteSpace(WhiteSpace.PRE_WRAP);
|
||||
card.add(span);
|
||||
card.addThemeVariants(CardVariant.LUMO_ELEVATED);
|
||||
if (query != null) {
|
||||
var a = new Anchor(queryPrefix + query, card);
|
||||
a.addClassName("nocolor");
|
||||
add(a);
|
||||
final Anchor anchor = new Anchor(queryPrefix + query, card);
|
||||
anchor.addClassName("nocolor");
|
||||
add(anchor);
|
||||
} else {
|
||||
add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -24,7 +25,10 @@ import com.vaadin.flow.theme.lumo.LumoUtility;
|
||||
|
||||
// id type shall have proper equals and hashCode - i.e. eligible hash set element
|
||||
@SuppressWarnings("java:S119") // better readability
|
||||
public class SelectionGrid<T, ID> extends Grid<T> {
|
||||
public final class SelectionGrid<T, ID> extends Grid<T> {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private volatile String rsqlFilter;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
@@ -38,6 +39,9 @@ import org.eclipse.hawkbit.ui.view.Constants;
|
||||
@SuppressWarnings("java:S119") // better readability
|
||||
public class TableView<T, ID> extends Div implements Constants, BeforeEnterObserver {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String COLOR = "color";
|
||||
private static final String VAR_LUMO_SECONDARY_TEXT_COLOR = "var(--lumo-secondary-text-color)";
|
||||
private static final String VAR_LUMO_PRIMARY_COLOR = "var(--lumo-primary-color)";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.view.util;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -58,17 +59,15 @@ import com.vaadin.flow.data.renderer.ComponentRenderer;
|
||||
import com.vaadin.flow.data.renderer.LocalDateTimeRenderer;
|
||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import com.vaadin.flow.theme.lumo.LumoUtility;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
|
||||
import org.eclipse.hawkbit.ui.view.Constants;
|
||||
|
||||
@NoArgsConstructor(access = lombok.AccessLevel.PRIVATE) // prevent initialization
|
||||
@Slf4j
|
||||
public class Utils {
|
||||
|
||||
private Utils() {
|
||||
// prevent initialization
|
||||
}
|
||||
|
||||
public static final String COMBO_NAME_ALLOWED_CHARS = "[0-9a-zA-Z-_./]";
|
||||
|
||||
public static TextField textField(final String label) {
|
||||
@@ -148,8 +147,8 @@ public class Utils {
|
||||
return layout;
|
||||
}
|
||||
|
||||
private static <T, ID> ConfirmDialog promptForDeleteConfirmation(Function<SelectionGrid<T, ID>, CompletionStage<Void>> removeHandler,
|
||||
SelectionGrid<T, ID> selectionGrid) {
|
||||
private static <T, ID> ConfirmDialog promptForDeleteConfirmation(
|
||||
final Function<SelectionGrid<T, ID>, CompletionStage<Void>> removeHandler, final SelectionGrid<T, ID> selectionGrid) {
|
||||
final ConfirmDialog dialog = new ConfirmDialog();
|
||||
dialog.setHeader("Confirm Deletion");
|
||||
dialog.setText("Are you sure you want to delete the selected items? This action cannot be undone.");
|
||||
@@ -160,9 +159,7 @@ public class Utils {
|
||||
dialog.setConfirmButtonTheme(ButtonVariant.LUMO_ERROR.getVariantName());
|
||||
dialog.setConfirmText("Delete");
|
||||
dialog.addConfirmListener(event -> {
|
||||
removeHandler
|
||||
.apply(selectionGrid)
|
||||
.thenAccept(v -> selectionGrid.refreshGrid(false));
|
||||
removeHandler.apply(selectionGrid).thenAccept(v -> selectionGrid.refreshGrid(false));
|
||||
dialog.close();
|
||||
});
|
||||
return dialog;
|
||||
@@ -238,6 +235,9 @@ public class Utils {
|
||||
|
||||
public static class BaseDialog<T> extends Dialog {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected final transient CompletableFuture<T> result = new CompletableFuture<>();
|
||||
|
||||
protected BaseDialog(final String headerTitle) {
|
||||
|
||||
Reference in New Issue
Block a user