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 Aug 14, 2023
2 parents b953326 + 10adcd0 commit 54c049f
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 24 deletions.
4 changes: 2 additions & 2 deletions gui/admin-gui/src/frontend/scss/midpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1752,8 +1752,8 @@ th.debug-list-buttons {

.request-access-wizard {
& .simple-tile {
width: 250px;
height: 250px;
width: 220px;
height: 220px;
}

& .role-catalog-tiles-table .catalog-tile-panel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5755,4 +5755,13 @@ public static <O extends AssignmentHolderType> List<String> getArchetypeOidsList
}
return oidsList;
}

public static <C extends Containerable> LoadableModel<PrismContainerDefinition<C>> getContainerDefinitionModel(Class<C> clazz) {
return new LoadableModel<>() {
@Override
protected PrismContainerDefinition<C> load() {
return PrismContext.get().getSchemaRegistry().findContainerDefinitionByCompileTimeClass(clazz);
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
import com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView;

import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
Expand Down Expand Up @@ -89,7 +91,7 @@ protected WebMarkupContainer createIconPanel(String idIcon) {
}

protected VisibleEnableBehaviour getDescriptionBehaviour() {
return VisibleEnableBehaviour.ALWAYS_VISIBLE_ENABLED;
return new VisibleBehaviour(() -> StringUtils.isNotEmpty(tileModel.getObject().getDescription()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper;
import com.evolveum.midpoint.gui.api.util.MappingDirection;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.api.util.WebPrismUtil;
import com.evolveum.midpoint.gui.impl.component.data.column.AbstractItemWrapperColumn;
import com.evolveum.midpoint.gui.impl.component.data.column.PrismPropertyWrapperColumn;
Expand Down Expand Up @@ -225,7 +226,7 @@ protected List<IColumn<PrismContainerValueWrapper<MappingType>, String>> createD
columns.add(new CheckBoxHeaderColumn<>());

IModel<PrismContainerDefinition<MappingType>> mappingTypeDef =
getMappingTypeDefinition();
WebComponentUtil.getContainerDefinitionModel(MappingType.class);

IColumn<PrismContainerValueWrapper<MappingType>, String> iconColumns = createUsedIconColumn();
Optional.ofNullable(iconColumns).ifPresent(column -> columns.add(column));
Expand Down Expand Up @@ -255,15 +256,6 @@ protected IColumn<PrismContainerValueWrapper<MappingType>, String> createUsedIco
};
protected abstract Collection<? extends IColumn<PrismContainerValueWrapper<MappingType>, String>> createCustomColumns();

protected LoadableModel<PrismContainerDefinition<MappingType>> getMappingTypeDefinition() {
return new LoadableModel<>() {
@Override
protected PrismContainerDefinition<MappingType> load() {
return PrismContext.get().getSchemaRegistry().findContainerDefinitionByCompileTimeClass(MappingType.class);
}
};
}

@Override
protected List<Component> createToolbarButtonsList(String idButton) {
List<Component> buttons = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.objectType.attributeMapping;

import com.evolveum.midpoint.gui.api.component.wizard.TileEnum;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper;
import com.evolveum.midpoint.gui.api.util.MappingDirection;
import com.evolveum.midpoint.gui.impl.component.data.column.AbstractItemWrapperColumn;
Expand All @@ -25,6 +26,7 @@
import org.apache.wicket.model.Model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

Expand All @@ -38,6 +40,29 @@ public InboundAttributeMappingsTable(
super(id, valueModel, config);
}

enum UsedFor {
CORRELATION(InboundMappingUseType.CORRELATION,
"text-warning fa fa-code-branch",
"InboundAttributeMappingsTable.usedForCorrelation"),
SYNCHRONIZATION(InboundMappingUseType.SYNCHRONIZATION,
"text-warning fa fa-rotate",
"InboundAttributeMappingsTable.usedForSynchronization"),
ALL(InboundMappingUseType.ALL,
"text-info fa fa-retweet",
"InboundAttributeMappingsTable.usedForAll");

private final InboundMappingUseType type;
private final String icon;

private final String tooltip;

UsedFor(InboundMappingUseType type, String icon, String tooltip) {
this.type = type;
this.icon = icon;
this.tooltip = tooltip;
}
}

@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PANEL_INBOUND_MAPPING_WIZARD;
Expand Down Expand Up @@ -67,13 +92,19 @@ public void populateItem(Item<ICellPopulator<PrismContainerValueWrapper<MappingT
protected DisplayType getIconDisplayType(IModel<PrismContainerValueWrapper<MappingType>> rowModel) {
PrismContainerValueWrapper<MappingType> mapping = rowModel.getObject();
MappingType mappingBean = mapping.getRealValue();
if (mappingBean instanceof InboundMappingType
&& InboundMappingUseType.CORRELATION.equals(((InboundMappingType) mappingBean).getUse())) {
return new DisplayType()
.tooltip("InboundAttributeMappingsTable.usedForCorrelation")
.beginIcon()
.cssClass("text-warning fa fa-code-branch")
.end();

InboundMappingUseType mappingUsed = ((InboundMappingType) mappingBean).getUse();
if (mappingUsed == null) {
mappingUsed = InboundMappingUseType.ALL;
}
for (UsedFor usedFor : Arrays.stream(UsedFor.values()).toList()) {
if (usedFor.type.equals(mappingUsed)) {
return new DisplayType()
.tooltip(usedFor.tooltip)
.beginIcon()
.cssClass(usedFor.icon)
.end();
}
}
return new DisplayType();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public VerifyResult execute() throws Exception {
result = super.execute();
}

log.info("");
log.info(
"Verification finished. {}, {}, {} optional issues found",
ConsoleFormat.formatMessageWithErrorParameters("{} critical", result.getCriticalCount()),
Expand All @@ -82,16 +83,16 @@ public VerifyResult execute() throws Exception {
if (options.getOutput() != null) {
log.info("Verification report saved to '{}'", options.getOutput().getPath());


if (Objects.equals(VerifyOptions.ReportStyle.CSV, options.getReportStyle())) {
log.info("XML dump with delta for each item saved to '{}'", options.getOutput().getPath() + VerificationReporter.DELTA_FILE_NAME_SUFFIX);
}

// FIXME: ADD links (do not display in batch mode)
// FIXME: Could We could try to infer script name?
if (context.isUserMode()) {
log.info("");
log.info("Please see documentation for use of verification report in upgrade process and modify it accordingly.");
log.info("After you reviewed verification report and marked changes to skip you can continue upgrade process "
log.info("After you've reviewed verification report and marked changes to skip you can continue upgrade process "
+ "with running 'ninja.sh upgrade-objects --verification-file \"{}\"'", options.getOutput().getPath());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ protected void handleResultOnFinish(OperationStatus operation, String finishMess
super.handleResultOnFinish(operation, finishMessage);
OperationResult result = operation.getResult();
if (result.isAcceptable() && context.isUserMode()) {
log.info("");
log.info("Objects were successfully upgraded.");
log.info("If you want to continue to continue with upgrade, please run:"
+ "ninja.sh upgrade-distribution.");
log.info("");
log.info("If you want to continue to continue with upgrade, please run: ninja.sh upgrade-distribution.");
}
}
}

0 comments on commit 54c049f

Please sign in to comment.