From 92797787bd603533927791f9d5348887182f168d Mon Sep 17 00:00:00 2001 From: Nick Grosenbacher Date: Mon, 9 Dec 2024 11:09:15 -0500 Subject: [PATCH] SWC-6910 - prop was removed --- .../web/client/jsinterop/EntityFinderProps.java | 11 ----------- .../widget/entity/browse/EntityFinderWidget.java | 2 -- .../entity/browse/EntityFinderWidgetImpl.java | 14 -------------- .../entity/browse/EntityFinderWidgetView.java | 1 - .../entity/browse/EntityFinderWidgetViewImpl.java | 2 -- .../controller/EntityActionControllerImpl.java | 2 -- .../modal/fileview/EntityContainerListWidget.java | 3 --- .../entity/browse/EntityFinderWidgetImplTest.java | 5 ----- 8 files changed, 40 deletions(-) diff --git a/src/main/java/org/sagebionetworks/web/client/jsinterop/EntityFinderProps.java b/src/main/java/org/sagebionetworks/web/client/jsinterop/EntityFinderProps.java index ac6384d470..6259c59db3 100644 --- a/src/main/java/org/sagebionetworks/web/client/jsinterop/EntityFinderProps.java +++ b/src/main/java/org/sagebionetworks/web/client/jsinterop/EntityFinderProps.java @@ -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; @@ -46,9 +40,6 @@ public interface SelectedCopyHandler { @JsNullable String[] selectableTypes; - @JsNullable - SelectedCopyHandler selectedCopy; - @JsNullable boolean treeOnly; @@ -63,7 +54,6 @@ public static EntityFinderProps create( List visibleTypesInList, List visibleTypesInTree, List selectableTypes, - SelectedCopyHandler selectedCopy, boolean treeOnly ) { EntityFinderProps props = new EntityFinderProps(); @@ -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; } diff --git a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidget.java b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidget.java index 9d0ba265a2..7393249be9 100644 --- a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidget.java +++ b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidget.java @@ -57,8 +57,6 @@ Builder setInitialContainer( Builder setHelpMarkdown(String helpMarkdown); - Builder setSelectedCopy(EntityFinderProps.SelectedCopyHandler selectedCopy); - Builder setInitialScope(EntityFinderScope initialScope); Builder setConfirmButtonCopy(String confirmButtonCopy); diff --git a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetImpl.java b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetImpl.java index 79b417adbe..8975c3435b 100644 --- a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetImpl.java +++ b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetImpl.java @@ -52,7 +52,6 @@ public class EntityFinderWidgetImpl private String modalTitle; private String promptCopy; - private EntityFinderProps.SelectedCopyHandler selectedCopy; private String confirmButtonCopy; @Inject @@ -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; @@ -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. Alternatively, navigate to the desired location in the current project, favorite projects or projects you own."; @@ -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 @@ -378,7 +366,6 @@ public void onSuccess(EntityBundle result) { selectableTypes, visibleTypesInList, visibleTypesInTree, - selectedCopy, treeOnly ); } @@ -395,7 +382,6 @@ public void onSuccess(EntityBundle result) { selectableTypes, visibleTypesInList, visibleTypesInTree, - selectedCopy, treeOnly ); } diff --git a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetView.java b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetView.java index 0d76ba97fe..52ccf15de6 100644 --- a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetView.java +++ b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetView.java @@ -27,7 +27,6 @@ void renderComponent( EntityFilter selectableEntityTypes, EntityFilter visibleTypesInList, EntityFilter visibleTypesInTree, - EntityFinderProps.SelectedCopyHandler selectedCopy, boolean treeOnly ); diff --git a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetViewImpl.java b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetViewImpl.java index 5da8889535..f2bb070288 100644 --- a/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetViewImpl.java +++ b/src/main/java/org/sagebionetworks/web/client/widget/entity/browse/EntityFinderWidgetViewImpl.java @@ -118,7 +118,6 @@ public void renderComponent( EntityFilter selectableEntityTypes, EntityFilter visibleTypesInList, EntityFilter visibleTypesInTree, - EntityFinderProps.SelectedCopyHandler selectedCopy, boolean treeOnly ) { entityFinderContainer.clear(); @@ -154,7 +153,6 @@ public void renderComponent( visibleTypesInList.getEntityQueryValues(), visibleTypesInTree.getEntityQueryValues(), selectableEntityTypes.getEntityQueryValues(), - selectedCopy, treeOnly ); diff --git a/src/main/java/org/sagebionetworks/web/client/widget/entity/controller/EntityActionControllerImpl.java b/src/main/java/org/sagebionetworks/web/client/widget/entity/controller/EntityActionControllerImpl.java index 1315e2b195..cc08ffd2b6 100755 --- a/src/main/java/org/sagebionetworks/web/client/widget/entity/controller/EntityActionControllerImpl.java +++ b/src/main/java/org/sagebionetworks/web/client/widget/entity/controller/EntityActionControllerImpl.java @@ -2164,7 +2164,6 @@ private void postCheckLink() { entity.getId() + ")" ) - .setSelectedCopy(count -> "Destination") .setConfirmButtonCopy("Create Link") .build() .show(); @@ -2268,7 +2267,6 @@ private void postCheckMove() { entity.getId() + ")" ) - .setSelectedCopy(count -> "Destination") .setConfirmButtonCopy("Move") .setVersionSelection(EntityFinderWidget.VersionSelection.DISALLOWED) .setTreeOnly(true) diff --git a/src/main/java/org/sagebionetworks/web/client/widget/table/modal/fileview/EntityContainerListWidget.java b/src/main/java/org/sagebionetworks/web/client/widget/table/modal/fileview/EntityContainerListWidget.java index 0384e70642..dc7bef5344 100644 --- a/src/main/java/org/sagebionetworks/web/client/widget/table/modal/fileview/EntityContainerListWidget.java +++ b/src/main/java/org/sagebionetworks/web/client/widget/table/modal/fileview/EntityContainerListWidget.java @@ -123,9 +123,6 @@ public void onSuccess(ArrayList 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) + diff --git a/src/test/java/org/sagebionetworks/web/unitclient/widget/entity/browse/EntityFinderWidgetImplTest.java b/src/test/java/org/sagebionetworks/web/unitclient/widget/entity/browse/EntityFinderWidgetImplTest.java index b37474a749..071751384e 100644 --- a/src/test/java/org/sagebionetworks/web/unitclient/widget/entity/browse/EntityFinderWidgetImplTest.java +++ b/src/test/java/org/sagebionetworks/web/unitclient/widget/entity/browse/EntityFinderWidgetImplTest.java @@ -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"; @@ -125,7 +123,6 @@ public void testBuildAndRender() { // Copy text builder.setModalTitle(title); builder.setPromptCopy(prompt); - builder.setSelectedCopy(selected); builder.setConfirmButtonCopy(confirmCopy); builder.setHelpMarkdown(helpText); @@ -153,7 +150,6 @@ public void testBuildAndRender() { selectableTypes, visibleTypesInList, visibleTypesInTree, - selected, treeOnly ); } @@ -216,7 +212,6 @@ public void testRenderWithCurrentProjectScope() { any(EntityFilter.class), any(EntityFilter.class), any(EntityFilter.class), - any(), anyBoolean() ); }