Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jan 17, 2020
2 parents a4672da + 1b91f6b commit 4a48950
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
Expand Up @@ -111,6 +111,8 @@ public class GuiStyleConstants {
public static final String CLASS_ICON_NO_OBJECTS = "fa fa-times";
public static final String CLASS_ICON_ACTIVATION_ACTIVE = "fa fa-check";
public static final String CLASS_ICON_ACTIVATION_INACTIVE = "fa fa-times";
public static final String CLASS_ICON_RESOURCE_BROKEN = "fa fa-exclamation";
public static final String CLASS_ICON_RESOURCE_UNKNOWN = "fa fa-question";
public static final String CLASS_ICON_ASSIGNMENTS = "fa fa-bank";
public static final String CLASS_SHADOW_ICON_REQUEST = "fa fa-pencil-square-o";
public static final String CLASS_ICON_TACHOMETER = "fa fa-tachometer";
Expand Down
Expand Up @@ -151,12 +151,16 @@ private ITab createSchemaEditor() {

@Override
public WebMarkupContainer getPanel(String panelId) {
XmlEditorPanel xmlEditorPanel = new XmlEditorPanel(panelId, createXmlEditorModel());
// quick fix: now changes from XmlEditorPanel are not saved anyhow
//(e.g. by clicking Finish button in wizard). For now,
//panel is made disabled for editing
AceEditor aceEditor = (AceEditor) xmlEditorPanel.get(ID_ACE_EDITOR);
aceEditor.setReadonly(true);
XmlEditorPanel xmlEditorPanel = new XmlEditorPanel(panelId, createXmlEditorModel()) {

// quick fix: now changes from XmlEditorPanel are not saved anyhow
//(e.g. by clicking Finish button in wizard). For now,
@Override
protected boolean isEditEnabled() {
return false;
}
};

return xmlEditorPanel;
}
};
Expand Down
Expand Up @@ -7,6 +7,7 @@

package com.evolveum.midpoint.web.component.wizard.resource.component;

import com.evolveum.midpoint.web.component.util.EnableBehaviour;
import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.component.BasePanel;
Expand All @@ -32,6 +33,11 @@ protected void onInitialize() {

protected void initLayout() {
AceEditor editor = new AceEditor(ID_ACE_EDITOR, getModel());
editor.setReadonly(!isEditEnabled());
add(editor);
}

protected boolean isEditEnabled() {
return true;
}
}
Expand Up @@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.List;

import com.evolveum.midpoint.xml.ns._public.common.common_3.AvailabilityStatusType;
import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
Expand All @@ -21,21 +22,13 @@
public class ResourceSummaryPanel extends ObjectSummaryPanel<ResourceType> {
private static final long serialVersionUID = 1L;

private static final String ID_UP_DOWN_TAG = "upDownTag";
private IModel<ResourceType> model;

public ResourceSummaryPanel(String id, IModel<ResourceType> model, ModelServiceLocator serviceLocator) {
super(id, ResourceType.class, model, serviceLocator);
}

// @Override
// protected void onBeforeRender() {
// super.onBeforeRender();
// }

@Override
protected List<SummaryTag<ResourceType>> getSummaryTagComponentList(){
boolean down = ResourceTypeUtil.isDown(getModelObject());
AvailabilityStatusType availability = ResourceTypeUtil.getLastAvailabilityStatus(getModelObject());

List<SummaryTag<ResourceType>> summaryTagList = new ArrayList<>();

Expand All @@ -44,12 +37,24 @@ protected List<SummaryTag<ResourceType>> getSummaryTagComponentList(){

@Override
protected void initialize(ResourceType object) {
if (!down) {
setIconCssClass(GuiStyleConstants.CLASS_ICON_ACTIVATION_ACTIVE);
setLabel(getString("ResourceSummaryPanel.UP"));
} else {
setIconCssClass(GuiStyleConstants.CLASS_ICON_ACTIVATION_INACTIVE);
setLabel(getString("ResourceSummaryPanel.DOWN"));
if (availability== null) {
setIconCssClass(GuiStyleConstants.CLASS_ICON_RESOURCE_UNKNOWN);
setLabel(getString("ResourceSummaryPanel.UNKNOWN"));
return;
}
setLabel(getString(ResourceSummaryPanel.this.getString(availability)));
switch(availability) {
case UP:
setIconCssClass(GuiStyleConstants.CLASS_ICON_ACTIVATION_ACTIVE);
break;
case DOWN:
setIconCssClass(GuiStyleConstants.CLASS_ICON_ACTIVATION_INACTIVE);
break;
case BROKEN:
setIconCssClass(GuiStyleConstants.CLASS_ICON_RESOURCE_BROKEN);
break;


}
}
};
Expand Down

0 comments on commit 4a48950

Please sign in to comment.