Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- changed style and position of the message warning user that the changes are applied immediately - when change assignment requested, modify only archetype assignments, don't apply other changes made in form - a little bit of code cleanup.
- Loading branch information
Showing
10 changed files
with
253 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/result/MessagePanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
~ Copyright (c) 2020 Evolveum | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:panel> | ||
<div class="feedback-message box box-solid" wicket:id="detailsBox"> | ||
<div class="box-header"> | ||
<i class="icon fa " wicket:id="iconType"></i> | ||
<b class="box-title" wicket:id="message"> | ||
</b> | ||
<div class="box-tools pull-right"> | ||
<div wicket:id="close" data-widget="remove" class="btn btn-box-tool"> | ||
<i class="fa fa-times"/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</wicket:panel> | ||
</body> | ||
</html> |
111 changes: 111 additions & 0 deletions
111
gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/result/MessagePanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* | ||
* Copyright (c) 2020 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.gui.api.component.result; | ||
|
||
import java.io.Serializable; | ||
|
||
import org.apache.wicket.AttributeModifier; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.ajax.markup.html.AjaxLink; | ||
import org.apache.wicket.behavior.AttributeAppender; | ||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.PropertyModel; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
|
||
public class MessagePanel extends BasePanel<String> { | ||
|
||
private static final String ID_MESSAGE = "message"; | ||
|
||
public enum MessagePanelType {INFO, WARN, SUCCESS, ERROR} | ||
|
||
private MessagePanelType type; | ||
|
||
public MessagePanel(String id, MessagePanelType type, IModel<String> model) { | ||
super(id, model); | ||
this.type = type; | ||
|
||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
initLayout(); | ||
} | ||
|
||
public void initLayout() { | ||
|
||
WebMarkupContainer detailsBox = new WebMarkupContainer("detailsBox"); | ||
detailsBox.setOutputMarkupId(true); | ||
detailsBox.add(AttributeModifier.append("class", createHeaderCss())); | ||
add(detailsBox); | ||
|
||
initHeader(detailsBox); | ||
|
||
} | ||
|
||
private IModel<String> createHeaderCss() { | ||
|
||
return (IModel<String>) () -> { | ||
switch (type) { | ||
case INFO: | ||
return " box-info"; | ||
case SUCCESS: | ||
return " box-success"; | ||
case ERROR: | ||
return " box-danger"; | ||
case WARN: // TODO: | ||
default: | ||
return " box-warning"; | ||
} | ||
}; | ||
} | ||
|
||
private void initHeader(WebMarkupContainer box) { | ||
WebMarkupContainer iconType = new WebMarkupContainer("iconType"); | ||
iconType.setOutputMarkupId(true); | ||
iconType.add(new AttributeAppender("class", (IModel) () -> { | ||
|
||
switch (type) { | ||
case INFO: | ||
return " fa-info"; | ||
case SUCCESS: | ||
return " fa-check"; | ||
case ERROR: | ||
return " fa-ban"; | ||
case WARN: | ||
default: | ||
return " fa-warning"; | ||
} | ||
})); | ||
|
||
box.add(iconType); | ||
|
||
Label message = new Label(ID_MESSAGE, getModel()); | ||
box.add(message); | ||
|
||
AjaxLink<Void> close = new AjaxLink<Void>("close") { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
public void onClick(AjaxRequestTarget target) { | ||
close(target); | ||
|
||
} | ||
}; | ||
|
||
box.add(close); | ||
} | ||
|
||
public void close(AjaxRequestTarget target){ | ||
this.setVisible(false); | ||
target.add(this); | ||
} | ||
} |
Oops, something went wrong.