@@ -262,13 +262,20 @@ public ReactSelect getAddNewEntityTypeSelect()
262262 *
263263 * @return A select at this given ordinal position.
264264 */
265- private ReactSelect getEntityTypeByPosition (int index )
265+ public ReactSelect getEntityTypeByPosition (int index )
266266 {
267267 return ReactSelect .finder (getDriver ())
268268 .withNamedInput (String .format ("entityType%d" , index ))
269269 .waitFor (elementCache ());
270270 }
271271
272+ public ReactSelect getDisabledEntityTypeByLabel (String typeName )
273+ {
274+ return ReactSelect .finder (getDriver ())
275+ .followingLabelWithSpan (typeName )
276+ .waitFor (elementCache ());
277+ }
278+
272279 public ReactSelect getEntityType (String entityName )
273280 {
274281 Locator input = Locator .tagWithAttribute ("input" , "value" , entityName .toLowerCase ());
@@ -344,6 +351,10 @@ public ParentEntityEditPanel addParent(String typeName, String parentId)
344351 return addParents (typeName , Arrays .asList (parentId ));
345352 }
346353
354+ public ParentEntityEditPanel addParents (String typeName , List <String > parentIds )
355+ {
356+ return addParents (typeName , parentIds , false );
357+ }
347358 /**
348359 * Add a specific parents (samples or sources) from the given type. If the type is not currently being used for
349360 * parent elements it will be added.
@@ -353,9 +364,9 @@ public ParentEntityEditPanel addParent(String typeName, String parentId)
353364 * @param parentIds A list of the individuals samples or sources to add.
354365 * @return A reference to this panel.
355366 */
356- public ParentEntityEditPanel addParents (String typeName , List <String > parentIds )
367+ public ParentEntityEditPanel addParents (String typeName , List <String > parentIds , boolean skipAdd )
357368 {
358- if (getEntityType (typeName ) == null )
369+ if (! skipAdd && getEntityType (typeName ) == null )
359370 getAddNewEntityTypeSelect ().select (typeName );
360371
361372 var selectParent = getParentFinder (typeName ).waitFor (elementCache ());
@@ -393,6 +404,9 @@ public ParentEntityEditPanel removeEntityType(String typeName)
393404 boolean found = false ;
394405 for (ReactSelect reactSelect : selectControls )
395406 {
407+ if (reactSelect .isDisabled ())
408+ continue ;
409+
396410 if (reactSelect .getSelections ().contains (typeName ))
397411 {
398412 found = true ;
@@ -444,6 +458,11 @@ public void clearActionComment()
444458 elementCache ().commentInput .clear ();
445459 }
446460
461+ public boolean hasParentInputError ()
462+ {
463+ return Locator .tagWithClass ("div" , "edit-parent-danger" ).isDisplayed (this );
464+ }
465+
447466
448467 /**
449468 * Simple finder for this panel.
0 commit comments