Merge branch 'master' into Feature/Add_Rest_Api_with_Java_client

Conflicts:
	examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java
	examples/hawkbit-mgmt-api-client/pom.xml
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java
	examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java
	hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java
	hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java
	hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java
	hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss
	hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss
	hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss
	hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss
	hawkbit-ui/src/main/resources/messages.properties
	hawkbit-ui/src/main/resources/messages_de.properties
	hawkbit-ui/src/main/resources/messages_en.properties


Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-05-17 11:16:18 +02:00
166 changed files with 2700 additions and 1284 deletions

View File

@@ -22,6 +22,7 @@ import org.eclipse.hawkbit.eventbus.event.TargetDeletedEvent;
import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
/**
* The default hawkbit event provider.
@@ -39,6 +40,7 @@ public class HawkbitEventProvider implements UIEventProvider {
SINGLE_EVENTS.add(DistributionSetTagUpdateEvent.class);
SINGLE_EVENTS.add(RolloutGroupChangeEvent.class);
SINGLE_EVENTS.add(RolloutChangeEvent.class);
SINGLE_EVENTS.add(TargetTagUpdateEvent.class);
BULK_EVENTS.add(TargetCreatedEvent.class);
BULK_EVENTS.add(TargetInfoUpdateEvent.class);

View File

@@ -37,6 +37,8 @@ public class UiProperties {
/**
* Demo user password.
*/
// Exception squid:S2068 - Empty password
@SuppressWarnings({ "squid:S2068" })
private String password = "";
public String getPassword() {
@@ -64,6 +66,7 @@ public class UiProperties {
}
}
/**
* Links to potentially other systems (e.g. support, user management,
* documentation etc.).
@@ -227,6 +230,7 @@ public class UiProperties {
}
}
/**
* Configuration of login view.
*

View File

@@ -16,6 +16,7 @@ import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
import org.eclipse.hawkbit.repository.SoftwareManagement;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
@@ -101,8 +102,8 @@ public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareMo
proxy.setVersion(bean.getVersion());
proxy.setVendor(bean.getVendor());
proxy.setDescription(bean.getDescription());
proxy.setCreatedByUser(HawkbitCommonUtil.getIMUser(bean.getCreatedBy()));
proxy.setModifiedByUser(HawkbitCommonUtil.getIMUser(bean.getLastModifiedBy()));
proxy.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(bean));
proxy.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(bean));
return proxy;
}

View File

@@ -234,12 +234,13 @@ public class SoftwareModuleAddUpdateWindow implements Serializable {
mainLayout.addComponent(hLayout);
mainLayout.setComponentAlignment(hLayout, Alignment.MIDDLE_LEFT);
mainLayout.addComponents(nameTextField, versionTextField, vendorTextField, descTextArea, buttonsLayout);
/* add main layout to the window */
window = SPUIComponentProvider.getWindow(i18n.get("upload.caption.add.new.swmodule"), null,
SPUIDefinitions.CREATE_UPDATE_WINDOW);
window.setContent(mainLayout);
window.setModal(true);
nameTextField.focus();
}
private void addDescriptionTextChangeListener() {

View File

@@ -257,6 +257,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
mainLayout = new HorizontalLayout();
mainLayout.addComponent(fieldButtonLayout);
setCompositionRoot(mainLayout);
typeName.focus();
}
private void addListeners() {
@@ -553,7 +554,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
.findSoftwareModuleTypeByName(typeName.getValue());
if (createOptiongroup.getValue().equals(createTypeStr)) {
if (!checkIsKeyDuplicate(typeKey.getValue()) && !checkIsDuplicate(existingType)) {
crateNewSWModuleType();
createNewSWModuleType();
}
} else {
@@ -610,9 +611,9 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
/**
* Create new tag.
*/
private void crateNewSWModuleType() {
private void createNewSWModuleType() {
int assignNumber = 0;
final String colorPicked = getColorPickedSting();
final String colorPicked = getColorPickedString();
final String typeNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeName.getValue());
final String typeKeyValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeKey.getValue());
final String typeDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(typeDesc.getValue());
@@ -649,7 +650,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
*
* @return String of color picked value.
*/
private String getColorPickedSting() {
private String getColorPickedString() {
return "rgb(" + getSelPreview().getColor().getRed() + "," + getSelPreview().getColor().getGreen() + ","
+ getSelPreview().getColor().getBlue() + ")";
}
@@ -675,7 +676,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
existingType.setDescription(null != typeDescValue ? typeDescValue : null);
existingType.setColour(getColorPickedSting());
existingType.setColour(getColorPickedString());
swTypeManagementService.updateSoftwareModuleType(existingType);
uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { existingType.getName() }));
closeWindow();

View File

@@ -37,20 +37,12 @@ import com.vaadin.ui.Upload.SucceededListener;
* {@link StreamVariable} upload variants.
*
* The handler manages the output to the user and at the same time ensures that
* the upload does not exceed the configued max file size.
*
*
*
*
*
* the upload does not exceed the configured max file size.
*
*/
public class UploadHandler implements StreamVariable, Receiver, SucceededListener, FailedListener, FinishedListener,
ProgressListener, StartedListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(UploadHandler.class);
@@ -108,7 +100,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
public OutputStream receiveUpload(final String fileName, final String mimeType) {
this.fileName = fileName;
this.mimeType = mimeType;
//reset has directory flag before upload
// reset has directory flag before upload
view.setHasDirectory(false);
try {
if (view.checkIfSoftwareModuleIsSelected()) {
@@ -343,11 +335,6 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
}
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
@@ -356,11 +343,6 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {

View File

@@ -0,0 +1,187 @@
/**
* 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.ui.common;
import java.util.Collections;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.im.authentication.UserPrincipal;
import org.eclipse.hawkbit.repository.model.BaseEntity;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
import com.vaadin.server.VaadinService;
/**
* A Utility class to user details e.g. username
*/
public final class UserDetailsFormatter {
private static final String TRIM_APPENDIX = "...";
private static final String DETAIL_SEPERATOR = ", ";
private UserDetailsFormatter() {
}
/**
* Load user details by the user name and format the user name to max 100
* characters.
*
* @see {@link UserDetailsFormatter#loadAndFormatUsername(String, int)}
*
* @param username
* the user name
* @return the formatted user name (max 100 characters) cannot be <null>
*/
public static String loadAndFormatUsername(final String username) {
return loadAndFormatUsername(username, 100);
}
/**
* Load user details by {@link BaseEntity#getCreatedBy()} and format the
* user name. Use {@link UserDetailsFormatter#loadAndFormatUsername(String)}
*
* @param baseEntity
* the entity
* @return the formatted 'created at user name' (max 100 characters) cannot
* be <null>
*/
public static String loadAndFormatCreatedBy(final BaseEntity baseEntity) {
if (baseEntity == null || baseEntity.getCreatedBy() == null) {
return StringUtils.EMPTY;
}
return loadAndFormatUsername(baseEntity.getCreatedBy());
}
/**
* Load user details by {@link BaseEntity#getLastModifiedBy()} and format
* the user name. Use
* {@link UserDetailsFormatter#loadAndFormatUsername(String)}
*
* @param baseEntity
* the entity
* @return the formatted 'last modefied by user name' (max 100 characters)
* cannot be <null>
*/
public static String loadAndFormatLastModifiedBy(final BaseEntity baseEntity) {
if (baseEntity == null || baseEntity.getLastModifiedBy() == null) {
return StringUtils.EMPTY;
}
return loadAndFormatUsername(baseEntity.getLastModifiedBy());
}
/**
* Load user details by the current session information and format the user
* name to max 12 characters. @see
* {@link UserDetailsFormatter#loadAndFormatUsername(String, int)}
*
* @return the formatted user name (max 12 characters) cannot be <null>
*/
public static String formatCurrentUsername() {
return loadAndFormatUsername(getCurrentUser().getUsername(), 5);
}
/**
* Load user details by the user name and format the user name. If the
* loaded {@link UserDetails} is not an instance of a {@link UserPrincipal},
* then just the {@link UserDetails#getUsername()} will return.
*
* If first and last name available, they will combined. Otherwise the
* {@link UserPrincipal#getLoginname()} will formatted. The formatted name
* is reduced to 100 characters.
*
* @param username
* the user name
* @param expectedNameLength
* the name size of each name part
* @return the formatted user name (max expectedNameLength characters)
* cannot be <null>
*/
public static String loadAndFormatUsername(final String username, final int expectedNameLength) {
final UserDetails userDetails = loadUserByUsername(username);
return formatUserName(expectedNameLength, userDetails);
}
private static String formatUserName(final int expectedNameLength, final UserDetails userDetails) {
if (!(userDetails instanceof UserPrincipal)) {
return userDetails.getUsername();
}
final UserPrincipal userPrincipal = (UserPrincipal) userDetails;
String firstname = StringUtils.defaultIfEmpty(userPrincipal.getFirstname(), StringUtils.EMPTY);
if (!StringUtils.isEmpty(firstname)) {
firstname += DETAIL_SEPERATOR;
}
final String firstAndLastname = firstname
+ StringUtils.defaultIfEmpty(userPrincipal.getLastname(), StringUtils.EMPTY);
final String trimmedUsername = trimAndFormatDetail(firstAndLastname, expectedNameLength);
if (StringUtils.isEmpty(trimmedUsername)) {
return trimAndFormatDetail(userPrincipal.getLoginname(), expectedNameLength);
}
return trimmedUsername;
}
/**
* Format the current tenant. The information is loaded by the current
* session information.
*
* @return the formatted user name (max 8 characters) can be <null>
*/
public static String formatCurrentTenant() {
final UserDetails userDetails = getCurrentUser();
if (!(userDetails instanceof UserPrincipal)) {
return null;
}
final UserPrincipal userPrincipal = (UserPrincipal) userDetails;
return trimAndFormatDetail(userPrincipal.getTenant(), 8);
}
private static UserDetails getCurrentUser() {
final SecurityContext context = (SecurityContext) VaadinService.getCurrentRequest().getWrappedSession()
.getAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY);
return (UserDetails) context.getAuthentication().getPrincipal();
}
private static String trimAndFormatDetail(final String formatString, final int expectedDetailLength) {
final String detail = StringUtils.defaultIfEmpty(formatString, StringUtils.EMPTY);
final String trimmedDetail = StringUtils.substring(detail, 0, expectedDetailLength);
if (StringUtils.length(detail) > expectedDetailLength) {
return trimmedDetail + TRIM_APPENDIX;
}
return trimmedDetail;
}
// Exception squid:S1166 - exception has to be hidden
@SuppressWarnings({ "squid:S1166" })
private static UserDetails loadUserByUsername(final String username) {
final UserDetailsService userDetailsService = SpringContextHelper.getBean(UserDetailsService.class);
try {
final UserDetails loadUserByUsername = userDetailsService.loadUserByUsername(username);
if (loadUserByUsername == null) {
throw new UsernameNotFoundException("User not found " + username);
}
return loadUserByUsername;
} catch (final UsernameNotFoundException e) {
return new User(username, "", Collections.emptyList());
}
}
}

View File

@@ -150,20 +150,20 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
private void buildLayout() {
final HorizontalLayout nameEditLayout = new HorizontalLayout();
nameEditLayout.setWidth(100.0f, Unit.PERCENTAGE);
nameEditLayout.setWidth(100.0F, Unit.PERCENTAGE);
nameEditLayout.addComponent(caption);
nameEditLayout.setComponentAlignment(caption, Alignment.MIDDLE_LEFT);
nameEditLayout.setComponentAlignment(caption, Alignment.TOP_LEFT);
if (hasEditPermission()) {
nameEditLayout.addComponent(editButton);
nameEditLayout.setComponentAlignment(editButton, Alignment.MIDDLE_RIGHT);
nameEditLayout.setComponentAlignment(editButton, Alignment.TOP_RIGHT);
}
nameEditLayout.setExpandRatio(caption, 1.0f);
nameEditLayout.setExpandRatio(caption, 1.0F);
nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
addComponent(nameEditLayout);
setComponentAlignment(nameEditLayout, Alignment.MIDDLE_CENTER);
setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
addComponent(detailsTab);
setComponentAlignment(nameEditLayout, Alignment.MIDDLE_CENTER);
setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
setSizeFull();
setHeightUndefined();
@@ -171,9 +171,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
}
private Label createHeaderCaption() {
final Label captionLabel = SPUIComponentProvider.getLabel(getDefaultCaption(),
SPUILabelDefinitions.SP_WIDGET_CAPTION);
return captionLabel;
return SPUIComponentProvider.getLabel(getDefaultCaption(), SPUILabelDefinitions.SP_WIDGET_CAPTION);
}
protected VerticalLayout getTabLayout() {
@@ -213,22 +211,22 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
populateDetailsWidget();
}
protected void updateLogLayout(final VerticalLayout changeLogLayout, final Long lastModifiedAt,
final String lastModifiedBy, final Long createdAt, final String createdBy, final I18N i18n) {
changeLogLayout.removeAllComponents();
changeLogLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.created.at"),
createdAt == null ? "" : SPDateTimeUtil.getFormattedDate(createdAt)));
protected void populateLog() {
logLayout.removeAllComponents();
changeLogLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.created.by"),
createdBy == null ? "" : HawkbitCommonUtil.getIMUser(createdBy)));
logLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.created.at"),
SPDateTimeUtil.formatCreatedAt(selectedBaseEntity)));
if (null != lastModifiedAt) {
changeLogLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.modified.date"),
SPDateTimeUtil.getFormattedDate(lastModifiedAt)));
logLayout.addComponent(SPUIComponentProvider.createCreatedByLabel(i18n, selectedBaseEntity));
changeLogLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.modified.by"),
lastModifiedBy == null ? "" : HawkbitCommonUtil.getIMUser(lastModifiedBy)));
if (selectedBaseEntity == null || selectedBaseEntity.getLastModifiedAt() == null) {
return;
}
logLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.modified.date"),
SPDateTimeUtil.formatLastModifiedAt(selectedBaseEntity)));
logLayout.addComponent(SPUIComponentProvider.createLastModifiedByLabel(i18n, selectedBaseEntity));
}
protected void updateDescriptionLayout(final String descriptionLabel, final String description) {
@@ -320,19 +318,6 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
return detailsLayout;
}
public VerticalLayout getLogLayout() {
return logLayout;
}
private void populateLog() {
if (selectedBaseEntity == null) {
updateLogLayout(getLogLayout(), null, StringUtils.EMPTY, null, null, i18n);
return;
}
updateLogLayout(getLogLayout(), selectedBaseEntity.getLastModifiedAt(), selectedBaseEntity.getLastModifiedBy(),
selectedBaseEntity.getCreatedAt(), selectedBaseEntity.getCreatedBy(), i18n);
}
private void populateDescription() {
if (selectedBaseEntity != null) {
updateDescriptionLayout(i18n.get("label.description"), selectedBaseEntity.getDescription());

View File

@@ -20,7 +20,7 @@ import javax.annotation.PreDestroy;
import org.eclipse.hawkbit.repository.model.NamedEntity;
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
@@ -212,9 +212,9 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
item.getItemProperty(SPUILabelDefinitions.VAR_ID).setValue(baseEntity.getId());
item.getItemProperty(SPUILabelDefinitions.VAR_DESC).setValue(baseEntity.getDescription());
item.getItemProperty(SPUILabelDefinitions.VAR_CREATED_BY)
.setValue(HawkbitCommonUtil.getIMUser(baseEntity.getCreatedBy()));
.setValue(UserDetailsFormatter.loadAndFormatCreatedBy(baseEntity));
item.getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY)
.setValue(HawkbitCommonUtil.getIMUser(baseEntity.getLastModifiedBy()));
.setValue(UserDetailsFormatter.loadAndFormatLastModifiedBy(baseEntity));
item.getItemProperty(SPUILabelDefinitions.VAR_CREATED_DATE)
.setValue(SPDateTimeUtil.getFormattedDate(baseEntity.getCreatedAt()));
item.getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE)
@@ -329,6 +329,17 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
columnList.add(
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.2F));
setItemDescriptionGenerator((source, itemId, propertyId) -> {
if (SPUILabelDefinitions.VAR_CREATED_BY.equals(propertyId)) {
return getItem(itemId).getItemProperty(SPUILabelDefinitions.VAR_CREATED_BY).getValue().toString();
}
if (SPUILabelDefinitions.VAR_LAST_MODIFIED_BY.equals(propertyId)) {
return getItem(itemId).getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY).getValue().toString();
}
return null;
});
return columnList;
}

View File

@@ -44,7 +44,7 @@ import com.vaadin.ui.VerticalLayout;
public abstract class AbstractTableHeader extends VerticalLayout {
private static final long serialVersionUID = 4881626370291837175L;
@Autowired
protected I18N i18n;
@@ -53,7 +53,6 @@ public abstract class AbstractTableHeader extends VerticalLayout {
@Autowired
protected transient EventBus.SessionEventBus eventbus;
private Label headerCaption;
@@ -83,7 +82,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
restoreState();
eventbus.subscribe(this);
}
@PreDestroy
void destroy() {
eventbus.unsubscribe(this);
@@ -171,8 +170,8 @@ public abstract class AbstractTableHeader extends VerticalLayout {
}
titleFilterIconsLayout.addComponent(maxMinIcon);
titleFilterIconsLayout.setComponentAlignment(maxMinIcon, Alignment.TOP_RIGHT);
titleFilterIconsLayout.setExpandRatio(headerCaption, 0.4f);
titleFilterIconsLayout.setExpandRatio(searchField, 0.6f);
titleFilterIconsLayout.setExpandRatio(headerCaption, 0.4F);
titleFilterIconsLayout.setExpandRatio(searchField, 0.6F);
addComponent(titleFilterIconsLayout);
@@ -192,10 +191,10 @@ public abstract class AbstractTableHeader extends VerticalLayout {
dropHintDropFilterLayout.addComponent(dropFilterLayout);
dropHintDropFilterLayout.setComponentAlignment(dropFilterLayout, Alignment.TOP_CENTER);
dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0f);
dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0F);
}
addComponent(dropHintDropFilterLayout);
setComponentAlignment(dropHintDropFilterLayout, Alignment.MIDDLE_CENTER);
setComponentAlignment(dropHintDropFilterLayout, Alignment.TOP_CENTER);
addStyleName("bordered-layout");
addStyleName("no-border-bottom");
}

View File

@@ -36,6 +36,8 @@ public class ProxyTarget extends Target {
private DistributionSet installedDistributionSet;
private DistributionSet assignedDistributionSet;
private TargetIdName targetIdName;
private String assignedDistNameVersion;
@@ -249,6 +251,21 @@ public class ProxyTarget extends Target {
this.installedDistributionSet = installedDistributionSet;
}
/**
* @return the assignedDistributionSet
*/
public DistributionSet getAssignedDistributionSet() {
return assignedDistributionSet;
}
/**
* @param assignedDistributionSet
* the assignedDistributionSet to set
*/
public void setAssignedDistributionSet(DistributionSet assignedDistributionSet) {
this.assignedDistributionSet = assignedDistributionSet;
}
/**
* @return the targetIdName
*/
@@ -297,4 +314,5 @@ public class ProxyTarget extends Target {
public void setStatus(final Status status) {
this.status = status;
}
}

View File

@@ -12,7 +12,9 @@ import java.util.Arrays;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.repository.model.BaseEntity;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUIComboBoxDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUIHeaderLayoutDecorator;
@@ -20,6 +22,7 @@ import org.eclipse.hawkbit.ui.decorators.SPUILabelDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUITextAreaDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUITextFieldDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUIWindowDecorator;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -328,6 +331,50 @@ public final class SPUIComponentProvider {
return nameValueLabel;
}
private static Label createUsernameLabel(final String label, final String username) {
String loadAndFormatUsername = StringUtils.EMPTY;
if (!StringUtils.isEmpty(username)) {
loadAndFormatUsername = UserDetailsFormatter.loadAndFormatUsername(username);
}
final Label nameValueLabel = new Label(getBoldHTMLText(label) + loadAndFormatUsername, ContentMode.HTML);
nameValueLabel.setSizeFull();
nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
nameValueLabel.addStyleName("label-style");
nameValueLabel.setDescription(loadAndFormatUsername);
return nameValueLabel;
}
/**
* Create label which represents the {@link BaseEntity#getCreatedBy()} by
* user name
*
* @param i18n
* the i18n
* @param baseEntity
* the entity
* @return the label
*/
public static Label createCreatedByLabel(final I18N i18n, final BaseEntity baseEntity) {
return createUsernameLabel(i18n.get("label.created.by"),
baseEntity == null ? StringUtils.EMPTY : baseEntity.getCreatedBy());
}
/**
* Create label which represents the
* {@link BaseEntity#getLastModifiedBy()()} by user name
*
* @param i18n
* the i18n
* @param baseEntity
* the entity
* @return the label
*/
public static Label createLastModifiedByLabel(final I18N i18n, final BaseEntity baseEntity) {
return createUsernameLabel(i18n.get("label.modified.by"),
baseEntity == null ? StringUtils.EMPTY : baseEntity.getLastModifiedBy());
}
/**
* Get Bold Text.
*

View File

@@ -1,29 +0,0 @@
/**
* 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.ui.customrenderers.client;
import org.eclipse.hawkbit.ui.customrenderers.renderers.LinkRenderer;
import com.vaadin.client.connectors.ButtonRendererConnector;
import com.vaadin.shared.ui.Connect;
/**
*
* A connector for {@link LinkRenderer}.
*
*/
@Connect(org.eclipse.hawkbit.ui.customrenderers.renderers.LinkRenderer.class)
public class LinkRendererConnector extends ButtonRendererConnector {
private static final long serialVersionUID = 7987417436367399331L;
@Override
public org.eclipse.hawkbit.ui.customrenderers.client.renderers.LinkRenderer getRenderer() {
return (org.eclipse.hawkbit.ui.customrenderers.client.renderers.LinkRenderer) super.getRenderer();
}
}

View File

@@ -0,0 +1,37 @@
/**
* 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.ui.customrenderers.client;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import com.google.web.bindery.event.shared.HandlerRegistration;
import com.vaadin.client.connectors.ClickableRendererConnector;
import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler;
import com.vaadin.shared.ui.Connect;
import elemental.json.JsonObject;
/**
* A connector for {@link CustomObjectRenderer }.
*
*/
@Connect(org.eclipse.hawkbit.ui.customrenderers.renderers.RolloutRenderer.class)
public class RolloutRendererConnector extends ClickableRendererConnector<RolloutRendererData> {
private static final long serialVersionUID = 7734682321931830566L;
public org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRenderer getRenderer() {
return (org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRenderer) super.getRenderer();
}
@Override
protected HandlerRegistration addClickHandler(
RendererClickHandler<JsonObject> handler) {
return getRenderer().addClickHandler(handler);
}
}

View File

@@ -1,42 +0,0 @@
/**
* 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.ui.customrenderers.client.renderers;
import com.google.gwt.user.client.ui.Button;
import com.vaadin.client.renderers.ButtonRenderer;
import com.vaadin.client.ui.VButton;
import com.vaadin.client.widget.grid.RendererCellReference;
/**
*
* Renders link with provided text.
*
*/
public class LinkRenderer extends ButtonRenderer {
@Override
public void render(RendererCellReference cell, String text, Button button) {
button.setText(text);
applystyle(button);
// this is to allow the button to disappear, if the text is null
button.setVisible(text != null);
button.getElement().setId(new StringBuilder("link").append(".").append(text).toString());
}
private void applystyle(Button button) {
button.setStyleName(VButton.CLASSNAME);
button.addStyleName(getStyle("borderless"));
button.addStyleName(getStyle("small"));
button.addStyleName(getStyle("on-focus-no-border"));
button.addStyleName(getStyle("link"));
}
private String getStyle(final String style) {
return new StringBuilder(style).append(" ").append(VButton.CLASSNAME).append("-").append(style).toString();
}
}

View File

@@ -0,0 +1,65 @@
/**
* 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.ui.customrenderers.client.renderers;
import com.google.gwt.core.shared.GWT;
import com.vaadin.client.renderers.ClickableRenderer;
import com.vaadin.client.ui.VButton;
import com.vaadin.client.widget.grid.RendererCellReference;
/**
* Renders button with provided CustomObject.
* Used to display button with link.
*
*/
public class RolloutRenderer extends ClickableRenderer<RolloutRendererData, VButton> {
@Override
public VButton createWidget() {
VButton b = GWT.create(VButton.class);
b.addClickHandler(this);
b.setStylePrimaryName("v-nativebutton");
return b;
}
@Override
public void render(RendererCellReference cell, RolloutRendererData text, VButton button) {
final String creating = "CREATING";
button.setText(text.getName());
applystyle(button);
// this is to allow the button to disappear, if the text is null
button.setVisible(text.getName() != null);
button.getElement().setId(new StringBuilder("link").append(".").append(text.getName()).toString());
/*
* checking Rollout Status for applying button style. If Rollout status
* is not "CREATING", then the Rollout button is applying hyperlink
* style
*/
final boolean isStatusCreate = text.getStatus() != null && creating.equalsIgnoreCase(text.getStatus());
if (isStatusCreate) {
button.addStyleName(getStyle("boldhide"));
button.setEnabled(false);
} else {
button.setEnabled(true);
}
}
private void applystyle(VButton button) {
button.setStyleName(VButton.CLASSNAME);
button.addStyleName(getStyle("borderless"));
button.addStyleName(getStyle("small"));
button.addStyleName(getStyle("on-focus-no-border"));
button.addStyleName(getStyle("link"));
}
private String getStyle(final String style) {
return new StringBuilder(style).append(" ").append(VButton.CLASSNAME).append("-").append(style).toString();
}
}

View File

@@ -0,0 +1,62 @@
/**
* 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.ui.customrenderers.client.renderers;
import java.io.Serializable;
/**
* RendererData class with Name and Status.
*
*/
public class RolloutRendererData implements Serializable {
private static final long serialVersionUID = -5018181529953620263L;
private String name;
private String status;
/**
* Initialize the RendererData.
*/
public RolloutRendererData() {
}
/**
* Initialize the RendererData.
*
* @param name
* Name of the Rollout.
* @param status
* Status of Rollout.
*/
public RolloutRendererData(String name, String status) {
super();
this.name = name;
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@@ -1,37 +0,0 @@
/**
* 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.ui.customrenderers.renderers;
import com.vaadin.ui.renderers.ButtonRenderer;
/**
*
* Renders link with provided text.
*
*/
public class LinkRenderer extends ButtonRenderer {
private static final long serialVersionUID = -1242995370043404892L;
/**
* Intialise link renderer.
*/
public LinkRenderer() {
super();
}
/**
* Intialise link renderer with {@link RendererClickListener}
*
* @param listener
* RendererClickListener
*/
public LinkRenderer(RendererClickListener listener) {
super(listener);
}
}

View File

@@ -0,0 +1,61 @@
/**
* 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.ui.customrenderers.renderers;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import com.vaadin.ui.renderers.ClickableRenderer;
import elemental.json.JsonValue;
/**
* Renders button with provided CustomObject.
* Used to display button with link.
*
*/
public class RolloutRenderer extends ClickableRenderer<RolloutRendererData> {
private static final long serialVersionUID = -8754180585906263554L;
/**
* Creates a new custom object renderer.
*/
public RolloutRenderer() {
super(RolloutRendererData.class, null);
}
/**
* Initialize custom object renderer with {@link Class<CustomObject>}
*
* @param presentationType
* Class<CustomObject>
*/
public RolloutRenderer(Class<RolloutRendererData> presentationType) {
super(presentationType);
}
/**
* Creates a new custom object renderer and adds the given click listener to it.
*
* @param listener
* the click listener to register
*/
public RolloutRenderer(RendererClickListener listener) {
this();
addClickListener(listener);
}
@Override
public JsonValue encode(RolloutRendererData resource) {
return super.encode(resource, RolloutRendererData.class);
}
}

View File

@@ -284,7 +284,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
mainLayout.addComponent(fieldLayout);
mainLayout.addComponent(twinTableLayout);
colorLayout = new HorizontalLayout();
sliderLayout = new VerticalLayout();
final HorizontalLayout chooseColorLayout = new HorizontalLayout();
@@ -299,6 +299,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
mainWindowLayout.addComponent(colorLayout);
mainWindowLayout.addComponent(buttonLayout);
setCompositionRoot(mainWindowLayout);
typeName.focus();
}
private HorizontalLayout createTwinColumnLayout() {

View File

@@ -20,6 +20,7 @@ import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.DistributionSetType;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
@@ -113,8 +114,8 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
proxyDistribution.setCreatedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getCreatedAt()));
proxyDistribution.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getLastModifiedAt()));
proxyDistribution.setDescription(distributionSet.getDescription());
proxyDistribution.setCreatedByUser(HawkbitCommonUtil.getIMUser(distributionSet.getCreatedBy()));
proxyDistribution.setModifiedByUser(HawkbitCommonUtil.getIMUser(distributionSet.getLastModifiedBy()));
proxyDistribution.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(distributionSet));
proxyDistribution.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(distributionSet));
proxyDistribution.setIsComplete(distributionSet.isComplete());
proxyDistributions.add(proxyDistribution);
}

View File

@@ -17,6 +17,7 @@ import org.eclipse.hawkbit.repository.SoftwareManagement;
import org.eclipse.hawkbit.repository.model.CustomSoftwareModule;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
@@ -99,8 +100,8 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
proxyItem.setVersion(bean.getVersion());
proxyItem.setVendor(bean.getVendor());
proxyItem.setDescription(bean.getDescription());
proxyItem.setCreatedByUser(HawkbitCommonUtil.getIMUser(bean.getCreatedBy()));
proxyItem.setModifiedByUser(HawkbitCommonUtil.getIMUser(bean.getLastModifiedBy()));
proxyItem.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(bean));
proxyItem.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(bean));
proxyItem.setAssigned(customSoftwareModule.isAssigned());
proxyItem.setColour(bean.getType().getColour());
proxyItem.setTypeId(bean.getType().getId());

View File

@@ -68,6 +68,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private static final long serialVersionUID = 7474232427119031474L;
private static final String breadcrumbCustomFilters = "breadcrumb.target.filter.custom.filters";
@Autowired
private I18N i18n;
@@ -93,6 +95,12 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
@Qualifier("uiExecutor")
private transient Executor executor;
private HorizontalLayout breadcrumbLayout;
private Button breadcrumbButton;
private Label breadcrumbName;
private Label headerCaption;
private TextField queryTextField;
@@ -169,6 +177,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
oldFilterName = filterManagementUIState.getTfQuery().get().getName();
oldFilterQuery = filterManagementUIState.getTfQuery().get().getQuery();
}
breadcrumbName.setValue(nameLabel.getValue());
showValidationSuccesIcon();
titleFilterIconsLayout.addStyleName(SPUIStyleDefinitions.TARGET_FILTER_CAPTION_LAYOUT);
headerCaption.setVisible(false);
@@ -177,6 +186,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private void resetComponents() {
headerCaption.setVisible(true);
breadcrumbName.setValue(headerCaption.getValue());
nameLabel.setValue("");
queryTextField.setValue("");
setInitialStatusIconStyle(validationIcon);
@@ -201,6 +211,9 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
}
private void createComponents() {
breadcrumbButton = createBreadcrumbButton();
headerCaption = SPUIComponentProvider.getLabel(SPUILabelDefinitions.VAR_CREATE_FILTER,
SPUILabelDefinitions.SP_WIDGET_CAPTION);
@@ -221,12 +234,23 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
closeIcon = createSearchResetIcon();
}
private Button createBreadcrumbButton() {
final Button createFilterViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
SPUIButtonStyleSmallNoBorder.class);
createFilterViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links");
createFilterViewLink.setDescription(i18n.get(breadcrumbCustomFilters));
createFilterViewLink.setCaption(i18n.get(breadcrumbCustomFilters));
createFilterViewLink.addClickListener(value -> showCustomFiltersView());
return createFilterViewLink;
}
private TextField createNameTextField() {
final TextField nameField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null,
i18n.get("textfield.customfiltername"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
nameField.setId(SPUIComponetIdProvider.CUSTOM_FILTER_ADD_NAME);
nameField.setPropertyDataSource(nameLabel);
nameField.addTextChangeListener(event -> onFiterNameChange(event));
nameField.addTextChangeListener(event -> onFilterNameChange(event));
return nameField;
}
@@ -256,7 +280,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
};
}
private void onFiterNameChange(final TextChangeEvent event) {
private void onFilterNameChange(final TextChangeEvent event) {
if (isNameAndQueryEmpty(event.getText(), queryTextField.getValue())
|| (event.getText().equals(oldFilterName) && queryTextField.getValue().equals(oldFilterQuery))) {
saveButton.setEnabled(false);
@@ -276,6 +300,13 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
titleFilterIconsLayout.addComponents(headerCaption, captionLayout);
titleFilterIconsLayout.setSpacing(true);
breadcrumbLayout = new HorizontalLayout();
breadcrumbLayout.addComponent(breadcrumbButton);
breadcrumbLayout.addComponent(new Label(">"));
breadcrumbName = SPUIComponentProvider.getLabel(null, SPUILabelDefinitions.SP_WIDGET_CAPTION);
breadcrumbLayout.addComponent(breadcrumbName);
breadcrumbName.addStyleName("breadcrumbPaddingLeft");
final HorizontalLayout titleFilterLayout = new HorizontalLayout();
titleFilterLayout.setSizeFull();
titleFilterLayout.addComponents(titleFilterIconsLayout, closeIcon);
@@ -290,7 +321,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
searchLayout.setSpacing(false);
searchLayout.addComponents(validationIcon, queryTextField);
searchLayout.addStyleName("custom-search-layout");
searchLayout.setComponentAlignment(validationIcon, Alignment.MIDDLE_CENTER);
searchLayout.setComponentAlignment(validationIcon, Alignment.TOP_CENTER);
final HorizontalLayout iconLayout = new HorizontalLayout();
iconLayout.setSizeUndefined();
@@ -302,10 +333,12 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
queryLayout.setSpacing(true);
queryLayout.addComponents(searchLayout, iconLayout);
addComponent(breadcrumbLayout);
addComponent(titleFilterLayout);
addComponent(queryLayout);
setSpacing(true);
addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
addStyleName("bordered-layout");
}
private void setUpCaptionLayout(final boolean isCreateView) {
@@ -524,4 +557,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
}
}
private void showCustomFiltersView() {
eventBus.publish(this, CustomFilterUIEvent.SHOW_FILTER_MANAGEMENT);
}
}

View File

@@ -17,10 +17,12 @@ 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.TargetUpdateStatus;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.AssignInstalledDSTooltipGenerator;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
@@ -69,6 +71,10 @@ public class CreateOrUpdateFilterTable extends Table {
private static final int PROPERTY_DEPT = 3;
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
private static final String INSTALL_DIST_SET = "installedDistributionSet";
/**
* Initialize the Action History Table.
*/
@@ -87,6 +93,7 @@ public class CreateOrUpdateFilterTable extends Table {
setId(SPUIComponetIdProvider.CUSTOM_FILTER_TARGET_TABLE_ID);
setSelectable(false);
eventBus.subscribe(this);
setItemDescriptionGenerator(new AssignInstalledDSTooltipGenerator());
}
@PreDestroy
@@ -160,6 +167,9 @@ public class CreateOrUpdateFilterTable extends Table {
private void setCollapsibleColumns() {
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, true);
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, true);
setColumnCollapsed(ASSIGN_DIST_SET, true);
setColumnCollapsed(INSTALL_DIST_SET, true);
}
/**
@@ -172,10 +182,13 @@ public class CreateOrUpdateFilterTable extends Table {
container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, Date.class, null);
container.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class, null, false, true);
container.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, String.class, null, false, true);
container.addContainerProperty(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER, String.class, "");
container.addContainerProperty(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER, String.class, null);
container.addContainerProperty(SPUILabelDefinitions.VAR_TARGET_STATUS, TargetUpdateStatus.class, null);
container.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false, true);
container.addContainerProperty(ASSIGN_DIST_SET, DistributionSet.class, null, false, true);
container.addContainerProperty(INSTALL_DIST_SET, DistributionSet.class, null, false, true);
container.addContainerProperty(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER, String.class, "");
container.addContainerProperty(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER, String.class, null);
}
private List<TableColumn> getVisbleColumns() {
@@ -186,12 +199,9 @@ public class CreateOrUpdateFilterTable extends Table {
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
columnList.add(
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER,
i18n.get("header.assigned.ds"), 0.125F));
columnList.add(new TableColumn(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER,
i18n.get("header.installed.ds"), 0.125F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.STATUS_ICON, i18n.get("header.status"), 0.1F));
return columnList;
}
@@ -244,4 +254,5 @@ public class CreateOrUpdateFilterTable extends Table {
populateTableData();
eventBus.publish(this, CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON);
}
}

View File

@@ -13,8 +13,8 @@ import java.util.List;
import java.util.Map;
import org.eclipse.hawkbit.repository.TargetManagement;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyTarget;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
@@ -118,22 +118,9 @@ public class CustomTargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
prxyTarget.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(targ.getLastModifiedAt()));
prxyTarget.setCreatedDate(SPDateTimeUtil.getFormattedDate(targ.getCreatedAt()));
prxyTarget.setCreatedAt(targ.getCreatedAt());
prxyTarget.setCreatedByUser(HawkbitCommonUtil.getIMUser(targ.getCreatedBy()));
prxyTarget.setModifiedByUser(HawkbitCommonUtil.getIMUser(targ.getLastModifiedBy()));
final Target target = getTargetManagement().findTargetByControllerIDWithDetails(targ.getControllerId());
final DistributionSet installedDistributionSet = target.getTargetInfo().getInstalledDistributionSet();
prxyTarget.setInstalledDistributionSet(installedDistributionSet);
final DistributionSet assignedDistributionSet = target.getAssignedDistributionSet();
prxyTarget.setAssignedDistributionSet(assignedDistributionSet);
prxyTarget.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(targ));
prxyTarget.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(targ));
if (null != assignedDistributionSet) {
prxyTarget.setAssignedDistNameVersion(HawkbitCommonUtil.getFormattedNameVersion(
assignedDistributionSet.getName(), assignedDistributionSet.getVersion()));
}
if (null != installedDistributionSet) {
prxyTarget.setInstalledDistNameVersion(HawkbitCommonUtil.getFormattedNameVersion(
installedDistributionSet.getName(), installedDistributionSet.getVersion()));
}
prxyTarget.setUpdateStatus(targ.getTargetInfo().getUpdateStatus());
prxyTarget.setLastTargetQuery(targ.getTargetInfo().getLastTargetQuery());
prxyTarget.setTargetInfo(targ.getTargetInfo());

View File

@@ -96,7 +96,8 @@ public class FilterManagementView extends VerticalLayout implements View {
} else if (custFilterUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK
|| custFilterUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) {
this.getUI().access(() -> viewCreateTargetFilterLayout());
} else if (custFilterUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW) {
} else if (custFilterUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW
|| custFilterUIEvent == CustomFilterUIEvent.SHOW_FILTER_MANAGEMENT) {
UI.getCurrent().access(() -> viewListView());
}
}
@@ -121,11 +122,11 @@ public class FilterManagementView extends VerticalLayout implements View {
tableHeaderLayout.setComponentAlignment(createNewFilterHeader, Alignment.TOP_CENTER);
tableHeaderLayout.addComponent(createNewFilterTable);
tableHeaderLayout.setComponentAlignment(createNewFilterTable, Alignment.TOP_CENTER);
tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0f);
tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0F);
addComponent(tableHeaderLayout);
setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
setExpandRatio(tableHeaderLayout, 1.0f);
setExpandRatio(tableHeaderLayout, 1.0F);
final HorizontalLayout targetsCountmessageLabelLayout = addTargetFilterMessageLabel();
addComponent(targetsCountmessageLabelLayout);
@@ -135,17 +136,17 @@ public class FilterManagementView extends VerticalLayout implements View {
private void viewListView() {
removeAllComponents();
final VerticalLayout tableHeaderLayout = new VerticalLayout();
tableHeaderLayout.setSizeFull();
tableHeaderLayout.setSpacing(false);
tableHeaderLayout.setMargin(false);
tableHeaderLayout.setStyleName("table-layout");
tableHeaderLayout.addComponent(targetFilterHeader);
tableHeaderLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER);
tableHeaderLayout.addComponent(targetFilterTable);
tableHeaderLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER);
tableHeaderLayout.setExpandRatio(targetFilterTable, 1.0f);
addComponent(tableHeaderLayout);
final VerticalLayout tableListViewLayout = new VerticalLayout();
tableListViewLayout.setSizeFull();
tableListViewLayout.setSpacing(false);
tableListViewLayout.setMargin(false);
tableListViewLayout.setStyleName("table-layout");
tableListViewLayout.addComponent(targetFilterHeader);
tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER);
tableListViewLayout.addComponent(targetFilterTable);
tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER);
tableListViewLayout.setExpandRatio(targetFilterTable, 1.0F);
addComponent(tableListViewLayout);
}
private HorizontalLayout addTargetFilterMessageLabel() {

View File

@@ -31,10 +31,7 @@ import cz.jirutka.rsql.parser.RSQLParserException;
*
* Validates the target filter query.
*
*
*
*/
public final class FilterQueryValidation {
private static final Logger LOGGER = LoggerFactory.getLogger(FilterQueryValidation.class);
@@ -103,6 +100,9 @@ public final class FilterQueryValidation {
* @param expectedTokens
* @return
*/
// Exception squid:S2095 - see
// https://jira.sonarsource.com/browse/SONARJAVA-1478
@SuppressWarnings({ "squid:S2095" })
public static List<String> processExpectedTokens(final List<Integer> expectedTokens) {
final List<String> expectToken = new ArrayList<>();
if (expectedTokens.size() == 2 && expectedTokens.contains(9) && expectedTokens.contains(4)) {

View File

@@ -14,6 +14,7 @@ import java.util.Map;
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyTargetFilter;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
@@ -93,9 +94,9 @@ public class TargetFilterBeanQuery extends AbstractBeanQuery<ProxyTargetFilter>
proxyTarFilter.setName(tarFilterQuery.getName());
proxyTarFilter.setId(tarFilterQuery.getId());
proxyTarFilter.setCreatedDate(SPDateTimeUtil.getFormattedDate(tarFilterQuery.getCreatedAt()));
proxyTarFilter.setCreatedBy(HawkbitCommonUtil.getIMUser(tarFilterQuery.getCreatedBy()));
proxyTarFilter.setCreatedBy(UserDetailsFormatter.loadAndFormatCreatedBy(tarFilterQuery));
proxyTarFilter.setModifiedDate(SPDateTimeUtil.getFormattedDate(tarFilterQuery.getLastModifiedAt()));
proxyTarFilter.setLastModifiedBy(HawkbitCommonUtil.getIMUser(tarFilterQuery.getLastModifiedBy()));
proxyTarFilter.setLastModifiedBy(UserDetailsFormatter.loadAndFormatLastModifiedBy(tarFilterQuery));
proxyTarFilter.setQuery(tarFilterQuery.getQuery());
proxyTargetFilter.add(proxyTarFilter);
}

View File

@@ -15,5 +15,5 @@ package org.eclipse.hawkbit.ui.filtermanagement.event;
*
*/
public enum CustomFilterUIEvent {
FILTER_TARGET_BY_QUERY, FILTER_BY_CUST_FILTER_TEXT, FILTER_BY_CUST_FILTER_TEXT_REMOVE, CREATE_NEW_FILTER_CLICK, EXIT_CREATE_OR_UPDATE_FILTRER_VIEW, TARGET_FILTER_DETAIL_VIEW, TARGET_DETAILS_VIEW, CREATE_TARGET_FILTER_QUERY, UPDATED_TARGET_FILTER_QUERY, UPDATE_TARGET_FILTER_SEARCH_ICON
FILTER_TARGET_BY_QUERY, FILTER_BY_CUST_FILTER_TEXT, FILTER_BY_CUST_FILTER_TEXT_REMOVE, CREATE_NEW_FILTER_CLICK, EXIT_CREATE_OR_UPDATE_FILTRER_VIEW, TARGET_FILTER_DETAIL_VIEW, TARGET_DETAILS_VIEW, CREATE_TARGET_FILTER_QUERY, UPDATED_TARGET_FILTER_QUERY, UPDATE_TARGET_FILTER_SEARCH_ICON, SHOW_FILTER_MANAGEMENT
}

View File

@@ -225,7 +225,7 @@ public class LoginView extends VerticalLayout implements View {
final String linkStyle = "v-link";
if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
final Link docuLink = SPUIComponentProvider.getLink(SPUIComponetIdProvider.LINK_DOCUMENATION,
final Link docuLink = SPUIComponentProvider.getLink(SPUIComponetIdProvider.LINK_DOCUMENTATION,
i18n.get("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle, true);
links.addComponent(docuLink);

View File

@@ -145,11 +145,12 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
setSizeUndefined();
addComponents(madatoryLabel, distsetTypeNameComboBox, distNameTextField, distVersionTextField, descTextArea,
reqMigStepCheckbox);
addComponent(buttonsLayout);
setComponentAlignment(madatoryLabel, Alignment.MIDDLE_LEFT);
}
distNameTextField.focus();
}
/**
* Create required UI components.

View File

@@ -18,6 +18,7 @@ import org.eclipse.hawkbit.repository.DistributionSetFilter.DistributionSetFilte
import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
@@ -129,8 +130,8 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
proxyDistribution.setCreatedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getCreatedAt()));
proxyDistribution.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getLastModifiedAt()));
proxyDistribution.setDescription(distributionSet.getDescription());
proxyDistribution.setCreatedByUser(HawkbitCommonUtil.getIMUser(distributionSet.getCreatedBy()));
proxyDistribution.setModifiedByUser(HawkbitCommonUtil.getIMUser(distributionSet.getLastModifiedBy()));
proxyDistribution.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(distributionSet));
proxyDistribution.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(distributionSet));
proxyDistribution.setNameVersion(
HawkbitCommonUtil.getFormattedNameVersion(distributionSet.getName(), distributionSet.getVersion()));
proxyDistributions.add(proxyDistribution);

View File

@@ -43,10 +43,6 @@ import com.vaadin.ui.themes.ValoTheme;
@SpringComponent
@VaadinSessionScope
public class CreateUpdateDistributionTagLayoutWindow extends CreateUpdateTagLayout {
/**
*
*/
private static final long serialVersionUID = 444276149954167545L;
@Autowired
@@ -288,16 +284,22 @@ public class CreateUpdateDistributionTagLayoutWindow extends CreateUpdateTagLayo
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onDistributionSetTagCreatedBulkEvent(final DistributionSetTagCreatedBulkEvent event) {
populateTagNameCombo();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onDistributionSetTagDeletedEvent(final DistributionSetTagDeletedEvent event) {
populateTagNameCombo();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onDistributionSetTagUpdateEvent(final DistributionSetTagUpdateEvent event) {
populateTagNameCombo();
}

View File

@@ -61,16 +61,22 @@ public class DistributionTagButtons extends AbstractFilterButtons {
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onDistributionSetTagCreatedBulkEvent(final DistributionSetTagCreatedBulkEvent event) {
refreshTagTable();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onDistributionSetTagDeletedEvent(final DistributionSetTagDeletedEvent event) {
refreshTagTable();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onDistributionSetTagUpdateEvent(final DistributionSetTagUpdateEvent event) {
refreshTagTable();
}

View File

@@ -171,7 +171,7 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C
tagName = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_NAME,
true, "", i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
tagName.setId(SPUIDefinitions.NEW_TARGET_TAG_NAME);
tagDesc = SPUIComponentProvider.getTextArea("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_DESC,
false, "", i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
@@ -237,7 +237,8 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C
fieldLayout.addComponent(madatoryLabel);
fieldLayout.addComponent(tagName);
fieldLayout.addComponent(tagDesc);
final HorizontalLayout colorLabelLayout = new HorizontalLayout();
colorLabelLayout.addComponents(colorLabel, tagColorPreviewBtn);
fieldLayout.addComponent(colorLabelLayout);
@@ -257,8 +258,8 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C
mainLayout = new HorizontalLayout();
mainLayout.addComponent(fieldButtonLayout);
setCompositionRoot(mainLayout);
tagName.focus();
}

View File

@@ -152,7 +152,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
madatoryLabel.setVisible(Boolean.FALSE);
}
mainLayout.addComponents(madatoryLabel, controllerIDTextField, nameTextField, descTextArea, buttonsLayout);
nameTextField.focus();
}
private void addListeners() {

View File

@@ -19,6 +19,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyTarget;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
@@ -130,8 +131,8 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
prxyTarget.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(targ.getLastModifiedAt()));
prxyTarget.setCreatedDate(SPDateTimeUtil.getFormattedDate(targ.getCreatedAt()));
prxyTarget.setCreatedAt(targ.getCreatedAt());
prxyTarget.setCreatedByUser(HawkbitCommonUtil.getIMUser(targ.getCreatedBy()));
prxyTarget.setModifiedByUser(HawkbitCommonUtil.getIMUser(targ.getLastModifiedBy()));
prxyTarget.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(targ));
prxyTarget.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(targ));
if (pinnedDistId == null) {
prxyTarget.setInstalledDistributionSet(null);

View File

@@ -32,6 +32,7 @@ import org.eclipse.hawkbit.repository.model.TargetInfo;
import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.filter.FilterExpression;
@@ -51,6 +52,7 @@ import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent.TargetComponentEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.state.TargetTableFilters;
import org.eclipse.hawkbit.ui.utils.AssignInstalledDSTooltipGenerator;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
@@ -136,6 +138,7 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> implements
addActionHandler(this);
actionSelectAll = new ShortcutAction(i18n.get("action.target.table.selectall"));
actionUnSelectAll = new ShortcutAction(i18n.get("action.target.table.clear"));
setItemDescriptionGenerator(new AssignInstalledDSTooltipGenerator());
}
/**
@@ -329,7 +332,7 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> implements
if (!isMaximized()) {
columnList.add(new TableColumn(SPUIDefinitions.TARGET_STATUS_POLL_TIME, "", 0.0F));
columnList.add(new TableColumn(SPUIDefinitions.TARGET_STATUS_PIN_TOGGLE_ICON, "", 0.0F));
}
}
return columnList;
}
@@ -739,7 +742,7 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> implements
.setValue(updatedTarget.getTargetInfo().getLastTargetQuery());
item.getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY)
.setValue(HawkbitCommonUtil.getIMUser(updatedTarget.getLastModifiedBy()));
.setValue(UserDetailsFormatter.loadAndFormatLastModifiedBy(updatedTarget));
item.getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE)
.setValue(SPDateTimeUtil.getFormattedDate(updatedTarget.getLastModifiedAt()));
item.getItemProperty(SPUILabelDefinitions.VAR_DESC).setValue(updatedTarget.getDescription());

View File

@@ -85,16 +85,22 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onEventTargetTagCreated(final TargetTagCreatedBulkEvent event) {
populateTagNameCombo();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onEventTargetDeletedEvent(final TargetTagDeletedEvent event) {
populateTagNameCombo();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onEventTargetTagUpdateEvent(final TargetTagUpdateEvent event) {
populateTagNameCombo();
}
@@ -144,7 +150,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue());
if (optiongroup.getValue().equals(createTagNw)) {
if (!checkIsDuplicate(existingTag)) {
crateNewTag();
createNewTag();
}
} else {
@@ -182,8 +188,8 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
/**
* Create new tag.
*/
private void crateNewTag() {
final String colorPicked = getColorPickedSting();
private void createNewTag() {
final String colorPicked = getColorPickedString();
final String tagNameValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagName.getValue());
final String tagDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue());
if (null != tagNameValue) {
@@ -214,7 +220,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
if (null != nameUpdateValue) {
targetObj.setName(nameUpdateValue);
targetObj.setDescription(null != descUpdateValue ? descUpdateValue : null);
targetObj.setColour(getColorPickedSting());
targetObj.setColour(getColorPickedString());
tagManagement.updateTargetTag(targetObj);
uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { targetObj.getName() }));
closeWindow();
@@ -244,7 +250,7 @@ public class CreateUpdateTargetTagLayout extends CreateUpdateTagLayout {
*
* @return String of color picked value.
*/
private String getColorPickedSting() {
private String getColorPickedString() {
return "rgb(" + getSelPreview().getColor().getRed() + "," + getSelPreview().getColor().getGreen() + ","
+ getSelPreview().getColor().getBlue() + ")";
}

View File

@@ -267,16 +267,22 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onEvent(final TargetTagUpdateEvent event) {
refreshContainer();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onEventTargetTagCreated(final TargetTagCreatedBulkEvent event) {
refreshContainer();
}
@EventBusListenerMethod(scope = EventScope.SESSION)
// Exception squid:S1172 - event not needed
@SuppressWarnings({ "squid:S1172" })
void onEventTargetDeletedEvent(final TargetTagDeletedEvent event) {
refreshContainer();
}

View File

@@ -18,23 +18,20 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.HawkbitServerProperties;
import org.eclipse.hawkbit.im.authentication.PermissionService;
import org.eclipse.hawkbit.im.authentication.UserPrincipal;
import org.eclipse.hawkbit.ui.UiProperties;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.menu.DashboardEvent.PostViewChangeEvent;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
import com.vaadin.server.FontAwesome;
import com.vaadin.server.Page;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.VaadinService;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.spring.annotation.SpringComponent;
import com.vaadin.spring.annotation.UIScope;
@@ -115,9 +112,9 @@ public final class DashboardMenu extends CustomComponent {
final VerticalLayout links = buildLinksAndVersion();
menus.addComponent(links);
menus.setComponentAlignment(links, Alignment.BOTTOM_CENTER);
menus.setExpandRatio(links, 1.0f);
menus.setExpandRatio(links, 1.0F);
menuContent.addComponent(menus);
menuContent.setExpandRatio(menus, 1.0f);
menuContent.setExpandRatio(menus, 1.0F);
dashboardMenuLayout.addComponent(menuContent);
return dashboardMenuLayout;
@@ -139,7 +136,7 @@ public final class DashboardMenu extends CustomComponent {
final Label logo = new Label("<strong>" + i18n.get("menu.title") + "</strong>", ContentMode.HTML);
logo.setSizeUndefined();
final HorizontalLayout logoWrapper = new HorizontalLayout(logo);
logoWrapper.setComponentAlignment(logo, Alignment.MIDDLE_CENTER);
logoWrapper.setComponentAlignment(logo, Alignment.TOP_CENTER);
logoWrapper.addStyleName("valo-menu-title");
return logoWrapper;
}
@@ -151,7 +148,7 @@ public final class DashboardMenu extends CustomComponent {
final String linkStyle = "v-link";
if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
final Link docuLink = SPUIComponentProvider.getLink(SPUIComponetIdProvider.LINK_DOCUMENATION,
final Link docuLink = SPUIComponentProvider.getLink(SPUIComponetIdProvider.LINK_DOCUMENTATION,
i18n.get("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle, true);
docuLink.setDescription(i18n.get("link.documentation.name"));
@@ -189,63 +186,27 @@ public final class DashboardMenu extends CustomComponent {
return links;
}
private UserDetails getCurrentUser() {
final SecurityContext context = (SecurityContext) VaadinService.getCurrentRequest().getWrappedSession()
.getAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY);
return (UserDetails) context.getAuthentication().getPrincipal();
}
private Component buildUserMenu() {
final MenuBar settings = new MenuBar();
settings.addStyleName("user-menu");
final UserDetails user = getCurrentUser();
settings.setHtmlContentAllowed(true);
final MenuItem settingsItem = settings.addItem("", new ThemeResource("images/profile-pic-57px.jpg"), null);
if (user instanceof UserPrincipal
&& (((UserPrincipal) user).getFirstname() != null || ((UserPrincipal) user).getLastname() != null)) {
settingsItem.setText(trimTanent(((UserPrincipal) user).getTenant()) + "\n"
+ concateFNameLName(((UserPrincipal) user).getFirstname(), ((UserPrincipal) user).getLastname()));
settingsItem.setDescription(
((UserPrincipal) user).getFirstname() + " / " + ((UserPrincipal) user).getLastname());
} else if (user instanceof UserPrincipal) {
if (((UserPrincipal) user).getLoginname().length() > 10) {
settingsItem.setText(trimTanent(((UserPrincipal) user).getTenant()) + "\n"
+ ((UserPrincipal) user).getLoginname().substring(0, 10) + "..");
} else {
settingsItem.setText(
trimTanent(((UserPrincipal) user).getTenant()) + "\n" + ((UserPrincipal) user).getLoginname());
}
settingsItem.setDescription(((UserPrincipal) user).getLoginname());
} else if (user != null) {
settingsItem.setText(user.getUsername());
settingsItem.setDescription(user.getUsername());
final String formattedTenant = UserDetailsFormatter.formatCurrentTenant();
final String formattedUsername = UserDetailsFormatter.formatCurrentUsername();
String tenantAndUsernameHtml = "";
if (!StringUtils.isEmpty(formattedTenant)) {
tenantAndUsernameHtml += formattedTenant + "<br>";
}
tenantAndUsernameHtml += formattedUsername;
settingsItem.setText(tenantAndUsernameHtml);
settingsItem.setDescription(formattedUsername);
settingsItem.setStyleName("user-menuitem");
settingsItem.addItem("Sign Out", selectedItem -> Page.getCurrent().setLocation("/UI/logout"));
return settings;
}
private String concateFNameLName(final String fName, final String lName) {
final StringBuilder userName = new StringBuilder();
if (fName != null && fName.length() > 6) {
userName.append(fName.substring(0, 6) + ".." + ", ");
} else {
userName.append(fName).append(", ");
}
if (lName != null && lName.length() > 6) {
userName.append(lName.substring(0, 6) + "..");
} else {
userName.append(lName);
}
return userName.toString();
}
private String trimTanent(final String tanent) {
if (tanent != null && tanent.length() > 8) {
return tanent.substring(0, 8) + "..";
}
return tanent;
}
private Component buildToggleButton() {
final Button valoMenuToggleButton = new Button("Menu", (ClickListener) event -> {
if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
@@ -264,7 +225,7 @@ public final class DashboardMenu extends CustomComponent {
private VerticalLayout buildMenuItems() {
final VerticalLayout menuItemsLayout = new VerticalLayout();
menuItemsLayout.addStyleName("valo-menuitems");
menuItemsLayout.setHeight(100.0f, Unit.PERCENTAGE);
menuItemsLayout.setHeight(100.0F, Unit.PERCENTAGE);
final List<DashboardMenuItem> accessibleViews = getAccessibleViews();
if (accessibleViews.isEmpty()) {

View File

@@ -209,6 +209,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
actionTypeOptionGroupLayout, linkToHelp, getSaveDiscardButtonLayout());
mainLayout.setComponentAlignment(linkToHelp, Alignment.BOTTOM_RIGHT);
setCompositionRoot(mainLayout);
rolloutName.focus();
}
private HorizontalLayout getGroupDetailsLayout() {

View File

@@ -18,6 +18,7 @@ import org.eclipse.hawkbit.repository.DistributionSetFilter;
import org.eclipse.hawkbit.repository.DistributionSetFilter.DistributionSetFilterBuilder;
import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
@@ -62,7 +63,8 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
sort = new Sort(sortStates[0] ? Direction.ASC : Direction.DESC, (String) sortPropertyIds[0]);
// Add sort
for (int distId = 1; distId < sortPropertyIds.length; distId++) {
sort.and(new Sort(sortStates[distId] ? Direction.ASC : Direction.DESC, (String) sortPropertyIds[distId]));
sort.and(new Sort(sortStates[distId] ? Direction.ASC : Direction.DESC,
(String) sortPropertyIds[distId]));
}
}
}
@@ -103,8 +105,8 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
for (final DistributionSet distributionSet : distBeans) {
final ProxyDistribution proxyDistribution = new ProxyDistribution();
proxyDistribution.setName(HawkbitCommonUtil.getFormattedNameVersion(distributionSet.getName(),
distributionSet.getVersion()));
proxyDistribution.setName(
HawkbitCommonUtil.getFormattedNameVersion(distributionSet.getName(), distributionSet.getVersion()));
proxyDistribution.setDescription(distributionSet.getDescription());
proxyDistribution.setDistId(distributionSet.getId());
proxyDistribution.setId(distributionSet.getId());
@@ -112,8 +114,8 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
proxyDistribution.setCreatedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getCreatedAt()));
proxyDistribution.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getLastModifiedAt()));
proxyDistribution.setDescription(distributionSet.getDescription());
proxyDistribution.setCreatedByUser(HawkbitCommonUtil.getIMUser(distributionSet.getCreatedBy()));
proxyDistribution.setModifiedByUser(HawkbitCommonUtil.getIMUser(distributionSet.getLastModifiedBy()));
proxyDistribution.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(distributionSet));
proxyDistribution.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(distributionSet));
proxyDistribution.setIsComplete(distributionSet.isComplete());
proxyDistributions.add(proxyDistribution);
}

View File

@@ -8,12 +8,16 @@
*/
package org.eclipse.hawkbit.ui.rollout.rollout;
import java.util.Set;
import org.eclipse.hawkbit.repository.model.Rollout;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import com.vaadin.server.FontAwesome;
/**
* Proxy rollout with suctome properties.
* Proxy rollout with custom properties.
*
*/
public class ProxyRollout extends Rollout {
@@ -30,8 +34,92 @@ public class ProxyRollout extends Rollout {
private Boolean isActionRecieved = Boolean.FALSE;
private Boolean isRequiredMigrationStep = Boolean.FALSE;
private String totalTargetsCount;
private RolloutRendererData rolloutRendererData;
private String discription;
private String type;
private Set<SoftwareModule> swModules;
/**
* @return the isRequiredMigrationStep
*/
public Boolean getIsRequiredMigrationStep() {
return isRequiredMigrationStep;
}
/**
* @param isRequiredMigrationStep
* the isRequiredMigrationStep to set
*/
public void setIsRequiredMigrationStep(Boolean isRequiredMigrationStep) {
this.isRequiredMigrationStep = isRequiredMigrationStep;
}
/**
* @return the discription
*/
public String getDiscription() {
return discription;
}
/**
* @param discription
* the discription to set
*/
public void setDiscription(String discription) {
this.discription = discription;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type
* the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
*
* @return the Set of Software modules
*/
public Set<SoftwareModule> getSwModules() {
return swModules;
}
/**
* @param swModules
* Set<SoftwareModule> to set
*/
public void setSwModules(Set<SoftwareModule> swModules) {
this.swModules = swModules;
}
public RolloutRendererData getRolloutRendererData() {
return rolloutRendererData;
}
public void setRolloutRendererData(RolloutRendererData rendererData) {
this.rolloutRendererData = rendererData;
}
/**
* @return the distributionSetNameVersion
*/
@@ -121,10 +209,9 @@ public class ProxyRollout extends Rollout {
public void setTotalTargetsCount(final String totalTargetsCount) {
this.totalTargetsCount = totalTargetsCount;
}
public String getAction() {
public String getAction() {
return FontAwesome.CIRCLE_O.getHtml();
}
}

View File

@@ -17,6 +17,8 @@ import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Rollout;
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
@@ -119,22 +121,29 @@ public class RolloutBeanQuery extends AbstractBeanQuery<ProxyRollout> {
proxyRollout.setName(rollout.getName());
proxyRollout.setDescription(rollout.getDescription());
final DistributionSet distributionSet = rollout.getDistributionSet();
proxyRollout.setDistributionSetNameVersion(HawkbitCommonUtil.getFormattedNameVersion(
distributionSet.getName(), distributionSet.getVersion()));
proxyRollout.setDistributionSetNameVersion(
HawkbitCommonUtil.getFormattedNameVersion(distributionSet.getName(), distributionSet.getVersion()));
proxyRollout.setDistributionSet(distributionSet);
proxyRollout.setNumberOfGroups(Long.valueOf(rollout.getRolloutGroups().size()));
proxyRollout.setCreatedDate(SPDateTimeUtil.getFormattedDate(rollout.getCreatedAt()));
proxyRollout.setModifiedDate(SPDateTimeUtil.getFormattedDate(rollout.getLastModifiedAt()));
proxyRollout.setCreatedBy(HawkbitCommonUtil.getIMUser(rollout.getCreatedBy()));
proxyRollout.setLastModifiedBy(HawkbitCommonUtil.getIMUser(rollout.getLastModifiedBy()));
proxyRollout.setCreatedBy(UserDetailsFormatter.loadAndFormatCreatedBy(rollout));
proxyRollout.setLastModifiedBy(UserDetailsFormatter.loadAndFormatLastModifiedBy(rollout));
proxyRollout.setForcedTime(rollout.getForcedTime());
proxyRollout.setId(rollout.getId());
proxyRollout.setStatus(rollout.getStatus());
proxyRollout
.setRolloutRendererData(new RolloutRendererData(rollout.getName(), rollout.getStatus().toString()));
final TotalTargetCountStatus totalTargetCountActionStatus = rollout.getTotalTargetCountStatus();
proxyRollout.setTotalTargetCountStatus(totalTargetCountActionStatus);
proxyRollout.setTotalTargetsCount(String.valueOf(rollout.getTotalTargets()));
proxyRollout.setDescription(distributionSet.getDescription());
proxyRollout.setType(distributionSet.getType().getName());
proxyRollout.setIsRequiredMigrationStep(distributionSet.isRequiredMigrationStep());
proxyRollout.setSwModules(distributionSet.getModules());
proxyRolloutList.add(proxyRollout);
}
return proxyRolloutList;
@@ -148,7 +157,8 @@ public class RolloutBeanQuery extends AbstractBeanQuery<ProxyRollout> {
* .util.List, java.util.List, java.util.List)
*/
@Override
protected void saveBeans(final List<ProxyRollout> arg0, final List<ProxyRollout> arg1, final List<ProxyRollout> arg2) {
protected void saveBeans(final List<ProxyRollout> arg0, final List<ProxyRollout> arg1,
final List<ProxyRollout> arg2) {
/**
* CRUD operations on Target will be done through repository methods
*/

View File

@@ -8,23 +8,31 @@
*/
package org.eclipse.hawkbit.ui.rollout.rollout;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_LI_CLOSE_TAG;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_LI_OPEN_TAG;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_UL_CLOSE_TAG;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_UL_OPEN_TAG;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.eclipse.hawkbit.eventbus.event.RolloutChangeEvent;
import org.eclipse.hawkbit.repository.RolloutManagement;
import org.eclipse.hawkbit.repository.SpPermissionChecker;
import org.eclipse.hawkbit.repository.model.Rollout;
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
import org.eclipse.hawkbit.ui.common.grid.AbstractGrid;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import org.eclipse.hawkbit.ui.customrenderers.renderers.HtmlButtonRenderer;
import org.eclipse.hawkbit.ui.customrenderers.renderers.HtmlLabelRenderer;
import org.eclipse.hawkbit.ui.customrenderers.renderers.LinkRenderer;
import org.eclipse.hawkbit.ui.customrenderers.renderers.RolloutRenderer;
import org.eclipse.hawkbit.ui.rollout.DistributionBarHelper;
import org.eclipse.hawkbit.ui.rollout.StatusFontIcon;
import org.eclipse.hawkbit.ui.rollout.event.RolloutEvent;
@@ -77,6 +85,13 @@ public class RolloutListGrid extends AbstractGrid {
private static final String START_OPTION = "Start";
private static final String DS_TYPE = "type";
private static final String SW_MODULES = "swModules";
private static final String IS_REQUIRED_MIGRATION_STEP = "isRequiredMigrationStep";
private static final String ROLLOUT_RENDERER_DATA = "rolloutRendererData";
@Autowired
private transient RolloutManagement rolloutManagement;
@@ -95,7 +110,10 @@ public class RolloutListGrid extends AbstractGrid {
private transient Map<RolloutStatus, StatusFontIcon> statusIconMap = new EnumMap<>(RolloutStatus.class);
/**
* Handles the RolloutEvent to refresh Grid.
*
*/
@EventBusListenerMethod(scope = EventScope.SESSION)
void onEvent(final RolloutEvent event) {
switch (event) {
@@ -132,10 +150,16 @@ public class RolloutListGrid extends AbstractGrid {
item.getItemProperty(SPUILabelDefinitions.VAR_STATUS).setValue(rollout.getStatus());
item.getItemProperty(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS).setValue(totalTargetCountStatus);
final Long groupCount = (Long) item.getItemProperty(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS).getValue();
if (rollout.getRolloutGroups() != null && groupCount != rollout.getRolloutGroups().size()) {
final int groupsCreated = rollout.getRolloutGroupsCreated();
if (groupsCreated != 0) {
item.getItemProperty(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS).setValue(Long.valueOf(groupsCreated));
} else if (rollout.getRolloutGroups() != null && groupCount != rollout.getRolloutGroups().size()) {
item.getItemProperty(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS)
.setValue(Long.valueOf(rollout.getRolloutGroups().size()));
}
item.getItemProperty(ROLLOUT_RENDERER_DATA)
.setValue(new RolloutRendererData(rollout.getName(), rollout.getStatus().toString()));
}
@Override
@@ -149,7 +173,11 @@ public class RolloutListGrid extends AbstractGrid {
protected void addContainerProperties() {
final LazyQueryContainer rolloutGridContainer = (LazyQueryContainer) getContainerDataSource();
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, "", false, false);
rolloutGridContainer.addContainerProperty(DS_TYPE, String.class, null, false, false);
rolloutGridContainer.addContainerProperty(SW_MODULES, Set.class, null, false, false);
rolloutGridContainer.addContainerProperty(ROLLOUT_RENDERER_DATA, RolloutRendererData.class, null, false, false);
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, null, false, false);
rolloutGridContainer.addContainerProperty(IS_REQUIRED_MIGRATION_STEP, boolean.class, null, false, false);
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_STATUS, RolloutStatus.class, null, false,
false);
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_DIST_NAME_VERSION, String.class, null, false,
@@ -163,7 +191,7 @@ public class RolloutListGrid extends AbstractGrid {
false);
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_MODIFIED_BY, String.class, null, false,
false);
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS, Integer.class, 0, false,
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS, Long.class, 0, false,
false);
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_TOTAL_TARGETS, String.class, "0", false,
false);
@@ -177,8 +205,9 @@ public class RolloutListGrid extends AbstractGrid {
@Override
protected void setColumnExpandRatio() {
getColumn(SPUILabelDefinitions.VAR_NAME).setMinimumWidth(40);
getColumn(SPUILabelDefinitions.VAR_NAME).setMaximumWidth(150);
getColumn(ROLLOUT_RENDERER_DATA).setMinimumWidth(40);
getColumn(ROLLOUT_RENDERER_DATA).setMaximumWidth(150);
getColumn(SPUILabelDefinitions.VAR_DIST_NAME_VERSION).setMinimumWidth(40);
getColumn(SPUILabelDefinitions.VAR_DIST_NAME_VERSION).setMaximumWidth(150);
@@ -202,7 +231,10 @@ public class RolloutListGrid extends AbstractGrid {
@Override
protected void setColumnHeaderNames() {
getColumn(SPUILabelDefinitions.VAR_NAME).setHeaderCaption(i18n.get("header.name"));
getColumn(ROLLOUT_RENDERER_DATA).setHeaderCaption(i18n.get("header.name"));
getColumn(DS_TYPE).setHeaderCaption("Type");
getColumn(SW_MODULES).setHeaderCaption("swModules");
getColumn(IS_REQUIRED_MIGRATION_STEP).setHeaderCaption("IsRequiredMigrationStep");
getColumn(SPUILabelDefinitions.VAR_DIST_NAME_VERSION).setHeaderCaption(i18n.get("header.distributionset"));
getColumn(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS).setHeaderCaption(i18n.get("header.numberofgroups"));
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS).setHeaderCaption(i18n.get("header.total.targets"));
@@ -225,8 +257,11 @@ public class RolloutListGrid extends AbstractGrid {
@Override
protected void setColumnProperties() {
final List<Object> columnList = new ArrayList<>();
columnList.add(SPUILabelDefinitions.VAR_NAME);
columnList.add(ROLLOUT_RENDERER_DATA);
columnList.add(SPUILabelDefinitions.VAR_DIST_NAME_VERSION);
columnList.add(DS_TYPE);
columnList.add(SW_MODULES);
columnList.add(IS_REQUIRED_MIGRATION_STEP);
columnList.add(SPUILabelDefinitions.VAR_STATUS);
columnList.add(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS);
columnList.add(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS);
@@ -245,11 +280,15 @@ public class RolloutListGrid extends AbstractGrid {
@Override
protected void setHiddenColumns() {
final List<Object> columnsToBeHidden = new ArrayList<>();
columnsToBeHidden.add(SPUILabelDefinitions.VAR_NAME);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_CREATED_DATE);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_CREATED_USER);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_MODIFIED_DATE);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_MODIFIED_BY);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_DESC);
columnsToBeHidden.add(IS_REQUIRED_MIGRATION_STEP);
columnsToBeHidden.add(DS_TYPE);
columnsToBeHidden.add(SW_MODULES);
for (final Object propertyId : columnsToBeHidden) {
getColumn(propertyId).setHidden(true);
}
@@ -263,6 +302,8 @@ public class RolloutListGrid extends AbstractGrid {
@Override
protected void addColumnRenderes() {
getColumn(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS).setRenderer(new HtmlRenderer(),
new TotalTargetGroupsConverter());
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS).setRenderer(new HtmlRenderer(),
new TotalTargetCountStatusConverter());
@@ -270,7 +311,11 @@ public class RolloutListGrid extends AbstractGrid {
getColumn(SPUILabelDefinitions.VAR_STATUS).setRenderer(new HtmlLabelRenderer(), new RolloutStatusConverter());
getColumn(SPUILabelDefinitions.ACTION).setRenderer(new HtmlButtonRenderer(event -> onClickOfActionBtn(event)));
getColumn(SPUILabelDefinitions.VAR_NAME).setRenderer(new LinkRenderer(event -> onClickOfRolloutName(event)));
final RolloutRenderer customObjectRenderer = new RolloutRenderer(RolloutRendererData.class);
customObjectRenderer.addClickListener(event -> onClickOfRolloutName(event));
getColumn(ROLLOUT_RENDERER_DATA).setRenderer(customObjectRenderer);
}
private void createRolloutStatusToFontMap() {
@@ -403,6 +448,9 @@ public class RolloutListGrid extends AbstractGrid {
((LazyQueryContainer) getContainerDataSource()).refresh();
}
/**
* Generator to generate fontIcon by String.
*/
public final class FontIconGenerator extends PropertyValueGenerator<String> {
private static final long serialVersionUID = 2544026030795375748L;
@@ -428,15 +476,54 @@ public class RolloutListGrid extends AbstractGrid {
return cell.getProperty().getValue().toString().toLowerCase();
} else if (SPUILabelDefinitions.ACTION.equals(cell.getPropertyId())) {
return SPUILabelDefinitions.ACTION.toLowerCase();
} else if (SPUILabelDefinitions.VAR_NAME.equals(cell.getPropertyId())) {
return cell.getProperty().getValue().toString();
} else if (ROLLOUT_RENDERER_DATA.equals(cell.getPropertyId())) {
return ((RolloutRendererData) cell.getProperty().getValue()).getName();
} else if (SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS.equals(cell.getPropertyId())) {
return DistributionBarHelper
.getTooltip(((TotalTargetCountStatus) cell.getValue()).getStatusTotalCountMap());
} else if (SPUILabelDefinitions.VAR_DIST_NAME_VERSION.equals(cell.getPropertyId())) {
return getDSDetails(cell.getItem());
}
return null;
}
private String getDSDetails(final Item rolloutItem) {
final StringBuilder swModuleNames = new StringBuilder();
final StringBuilder swModuleVendors = new StringBuilder();
final Set<SoftwareModule> swModules = (Set<SoftwareModule>) rolloutItem.getItemProperty(SW_MODULES).getValue();
swModules.forEach(swModule -> {
swModuleNames.append(swModule.getName());
swModuleNames.append(" , ");
swModuleVendors.append(swModule.getVendor());
swModuleVendors.append(" , ");
});
final StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(HTML_UL_OPEN_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append(" DistributionSet Description : ")
.append((String) rolloutItem.getItemProperty(SPUILabelDefinitions.VAR_DESC).getValue());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append(" DistributionSet Type : ")
.append((String) rolloutItem.getItemProperty(DS_TYPE).getValue());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append("Required Migration step : ")
.append((boolean) rolloutItem.getItemProperty(IS_REQUIRED_MIGRATION_STEP).getValue() ? "Yes" : "No");
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append("SoftWare Modules : ").append(swModuleNames.toString());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append("Vendor(s) : ").append(swModuleVendors.toString());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_UL_CLOSE_TAG);
return stringBuilder.toString();
}
enum ACTION {
PAUSE, RESUME, START, UPDATE
}
@@ -568,4 +655,39 @@ public class RolloutListGrid extends AbstractGrid {
}
}
/**
* Converter to convert 0 to empty, if total target groups is zero.
*
*/
class TotalTargetGroupsConverter implements Converter<String, Long> {
private static final long serialVersionUID = 6589305227035220369L;
@Override
public Long convertToModel(final String value, final Class<? extends Long> targetType, final Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
return null;
}
@Override
public String convertToPresentation(final Long value, final Class<? extends String> targetType,
final Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException {
if (value == 0) {
return "";
}
return value.toString();
}
@Override
public Class<Long> getModelType() {
return Long.class;
}
@Override
public Class<String> getPresentationType() {
return String.class;
}
}
}

View File

@@ -9,200 +9,211 @@
package org.eclipse.hawkbit.ui.rollout.rolloutgroup;
import org.eclipse.hawkbit.repository.model.RolloutGroup;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
/**
* Proxy rollout group with suctome properties.
* Proxy rollout group with renderer properties.
*
*/
public class ProxyRolloutGroup extends RolloutGroup {
private static final long serialVersionUID = -2745056813306692356L;
private static final long serialVersionUID = -2745056813306692356L;
private String createdDate;
private String createdDate;
private String modifiedDate;
private String modifiedDate;
private String finishedPercentage;
private String finishedPercentage;
private Long runningTargetsCount;
private Long runningTargetsCount;
private Long scheduledTargetsCount;
private Long scheduledTargetsCount;
private Long cancelledTargetsCount;
private Long cancelledTargetsCount;
private Long errorTargetsCount;
private Long errorTargetsCount;
private Long finishedTargetsCount;
private Long finishedTargetsCount;
private Long notStartedTargetsCount;
private Long notStartedTargetsCount;
private Boolean isActionRecieved = Boolean.FALSE;
private Boolean isActionRecieved = Boolean.FALSE;
private String totalTargetsCount;
private String totalTargetsCount;
/**
* @return the createdDate
*/
public String getCreatedDate() {
return createdDate;
}
private RolloutRendererData rolloutRendererData;
/**
* @param createdDate
* the createdDate to set
*/
public void setCreatedDate(final String createdDate) {
this.createdDate = createdDate;
}
public RolloutRendererData getRolloutRendererData() {
return rolloutRendererData;
}
/**
* @return the modifiedDate
*/
public String getModifiedDate() {
return modifiedDate;
}
public void setRolloutRendererData(RolloutRendererData rendererData) {
this.rolloutRendererData = rendererData;
}
/**
* @param modifiedDate
* the modifiedDate to set
*/
public void setModifiedDate(final String modifiedDate) {
this.modifiedDate = modifiedDate;
}
/**
* @return the createdDate
*/
public String getCreatedDate() {
return createdDate;
}
/**
* @return the finishedPercentage
*/
public String getFinishedPercentage() {
return finishedPercentage;
}
/**
* @param createdDate
* the createdDate to set
*/
public void setCreatedDate(final String createdDate) {
this.createdDate = createdDate;
}
/**
* @param finishedPercentage
* the finishedPercentage to set
*/
public void setFinishedPercentage(final String finishedPercentage) {
this.finishedPercentage = finishedPercentage;
}
/**
* @return the modifiedDate
*/
public String getModifiedDate() {
return modifiedDate;
}
/**
* @return the runningTargetsCount
*/
public Long getRunningTargetsCount() {
return runningTargetsCount;
}
/**
* @param modifiedDate
* the modifiedDate to set
*/
public void setModifiedDate(final String modifiedDate) {
this.modifiedDate = modifiedDate;
}
/**
* @param runningTargetsCount
* the runningTargetsCount to set
*/
public void setRunningTargetsCount(final Long runningTargetsCount) {
this.runningTargetsCount = runningTargetsCount;
}
/**
* @return the finishedPercentage
*/
public String getFinishedPercentage() {
return finishedPercentage;
}
/**
* @return the scheduledTargetsCount
*/
public Long getScheduledTargetsCount() {
return scheduledTargetsCount;
}
/**
* @param finishedPercentage
* the finishedPercentage to set
*/
public void setFinishedPercentage(final String finishedPercentage) {
this.finishedPercentage = finishedPercentage;
}
/**
* @param scheduledTargetsCount
* the scheduledTargetsCount to set
*/
public void setScheduledTargetsCount(final Long scheduledTargetsCount) {
this.scheduledTargetsCount = scheduledTargetsCount;
}
/**
* @return the runningTargetsCount
*/
public Long getRunningTargetsCount() {
return runningTargetsCount;
}
/**
* @return the cancelledTargetsCount
*/
public Long getCancelledTargetsCount() {
return cancelledTargetsCount;
}
/**
* @param runningTargetsCount
* the runningTargetsCount to set
*/
public void setRunningTargetsCount(final Long runningTargetsCount) {
this.runningTargetsCount = runningTargetsCount;
}
/**
* @param cancelledTargetsCount
* the cancelledTargetsCount to set
*/
public void setCancelledTargetsCount(final Long cancelledTargetsCount) {
this.cancelledTargetsCount = cancelledTargetsCount;
}
/**
* @return the scheduledTargetsCount
*/
public Long getScheduledTargetsCount() {
return scheduledTargetsCount;
}
/**
* @return the errorTargetsCount
*/
public Long getErrorTargetsCount() {
return errorTargetsCount;
}
/**
* @param scheduledTargetsCount
* the scheduledTargetsCount to set
*/
public void setScheduledTargetsCount(final Long scheduledTargetsCount) {
this.scheduledTargetsCount = scheduledTargetsCount;
}
/**
* @param errorTargetsCount
* the errorTargetsCount to set
*/
public void setErrorTargetsCount(final Long errorTargetsCount) {
this.errorTargetsCount = errorTargetsCount;
}
/**
* @return the cancelledTargetsCount
*/
public Long getCancelledTargetsCount() {
return cancelledTargetsCount;
}
/**
* @return the finishedTargetsCount
*/
public Long getFinishedTargetsCount() {
return finishedTargetsCount;
}
/**
* @param cancelledTargetsCount
* the cancelledTargetsCount to set
*/
public void setCancelledTargetsCount(final Long cancelledTargetsCount) {
this.cancelledTargetsCount = cancelledTargetsCount;
}
/**
* @param finishedTargetsCount
* the finishedTargetsCount to set
*/
public void setFinishedTargetsCount(final Long finishedTargetsCount) {
this.finishedTargetsCount = finishedTargetsCount;
}
/**
* @return the errorTargetsCount
*/
public Long getErrorTargetsCount() {
return errorTargetsCount;
}
/**
* @return the notStartedTargetsCount
*/
public Long getNotStartedTargetsCount() {
return notStartedTargetsCount;
}
/**
* @param errorTargetsCount
* the errorTargetsCount to set
*/
public void setErrorTargetsCount(final Long errorTargetsCount) {
this.errorTargetsCount = errorTargetsCount;
}
/**
* @param notStartedTargetsCount
* the notStartedTargetsCount to set
*/
public void setNotStartedTargetsCount(final Long notStartedTargetsCount) {
this.notStartedTargetsCount = notStartedTargetsCount;
}
/**
* @return the finishedTargetsCount
*/
public Long getFinishedTargetsCount() {
return finishedTargetsCount;
}
/**
* @return the isActionRecieved
*/
public Boolean getIsActionRecieved() {
return isActionRecieved;
}
/**
* @param finishedTargetsCount
* the finishedTargetsCount to set
*/
public void setFinishedTargetsCount(final Long finishedTargetsCount) {
this.finishedTargetsCount = finishedTargetsCount;
}
/**
* @param isActionRecieved
* the isActionRecieved to set
*/
public void setIsActionRecieved(final Boolean isActionRecieved) {
this.isActionRecieved = isActionRecieved;
}
/**
* @return the notStartedTargetsCount
*/
public Long getNotStartedTargetsCount() {
return notStartedTargetsCount;
}
/**
* @return the totalTargetsCount
*/
public String getTotalTargetsCount() {
return totalTargetsCount;
}
/**
* @param notStartedTargetsCount
* the notStartedTargetsCount to set
*/
public void setNotStartedTargetsCount(final Long notStartedTargetsCount) {
this.notStartedTargetsCount = notStartedTargetsCount;
}
/**
* @param totalTargetsCount
* the totalTargetsCount to set
*/
public void setTotalTargetsCount(final String totalTargetsCount) {
this.totalTargetsCount = totalTargetsCount;
}
/**
* @return the isActionRecieved
*/
public Boolean getIsActionRecieved() {
return isActionRecieved;
}
/**
* @param isActionRecieved
* the isActionRecieved to set
*/
public void setIsActionRecieved(final Boolean isActionRecieved) {
this.isActionRecieved = isActionRecieved;
}
/**
* @return the totalTargetsCount
*/
public String getTotalTargetsCount() {
return totalTargetsCount;
}
/**
* @param totalTargetsCount
* the totalTargetsCount to set
*/
public void setTotalTargetsCount(final String totalTargetsCount) {
this.totalTargetsCount = totalTargetsCount;
}
}

View File

@@ -15,6 +15,8 @@ import java.util.Map;
import org.eclipse.hawkbit.repository.RolloutGroupManagement;
import org.eclipse.hawkbit.repository.RolloutManagement;
import org.eclipse.hawkbit.repository.model.RolloutGroup;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
@@ -110,8 +112,8 @@ public class RolloutGroupBeanQuery extends AbstractBeanQuery<ProxyRolloutGroup>
proxyRolloutGroup.setDescription(rolloutGroup.getDescription());
proxyRolloutGroup.setCreatedDate(SPDateTimeUtil.getFormattedDate(rolloutGroup.getCreatedAt()));
proxyRolloutGroup.setModifiedDate(SPDateTimeUtil.getFormattedDate(rolloutGroup.getLastModifiedAt()));
proxyRolloutGroup.setCreatedBy(HawkbitCommonUtil.getIMUser(rolloutGroup.getCreatedBy()));
proxyRolloutGroup.setLastModifiedBy(HawkbitCommonUtil.getIMUser(rolloutGroup.getLastModifiedBy()));
proxyRolloutGroup.setCreatedBy(UserDetailsFormatter.loadAndFormatCreatedBy(rolloutGroup));
proxyRolloutGroup.setLastModifiedBy(UserDetailsFormatter.loadAndFormatLastModifiedBy(rolloutGroup));
proxyRolloutGroup.setId(rolloutGroup.getId());
proxyRolloutGroup.setStatus(rolloutGroup.getStatus());
proxyRolloutGroup.setErrorAction(rolloutGroup.getErrorAction());
@@ -122,6 +124,8 @@ public class RolloutGroupBeanQuery extends AbstractBeanQuery<ProxyRolloutGroup>
proxyRolloutGroup.setSuccessConditionExp(rolloutGroup.getSuccessConditionExp());
proxyRolloutGroup.setFinishedPercentage(calculateFinishedPercentage(rolloutGroup));
proxyRolloutGroup.setRolloutRendererData(new RolloutRendererData(rolloutGroup.getName(), null));
proxyRolloutGroup.setTotalTargetsCount(String.valueOf(rolloutGroup.getTotalTargets()));
proxyRolloutGroup.setTotalTargetCountStatus(rolloutGroup.getTotalTargetCountStatus());

View File

@@ -17,13 +17,15 @@ import java.util.Map;
import org.eclipse.hawkbit.eventbus.event.RolloutGroupChangeEvent;
import org.eclipse.hawkbit.repository.RolloutGroupManagement;
import org.eclipse.hawkbit.repository.RolloutManagement;
import org.eclipse.hawkbit.repository.SpPermissionChecker;
import org.eclipse.hawkbit.repository.model.RolloutGroup;
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupStatus;
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
import org.eclipse.hawkbit.ui.common.grid.AbstractGrid;
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
import org.eclipse.hawkbit.ui.customrenderers.renderers.HtmlLabelRenderer;
import org.eclipse.hawkbit.ui.customrenderers.renderers.LinkRenderer;
import org.eclipse.hawkbit.ui.customrenderers.renderers.RolloutRenderer;
import org.eclipse.hawkbit.ui.rollout.DistributionBarHelper;
import org.eclipse.hawkbit.ui.rollout.StatusFontIcon;
import org.eclipse.hawkbit.ui.rollout.event.RolloutEvent;
@@ -59,9 +61,14 @@ import com.vaadin.ui.renderers.HtmlRenderer;
public class RolloutGroupListGrid extends AbstractGrid {
private static final long serialVersionUID = 4060904914954370524L;
private static final String ROLLOUT_RENDERER_DATA = "rolloutRendererData";
@Autowired
private transient RolloutGroupManagement rolloutGroupManagement;
@Autowired
private transient RolloutManagement rolloutManagement;
@Autowired
private transient RolloutUIState rolloutUIState;
@@ -103,6 +110,13 @@ public class RolloutGroupListGrid extends AbstractGrid {
item.getItemProperty(SPUILabelDefinitions.VAR_STATUS).setValue(rolloutGroup.getStatus());
item.getItemProperty(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS)
.setValue(rolloutGroup.getTotalTargetCountStatus());
item.getItemProperty(SPUILabelDefinitions.ROLLOUT_GROUP_INSTALLED_PERCENTAGE)
.setValue(calculateFinishedPercentage(rolloutGroup));
}
private String calculateFinishedPercentage(final RolloutGroup rolloutGroup) {
return HawkbitCommonUtil.formattingFinishedPercentage(rolloutGroup,
rolloutManagement.getFinishedPercentForRunningGroup(rolloutGroup.getRollout().getId(), rolloutGroup));
}
@Override
@@ -116,6 +130,9 @@ public class RolloutGroupListGrid extends AbstractGrid {
protected void addContainerProperties() {
final LazyQueryContainer rolloutGroupGridContainer = (LazyQueryContainer) getContainerDataSource();
rolloutGroupGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, "", false, false);
rolloutGroupGridContainer.addContainerProperty(ROLLOUT_RENDERER_DATA, RolloutRendererData.class, null, false,
false);
rolloutGroupGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, null, false, false);
rolloutGroupGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_STATUS, RolloutGroupStatus.class, null,
false, false);
@@ -145,8 +162,8 @@ public class RolloutGroupListGrid extends AbstractGrid {
@Override
protected void setColumnExpandRatio() {
getColumn(SPUILabelDefinitions.VAR_NAME).setMinimumWidth(40);
getColumn(SPUILabelDefinitions.VAR_NAME).setMaximumWidth(200);
getColumn(ROLLOUT_RENDERER_DATA).setMinimumWidth(40);
getColumn(ROLLOUT_RENDERER_DATA).setMaximumWidth(200);
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS).setMinimumWidth(40);
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS).setMaximumWidth(100);
@@ -170,7 +187,7 @@ public class RolloutGroupListGrid extends AbstractGrid {
@Override
protected void setColumnHeaderNames() {
getColumn(SPUILabelDefinitions.VAR_NAME).setHeaderCaption(i18n.get("header.name"));
getColumn(ROLLOUT_RENDERER_DATA).setHeaderCaption(i18n.get("header.name"));
getColumn(SPUILabelDefinitions.VAR_STATUS).setHeaderCaption(i18n.get("header.status"));
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS)
.setHeaderCaption(i18n.get("header.detail.status"));
@@ -196,7 +213,7 @@ public class RolloutGroupListGrid extends AbstractGrid {
@Override
protected void setColumnProperties() {
final List<Object> columnList = new ArrayList<>();
columnList.add(SPUILabelDefinitions.VAR_NAME);
columnList.add(ROLLOUT_RENDERER_DATA);
columnList.add(SPUILabelDefinitions.VAR_STATUS);
columnList.add(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS);
columnList.add(SPUILabelDefinitions.VAR_TOTAL_TARGETS);
@@ -221,14 +238,15 @@ public class RolloutGroupListGrid extends AbstractGrid {
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS).setRenderer(new HtmlRenderer(),
new TotalTargetCountStatusConverter());
if (permissionChecker.hasRolloutTargetsReadPermission()) {
getColumn(SPUILabelDefinitions.VAR_NAME)
.setRenderer(new LinkRenderer(event -> onClickOfRolloutGroupName(event)));
getColumn(ROLLOUT_RENDERER_DATA)
.setRenderer(new RolloutRenderer(event -> onClickOfRolloutGroupName(event)));
}
}
@Override
protected void setHiddenColumns() {
final List<Object> columnsToBeHidden = new ArrayList<>();
columnsToBeHidden.add(SPUILabelDefinitions.VAR_NAME);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_CREATED_DATE);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_CREATED_USER);
columnsToBeHidden.add(SPUILabelDefinitions.VAR_MODIFIED_DATE);
@@ -268,8 +286,8 @@ public class RolloutGroupListGrid extends AbstractGrid {
return cell.getProperty().getValue().toString().toLowerCase();
} else if (SPUILabelDefinitions.ACTION.equals(cell.getPropertyId())) {
return SPUILabelDefinitions.ACTION.toLowerCase();
} else if (SPUILabelDefinitions.VAR_NAME.equals(cell.getPropertyId())) {
return cell.getProperty().getValue().toString();
} else if (ROLLOUT_RENDERER_DATA.equals(cell.getPropertyId())) {
return ((RolloutRendererData) cell.getProperty().getValue()).getName();
} else if (SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS.equals(cell.getPropertyId())) {
return DistributionBarHelper
.getTooltip(((TotalTargetCountStatus) cell.getValue()).getStatusTotalCountMap());
@@ -306,14 +324,14 @@ public class RolloutGroupListGrid extends AbstractGrid {
@Override
public TotalTargetCountStatus convertToModel(final String value,
final Class<? extends TotalTargetCountStatus> targetType, final Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
throws com.vaadin.data.util.converter.Converter.ConversionException {
return null;
}
@Override
public String convertToPresentation(final TotalTargetCountStatus value,
final Class<? extends String> targetType, final Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
throws com.vaadin.data.util.converter.Converter.ConversionException {
return DistributionBarHelper.getDistributionBarAsHTMLString(value.getStatusTotalCountMap());
}

View File

@@ -161,6 +161,7 @@ public class RolloutGroupsListHeader extends AbstractGridHeader {
final HorizontalLayout headerCaptionLayout = new HorizontalLayout();
headerCaptionLayout.addComponent(rolloutsListViewLink);
headerCaptionLayout.addComponent(new Label(">"));
headerCaption.addStyleName("breadcrumbPaddingLeft");
headerCaptionLayout.addComponent(headerCaption);
return headerCaptionLayout;

View File

@@ -17,6 +17,7 @@ import org.eclipse.hawkbit.repository.RolloutManagement;
import org.eclipse.hawkbit.repository.model.RolloutGroup;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetWithActionStatus;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyTarget;
import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
@@ -105,8 +106,8 @@ public class RolloutGroupTargetsBeanQuery extends AbstractBeanQuery<ProxyTarget>
prxyTarget.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(targ.getLastModifiedAt()));
prxyTarget.setCreatedDate(SPDateTimeUtil.getFormattedDate(targ.getCreatedAt()));
prxyTarget.setCreatedAt(targ.getCreatedAt());
prxyTarget.setCreatedByUser(HawkbitCommonUtil.getIMUser(targ.getCreatedBy()));
prxyTarget.setModifiedByUser(HawkbitCommonUtil.getIMUser(targ.getLastModifiedBy()));
prxyTarget.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(targ));
prxyTarget.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(targ));
if (targetWithActionStatus.getStatus() != null) {
prxyTarget.setStatus(targetWithActionStatus.getStatus());
}

View File

@@ -113,7 +113,7 @@ public class AuthenticationConfigurationView extends BaseConfigurationView
downloadAnonymousCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
downloadAnonymousCheckBox.setId("downloadanonymouscheckbox");
downloadAnonymousCheckBox.setValue(targetSecurityTokenAuthenticationConfigurationItem.isConfigEnabled());
downloadAnonymousCheckBox.setValue(anonymousDownloadAuthenticationConfigurationItem.isConfigEnabled());
downloadAnonymousCheckBox.addValueChangeListener(this);
anonymousDownloadAuthenticationConfigurationItem.addChangeListener(this);
gridLayout.addComponent(downloadAnonymousCheckBox, 0, 3);

View File

@@ -0,0 +1,83 @@
/**
* 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.ui.utils;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_LI_CLOSE_TAG;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_LI_OPEN_TAG;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_UL_CLOSE_TAG;
import static org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil.HTML_UL_OPEN_TAG;
import java.util.Set;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import com.vaadin.data.Item;
import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.Component;
import com.vaadin.ui.Table;
public class AssignInstalledDSTooltipGenerator implements ItemDescriptionGenerator {
private static final long serialVersionUID = 688730421728162456L;
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
private static final String INSTALL_DIST_SET = "installedDistributionSet";
@Override
public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
final DistributionSet distributionSet;
final Item item = ((Table) source).getItem(itemId);
if (propertyId != null) {
if (propertyId.equals(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER)) {
distributionSet = (DistributionSet) item.getItemProperty(ASSIGN_DIST_SET).getValue();
return getDSDetails(distributionSet);
} else if (propertyId.equals(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER)) {
distributionSet = (DistributionSet) item.getItemProperty(INSTALL_DIST_SET).getValue();
return getDSDetails(distributionSet);
}
}
return null;
}
private String getDSDetails(final DistributionSet distributionSet) {
if (distributionSet == null) {
return null;
}
final StringBuilder swModuleNames = new StringBuilder();
final StringBuilder swModuleVendors = new StringBuilder();
final Set<SoftwareModule> swModules = distributionSet.getModules();
swModules.forEach(swModule -> {
swModuleNames.append(swModule.getName());
swModuleNames.append(" , ");
swModuleVendors.append(swModule.getVendor());
swModuleVendors.append(" , ");
});
final StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(HTML_UL_OPEN_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append(" DistributionSet Description : ").append(distributionSet.getDescription());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append(" DistributionSet Type : ").append((distributionSet.getType()).getName());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append(" Required Migration step : ")
.append(distributionSet.isRequiredMigrationStep() ? "Yes" : "No");
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append("SoftWare Modules : ").append(swModuleNames.toString());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append("Vendor(s) : ").append(swModuleVendors.toString());
stringBuilder.append(HTML_LI_CLOSE_TAG);
stringBuilder.append(HTML_UL_CLOSE_TAG);
return stringBuilder.toString();
}
}

View File

@@ -20,9 +20,9 @@ import java.util.Map.Entry;
import java.util.TimeZone;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.im.authentication.UserPrincipal;
import org.eclipse.hawkbit.repository.SoftwareManagement;
import org.eclipse.hawkbit.repository.model.AssignmentResult;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.NamedEntity;
import org.eclipse.hawkbit.repository.model.RolloutGroup;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
@@ -34,9 +34,6 @@ import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus.Status;
import org.eclipse.hawkbit.ui.rollout.StatusFontIcon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
@@ -76,6 +73,11 @@ public final class HawkbitCommonUtil {
*/
public static final String SPAN_CLOSE = "</span>";
public static final String HTML_LI_CLOSE_TAG = "</li>";
public static final String HTML_LI_OPEN_TAG = "<li>";
public static final String HTML_UL_CLOSE_TAG = "</ul>";
public static final String HTML_UL_OPEN_TAG = "<ul>";
private static final Logger LOG = LoggerFactory.getLogger(HawkbitCommonUtil.class);
private static final String JS_DRAG_COUNT_REM_CHILD = " if(x) { document.head.removeChild(x); } ";
@@ -107,6 +109,9 @@ public final class HawkbitCommonUtil {
private static final String DELETE_DROP_CREATE_SCRIPT = "var q = document.getElementById('show-delete-drop-hint'); if(q) { } else { showDeleteDrop = document.createElement('style'); showDeleteDrop.id=\"show-delete-drop-hint\"; document.head.appendChild(showDeleteDrop); }";
private static final String DELETE_TAG_DROP_REMOVE_SCRIPT = "var o = document.getElementById('show-delete-drop-hint'); if(o) { document.head.removeChild(o); } ";
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
private static final String INSTALL_DIST_SET = "installedDistributionSet";
/**
* Define empty string.
*/
@@ -605,31 +610,6 @@ public final class HawkbitCommonUtil {
return requiredExtraWidth + minTableWidth;
}
/**
* get formatted name - lastname,firstname.
*
* @param user
* user name
* @return String formatted name
*/
public static String getFormattedName(final UserDetails user) {
final StringBuilder formattedName = new StringBuilder();
if (user instanceof UserPrincipal) {
if (trimAndNullIfEmpty(((UserPrincipal) user).getLastname()) != null) {
formattedName.append(((UserPrincipal) user).getLastname());
}
if (trimAndNullIfEmpty(((UserPrincipal) user).getFirstname()) != null) {
if (formattedName.length() > 0) {
formattedName.append(", ");
}
formattedName.append(((UserPrincipal) user).getFirstname());
}
} else if (user != null) {
formattedName.append(user.getUsername());
}
return formattedName.toString();
}
/**
* get the Last sequence of string which is after last dot in String.
*
@@ -686,30 +666,6 @@ public final class HawkbitCommonUtil {
return exeJS.toString();
}
/**
* Get IM User for user UUID.
*
* @param uuid
* @return imReslovedUser user details
*/
public static String getIMUser(final String uuid) {
// Get modifed user
String imReslovedUser = HawkbitCommonUtil.SP_STRING_SPACE;
if (HawkbitCommonUtil.trimAndNullIfEmpty(uuid) != null) {
final UserDetailsService idManagement = SpringContextHelper.getBean(UserDetailsService.class);
try {
imReslovedUser = HawkbitCommonUtil.getFormattedName(idManagement.loadUserByUsername(uuid));
} catch (final UsernameNotFoundException e) { // NOSONAR
// nope not need to handle
}
// If Null display the UID
if (HawkbitCommonUtil.trimAndNullIfEmpty(imReslovedUser) == null) {
imReslovedUser = uuid;
}
}
return imReslovedUser;
}
/**
* Get formatted label.Appends ellipses if content does not fit the label.
*
@@ -1090,6 +1046,10 @@ public final class HawkbitCommonUtil {
targetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP, String.class, null,
false, true);
targetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false, true);
targetTableContainer.addContainerProperty(ASSIGN_DIST_SET, DistributionSet.class, null, false, true);
targetTableContainer.addContainerProperty(INSTALL_DIST_SET, DistributionSet.class, null, false, true);
}
/**

View File

@@ -15,7 +15,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.eclipse.hawkbit.repository.model.BaseEntity;
import com.vaadin.server.WebBrowser;
@@ -80,14 +82,45 @@ public final class SPDateTimeUtil {
* @param lastQueryDate
* @return String formatted date
*/
public static String getFormattedDate(final Long lastQueryDate) {
return formatDate(lastQueryDate, null);
}
/**
* Get formatted date 'created at' by entity.
*
* @param baseEntity
* the entity
* @return String formatted date
*/
public static String formatCreatedAt(final BaseEntity baseEntity) {
if (baseEntity == null) {
return StringUtils.EMPTY;
}
return formatDate(baseEntity.getCreatedAt(), StringUtils.EMPTY);
}
/**
* Get formatted date 'last modified at' by entity.
*
* @param baseEntity
* the entity
* @return String formatted date
*/
public static String formatLastModifiedAt(final BaseEntity baseEntity) {
if (baseEntity == null) {
return StringUtils.EMPTY;
}
return formatDate(baseEntity.getLastModifiedAt(), StringUtils.EMPTY);
}
private static String formatDate(final Long lastQueryDate, final String defaultString) {
if (lastQueryDate != null) {
final SimpleDateFormat format = new SimpleDateFormat(SPUIDefinitions.LAST_QUERY_DATE_FORMAT);
format.setTimeZone(getBrowserTimeZone());
return format.format(new Date(lastQueryDate));
}
return null;
return defaultString;
}
/**

View File

@@ -599,7 +599,7 @@ public final class SPUIComponetIdProvider {
/**
* Documentation Link in Login view and menu.
*/
public static final String LINK_DOCUMENATION = "link.documentation";
public static final String LINK_DOCUMENTATION = "link.documentation";
/**
* Demo Link in Login view and menu.

View File

@@ -143,9 +143,15 @@
.valo-menu-title {
line-height: 1.2;
}
.v-menubar-user-menu:after {
display: none;
}
.v-menubar-menuitem-user-menuitem {
width: 100%;
}
.v-menubar-user-menu > .v-menubar-menuitem {
white-space: normal !important;
.v-icon {

View File

@@ -228,4 +228,8 @@
.v-tooltip{
max-width:43em;
}
.breadcrumbPaddingLeft{
padding-left: 3px !important;
}
}

View File

@@ -19,20 +19,32 @@
}
}
.v-context-menu .v-context-menu-item-basic-icon-container{
height:0px !important;
width:0px !important;
}
.v-context-menu, .v-context-menu .v-context-menu-item-basic{
.v-context-menu .v-context-menu-item-basic{
background-color: #feffff !important;
border-radius: 4px;
font-family : $app-font-family;
font-size : $app-text-font-size;
font-weight : normal;
font-style : normal;
}
.v-context-menu{
background-color: #feffff !important;
border-radius: 4px;
}
.v-context-menu .v-context-menu-item-basic:focus, .v-context-menu .v-context-menu-item-basic-submenu:focus, .v-context-menu .v-context-menu-item-basic-open {
@include valo-gradient($color: $hawkbit-primary-color);
background-color: $hawkbit-primary-color !important;
color: #e8eef3;
height: 30px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
}
@@ -77,5 +89,9 @@
border-left: $v-grid-border-size solid $widget-border-color ;
}
.v-button-boldhide{
text-decoration:none;
}
}

View File

@@ -28,12 +28,12 @@
.error-icon{
color:$success-icon-color !important;
padding:2px;
padding-left:2px !important;
}
.success-icon{
color:$error-icon-color !important;
padding:2px;
padding-left:2px !important;
}
.on-focus-no-border:focus::after{

View File

@@ -487,3 +487,6 @@ message.error.starting.rollout = Server error. Error starting rollout. Please co
#Menu
menu.title = Software Provisioning
#Target Filter Management
breadcrumb.target.filter.custom.filters = Custom Filters

View File

@@ -473,3 +473,6 @@ label.target.per.group = Targets per group :
message.dist.already.assigned = Distribution {0} is already assigned to target
message.error.creating.rollout = Server error. Error creating rollout. Please contact the administrator
message.error.starting.rollout = Server error. Error starting rollout. Please contact the administrator
#Target Filter Management
breadcrumb.target.filter.custom.filters = Custom Filters

View File

@@ -464,3 +464,6 @@ label.target.per.group = Targets per group :
message.dist.already.assigned = Distribution {0} is already assigned to target
message.error.creating.rollout = Server error. Error creating rollout. Please contact the administrator
message.error.starting.rollout = Server error. Error starting rollout. Please contact the administrator
#Target Filter Management
breadcrumb.target.filter.custom.filters = Custom Filters