Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
3,165 additions
and
2,474 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
4,592 changes: 2,319 additions & 2,273 deletions
4,592
gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/page/PageBase.java
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...point/web/component/box/InfoBoxPanel.html → .../web/component/box/BasicInfoBoxPanel.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
80 changes: 80 additions & 0 deletions
80
gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/box/BasicInfoBoxPanel.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,80 @@ | ||
/** | ||
* Copyright (c) 2010-2019 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.evolveum.midpoint.web.component.box; | ||
|
||
import org.apache.wicket.ajax.AjaxEventBehavior; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
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 org.apache.wicket.request.component.IRequestablePage; | ||
|
||
import com.evolveum.midpoint.gui.api.component.progressbar.ProgressbarPanel; | ||
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; | ||
|
||
/** | ||
* @author katkav | ||
* @author semancik | ||
* @author skublik | ||
*/ | ||
public class BasicInfoBoxPanel extends InfoBoxPanel{ | ||
private static final long serialVersionUID = 1L; | ||
|
||
private static final String ID_PROGRESS = "progress"; | ||
private static final String ID_PROGRESS_BAR = "progressBar"; | ||
private static final String ID_DESCRIPTION = "description"; | ||
|
||
public BasicInfoBoxPanel(String id, IModel<InfoBoxType> model) { | ||
super(id, model); | ||
} | ||
|
||
public BasicInfoBoxPanel(String id, IModel<InfoBoxType> model, Class<? extends IRequestablePage> linkPage) { | ||
super(id, model, linkPage); | ||
} | ||
|
||
@Override | ||
protected void customInitLayout(WebMarkupContainer parentInfoBox, IModel<InfoBoxType> model, | ||
Class<? extends IRequestablePage> linkPage) { | ||
WebMarkupContainer progress = new WebMarkupContainer(ID_PROGRESS); | ||
parentInfoBox.add(progress); | ||
progress.add(new VisibleEnableBehaviour() { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
public boolean isVisible() { | ||
return model.getObject().getProgress() != null; | ||
} | ||
}); | ||
ProgressbarPanel progressBar = new ProgressbarPanel(ID_PROGRESS_BAR, new PropertyModel<>(model, InfoBoxType.PROGRESS)); | ||
progress.add(progressBar); | ||
|
||
Label description = new Label(ID_DESCRIPTION, new PropertyModel<String>(model, InfoBoxType.DESCRIPTION)); | ||
parentInfoBox.add(description); | ||
|
||
if (linkPage != null) { | ||
add(new AjaxEventBehavior("click") { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
protected void onEvent(AjaxRequestTarget target) { | ||
setResponsePage(linkPage); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
} |
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
36 changes: 36 additions & 0 deletions
36
gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/box/SmallInfoBoxPanel.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,36 @@ | ||
<!-- | ||
~ Copyright (c) 2010-2019 Evolveum | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<wicket:panel> | ||
<div class="col-lg-3 col-xs-6"> | ||
<div class="small-box" wicket:id="infoBox"> | ||
<div class="inner"> | ||
<h3 wicket:id="number"/> | ||
<p wicket:id="message"/> | ||
</div> | ||
<div class="icon" wicket:id="infoBoxIcon"> | ||
<i wicket:id="imageId"></i> | ||
</div> | ||
<div class="small-box-footer" wicket:id="moreInfoBox"> | ||
<div wicket:id="moreInfoBoxLabel"/> | ||
<i class="fa fa-arrow-circle-right" wicket:id="moreInfoBoxIcon"/> | ||
</div> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</html> |
97 changes: 97 additions & 0 deletions
97
gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/box/SmallInfoBoxPanel.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,97 @@ | ||
/** | ||
* Copyright (c) 2010-2019 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.evolveum.midpoint.web.component.box; | ||
|
||
import org.apache.wicket.AttributeModifier; | ||
import org.apache.wicket.Component; | ||
import org.apache.wicket.ajax.AjaxEventBehavior; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
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.Model; | ||
import org.apache.wicket.model.PropertyModel; | ||
import org.apache.wicket.request.component.IRequestablePage; | ||
|
||
import com.evolveum.midpoint.gui.api.page.PageBase; | ||
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; | ||
|
||
/** | ||
* @author skublik | ||
*/ | ||
public class SmallInfoBoxPanel extends InfoBoxPanel{ | ||
private static final long serialVersionUID = 1L; | ||
|
||
private static final String ID_MORE_INFO_BOX = "moreInfoBox"; | ||
private static final String ID_MORE_INFO_BOX_ICON = "moreInfoBoxIcon"; | ||
private static final String ID_MORE_INFO_BOX_LABEL = "moreInfoBoxLabel"; | ||
|
||
private PageBase pageBase; | ||
|
||
public SmallInfoBoxPanel(String id, IModel<InfoBoxType> model, PageBase pageBase) { | ||
super(id, model); | ||
this.pageBase = pageBase; | ||
} | ||
|
||
public SmallInfoBoxPanel(String id, IModel<InfoBoxType> model, Class<? extends IRequestablePage> linkPage, PageBase pageBase) { | ||
super(id, model, linkPage); | ||
this.pageBase = pageBase; | ||
} | ||
|
||
protected void setParametersBeforeClickOnMoreInfo() { | ||
|
||
} | ||
|
||
@Override | ||
protected void customInitLayout(WebMarkupContainer parentInfoBox, IModel<InfoBoxType> model, | ||
Class<? extends IRequestablePage> linkPage) { | ||
|
||
WebMarkupContainer moreInfoBox = new WebMarkupContainer(ID_MORE_INFO_BOX); | ||
parentInfoBox.add(moreInfoBox); | ||
WebMarkupContainer moreInfoBoxIcon = new WebMarkupContainer(ID_MORE_INFO_BOX_ICON); | ||
moreInfoBox.add(moreInfoBoxIcon); | ||
Label moreInfoBoxLabel = new Label(ID_MORE_INFO_BOX_LABEL, this.pageBase.createStringResource("PageDashboard.infobox.moreInfo")); | ||
moreInfoBox.add(moreInfoBoxLabel); | ||
|
||
if (linkPage != null) { | ||
moreInfoBox.add(new AjaxEventBehavior("click") { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
protected void onEvent(AjaxRequestTarget target) { | ||
setParametersBeforeClickOnMoreInfo(); | ||
setResponsePage(linkPage); | ||
} | ||
}); | ||
moreInfoBox.add(AttributeModifier.append("class", "cursor-pointer")); | ||
} else { | ||
setInvisible(moreInfoBoxIcon); | ||
setInvisible(moreInfoBoxLabel); | ||
moreInfoBox.add(AttributeModifier.append("style", "height: 26px;")); | ||
} | ||
} | ||
|
||
private void setInvisible(Component component) { | ||
component.add(new VisibleEnableBehaviour(){ | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
public boolean isVisible() { | ||
return false; | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.