Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Apr 6, 2023
2 parents 4ddbbde + 5276fb3 commit 495e572
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<span class="sr-only"><wicket:message key="SplitButtonDropDown.toggle"/></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li wicket:id="menuItems">
<div class="dropdown-item d-flex justify-content-between align-items-center" wicket:id="menuItem"/>
</li>
<wicket:container wicket:id="menuItems">
<a class="dropdown-item" wicket:id="menuItem"/>
</wicket:container>
</ul>
</div>
</wicket:panel>
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
*/
package com.evolveum.midpoint.gui.impl.component.search.panel;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.data.column.AjaxLinkPanel;

import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import java.util.List;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.list.ListItem;
Expand All @@ -24,7 +19,9 @@
import org.apache.wicket.model.Model;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;

public abstract class SearchButtonWithDropdownMenu<E extends Enum> extends BasePanel<List<E>> {
private static final long serialVersionUID = 1L;
Expand All @@ -37,7 +34,7 @@ public abstract class SearchButtonWithDropdownMenu<E extends Enum> extends BaseP

// E selectedValue = null;

private IModel<E> mode;
private final IModel<E> mode;

public SearchButtonWithDropdownMenu(String id, @NotNull IModel<List<E>> menuItemsModel, IModel<E> defaultValue) {
super(id, menuItemsModel);
Expand All @@ -57,7 +54,7 @@ private void initLayout() {

@Override
protected void onError(AjaxRequestTarget target) {
Form form = SearchButtonWithDropdownMenu.this.findParent(Form.class);
Form<?> form = SearchButtonWithDropdownMenu.this.findParent(Form.class);
if (form != null) {
target.add(form);
} else {
Expand Down Expand Up @@ -97,7 +94,7 @@ public void onClick(AjaxRequestTarget target) {

@Override
protected void populateItem(ListItem<E> item) {
AjaxLinkPanel ajaxLinkPanel = new AjaxLinkPanel(ID_MENU_ITEM, createStringResource(item.getModelObject())) {
AjaxButton ajaxLinkPanel = new AjaxButton(ID_MENU_ITEM, createStringResource(item.getModelObject())) {

@Override
public void onClick(AjaxRequestTarget target) {
Expand All @@ -109,86 +106,17 @@ public void onClick(AjaxRequestTarget target) {
};

item.add(ajaxLinkPanel);

// InlineMenuItem searchItem = new InlineMenuItem(createStringResource(item.getModelObject())) {
// private static final long serialVersionUID = 1L;
//
// @Override
// public InlineMenuItemAction initAction() {
// return new InlineMenuItemAction() {
//
// private static final long serialVersionUID = 1L;
//
// @Override
// public void onClick(AjaxRequestTarget target) {
// target.add(getSearchButton());
// mode = item;
// menuItemSelected(target, item);
// }
// };
// }
//
// @Override
// public IModel<Boolean> getVisible() {
// return isMenuItemVisible(item);
// }
// }
//
// WebMarkupContainer menuItemBody = new MenuLinkPanel(ID_MENU_ITEM, searchItem);
// menuItemBody.setRenderBodyOnly(true);
// item.add(menuItemBody);
// menuItemBody.add(new VisibleEnableBehaviour() {
// @Override
// public boolean isVisible() {
// return Boolean.TRUE.equals(item.getModelObject().getVisible().getObject());
// }
// });
}
};
menuItems.setOutputMarkupId(true);
add(menuItems);

}

// public void setSelectedValue(E newValue) {
// selectedValue = newValue;
// }

protected VisibleEnableBehaviour getSearchButtonVisibleEnableBehavior() {
return new VisibleEnableBehaviour();
}

// private IModel<List<InlineMenuItem>> createMenuItemsModel() {
// List<InlineMenuItem> menuItems = new ArrayList<>();
// getModelObject().forEach(item -> {
// InlineMenuItem searchItem = new InlineMenuItem(createStringResource(item)) {
// private static final long serialVersionUID = 1L;
//
// @Override
// public InlineMenuItemAction initAction() {
// return new InlineMenuItemAction() {
//
// private static final long serialVersionUID = 1L;
//
// @Override
// public void onClick(AjaxRequestTarget target) {
// target.add(getSearchButton());
// mode = item;
// menuItemSelected(target, item);
// }
// };
// }
//
// @Override
// public IModel<Boolean> getVisible() {
// return isMenuItemVisible(item);
// }
// };
// menuItems.add(searchItem);
// });
// return Model.ofList(menuItems);
// }

public AjaxSubmitLink getSearchButton() {
return (AjaxSubmitLink) get(ID_SEARCH_BUTTON);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import java.util.List;
import java.util.stream.Collectors;

import com.evolveum.midpoint.web.component.prism.show.WrapperVisualization;

import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
Expand All @@ -39,6 +37,7 @@
import com.evolveum.midpoint.web.component.prism.show.ChangesPanel;
import com.evolveum.midpoint.web.component.prism.show.VisualizationDto;
import com.evolveum.midpoint.web.component.prism.show.VisualizationPanel;
import com.evolveum.midpoint.web.component.prism.show.WrapperVisualization;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.wf.ApprovalProcessesPreviewPanel;
import com.evolveum.midpoint.web.page.admin.workflow.EvaluatedTriggerGroupListPanel;
Expand Down Expand Up @@ -165,7 +164,7 @@ private void initLayout() {
createVisualizationModel(secondaryModel, "PagePreviewChanges.secondaryChangesOne", "PagePreviewChanges.secondaryChangesMore"));
add(secondaryDeltas);

add(new ChangesPanel(ID_PRIMARY, null, primaryModel) {
add(new ChangesPanel(ID_PRIMARY, primaryModel) {

@Override
protected IModel<String> createTitle() {
Expand All @@ -177,7 +176,7 @@ protected IModel<String> createTitle() {
};
}
});
add(new ChangesPanel(ID_SECONDARY, null, secondaryModel) {
add(new ChangesPanel(ID_SECONDARY, secondaryModel) {

@Override
protected IModel<String> createTitle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="d-flex flex-wrap" wicket:id="topButtonsContainer">
<div wicket:id="topButtons"/>
<div class="d-flex flex-wrap gap-3 mt-3" wicket:id="topButtonsContainer">
<a class="btn btn-primary p-3 flex-basis-0 flex-fill" wicket:id="topButtons"/>
</div>
<div class="d-flex flex-wrap justify-content-between pl-4">
<div class="d-flex flex-wrap gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ public void onClick(AjaxRequestTarget target) {
};
attrMappingButton.setOutputMarkupId(true);
attrMappingButton.showTitleAsLabel(true);
attrMappingButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-basis-0 flex-fill mr-3"));
attrMappingButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(attrMappingButton);
}
Expand All @@ -390,7 +389,6 @@ public void onClick(AjaxRequestTarget target) {
};
synchConfButton.setOutputMarkupId(true);
synchConfButton.showTitleAsLabel(true);
synchConfButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-fill flex-basis-0 mr-3"));
synchConfButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(synchConfButton);
}
Expand All @@ -413,7 +411,6 @@ public void onClick(AjaxRequestTarget target) {
};
synchConfButton.setOutputMarkupId(true);
synchConfButton.showTitleAsLabel(true);
synchConfButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-fill flex-basis-0 mr-3"));
synchConfButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(synchConfButton);
}
Expand All @@ -436,7 +433,6 @@ public void onClick(AjaxRequestTarget target) {
};
correlationConfButton.setOutputMarkupId(true);
correlationConfButton.showTitleAsLabel(true);
correlationConfButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-fill flex-basis-0 mr-3"));
correlationConfButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(correlationConfButton);
}
Expand All @@ -459,7 +455,6 @@ public void onClick(AjaxRequestTarget target) {
};
capabilitiesConfButton.setOutputMarkupId(true);
capabilitiesConfButton.showTitleAsLabel(true);
capabilitiesConfButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-fill flex-basis-0 mr-3"));
capabilitiesConfButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(capabilitiesConfButton);
}
Expand All @@ -482,7 +477,6 @@ public void onClick(AjaxRequestTarget target) {
};
credentialsConfButton.setOutputMarkupId(true);
credentialsConfButton.showTitleAsLabel(true);
credentialsConfButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-basis-0 flex-fill mr-3"));
credentialsConfButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(credentialsConfButton);
}
Expand All @@ -505,7 +499,6 @@ public void onClick(AjaxRequestTarget target) {
};
activationButton.setOutputMarkupId(true);
activationButton.showTitleAsLabel(true);
activationButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-basis-0 flex-fill mr-3"));
activationButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(activationButton);
}
Expand All @@ -528,7 +521,6 @@ public void onClick(AjaxRequestTarget target) {
};
associationConfButton.setOutputMarkupId(true);
associationConfButton.showTitleAsLabel(true);
associationConfButton.add(AttributeAppender.append("class", "btn btn-primary p-3 flex-basis-0 flex-fill"));
associationConfButton.add(new VisibleBehaviour(() -> isTopTableButtonsVisible()));
topButtons.add(associationConfButton);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ <h3 class="card-title">
</wicket:enclosure>
</div>
<div class="col-9">
<div wicket:id="changesNew"/>

<div wicket:id="changes"/>
</div>
</div>
Expand Down

0 comments on commit 495e572

Please sign in to comment.