Skip to content

Commit

Permalink
LPS-153687 Return fetchSharingContactsURL with the URL of the collabo…
Browse files Browse the repository at this point in the history
…rators panel when it is visible.
  • Loading branch information
cgoncas committed Jul 26, 2022
1 parent ca398e3 commit c49e363
Showing 1 changed file with 23 additions and 0 deletions.
Expand Up @@ -142,6 +142,10 @@ protected void doServeResource(
"fetchSharingButtonURL",
_getFetchSharingButtonURL(
contentDashboardItem, httpServletRequest)
).put(
"fetchSharingContactsURL",
_getFetchSharingContactsURL(
contentDashboardItem, httpServletRequest)
).put(
"languageTag", locale.toLanguageTag()
).put(
Expand Down Expand Up @@ -331,6 +335,25 @@ private String _getFetchSharingButtonURL(
return null;
}

private String _getFetchSharingContactsURL(
ContentDashboardItem contentDashboardItem,
HttpServletRequest httpServletRequest) {

List<ContentDashboardItemAction> contentDashboardItemActions =
contentDashboardItem.getContentDashboardItemActions(
httpServletRequest,
ContentDashboardItemAction.Type.SHARING_COLLABORATORS);

if (ListUtil.isNotEmpty(contentDashboardItemActions)) {
ContentDashboardItemAction contentDashboardItemAction =
contentDashboardItemActions.get(0);

return contentDashboardItemAction.getURL();
}

return null;
}

private JSONObject _getSpecificFieldsJSONObject(
ContentDashboardItem contentDashboardItem, Locale locale) {

Expand Down

0 comments on commit c49e363

Please sign in to comment.