Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
* 'master' of github.com:Evolveum/midpoint: (80 commits)
  Adapt TestCsvSimulationReport
  Finalize sim reports and event marks
  Prevent deletion of protected shadows in admin GUI
  MID-8495 added description for login page in case of multiple loginForm modules
  Add support for sync reaction lifecycle state
  MID-8598:fix for break long word in table after rerender
  Fix MID-8500 reconciliation task on resource prefilling
  Import missing archetypes in AbstractLongTest
  Fix MID-8592 entitlements search
  MID-8651:mark object class in delineation of object type as mandatory
  MID-8657 anothe NPE fix
  MID-8657 added marks to list of resource objects in Resource/Accounts,Entitlements,Generic, onclick fix
  MID-8655: Use ShadowType in deltas to trigger provisioning effectiveMark computation
  MID-8470: Do not include incomplete=true in LookupTables
  Add tests for MID-8639 and improve the fix
  fix for null sequence id while ldap authentication
  TwoStateSimulatedToRealConverter: quotes around attribute, cleanup
  MID-8657 added marks to list of resource objects in Resource/Accounts,Entitlements,Generic
  Remove 005-standard-functions.xml object
  Stop storing "consideredEventMarkRef" into repo
  ...
  • Loading branch information
katkav committed Mar 26, 2023
2 parents 9bc559d + 0f38820 commit 0337083
Show file tree
Hide file tree
Showing 190 changed files with 3,821 additions and 1,366 deletions.
78 changes: 33 additions & 45 deletions config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -169,37 +169,17 @@ $aa$);

-- changes for 4.7

-- Simulations
-- Simulations, enum type changes
call apply_change(12, $aa$
do $$
begin
-- Temporary code, to migrate from TagType to MarkType
if 'TAG'::name = any(enum_range(null::ObjectType)::name[]) then
ALTER TYPE ObjectType RENAME VALUE 'TAG' TO 'MARK';
ALTER TYPE ReferenceType RENAME VALUE 'PROCESSED_OBJECT_EVENT_TAG' TO 'PROCESSED_OBJECT_EVENT_MARK';
else
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'MARK' AFTER 'LOOKUP_TABLE';
ALTER TYPE ReferenceType ADD VALUE IF NOT EXISTS 'PROCESSED_OBJECT_EVENT_MARK' AFTER 'PERSONA';
ALTER TYPE ReferenceType ADD VALUE IF NOT EXISTS 'OBJECT_EFFECTIVE_MARK' AFTER 'OBJECT_CREATE_APPROVER';
end if;
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT' AFTER 'SHADOW';
ALTER TYPE ContainerType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT_PROCESSED_OBJECT' AFTER 'OPERATION_EXECUTION';
end
$$;
$aa$, true); -- TODO remove forced before release
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'MARK' AFTER 'LOOKUP_TABLE';
ALTER TYPE ReferenceType ADD VALUE IF NOT EXISTS 'PROCESSED_OBJECT_EVENT_MARK' AFTER 'PERSONA';
ALTER TYPE ReferenceType ADD VALUE IF NOT EXISTS 'OBJECT_EFFECTIVE_MARK' AFTER 'OBJECT_CREATE_APPROVER';
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT' AFTER 'SHADOW';
ALTER TYPE ContainerType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT_PROCESSED_OBJECT' AFTER 'OPERATION_EXECUTION';
$aa$);

-- Simulations, tables
call apply_change(13, $aa$
-- TODO delete before release
DROP TABLE IF EXISTS m_simulation_result CASCADE;
DROP TABLE IF EXISTS m_simulation_result_processed_object_default CASCADE;
DROP TABLE IF EXISTS m_simulation_result_processed_object CASCADE;
DROP TABLE IF EXISTS m_tag CASCADE;
DROP TABLE IF EXISTS m_mark CASCADE;
DROP TABLE IF EXISTS m_processed_object_event_tag;
DROP TABLE IF EXISTS m_processed_object_event_mark;
DROP TYPE IF EXISTS ObjectProcessingStateType;
-- TODO end of the block

CREATE TABLE m_simulation_result (
oid UUID NOT NULL PRIMARY KEY REFERENCES m_object_oid(oid),
objectType ObjectType GENERATED ALWAYS AS ('SIMULATION_RESULT') STORED
Expand Down Expand Up @@ -289,6 +269,18 @@ LANGUAGE plpgsql;
CREATE TRIGGER m_simulation_result_delete_partition BEFORE DELETE ON m_simulation_result
FOR EACH ROW EXECUTE FUNCTION m_simulation_result_delete_partition();

CREATE TABLE m_processed_object_event_mark (
ownerOid UUID NOT NULL REFERENCES m_object_oid(oid) ON DELETE CASCADE,
ownerType ObjectType, -- GENERATED ALWAYS AS ('SIMULATION_RESULT') STORED,
processedObjectCid INTEGER NOT NULL,
referenceType ReferenceType GENERATED ALWAYS AS ('PROCESSED_OBJECT_EVENT_MARK') STORED,
targetOid UUID NOT NULL, -- soft-references m_object
targetType ObjectType NOT NULL,
relationId INTEGER NOT NULL REFERENCES m_uri(id)

) PARTITION BY LIST(ownerOid);

CREATE TABLE m_processed_object_event_mark_default PARTITION OF m_processed_object_event_mark DEFAULT;

CREATE TABLE m_mark (
oid UUID NOT NULL PRIMARY KEY REFERENCES m_object_oid(oid),
Expand All @@ -304,21 +296,6 @@ CREATE TRIGGER m_mark_update_tr BEFORE UPDATE ON m_mark
CREATE TRIGGER m_mark_oid_delete_tr AFTER DELETE ON m_mark
FOR EACH ROW EXECUTE FUNCTION delete_object_oid();


CREATE TABLE m_processed_object_event_mark (
ownerOid UUID NOT NULL REFERENCES m_object_oid(oid) ON DELETE CASCADE,
ownerType ObjectType, -- GENERATED ALWAYS AS ('SIMULATION_RESULT') STORED,
processedObjectCid INTEGER NOT NULL,
referenceType ReferenceType GENERATED ALWAYS AS ('PROCESSED_OBJECT_EVENT_MARK') STORED,
targetOid UUID NOT NULL, -- soft-references m_object
targetType ObjectType NOT NULL,
relationId INTEGER NOT NULL REFERENCES m_uri(id)

) PARTITION BY LIST(ownerOid);

CREATE TABLE m_processed_object_event_mark_default PARTITION OF m_processed_object_event_mark DEFAULT;


-- stores ObjectType/effectiveMarkRef
CREATE TABLE m_ref_object_effective_mark (
ownerOid UUID NOT NULL REFERENCES m_object_oid(oid) ON DELETE CASCADE,
Expand All @@ -329,11 +306,22 @@ CREATE TABLE m_ref_object_effective_mark (
)
INHERITS (m_reference);

CREATE INDEX m_ref_object_effective_markTargetOidRelationId_idx
CREATE INDEX m_ref_object_effective_mark_targetOidRelationId_idx
ON m_ref_object_effective_mark (targetOid, relationId);
$aa$);

$aa$, true); -- TODO remove `true` before M2 or before RC1! (Also, the first 3 table drops)
-- Minor index name fixes
call apply_change(14, $aa$
ALTER INDEX m_ref_object_create_approverTargetOidRelationId_idx
RENAME TO m_ref_object_create_approver_targetOidRelationId_idx;
ALTER INDEX m_ref_object_modify_approverTargetOidRelationId_idx
RENAME TO m_ref_object_modify_approver_targetOidRelationId_idx;
$aa$);

-- Making resource.abstract queryable
call apply_change(15, $aa$
ALTER TABLE m_resource ADD abstract BOOLEAN;
$aa$);

-- WRITE CHANGES ABOVE ^^
-- IMPORTANT: update apply_change number at the end of postgres-new.sql
Expand Down
15 changes: 8 additions & 7 deletions config/sql/native-new/postgres-new.sql
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ CREATE TABLE m_ref_object_create_approver (
)
INHERITS (m_reference);

CREATE INDEX m_ref_object_create_approverTargetOidRelationId_idx
CREATE INDEX m_ref_object_create_approver_targetOidRelationId_idx
ON m_ref_object_create_approver (targetOid, relationId);


Expand All @@ -415,7 +415,7 @@ CREATE TABLE m_ref_object_effective_mark (
)
INHERITS (m_reference);

CREATE INDEX m_ref_object_effective_markTargetOidRelationId_idx
CREATE INDEX m_ref_object_effective_mark_targetOidRelationId_idx
ON m_ref_object_effective_mark (targetOid, relationId);


Expand All @@ -429,7 +429,7 @@ CREATE TABLE m_ref_object_modify_approver (
)
INHERITS (m_reference);

CREATE INDEX m_ref_object_modify_approverTargetOidRelationId_idx
CREATE INDEX m_ref_object_modify_approver_targetOidRelationId_idx
ON m_ref_object_modify_approver (targetOid, relationId);

-- stores AssignmentHolderType/roleMembershipRef
Expand Down Expand Up @@ -872,7 +872,8 @@ CREATE TABLE m_resource (
connectorRefTargetOid UUID,
connectorRefTargetType ObjectType,
connectorRefRelationId INTEGER REFERENCES m_uri(id),
template BOOLEAN
template BOOLEAN,
abstract BOOLEAN
)
INHERITS (m_assignment_holder);

Expand Down Expand Up @@ -1742,7 +1743,7 @@ CREATE TABLE m_assignment (
containerType ContainerType NOT NULL CHECK (containerType IN ('ASSIGNMENT', 'INDUCEMENT')),
ownerType ObjectType NOT NULL,
lifecycleState TEXT,
orderValue INTEGER,
orderValue INTEGER, -- item "order"
orgRefTargetOid UUID,
orgRefTargetType ObjectType,
orgRefRelationId INTEGER REFERENCES m_uri(id),
Expand Down Expand Up @@ -2077,11 +2078,11 @@ BEGIN
END IF;
COMMIT;
ELSE
RAISE NOTICE 'Change #% skipped, last change #% is newer!', changeNumber, lastChange;
RAISE NOTICE 'Change #% skipped - not newer than the last change #%!', changeNumber, lastChange;
END IF;
END $$;
-- endregion

-- Initializing the last change number used in postgres-new-upgrade.sql.
-- This is important to avoid applying any change more than once.
call apply_change(11, $$ SELECT 1 $$, true);
call apply_change(15, $$ SELECT 1 $$, true);
6 changes: 6 additions & 0 deletions gui/admin-gui/src/frontend/js/ace-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export default class MidPointAceEditor {
var jqTextArea = '#' + textAreaId;
var editorId = textAreaId + ACE_EDITOR_POSTFIX;
var jqEditor = '#' + editorId;

if ($("#" + editorId).length > 0){
$(jqTextArea).hide();
return;
}

//
var newHeight = height;
if (resize) {
Expand Down
43 changes: 21 additions & 22 deletions gui/admin-gui/src/frontend/js/midpoint-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,6 @@ export default class MidPointTheme {
});
});

jQuery(function ($) {
$(".word-break-longer-text").css("word-break", function (index, origValue) {

var textOfColumn = $(".word-break-longer-text")[index].innerText;
if (textOfColumn != '' && textOfColumn != ' ') {
var numberOfChars = 15;
var controlValue = numberOfChars;
var indexOfSpace = textOfColumn.indexOf(' ');

while (indexOfSpace == (controlValue - numberOfChars)) {
controlValue = controlValue + 1 + indexOfSpace;
indexOfSpace = textOfColumn.indexOf(' ', (indexOfSpace + 1));
}

if (indexOfSpace + 1 != textOfColumn.length && textOfColumn.length > controlValue) {
return "break-word";
}
}
return "inherit";
});
});

jQuery(function ($) {
$(document).on("click", ".compositedButton[data-toggle='tooltip']", function (e, t) {
var parent = $(this).closest('.modal-dialog-content');
Expand All @@ -179,6 +157,27 @@ export default class MidPointTheme {
});
}

breakLongerTextInTableCell(cellId) {
$("#" + cellId).css("word-break", function (index, origValue) {
var textOfColumn = document.getElementById(cellId).innerText;
if (textOfColumn != '' && textOfColumn != ' ') {
var numberOfChars = 15;
var controlValue = numberOfChars;
var indexOfSpace = textOfColumn.indexOf(' ');

while (indexOfSpace == (controlValue - numberOfChars)) {
controlValue = controlValue + 1 + indexOfSpace;
indexOfSpace = textOfColumn.indexOf(' ', (indexOfSpace + 1));
}

if (indexOfSpace + 1 != textOfColumn.length && textOfColumn.length > controlValue) {
return "break-word";
}
}
return "inherit";
});
}

// I'm not sure why sidebar has 15px padding -> and why I had to use 10px constant here [lazyman]
fixContentHeight() {
if ($(".main-footer").length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public class GuiStyleConstants {
public static final String CLASS_TASK_STATISTICS_ICON = "fa fa-chart-line";
public static final String CLASS_TASK_ERRORS_ICON = "fa fa-exclamation-circle";
public static final String CLASS_TASK_ACTIVITY_ICON = "fa fa-cog";
public static final String CLASS_TASK_EXECUTION_ICON = "fa fa-gears";

public static final String CLASS_GROUP_ICON = "fa fa-users";
public static final String CLASS_APPLICABLE_POLICY_ICON = "fa fa-share-alt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.apache.wicket.RestartResponseException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.IModel;
Expand All @@ -26,7 +25,6 @@
import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.component.button.CsvDownloadButtonPanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.GuiDisplayTypeUtil;
Expand Down Expand Up @@ -65,7 +63,6 @@
import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.PageImportObject;
import com.evolveum.midpoint.web.page.admin.users.component.ExecuteChangeOptionsDto;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
Expand Down Expand Up @@ -224,7 +221,7 @@ protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRe
getPageBase().showMainPopup(buttonsPanel, target);
}
};
createNewObjectButton.add(new VisibleBehaviour(this::isCreateNewObjectEnabled));
createNewObjectButton.add(new VisibleBehaviour(this::isCreateNewObjectVisible));
createNewObjectButton.add(AttributeAppender.append("class", "btn btn-default btn-sm"));
return createNewObjectButton;
}
Expand Down Expand Up @@ -415,8 +412,9 @@ private IModel<String> getRefreshPausePlayButtonTitleModel() {
return createStringResource("MainObjectListPanel.refresh.start").getString();
};
}
protected boolean isCreateNewObjectEnabled() {
return !isCollectionViewPanel() || !getNewObjectInfluencesList().isEmpty();
protected boolean isCreateNewObjectVisible() {
return !isCollectionViewPanel() || getObjectCollectionView().isApplicableForOperation(OperationTypeType.ADD) ||
CollectionUtils.isNotEmpty(getNewObjectInfluencesList());
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ protected boolean notContainsNameColumn(@NotNull List<IColumn<SelectableBean<O>,

@Override
protected IColumn<SelectableBean<O>, String> createNameColumn(IModel<String> displayModel, GuiObjectColumnType customColumn, ExpressionType expression) {
ItemPath itemPath = WebComponentUtil.getPath(customColumn);

return new ObjectNameColumn<>(displayModel == null ? createStringResource("ObjectType.name") : displayModel,
customColumn, expression, getPageBase()) {
private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
<body>
<wicket:panel>
<div wicket:id="operationResultsPanel" />
<a class="btn btn-default btn-sm pull-right" wicket:id="ok" />

<wicket:fragment wicket:id="buttons">
<div class="d-flex flex-wrap gap-2 w-100">
<a class="btn btn-outline-primary" wicket:id="close">
<wicket:message key="Button.close"/>
</a>
</div>
</wicket:fragment>
</wicket:panel>
</body>
</html>

0 comments on commit 0337083

Please sign in to comment.