Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Sep 14, 2022
2 parents 6368fd3 + f364916 commit 2f86950
Show file tree
Hide file tree
Showing 61 changed files with 927 additions and 536 deletions.
7 changes: 3 additions & 4 deletions config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,15 @@ CREATE TABLE m_focus_identity (
CHECK (containerType = 'FOCUS_IDENTITY'),
fullObject BYTEA,
sourceResourceRefTargetOid UUID,
itemsOriginal JSONB,
itemsNormalized JSONB,

PRIMARY KEY (ownerOid, cid)
)
INHERITS(m_container);

CREATE INDEX m_focus_identity_sourceResourceRefTargetOid_idx ON m_focus_identity (sourceResourceRefTargetOid);
CREATE INDEX m_focus_identity_itemsOriginal_idx ON m_focus_identity USING gin(itemsOriginal);
CREATE INDEX m_focus_identity_itemsNormalized_idx ON m_focus_identity USING gin(itemsNormalized);

ALTER TABLE m_focus ADD normalizedData JSONB;
CREATE INDEX m_focus_normalizedData_idx ON m_focus USING gin(normalizedData);
$aa$);

-- resource templates
Expand Down
5 changes: 1 addition & 4 deletions config/sql/native-new/postgres-new.sql
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ CREATE TABLE m_focus (
validityChangeTimestamp TIMESTAMPTZ,
archiveTimestamp TIMESTAMPTZ,
lockoutStatus LockoutStatusType,
normalizedData JSONB,

CHECK (FALSE) NO INHERIT
)
Expand Down Expand Up @@ -495,16 +496,12 @@ CREATE TABLE m_focus_identity (
CHECK (containerType = 'FOCUS_IDENTITY'),
fullObject BYTEA,
sourceResourceRefTargetOid UUID,
itemsOriginal JSONB,
itemsNormalized JSONB,

PRIMARY KEY (ownerOid, cid)
)
INHERITS(m_container);

CREATE INDEX m_focus_identity_sourceResourceRefTargetOid_idx ON m_focus_identity (sourceResourceRefTargetOid);
CREATE INDEX m_focus_identity_itemsOriginal_idx ON m_focus_identity USING gin(itemsOriginal);
CREATE INDEX m_focus_identity_itemsNormalized_idx ON m_focus_identity USING gin(itemsNormalized);

-- Represents GenericObjectType, see https://docs.evolveum.com/midpoint/reference/schema/generic-objects/
CREATE TABLE m_generic_object (
Expand Down
16 changes: 14 additions & 2 deletions gui/admin-gui/src/frontend/js/midpoint-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,26 @@ export default class MidPointTheme {
history.replaceState(null, null, "?" + queryParams.toString());
}

increment(inputId, increment) {
increment(inputId, incrementId, decrementId, increment) {
var input = $('#' + inputId);
var inc = $('#' + incrementId);
var dec = $('#' + decrementId);

var value = parseInt(input.val(), 10) || 0;

value = value + increment;
if (value <= 0) {
if (value <= 5) {
value = 5;
dec.addClass("disabled");
} else {
dec.removeClass("disabled")
}

if (value >= 100) {
value = 100;
inc.addClass("disabled");
} else {
inc.removeClass("disabled");
}

input.val(value);
Expand Down
16 changes: 14 additions & 2 deletions gui/admin-gui/src/frontend/scss/_tiles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
@mixin selectable-tile {
cursor: pointer;

&:hover,
&:hover {
border: 2px solid $input-border-color;
border-radius: $border-radius;
}

&.active {
border: 2px solid $primary;
border-radius: $border-radius;
Expand All @@ -40,7 +44,10 @@
}

@mixin selectable-tile-dark-mode {
&:hover,
&:hover {
border-color: $gray-400;
}

&.active {
border-color: $primary-alt;
}
Expand Down Expand Up @@ -72,6 +79,11 @@
position: relative;
top: -20px;
left: 32px;
margin-bottom: -20px;

&.rounded-icon-none {
margin-bottom: 0;
}
}

& > .title {
Expand Down
25 changes: 25 additions & 0 deletions gui/admin-gui/src/frontend/scss/midpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1748,3 +1748,28 @@ th.debug-list-buttons {
.flex-basis-0 {
flex-basis: 0px!important;
}

.paging-size {
& > input {
max-width: 50px;
}

& .btn-increment {
line-height: 1;
color: #444;

display: flex;
border: 1px solid #ced4da;
flex: 1 1 auto !important;
padding: 0 0.25rem !important;
align-items: center !important;
cursor: pointer;

&.disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 0.65;
background-color: #f8f9fa;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@ public void previous() {
}

public WizardStep getNextPanel() {
int nextIndex = activeStepIndex + 1;
if (steps.size() <= nextIndex) {
return null;
}

return steps.get(nextIndex);
return findNextStep();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class CatalogTile<T extends Serializable> extends Tile<T> {

private RoundedIconPanel.State checkState;

private String checkTitle;

public CatalogTile() {
this(null, null);
}
Expand Down Expand Up @@ -54,4 +56,12 @@ public RoundedIconPanel.State getCheckState() {
public void setCheckState(RoundedIconPanel.State checkState) {
this.checkState = checkState;
}

public String getCheckTitle() {
return checkTitle;
}

public void setCheckTitle(String checkTitle) {
this.checkTitle = checkTitle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void initLayout() {
RoundedImagePanel logo1 = new RoundedImagePanel(ID_LOGO, () -> createDisplayType(getModel()), createPreferredImage(getModel()));
add(logo1);

RoundedIconPanel check = new RoundedIconPanel(ID_CHECK, () -> "fa fa-check", () -> getModelObject().getCheckState());
RoundedIconPanel check = new RoundedIconPanel(ID_CHECK, () -> "fa fa-check", () -> getModelObject().getCheckState(), () -> getModelObject().getCheckTitle());
add(check);

Label description = new Label(ID_DESCRIPTION, () -> getModelObject().getDescription());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package com.evolveum.midpoint.gui.impl.page.admin.component;

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
Expand All @@ -19,8 +21,6 @@
import com.evolveum.midpoint.web.component.prism.ItemVisibility;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.wicket.model.IModel;

@PanelType(name = "formPanel")
@PanelInstance(
identifier = "infrastructurePanel",
Expand Down Expand Up @@ -152,25 +152,6 @@
},
expanded = true
)
// todo custom panel needs to be created for logging, since profilingClassLogger property wrapper is created automagically and
// can't be hidden using virtual container because it's using non-existing path (item name).
//@PanelInstance(
// identifier = "loggingPanel",
// applicableForType = LoggingConfigurationType.class,
// display = @PanelDisplay(
// label = "LoggingPanelContent.label",
// icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
// order = 100
// ),
// expanded = true,
// containerPath = "logging",
// hiddenContainers = {
// "logging/classLogger",
// "logging/subSystemLogger",
// "logging/appender",
// "logging/profilingClassLogger"
// }
//)
public class GenericSingleContainerPanel<C extends Containerable, O extends ObjectType> extends AbstractObjectMainPanel<O, ObjectDetailsModels<O>> {

private static final String ID_DETAILS = "details";
Expand All @@ -183,6 +164,7 @@ public GenericSingleContainerPanel(String id, ObjectDetailsModels<O> model, Cont
protected void initLayout() {
add(new SingleContainerPanel<C>(ID_DETAILS, (IModel) getObjectWrapperModel(), getPanelConfiguration()) {
private static final long serialVersionUID = 1L;

@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
ContainerPanelConfigurationType config = getPanelConfiguration();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
~ Copyright (c) 2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row no-gutters mb-3">
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label">Host</div>
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="host"/>
</div>
<div class="row no-gutters mb-3">
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label">Port</div>
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="port"/>
</div>
<div class="row no-gutters mb-3">
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label">Username</div>
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="username"/>
</div>
<div class="row no-gutters mb-3">
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label">Password</div>
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="password"/>
</div>
</wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2022 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.impl.page.admin.systemconfiguration.component;

import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

import com.evolveum.midpoint.gui.api.component.password.PasswordPanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.web.component.input.TextPanel;
import com.evolveum.midpoint.web.component.prism.InputPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MailServerConfigurationType;

/**
* Created by Viliam Repan (lazyman).
*/
public class MailServerPanel extends InputPanel {

private static final long serialVersionUID = 1L;

private static final String ID_HOST = "host";
private static final String ID_PORT = "port";
private static final String ID_USERNAME = "username";
private static final String ID_PASSWORD = "password";

private IModel<MailServerConfigurationType> model;

public MailServerPanel(String id, IModel<MailServerConfigurationType> model) {
super(id);

this.model = new LoadableModel<>() {

@Override
protected MailServerConfigurationType load() {
if (model == null) {
return new MailServerConfigurationType();
}

MailServerConfigurationType config = model.getObject();

return config != null ? config : new MailServerConfigurationType();
}
};

initLayout();
}

public IModel<MailServerConfigurationType> getModel() {
return model;
}

private void initLayout() {
add(new TextPanel<>(ID_HOST, new PropertyModel<>(model, MailServerConfigurationType.F_HOST.getLocalPart())));
add(new TextPanel<>(ID_PORT, new PropertyModel<>(model, MailServerConfigurationType.F_PORT.getLocalPart())));
add(new TextPanel<>(ID_USERNAME, new PropertyModel<>(model, MailServerConfigurationType.F_USERNAME.getLocalPart())));
add(new PasswordPanel(ID_PASSWORD, new PropertyModel<>(model, MailServerConfigurationType.F_PASSWORD.getLocalPart())));
}

@Override
public FormComponent getBaseFormComponent() {
return ((TextPanel) get(ID_HOST)).getBaseFormComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2022 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.impl.page.admin.systemconfiguration.component;

import javax.annotation.PostConstruct;

import org.springframework.stereotype.Component;

import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper;
import com.evolveum.midpoint.gui.impl.factory.panel.AbstractInputGuiComponentFactory;
import com.evolveum.midpoint.gui.impl.factory.panel.PrismPropertyPanelContext;
import com.evolveum.midpoint.web.component.prism.InputPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MailServerConfigurationType;

/**
* Created by Viliam Repan (lazyman).
*/
@Component
public class MailServerPanelFactory extends AbstractInputGuiComponentFactory<MailServerConfigurationType> {

@PostConstruct
public void register() {
getRegistry().addToRegistry(this);
}

@Override
public <IW extends ItemWrapper<?, ?>> boolean match(IW wrapper) {
return MailServerConfigurationType.COMPLEX_TYPE.equals(wrapper.getTypeName());
}

@Override
protected InputPanel getPanel(PrismPropertyPanelContext<MailServerConfigurationType> panelCtx) {
return new MailServerPanel(panelCtx.getComponentId(), panelCtx.getRealValueModel());
}
}

0 comments on commit 2f86950

Please sign in to comment.