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 11, 2019
2 parents ac94b50 + cbe4520 commit 0e6a0ad
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 329 deletions.
Expand Up @@ -1491,11 +1491,9 @@ th.countLabel{
table-layout: fixed; // fix for text in cells
}

@-moz-document url-prefix() {
.shopping-cart-icon > .badge { //fix for bug in firefox
.shopping-cart-icon > .badge {
margin-left: -10px !important;
}
}

@media (max-width: 767px) {
.content-wrapper {
Expand Down
Expand Up @@ -2286,13 +2286,15 @@
those hardcoded lifecycle states need to be explicitly defined in the state model
and the forcedActivationStatus property shoule be left undefined.
</p>
<!-- TODO: should be replaced by assignmentSelector later -->
</xsd:documentation>
<xsd:appinfo>
<a:since>3.8</a:since>
<a:displayName>LifecycleStateType.activeAssignments</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<!-- TODO: MID-5741: assignmentSelector that can be used to selectively activate/deactivate assignments based on their targetType, targetArchetype, relation, subtype and so on -->
<!-- TODO: activationStatus -->
<xsd:element name="entryAction" type="tns:LifecycleStateActionType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
Expand Down
Expand Up @@ -28,6 +28,7 @@
import com.evolveum.midpoint.schema.util.*;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.util.LocalizableMessage;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.exception.*;
import com.evolveum.midpoint.util.logging.LoggingUtils;

Expand Down Expand Up @@ -547,7 +548,15 @@ public static <F extends ObjectType> boolean evaluateIterationCondition(LensCont
*/
public static boolean isAssignmentValid(AssignmentHolderType focus, AssignmentType assignmentType, XMLGregorianCalendar now,
ActivationComputer activationComputer, LifecycleStateModelType focusStateModel) {
String focusLifecycleState = focus.getLifecycleState();
ObjectReferenceType targetRef = assignmentType.getTargetRef();
if (targetRef != null) {
if (QNameUtil.match(ArchetypeType.COMPLEX_TYPE, targetRef.getType())) {
// Archetype assignments are always valid, even in non-valid lifecycle states.
// The object cannot lose its (arche)type.
return true;
}
}
String focusLifecycleState = focus.getLifecycleState();

if (!activationComputer.lifecycleHasActiveAssignments(focusLifecycleState, focusStateModel)) {
return false;
Expand Down
Expand Up @@ -84,6 +84,9 @@ public class TestArchetypes extends AbstractArchetypesTest {

public static final File USER_MEATHOOK_FILE = new File(TEST_DIR, "user-meathook.xml");
protected static final String USER_MEATHOOK_OID = "f79fc10e-78a8-11e9-92ec-cf427cb6e7a0";

public static final File USER_WANNABE_FILE = new File(TEST_DIR, "user-wannabe.xml");
protected static final String USER_WANNABE_OID = "28038d88-d3eb-11e9-87fb-cff5e050b6f9";

public static final File ROLE_EMPLOYEE_BASE_FILE = new File(TEST_DIR, "role-employee-base.xml");
protected static final String ROLE_EMPLOYEE_BASE_OID = "e869d6c4-f6ef-11e8-b51f-df3e51bba129";
Expand Down Expand Up @@ -747,6 +750,42 @@ public void test140AddMeathookContractor() throws Exception {
.end()
.assertEmployeeNumber(CONTRACTOR_EMPLOYEE_NUMBER);
}

/**
* Add "Wanabe" user with an contractor archetype, but in DRAFT lifecycle state.
* Even though assignments are not active in draft state, archetype assignment should be active anyway.
* MID-5583
*/
@Test
public void test150AddWannabe() throws Exception {
final String TEST_NAME = "test150AddWannabe";
displayTestTitle(TEST_NAME);

Task task = createTask(TEST_NAME);
OperationResult result = task.getResult();

// WHEN
displayWhen(TEST_NAME);

addObject(USER_WANNABE_FILE, task, result);

// THEN
displayThen(TEST_NAME);
assertSuccess(result);

assertUserAfter(USER_WANNABE_OID)
.assertLifecycleState(SchemaConstants.LIFECYCLE_DRAFT)
.assignments()
.assertAssignments(1)
.assertArchetype(ARCHETYPE_CONTRACTOR_OID)
.end()
.assertArchetypeRef(ARCHETYPE_CONTRACTOR_OID)
.roleMembershipRefs()
.assertRoleMemberhipRefs(1)
.assertArchetype(ARCHETYPE_CONTRACTOR_OID)
.end()
.assertEmployeeNumber(CONTRACTOR_EMPLOYEE_NUMBER);
}

@Test
public void test200AssignJackBarbossaArchetypeEmployee() throws Exception {
Expand Down
22 changes: 22 additions & 0 deletions model/model-intest/src/test/resources/archetypes/user-wannabe.xml
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2019 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->

<user oid="28038d88-d3eb-11e9-87fb-cff5e050b6f9"
xmlns='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
xmlns:t='http://prism.evolveum.com/xml/ns/public/types-3'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:piracy='http://midpoint.evolveum.com/xml/ns/samples/piracy'>
<name>wannabe</name>
<lifecycleState>draft</lifecycleState>
<assignment>
<targetRef oid="3911cac2-78a6-11e9-8b5e-4b5bdb0c81d5" type="ArchetypeType"/> <!-- Contractor -->
</assignment>
<fullName>Contractor Wannabe</fullName>
</user>
180 changes: 0 additions & 180 deletions weblogic-build/pom.xml

This file was deleted.

0 comments on commit 0e6a0ad

Please sign in to comment.