Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 31, 2018
2 parents 4cbcee6 + 4551369 commit bcf8fc1
Show file tree
Hide file tree
Showing 20 changed files with 359 additions and 111 deletions.
Expand Up @@ -70,6 +70,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.validator.routines.checkdigit.VerhoeffCheckDigit;
import org.apache.wicket.*;
Expand Down Expand Up @@ -1616,9 +1617,8 @@ public static <T extends ObjectType> String createDefaultColoredIcon(QName objec
return GuiStyleConstants.CLASS_OBJECT_SHADOW_ICON_COLORED;
} else if (QNameUtil.match(PolicyRuleType.COMPLEX_TYPE, objectType)) {
return GuiStyleConstants.CLASS_POLICY_RULES_ICON_COLORED;
} else if (QNameUtil.match(ObjectPolicyConfigurationType.COMPLEX_TYPE, objectType)) {
return GuiStyleConstants.CLASS_SYSTEM_CONFIGURATION_ICON_COLORED;
} else if (QNameUtil.match(GlobalPolicyRuleType.COMPLEX_TYPE, objectType)) {
} else if (QNameUtil.match(ObjectPolicyConfigurationType.COMPLEX_TYPE, objectType) || QNameUtil.match(GlobalPolicyRuleType.COMPLEX_TYPE, objectType)
|| QNameUtil.match(FileAppenderConfigurationType.COMPLEX_TYPE, objectType) || QNameUtil.match(SyslogAppenderConfigurationType.COMPLEX_TYPE, objectType)) {
return GuiStyleConstants.CLASS_SYSTEM_CONFIGURATION_ICON_COLORED;
} else {
return "";
Expand Down Expand Up @@ -2899,4 +2899,21 @@ public static <IW extends ItemWrapper> String loadHelpText(IModel<IW> model, Pan

return PageBase.createStringResourceStatic(panel, doc).getString().replaceAll("\\s{2,}", " ").trim();
}

public static String formatDurationWordsForLocal(long durationMillis, boolean suppressLeadingZeroElements,
boolean suppressTrailingZeroElements, PageBase pageBase){

String duration = DurationFormatUtils.formatDurationWords(durationMillis, suppressLeadingZeroElements, suppressTrailingZeroElements);

duration = StringUtils.replaceOnce(duration, "seconds", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.seconds").getString());
duration = StringUtils.replaceOnce(duration, "minutes", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.minutes").getString());
duration = StringUtils.replaceOnce(duration, "hours", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.hours").getString());
duration = StringUtils.replaceOnce(duration, "days", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.days").getString());
duration = StringUtils.replaceOnce(duration, "second", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.second").getString());
duration = StringUtils.replaceOnce(duration, "minute", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.minute").getString());
duration = StringUtils.replaceOnce(duration, "hour", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.hour").getString());
duration = StringUtils.replaceOnce(duration, "day", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.day").getString());

return duration;
}
}
Expand Up @@ -337,7 +337,7 @@ private MultivalueContainerListDataProvider<C> getDataProvider() {
}


private IModel<String> createStyleClassModelForNewObjectIcon() {
protected IModel<String> createStyleClassModelForNewObjectIcon() {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;

Expand Down
Expand Up @@ -137,7 +137,7 @@ public boolean isVisible() {
valueWrapper.add(feedback);
}

public CheckBox getValue(){
return (CheckBox) get(ID_VALUE_WRAPPER + ":" + ID_VALUE);
public TriStateComboPanel getValue(){
return (TriStateComboPanel) get(createComponentPath(ID_PROPERTY_LABEL, ID_ROW, ID_VALUE_WRAPPER, ID_VALUE));
}
}
Expand Up @@ -54,6 +54,13 @@
</div>

<div class="top-level-prism-container" wicket:id="audit"/>

<wicket:fragment wicket:id="buttonToolbarFragment">
<form wicket:id="choiceAppenderTypeForm">
<div wicket:id="appendersChoice" style="float:left;"/>
<div wicket:id="newItemButton" style="float:left;"/>
</form>
</wicket:fragment>

</wicket:panel>
</html>

Large diffs are not rendered by default.

Expand Up @@ -22,7 +22,7 @@
<span class="summary-content-box">
<span class="col-xs-12 col-sm-6 col-md-8 col-lg-9 summary-text-box" style="padding: 0px;">
<span class="col-xs-12 info-box-number" style="padding: 0px;">
<span class="col-xs-12 summary-panel-display-name" wicket:id="summaryDisplayName" style="padding: 0px;"/> <span class="col-xs-12 summary-panel-identifier" wicket:id="summaryIdentifierPanel" style="padding: 0px;">(<span wicket:id="summaryIdentifier"/>)</span>
<span class="summary-panel-display-name" wicket:id="summaryDisplayName" style="padding: 0px;"/> <span class="summary-panel-identifier" wicket:id="summaryIdentifierPanel" style="padding: 0px;">(<span wicket:id="summaryIdentifier"/>)</span>
</span>
<span wicket:id="summaryTitle" class="summary-panel-title">
</span>
Expand All @@ -33,7 +33,7 @@
<span wicket:id="summaryOrganization" class="summary-panel-organization">
</span>
</span>
<span wicket:id="summaryTagBox" class="col-xs-12 col-sm-6 col-md-4 col-lg-3 summary-tag-box">
<span wicket:id="summaryTagBox" class="col-xs-12 col-sm-6 col-md-4 col-lg-3 summary-tag-box" style="max-width: 170px;">
<wicket:child />
</span>
</span>
Expand Down
Expand Up @@ -194,7 +194,7 @@ protected WebMarkupContainer initButtonToolbar(String id) {
if(buttonToolbar == null) {
return super.initButtonToolbar(id);
}
return initCustomButtonToolbar(id);
return buttonToolbar;
}

};
Expand Down
Expand Up @@ -193,6 +193,10 @@ protected WebMarkupContainer createHeader(String headerId) {
protected WebMarkupContainer createFooter(String footerId) {
return new PagingFooter(footerId, ID_PAGING_FOOTER, this, this);
}

public Component getFooterButtonToolbar() {
return ((PagingFooter) getFooter()).getFooterButtonToolbar();
}

public Component getFooterMenu() {
return ((PagingFooter) getFooter()).getFooterMenu();
Expand Down Expand Up @@ -277,6 +281,10 @@ protected void pageSizeChanged(AjaxRequestTarget target) {
footerContainer.add(menu);
add(footerContainer);
}

public Component getFooterButtonToolbar() {
return get(ID_BUTTON_TOOLBAR);
}

public Component getFooterMenu() {
return get(ID_FOOTER_CONTAINER).get(ID_MENU);
Expand Down
Expand Up @@ -22,6 +22,7 @@
import com.evolveum.midpoint.gui.api.util.ModelServiceLocator;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.gui.impl.model.RealContainerValueFromContainerValueWrapperModel;
import com.evolveum.midpoint.prism.*;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.prism.path.ItemPathSegment;
Expand Down Expand Up @@ -297,8 +298,17 @@ public <O extends ObjectType, C extends Containerable> List<ItemWrapper> createP
new Object[] { containerWrapper.getItem().getElementName() });
return properties;
}

Collection<? extends ItemDefinition> propertyDefinitions = definition.getDefinitions();

if(containerWrapper.getPath().equals(new ItemPath(SystemConfigurationType.F_LOGGING, LoggingConfigurationType.F_APPENDER))) {
RealContainerValueFromContainerValueWrapperModel value = new RealContainerValueFromContainerValueWrapperModel(cWrapper);
if(value != null || value.getObject() != null || value.getObject().asPrismContainerValue()!= null
|| value.getObject().asPrismContainerValue().getComplexTypeDefinition() != null
|| value.getObject().asPrismContainerValue().getComplexTypeDefinition().getDefinitions() != null) {
propertyDefinitions = value.getObject().asPrismContainerValue().getComplexTypeDefinition().getDefinitions();
}
}

List<PropertyOrReferenceWrapper> propertyOrReferenceWrappers = new ArrayList<>();
List<ContainerWrapper<C>> containerWrappers = new ArrayList<>();
propertyDefinitions.forEach(itemDef -> {
Expand Down
Expand Up @@ -209,8 +209,8 @@ public String getObject() {
ProgressReportActivityDto si = item.getModelObject();
if (si.getActivityType() == RESOURCE_OBJECT_OPERATION && si.getResourceShadowDiscriminator() != null) {
ResourceShadowDiscriminator rsd = si.getResourceShadowDiscriminator();
return createStringResource(rsd.getKind()).getString()
+ " (" + rsd.getIntent() + ") on " + si.getResourceName(); // TODO correct i18n
return createStringResource("ProgressPanel.populateStatusItem.resourceObjectActivity", createStringResource(rsd.getKind()).getString(),
rsd.getIntent(),si.getResourceName()).getString();
} else {
return createStringResource(si.getActivityType()).getString();
}
Expand All @@ -233,11 +233,12 @@ public String getObject() {

@Override
public String getObject() { // TODO why this does not work???
OperationResultStatusType statusType = item.getModelObject().getStatus(); // TODO i18n
OperationResultStatusType statusType = item.getModelObject().getStatus();
if (statusType == null) {
return null;
} else {
return statusType.toString();
return getPageBase().createStringResource(
OperationResultStatusPresentationProperties.parseOperationalResultStatus(statusType).getStatusLabelKey()).getString();
}
}
}
Expand Down
Expand Up @@ -16,6 +16,7 @@

package com.evolveum.midpoint.web.component.progress;

import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.prism.xml.XmlTypeConverter;
import com.evolveum.midpoint.schema.statistics.EnvironmentalPerformanceInformation;
import com.evolveum.midpoint.schema.statistics.StatusMessage;
Expand All @@ -30,7 +31,9 @@
*/
public class StatisticsDto implements Serializable {

public static final String F_PROVISIONING_LINES = "provisioningLines";
private static final long serialVersionUID = 1L;

public static final String F_PROVISIONING_LINES = "provisioningLines";
public static final String F_MAPPINGS_LINES = "mappingsLines";
public static final String F_NOTIFICATIONS_LINES = "notificationsLines";
public static final String F_LAST_MESSAGE = "lastMessage";
Expand Down Expand Up @@ -93,7 +96,7 @@ public void setNotificationsLines(List<NotificationsLineDto> notificationsLines)
}

public String getLastMessage() {
return lastMessage != null ? lastMessage : "(none)"; // i18n
return lastMessage != null ? lastMessage : "(" + PageBase.createStringResourceStatic(null, "StatisticsDto.getLastMessage.none").getString() + ")";
}

public void setLastMessage(String lastMessage) {
Expand Down
Expand Up @@ -131,13 +131,12 @@ private String computeDeadlineAsString(PageBase page) {
delta = (delta / precision) * precision;
}

//todo i18n for durations
if (delta > 0) {
String key = stageLevelInfo ? "PageCertCampaigns.inForStage" : "PageCertCampaigns.inForCampaign";
return PageBase.createStringResourceStatic(page, key, DurationFormatUtils.formatDurationWords(delta, true, true)).getString();
return PageBase.createStringResourceStatic(page, key, WebComponentUtil.formatDurationWordsForLocal(delta, true, true, page)).getString();
} else if (delta < 0) {
String key = stageLevelInfo ? "PageCertCampaigns.agoForStage" : "PageCertCampaigns.agoForCampaign";
return PageBase.createStringResourceStatic(page, key, DurationFormatUtils.formatDurationWords(-delta, true, true)).getString();
return PageBase.createStringResourceStatic(page, key, WebComponentUtil.formatDurationWordsForLocal(-delta, true, true, page)).getString();
} else {
String key = stageLevelInfo ? "PageCertCampaigns.nowForStage" : "PageCertCampaigns.nowForCampaign";
return page.getString(key);
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.evolveum.midpoint.web.page.admin.certification.dto;

import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.xml.XmlTypeConverter;
import com.evolveum.midpoint.schema.util.CertCampaignTypeUtil;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
Expand Down Expand Up @@ -189,11 +190,10 @@ private String computeDeadlineAsString(PageBase page) {
delta = (delta / precision) * precision;
}

//todo i18n
if (delta > 0) {
return PageBase.createStringResourceStatic(page, "PageCert.in", DurationFormatUtils.formatDurationWords(delta, true, true)).getString();
return PageBase.createStringResourceStatic(page, "PageCert.in", WebComponentUtil.formatDurationWordsForLocal(delta, true, true, page)).getString();
} else if (delta < 0) {
return PageBase.createStringResourceStatic(page, "PageCert.ago", DurationFormatUtils.formatDurationWords(-delta, true, true)).getString();
return PageBase.createStringResourceStatic(page, "PageCert.ago", WebComponentUtil.formatDurationWordsForLocal(-delta, true, true, page)).getString();
} else {
return page.getString("PageCert.now");
}
Expand Down
Expand Up @@ -42,7 +42,7 @@
</div>

<wicket:enclosure child="resource">
<div class="form-group">
<div class="form-group" style="float: left; padding-right: 5px;">
<label class="sr-only"><wicket:message key="pageDebugList.resource"/></label>
<select class="form-control input-sm" wicket:id="resource"/>
</div>
Expand Down
Expand Up @@ -18,6 +18,7 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

Expand Down Expand Up @@ -149,6 +150,7 @@ public class PageTaskAdd extends PageAdminTasks {
private static final String OPERATION_SAVE_TASK = DOT_CLASS + "saveTask";

private static final StringChoiceRenderer CATEGORY_RENDERER = StringChoiceRenderer.prefixed("pageTask.category.");
private static final String MEDIUM_NOTIME_STYLE = "M-";

private IModel<TaskAddDto> model;

Expand Down Expand Up @@ -503,7 +505,7 @@ protected void onUpdate(AjaxRequestTarget target) {
new PropertyModel<>(model, TaskAddDto.F_NOT_START_BEFORE)) {
@Override
protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel) {
return DateTextField.forDatePattern(id, dateFieldModel, "dd/MMM/yyyy"); // todo i18n
return DateTextField.forDatePattern(id, dateFieldModel, WebComponentUtil.getLocalizedDatePattern(MEDIUM_NOTIME_STYLE));
}
};
notStartBefore.setOutputMarkupId(true);
Expand All @@ -513,7 +515,7 @@ protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel
model, TaskAddDto.F_NOT_START_AFTER)) {
@Override
protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel) {
return DateTextField.forDatePattern(id, dateFieldModel, "dd/MMM/yyyy"); // todo i18n
return DateTextField.forDatePattern(id, dateFieldModel, WebComponentUtil.getLocalizedDatePattern(MEDIUM_NOTIME_STYLE));
}
};
notStartAfter.setOutputMarkupId(true);
Expand Down
Expand Up @@ -1136,15 +1136,8 @@ private Date getCurrentRuntime(IModel<TaskDto> taskModel) {
}
return new Date(time);

} else {
//todo why?
Long time = task.getCurrentRuntime();
if (time == null) {
return null;
}
//todo i18n
return null;
}
}
return null;
}

private String getLastCheckInTime(IModel<NodeDto> nodeModel) {
Expand Down
Expand Up @@ -2505,6 +2505,14 @@ pageWorkItem.requestedOn=Requested on:
pageWorkItem.requester.description=Requester
pageWorkItem.requestSpecific.description=Your decision
webComponentUtil.message.createMenuItemsFromActions.warning=There are no objects to execute the action on
WebComponentUtil.formatDurationWordsForLocal.seconds=seconds
WebComponentUtil.formatDurationWordsForLocal.minutes=minutes
WebComponentUtil.formatDurationWordsForLocal.hours=hours
WebComponentUtil.formatDurationWordsForLocal.days=days
WebComponentUtil.formatDurationWordsForLocal.second=second
WebComponentUtil.formatDurationWordsForLocal.minute=minute
WebComponentUtil.formatDurationWordsForLocal.hour=hour
WebComponentUtil.formatDurationWordsForLocal.day=day
workItemPanel.originallyAllocatedTo=Originally allocated to:
workItemPanel.currentlyAllocatedTo=Currently allocated to:
workItemPanel.candidateActors=Candidate actors:
Expand Down Expand Up @@ -2643,6 +2651,7 @@ ProgressPanel.ExecutionTimeWhenRunning=Operation executing for {0} second(s).
ProgressPanel.abortRequested=Abort requested, please wait...
ProgressPanel.abortRequestedFinished=Abort requested, but the execution seems to be already finished.
ProgressPanel.abortRequestedNoInterrupt=Abort requested, please wait... (note: couldn't interrupt the thread)
ProgressPanel.populateStatusItem.resourceObjectActivity={0} ({1}) on {2}
ProgressTableHeader.Activity=Activity
ProgressTableHeader.ResourceObject=Resource object (if applicable)
ProgressTableHeader.Status=Status
Expand Down Expand Up @@ -4269,4 +4278,10 @@ PendingOperationPanel.attempt=Attempt:
PendingOperationPanel.lastAttemptTimestamp=Last attempt:
PendingOperationPanel.completionTimestamp=Completed:
pageForgetPassword.message.user.not.found=Reset password failed. Please contact system administrator.
PageCertDefinitions.campaignWasCreated=Certification campaign "{0}" was created.
PageCertDefinitions.campaignWasCreated=Certification campaign "{0}" was created.
StatisticsDto.getLastMessage.none=none
LoggingConfigurationTabPanel.appendersChoice.SyslogAppenderConfigurationType=Syslog appender
LoggingConfigurationTabPanel.appendersChoice.FileAppenderConfigurationType=File appender
LoggingConfigurationTabPanel.appender.nameColumn=Name
LoggingConfigurationTabPanel.appender.patternColumn=Pattern
LoggingConfigurationTabPanel.appender.typeColumn=Type
Expand Up @@ -1410,4 +1410,10 @@ th.countLabel{
.shopping-cart-icon > .badge { //fix for bug in firefox
margin-left: -10px !important;
}
}

@media (max-width: 767px) {
.content-wrapper {
width: 100%;
}
}

0 comments on commit bcf8fc1

Please sign in to comment.