Skip to content

Commit

Permalink
MID-6271 unassign members dialog css/html fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed May 24, 2022
1 parent 55810df commit 6a3422e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>

<form class="clearfix form-horizontal" wicket:id="form">
<div wicket:id="memberContainer">
<div wicket:id="memberTable" />
</div>
</form>

</wicket:panel>
</body>
</html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@

package com.evolveum.midpoint.web.component;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.markup.html.form.ListMultipleChoice;
import org.apache.wicket.model.IModel;

import java.util.*;

/**
* @author lazyman
*/
public class DropDownMultiChoice<T> extends ListMultipleChoice<T> {

public static final String PROP_BUTTON_CLASS = "buttonClass";

private IModel<Map<String, String>> options;

public DropDownMultiChoice(String id, IModel<List<T>> object, IModel<List<T>> choices,
IChoiceRenderer<T> renderer, IModel<Map<String, String>> options) {
IChoiceRenderer<T> renderer, IModel<Map<String, String>> options) {
super(id, object, choices, renderer);
this.options = options;
}
Expand All @@ -51,7 +52,7 @@ private void appendOptions(StringBuilder sb) {
}

sb.append('{');
Iterator<Map.Entry<String, String>> keys = map.entrySet().iterator();
Iterator<Map.Entry<String, String>> keys = map.entrySet().iterator();
while (keys.hasNext()) {
final Map.Entry<String, String> key = keys.next();
sb.append(key.getKey()).append(":");
Expand All @@ -65,7 +66,9 @@ private void appendOptions(StringBuilder sb) {

private Map<String, String> createDefaultOptions() {
Map<String, String> map = new HashMap<>();
map.put(PROP_BUTTON_CLASS, "btn btn-default btn-sm");
map.put("buttonContainer", "<div class=\"dropdown\">");
map.put("buttonClass", "custom-select custom-select-sm shadow-none");
map.put("buttonTextAlignment", "left");

return map;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@
-->

<wicket:panel xmlns:wicket="http://wicket.apache.org">
<div>
<div wicket:id="warningFeedback" align="center"/>
<div class="form-group" style="display: -webkit-box;">
<div class="col-md-12" wicket:id="type"/>
</div>
<div class="form-group col-md-12">
<label class="col-md-4" style="font-weight:normal;">
<div class="d-flex flex-column gap-2">
<div wicket:id="warningFeedback"/>
<div class="row" wicket:id="type"/>
<div class="row">
<label class="col-md-4 col-form-label font-weight-normal">
<wicket:message key="chooseFocusTypeAndRelationDialogPanel.relation"/>
<span style="color: #f00;font-weight: bold;" wicket:message="title:prismPropertyPanel.required" wicket:id="relationRequired">*</span>
<span class="text-danger font-weight-bold" wicket:message="title:prismPropertyPanel.required" wicket:id="relationRequired">*</span>
</label>
<div class="col-md-8" wicket:id="relation" style="font-weight: normal;"/>
<div class="col-md-8" wicket:id="relation"/>
</div>
<div wicket:id="infoMessage" align="center"/>
<p align="right" class="form-group">
<span class="mb-2 text-center" wicket:id="infoMessage"/>
<div class="main-button-bar justify-content-end">
<a class="btn btn-primary btn-sm" wicket:id="cancel" />
<a class="btn btn-primary btn-sm" wicket:id="ok" />
<a class="btn btn-default btn-sm" wicket:id="configureTask" />
</p>
</div>
</div>
</wicket:panel>
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ private void initLayout(){
type.add(new VisibleBehaviour(this::isFocusTypeSelectorVisible));
add(type);

IModel<Map<String, String>> options = new Model(null);
options.setObject(new HashMap<>());
ListMultipleChoicePanel<QName> relation = new ListMultipleChoicePanel<>(ID_RELATION, Model.ofList(getDefaultRelations()),
new ListModel<>(getSupportedRelations()), WebComponentUtil.getRelationChoicesRenderer(getPageBase()), options);
new ListModel<>(getSupportedRelations()), WebComponentUtil.getRelationChoicesRenderer(getPageBase()), null);
relation.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
relation.setOutputMarkupId(true);
add(relation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="modal-content">
<wicket:enclosure child="title">
<div class="modal-header">
<h4 wicket:id="title"/>
<h4 class="modal-title" wicket:id="title"/>
</div>
</wicket:enclosure>
<div wicket:id="content" class="modal-body"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<wicket:panel>
<div wicket:id="labelContainer">
<span wicket:id="label"/>
<span wicket:id="required" style="color: #f00; font-weight: bold;"
<span wicket:id="required" class="text-danger font-weight-bold"
wicket:message="title:prismPropertyPanel.required">*</span>
<i wicket:id="tooltip"/>
</div>
Expand Down

0 comments on commit 6a3422e

Please sign in to comment.