Consitent breadcrumb usage
Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
@@ -93,6 +93,10 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
@Qualifier("uiExecutor")
|
||||
private transient Executor executor;
|
||||
|
||||
private HorizontalLayout breadcrumbLayout;
|
||||
|
||||
private Button breadcrumbButton;
|
||||
|
||||
private Label headerCaption;
|
||||
|
||||
private TextField queryTextField;
|
||||
@@ -201,6 +205,10 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
}
|
||||
|
||||
private void createComponents() {
|
||||
|
||||
// Breadcrumb
|
||||
breadcrumbButton = createBreadcrumbButton();
|
||||
|
||||
headerCaption = SPUIComponentProvider.getLabel(SPUILabelDefinitions.VAR_CREATE_FILTER,
|
||||
SPUILabelDefinitions.SP_WIDGET_CAPTION);
|
||||
|
||||
@@ -221,12 +229,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("breadcrumb.target.filter.custom.filters"));
|
||||
createFilterViewLink.setCaption(i18n.get("breadcrumb.target.filter.custom.filters"));
|
||||
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 +275,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 +295,12 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
titleFilterIconsLayout.addComponents(headerCaption, captionLayout);
|
||||
titleFilterIconsLayout.setSpacing(true);
|
||||
|
||||
breadcrumbLayout = new HorizontalLayout();
|
||||
breadcrumbLayout.addComponent(breadcrumbButton);
|
||||
breadcrumbLayout.addComponent(new Label(">"));
|
||||
headerCaption.addStyleName("breadcrumbPaddingLeft");
|
||||
breadcrumbLayout.addComponent(headerCaption);
|
||||
|
||||
final HorizontalLayout titleFilterLayout = new HorizontalLayout();
|
||||
titleFilterLayout.setSizeFull();
|
||||
titleFilterLayout.addComponents(titleFilterIconsLayout, closeIcon);
|
||||
@@ -302,10 +327,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 +551,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());
|
||||
}
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -228,4 +228,8 @@
|
||||
.v-tooltip{
|
||||
max-width:43em;
|
||||
}
|
||||
|
||||
.breadcrumbPaddingLeft{
|
||||
padding-left: 3px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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