Skip to content

Commit

Permalink
Merge pull request #5586 from jay-hodgson/SWC-7173
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson authored Nov 19, 2024
2 parents 7bbf6b7 + 9f272ba commit 1b68750
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
import static org.sagebionetworks.web.client.utils.FutureUtils.getFuture;
import static org.sagebionetworks.web.client.widget.entity.browse.EntityFilter.CONTAINER;
import static org.sagebionetworks.web.client.widget.entity.browse.EntityFilter.PROJECT;
import static org.sagebionetworks.web.shared.WebConstants.FLAG_ISSUE_COLLECTOR_URL;
import static org.sagebionetworks.web.shared.WebConstants.FLAG_ISSUE_DESCRIPTION_PART_1;
import static org.sagebionetworks.web.shared.WebConstants.FLAG_ISSUE_DESCRIPTION_PART_2;
import static org.sagebionetworks.web.shared.WebConstants.FLAG_ISSUE_PRIORITY;
import static org.sagebionetworks.web.shared.WebConstants.REVIEW_DATA_REQUEST_COMPONENT_ID;

import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
Expand Down Expand Up @@ -712,34 +707,9 @@ private void configureReportViolation() {
actionMenu.setActionListener(
Action.REPORT_VIOLATION,
(action, event) -> {
// report abuse via Jira issue collector
String userId = WebConstants.ANONYMOUS, email =
WebConstants.ANONYMOUS, displayName = WebConstants.ANONYMOUS, synId =
entity.getId();
UserProfile userProfile =
authenticationController.getCurrentUserProfile();
if (userProfile != null) {
userId = userProfile.getOwnerId();
displayName = DisplayUtils.getDisplayName(userProfile);
email = DisplayUtils.getPrimaryEmail(userProfile);
}

ginInjector
.getSynapseJSNIUtils()
.showJiraIssueCollector(
"", // summary
FLAG_ISSUE_DESCRIPTION_PART_1 +
gwt.getCurrentURL() +
FLAG_ISSUE_DESCRIPTION_PART_2,
FLAG_ISSUE_COLLECTOR_URL,
userId,
displayName,
email,
synId, // Synapse data object ID
REVIEW_DATA_REQUEST_COMPONENT_ID,
null, // AR ID
FLAG_ISSUE_PRIORITY
);
popupUtils.openInNewWindow(
WebConstants.PRIVACY_SECURITY_COMPLIANCE_HELP_CENTER_URL
);
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class WebConstants {

public static final String DOCS_BASE_URL = "https://help.synapse.org/";
public static final String DOCS_URL = DOCS_BASE_URL + "docs/";
public static final String PRIVACY_SECURITY_COMPLIANCE_HELP_CENTER_URL =
"https://sagebionetworks.jira.com/servicedesk/customer/portal/20";
public static final String PROVENANCE_API_URL =
DOCS_URL + "Provenance.1972470373.html";
public static final String SHARING_SETTINGS_URL =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5330,20 +5330,9 @@ public void testReportViolation() {

// Call under test - invocation
actionListenerCaptor.getValue().onAction(Action.REPORT_VIOLATION, null);
verify(mockJsniUtils)
.showJiraIssueCollector(
"", // summary
FLAG_ISSUE_DESCRIPTION_PART_1 +
url +
WebConstants.FLAG_ISSUE_DESCRIPTION_PART_2, // description
FLAG_ISSUE_COLLECTOR_URL,
ownerId,
DisplayUtils.getDisplayName(firstName, lastName, username),
email,
entityId, // Synapse data object ID
REVIEW_DATA_REQUEST_COMPONENT_ID,
null, // Access requirement ID
FLAG_ISSUE_PRIORITY
verify(mockPopupUtils)
.openInNewWindow(
WebConstants.PRIVACY_SECURITY_COMPLIANCE_HELP_CENTER_URL
);
}
}

0 comments on commit 1b68750

Please sign in to comment.