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

Issue 51620: Remove the UI for Object-level discussions #6275

Merged
merged 8 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -132,7 +132,7 @@ public DiscussionService.DiscussionView getDiscussionArea(ViewContext context, S
@Nullable
public DiscussionService.DiscussionView getDiscussionArea(Container c, User user, URLHelper currentURL, String objectId, ActionURL pageURL, String newDiscussionTitle, boolean allowMultipleDiscussions, boolean displayFirstDiscussionByDefault)
{
if (!LookAndFeelProperties.getInstance(c).isDiscussionEnabled())
if (!LookAndFeelProperties.getInstance(c).isDiscussionEnabled() || !AppProps.getInstance().isOptionalFeatureEnabled(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS))
return null;

// get discussion parameters
Expand Down
1 change: 1 addition & 0 deletions api/src/org/labkey/api/settings/AppProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public interface AppProps
String EXPERIMENTAL_NO_GUESTS = "disableGuestAccount";
String EXPERIMENTAL_BLOCKER = "blockMaliciousClients";
String EXPERIMENTAL_RESOLVE_PROPERTY_URI_COLUMNS = "resolve-property-uri-columns";
String DEPRECATED_OBJECT_LEVEL_DISCUSSIONS = "deprecatedObjectLevelDiscussions";

String UNKNOWN_VERSION = "Unknown Release Version";

Expand Down
10 changes: 8 additions & 2 deletions assay/src/org/labkey/api/assay/nab/view/runDetails.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<%@ page import="org.labkey.api.view.HttpView" %>
<%@ page import="org.labkey.api.view.JspView" %>
<%@ page import="org.labkey.api.view.template.ClientDependencies" %>
<%@ page import="org.labkey.api.settings.AppProps" %>
<%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>
<%!
Expand Down Expand Up @@ -84,7 +85,12 @@
</labkey:panel>

<%
if (!bean.isPrintView() && writer && LookAndFeelProperties.getInstance(getContainer()).isDiscussionEnabled())
if (
!bean.isPrintView()
&& writer
&& AppProps.getInstance().isOptionalFeatureEnabled(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS)
&& LookAndFeelProperties.getInstance(getContainer()).isDiscussionEnabled()
)
{
%>
<labkey:panel title="Discussions">
Expand All @@ -96,4 +102,4 @@
</labkey:panel>
<%
}
%>
%>
8 changes: 4 additions & 4 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
},
"dependencies": {
"@labkey/components": "6.21.1",
"@labkey/components": "6.21.1-fb-issue51620.0",
"@labkey/themes": "1.4.0"
},
"devDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions core/src/org/labkey/core/CoreModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ public QuerySchema createSchema(DefaultSchema schema, Module module)
"Short-circuit robots",
"Save resources by not rendering pages marked as 'noindex' for robots. This is experimental as not all robots are search engines.",
false);
AdminConsole.addOptionalFeatureFlag(new OptionalFeatureFlag(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS,
"Restore Object-Level Discussions",
"This option and all support for Object-Level Discussions will be removed in LabKey Server v25.7.",
false, false, FeatureType.Deprecated));

SiteValidationService svc = SiteValidationService.get();
if (null != svc)
Expand Down Expand Up @@ -1335,6 +1339,7 @@ public JSONObject getPageContextJson(ContainerUser context)
{
JSONObject json = new JSONObject(getDefaultPageContextJson(context.getContainer()));
json.put("productFeatures", ProductRegistry.getProductFeatureSet());
json.put(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS, AppProps.getInstance().isOptionalFeatureEnabled(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS));
return json;
}

Expand Down
27 changes: 27 additions & 0 deletions core/src/org/labkey/core/admin/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9478,6 +9478,33 @@ public void addNavTrail(NavTree root)
}
}

public static class DeprecatedFlagForm
{
private String featureName;

public String getFeatureName()
{
return featureName;
}

public void setFeatureName(String featureName)
{
this.featureName = featureName;
}
}

@RequiresPermission(ReadPermission.class)
public static class DeprecatedFlagAction extends ReadOnlyApiAction<DeprecatedFlagForm>
{
@Override
public ApiResponse execute(DeprecatedFlagForm form, BindException errors)
{
ApiSimpleResponse ret = new ApiSimpleResponse();
ret.put("response", AppProps.getInstance().isOptionalFeatureEnabled(form.getFeatureName()));
return ret;
}
}

@RequiresPermission(AdminOperationsPermission.class)
public static class ProductFeatureAction extends BaseApiAction<ProductConfigForm>
{
Expand Down
8 changes: 8 additions & 0 deletions core/src/org/labkey/core/admin/lookAndFeelProperties.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<%@ page import="java.util.Map" %>
<%@ page import="java.util.Set" %>
<%@ page import="java.util.stream.Collectors" %>
<%@ page import="org.labkey.api.settings.AppProps" %>
<%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>
<%
Expand Down Expand Up @@ -209,6 +210,10 @@
<%=inheritCheckbox(inherited, helpMenuEnabled)%>
<td><input type="checkbox" id="<%=helpMenuEnabled%>" name="<%=helpMenuEnabled%>" size="<%=standardInputWidth%>"<%=checked(laf.isHelpMenuEnabled())%><%=disabled(inherited)%>></td>
</tr>
<%
if (AppProps.getInstance().isOptionalFeatureEnabled(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS))
{
%>
<tr>
<%
String enableDiscussionHelp = "Some items within LabKey Server, like reports and wiki pages, support discussions " +
Expand All @@ -219,6 +224,9 @@
<%=inheritCheckbox(inherited, discussionEnabled)%>
<td><input type="checkbox" id="<%=discussionEnabled%>" name="<%=discussionEnabled%>" size="<%=standardInputWidth%>"<%=checked(laf.isDiscussionEnabled())%><%=disabled(inherited)%>></td>
</tr>
<%
}
%>
<tr>
<td class="labkey-form-label"><label for="<%=logoHref%>">Logo link (specifies page that header logo links to)</label></td>
<% inherited = isInherited(laf.getUnsubstitutedLogoHrefStored()); %>
Expand Down
8 changes: 7 additions & 1 deletion list/src/org/labkey/list/controllers/ListController.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import org.labkey.api.security.permissions.PlatformDeveloperPermission;
import org.labkey.api.security.permissions.ReadPermission;
import org.labkey.api.security.permissions.UpdatePermission;
import org.labkey.api.settings.AppProps;
import org.labkey.api.settings.LookAndFeelProperties;
import org.labkey.api.util.FileStream;
import org.labkey.api.util.FileUtil;
Expand Down Expand Up @@ -625,7 +626,12 @@ public ModelAndView getView(ListDefinitionForm form, BindException errors)
view.addView(new HtmlView(PageFlowUtil.link("show item history").href(getViewContext().cloneActionURL().addParameter("showHistory", "1")).build()));
}

if (_list.getDiscussionSetting().isLinked() && LookAndFeelProperties.getInstance(getContainer()).isDiscussionEnabled() && DiscussionService.get() != null)
if (
_list.getDiscussionSetting().isLinked()
&& AppProps.getInstance().isOptionalFeatureEnabled(AppProps.DEPRECATED_OBJECT_LEVEL_DISCUSSIONS)
&& LookAndFeelProperties.getInstance(getContainer()).isDiscussionEnabled()
&& DiscussionService.get() != null
)
{
String entityId = item.getEntityId();

Expand Down