Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.labkey.test.components.react.FilteringReactSelect;
import org.labkey.test.components.react.ReactDateTimePicker;
import org.labkey.test.components.react.ToggleButton;
import org.labkey.test.components.ui.files.AttachmentCard;
import org.labkey.test.components.ui.files.FileAttachmentContainer;
import org.labkey.test.components.ui.files.FileUploadField;
import org.labkey.test.params.FieldDefinition;
Expand Down Expand Up @@ -294,6 +295,24 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
return this;
}

/**
* Removes an existing attachment displayed as an {@link AttachmentCard} in the bulk update dialog.
* This is used when the rows being edited already have an attachment — the existing file is shown
* as an AttachmentCard with a dropdown menu containing "Remove attachment".
*
* @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
* @return this component
*/
public EntityBulkUpdateDialog removeExistingAttachment(CharSequence fieldIdentifier)
{
var row = getFileField(fieldIdentifier);
// setEditableState(fieldIdentifier, true);
// WebElement row = elementCache().formRow(fieldIdentifier);
AttachmentCard card = new AttachmentCard.FileAttachmentCardFinder(getDriver()).waitFor(row);
card.clickRemove();
return this;
}

public FileUploadField getExistingFileCard(CharSequence fieldIdentifier)
{
FieldKey identifier = FileAttachmentContainer.fileUploadFieldKey(fieldIdentifier);
Expand Down
Loading