Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWC-6910 - EntityFinder prop was removed #5602

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
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 @@ -18,12 +18,6 @@ public interface OnSelectCallback {
void run(ReferenceJSNIObject[] selected);
}

@FunctionalInterface
@JsFunction
public interface SelectedCopyHandler {
String getSelectedCopy(int count);
}

OnSelectCallback onSelectedChange;
boolean selectMultiple;
String versionSelection;
Expand All @@ -46,9 +40,6 @@ public interface SelectedCopyHandler {
@JsNullable
String[] selectableTypes;

@JsNullable
SelectedCopyHandler selectedCopy;

@JsNullable
boolean treeOnly;

Expand All @@ -63,7 +54,6 @@ public static EntityFinderProps create(
List<EntityType> visibleTypesInList,
List<EntityType> visibleTypesInTree,
List<EntityType> selectableTypes,
SelectedCopyHandler selectedCopy,
boolean treeOnly
) {
EntityFinderProps props = new EntityFinderProps();
Expand All @@ -85,7 +75,6 @@ public static EntityFinderProps create(
for (int i = 0; i < selectableTypes.size(); i++) {
props.selectableTypes[i] = selectableTypes.get(i).toString();
}
props.selectedCopy = selectedCopy;
props.treeOnly = treeOnly;
return props;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ Builder setInitialContainer(

Builder setHelpMarkdown(String helpMarkdown);

Builder setSelectedCopy(EntityFinderProps.SelectedCopyHandler selectedCopy);

Builder setInitialScope(EntityFinderScope initialScope);

Builder setConfirmButtonCopy(String confirmButtonCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class EntityFinderWidgetImpl

private String modalTitle;
private String promptCopy;
private EntityFinderProps.SelectedCopyHandler selectedCopy;
private String confirmButtonCopy;

@Inject
Expand Down Expand Up @@ -104,7 +103,6 @@ private EntityFinderWidgetImpl(
treeOnly = builder.treeOnly;
modalTitle = builder.modalTitle;
promptCopy = builder.promptCopy;
selectedCopy = builder.selectedCopy;
modalTitle = builder.modalTitle;
multiSelect = builder.multiSelect;
initialContainer = builder.initialContainer;
Expand Down Expand Up @@ -164,8 +162,6 @@ public static class Builder implements EntityFinderWidget.Builder {
private EntityFinderScope initialScope = EntityFinderScope.CREATED_BY_ME;
private String modalTitle = "Find in Synapse";
private String promptCopy = "";
private EntityFinderProps.SelectedCopyHandler selectedCopy = count ->
"Selected";
private String confirmButtonCopy = "Select";
private String helpMarkdown =
"Finding items in Synapse can be done by either “browsing”, “searching,” or directly entering the Synapse ID.&#10;Alternatively, navigate to the desired location in the current project, favorite projects or projects you own.";
Expand Down Expand Up @@ -260,14 +256,6 @@ public EntityFinderWidget.Builder setHelpMarkdown(String helpMarkdown) {
return this;
}

@Override
public EntityFinderWidget.Builder setSelectedCopy(
EntityFinderProps.SelectedCopyHandler selectedCopy
) {
this.selectedCopy = selectedCopy;
return this;
}

@Override
public EntityFinderWidget.Builder setInitialScope(
EntityFinderScope initialScope
Expand Down Expand Up @@ -378,7 +366,6 @@ public void onSuccess(EntityBundle result) {
selectableTypes,
visibleTypesInList,
visibleTypesInTree,
selectedCopy,
treeOnly
);
}
Expand All @@ -395,7 +382,6 @@ public void onSuccess(EntityBundle result) {
selectableTypes,
visibleTypesInList,
visibleTypesInTree,
selectedCopy,
treeOnly
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ void renderComponent(
EntityFilter selectableEntityTypes,
EntityFilter visibleTypesInList,
EntityFilter visibleTypesInTree,
EntityFinderProps.SelectedCopyHandler selectedCopy,
boolean treeOnly
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public void renderComponent(
EntityFilter selectableEntityTypes,
EntityFilter visibleTypesInList,
EntityFilter visibleTypesInTree,
EntityFinderProps.SelectedCopyHandler selectedCopy,
boolean treeOnly
) {
entityFinderContainer.clear();
Expand Down Expand Up @@ -154,7 +153,6 @@ public void renderComponent(
visibleTypesInList.getEntityQueryValues(),
visibleTypesInTree.getEntityQueryValues(),
selectableEntityTypes.getEntityQueryValues(),
selectedCopy,
treeOnly
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,6 @@ private void postCheckLink() {
entity.getId() +
")"
)
.setSelectedCopy(count -> "Destination")
.setConfirmButtonCopy("Create Link")
.build()
.show();
Expand Down Expand Up @@ -2268,7 +2267,6 @@ private void postCheckMove() {
entity.getId() +
")"
)
.setSelectedCopy(count -> "Destination")
.setConfirmButtonCopy("Move")
.setVersionSelection(EntityFinderWidget.VersionSelection.DISALLOWED)
.setTreeOnly(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ public void onSuccess(ArrayList<EntityHeader> entityHeaders) {
.setInitialContainer(EntityFinderWidget.InitialContainer.PROJECT)
.setSelectableTypes(EntityFilter.FILE)
.setVersionSelection(EntityFinderWidget.VersionSelection.REQUIRED)
.setSelectedCopy(count ->
count + " File" + ((count > 1) ? "s" : "") + " Selected"
)
.setHelpMarkdown(
"Search or Browse Synapse to find " +
EntityTypeUtils.getDisplayName(EntityType.file) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ public void testBuildAndRender() {

String title = "Custom modal title";
String prompt = "Custom prompt text";
EntityFinderProps.SelectedCopyHandler selected = count ->
"Custom selected text";
String confirmCopy = "Custom Action";
String helpText = "Custom Instructions and Guidance";

Expand All @@ -125,7 +123,6 @@ public void testBuildAndRender() {
// Copy text
builder.setModalTitle(title);
builder.setPromptCopy(prompt);
builder.setSelectedCopy(selected);
builder.setConfirmButtonCopy(confirmCopy);
builder.setHelpMarkdown(helpText);

Expand Down Expand Up @@ -153,7 +150,6 @@ public void testBuildAndRender() {
selectableTypes,
visibleTypesInList,
visibleTypesInTree,
selected,
treeOnly
);
}
Expand Down Expand Up @@ -216,7 +212,6 @@ public void testRenderWithCurrentProjectScope() {
any(EntityFilter.class),
any(EntityFilter.class),
any(EntityFilter.class),
any(),
anyBoolean()
);
}
Expand Down
Loading