Merge remote-tracking branch 'origin/master' into fix_introduce_consistent_button_position_in_change_dialogs
This commit is contained in:
@@ -339,7 +339,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (fileName == null ? 0 : fileName.hashCode());
|
||||
result = prime * result + ((fileName == null) ? 0 : fileName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -348,12 +348,17 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof UploadHandler)) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final UploadHandler other = (UploadHandler) obj;
|
||||
if (fileName == null && other.fileName != null) {
|
||||
return false;
|
||||
if (fileName == null) {
|
||||
if (other.fileName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!fileName.equals(other.fileName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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,13 +234,24 @@ 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(i18n.get("textfield.customfiltername"), "",
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -257,7 +281,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);
|
||||
@@ -277,6 +301,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);
|
||||
@@ -303,10 +334,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) {
|
||||
@@ -525,4 +558,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
}
|
||||
}
|
||||
|
||||
private void showCustomFiltersView() {
|
||||
eventBus.publish(this, CustomFilterUIEvent.SHOW_FILTER_MANAGEMENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -13,7 +13,6 @@ import javax.annotation.PostConstruct;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIButton;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmall;
|
||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
||||
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
|
||||
@@ -79,9 +78,8 @@ public class TargetFilterHeader extends VerticalLayout {
|
||||
}
|
||||
|
||||
private Label createHeaderCaption() {
|
||||
final Label captionLabel = SPUIComponentProvider.getLabel("Custom Filters",
|
||||
return SPUIComponentProvider.getLabel(SPUIDefinitions.TARGET_FILTER_LIST_HEADER_CAPTION,
|
||||
SPUILabelDefinitions.SP_WIDGET_CAPTION);
|
||||
return captionLabel;
|
||||
}
|
||||
|
||||
private void buildLayout() {
|
||||
@@ -110,10 +108,9 @@ public class TargetFilterHeader extends VerticalLayout {
|
||||
}
|
||||
|
||||
private Button createAddButton() {
|
||||
final Button button = SPUIComponentProvider.getButton("camp.search.add.Id", "Create Filter", "Create Filter",
|
||||
"", false, null, SPUIButtonStyleSmall.class);
|
||||
final Button button = SPUIComponentProvider.getButton(SPUIComponetIdProvider.TARGET_FILTER_ADD_ICON_ID, "", "",
|
||||
null, false, FontAwesome.PLUS, SPUIButtonStyleSmallNoBorder.class);
|
||||
button.addClickListener(event -> addNewFilter());
|
||||
button.addStyleName("on-focus-no-border link");
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -296,8 +296,8 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
* add distribution name to the item which will be displayed in the
|
||||
* table. The name should not exceed certain limit.
|
||||
*/
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).setValue(HawkbitCommonUtil
|
||||
.getFormattedText(actionWithStatusCount.getDsName() + ":" + actionWithStatusCount.getDsVersion()));
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).setValue(actionWithStatusCount.getDsName() + ":" +
|
||||
actionWithStatusCount.getDsVersion());
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_FORCED).setValue(action);
|
||||
|
||||
/* Default no child */
|
||||
@@ -442,8 +442,8 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE_HIDDEN).setValue("");
|
||||
|
||||
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST)
|
||||
.setValue(HawkbitCommonUtil.getFormattedText(action.getDistributionSet().getName() + ":"
|
||||
+ action.getDistributionSet().getVersion()));
|
||||
.setValue(action.getDistributionSet().getName() + ":"
|
||||
+ action.getDistributionSet().getVersion());
|
||||
|
||||
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DATETIME)
|
||||
.setValue(SPDateTimeUtil.getFormattedDate(actionStatus.getCreatedAt()));
|
||||
|
||||
@@ -148,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"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -431,27 +431,7 @@ public final class HawkbitCommonUtil {
|
||||
return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the lengthy text.
|
||||
*
|
||||
* @param orgText
|
||||
* text to be formatted
|
||||
* @return String formatted text
|
||||
*/
|
||||
public static String getFormattedText(final String orgText) {
|
||||
if (orgText == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
final int txtLengthAllowed = SPUIDefinitions.NAME_DESCRIPTION_LENGTH;
|
||||
if (orgText.length() > txtLengthAllowed) {
|
||||
return new StringBuilder(orgText.substring(0, txtLengthAllowed)).append("...").toString();
|
||||
}
|
||||
|
||||
return orgText;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Find extra height required to increase by all the components to utilize
|
||||
* the full height of browser for the responsive UI.
|
||||
*
|
||||
|
||||
@@ -75,6 +75,11 @@ public final class SPUIComponetIdProvider {
|
||||
*/
|
||||
public static final String TARGET_TEXT_FIELD = "target.search.textfield";
|
||||
|
||||
/**
|
||||
* ID for add target filter icon
|
||||
*/
|
||||
public static final String TARGET_FILTER_ADD_ICON_ID = "target.filter.add.id";
|
||||
|
||||
/**
|
||||
* ID-Dist.
|
||||
*/
|
||||
@@ -599,7 +604,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.
|
||||
|
||||
@@ -922,6 +922,11 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String CUSTOM_FILTER_ASSIGNED_DS = "Assigned DS";
|
||||
|
||||
/**
|
||||
* TARGET_FILTER_MANAGEMENT - header caption .
|
||||
*/
|
||||
public static final String TARGET_FILTER_LIST_HEADER_CAPTION = "Custom Filters";
|
||||
|
||||
/**
|
||||
* CUSTOM_FILTER_STATUS.
|
||||
*/
|
||||
@@ -1001,7 +1006,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_STARTED_DATE = "Started date";
|
||||
|
||||
|
||||
/**
|
||||
* Rollout group status column property.
|
||||
*/
|
||||
|
||||
@@ -228,4 +228,8 @@
|
||||
.v-tooltip{
|
||||
max-width:43em;
|
||||
}
|
||||
|
||||
.breadcrumbPaddingLeft{
|
||||
padding-left: 3px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,4 +132,12 @@ $v-included-components: remove($v-included-components, form);
|
||||
left: 50%;
|
||||
margin-left: -20px;
|
||||
}
|
||||
.v-generated-body &.v-app {
|
||||
background-image: $app-background-image, linear-gradient(to bottom, $app-background-image-gradient) !important;
|
||||
background-image: $app-background-image, -webkit-linear-gradient(top, $app-background-image-gradient) !important;
|
||||
background-image: $app-background-image, -moz-linear-gradient(top, $app-background-image-gradient) !important;
|
||||
background-position: bottom;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user