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

Lpd 34910 #6038

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -25,7 +25,6 @@
import com.liferay.document.library.web.internal.security.permission.resource.DLFolderPermission;
import com.liferay.portal.kernel.dao.search.SearchContainer;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.model.ResourceConstants;
import com.liferay.portal.kernel.model.Role;
import com.liferay.portal.kernel.model.User;
Expand Down Expand Up @@ -296,12 +295,6 @@ public String getViewFileEntryURL(FileEntry fileEntry) {
}

public boolean hasApprovedVersion(long fileEntryId) {
if (!FeatureFlagManagerUtil.isEnabled(
_themeDisplay.getCompanyId(), "LPD-10701")) {

return false;
}

DLFileVersion dlFileVersion =
DLFileVersionLocalServiceUtil.fetchLatestFileVersion(
fileEntryId, false, WorkflowConstants.STATUS_APPROVED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItemListBuilder;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
Expand Down Expand Up @@ -256,12 +255,6 @@ public UUID getUuid() {

@Override
public boolean hasApprovedVersion() {
if (!FeatureFlagManagerUtil.isEnabled(
_fileVersion.getCompanyId(), "LPD-10701")) {

return false;
}

DLFileVersion dlFileVersion =
DLFileVersionLocalServiceUtil.fetchLatestFileVersion(
_fileVersion.getFileEntryId(), false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import com.liferay.petra.string.StringPool;
import com.liferay.portal.configuration.metatype.bnd.util.ConfigurableUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactory;
import com.liferay.portal.kernel.json.JSONObject;
Expand Down Expand Up @@ -518,9 +517,7 @@ private void _addPublishedDocumentMessage(
ActionRequest actionRequest, FileVersion fileVersion,
ThemeDisplay themeDisplay) {

if (!FeatureFlagManagerUtil.isEnabled("LPD-10701") ||
!fileVersion.isScheduled()) {

if (!fileVersion.isScheduled()) {
String portletResource = ParamUtil.getString(
actionRequest, "portletResource");

Expand Down Expand Up @@ -996,9 +993,7 @@ private Date _getDisplayDate(
TimeZone timeZone)
throws PortalException {

if (addDynamic || !PropsValues.SCHEDULER_ENABLED ||
!FeatureFlagManagerUtil.isEnabled("LPD-10701")) {

if (addDynamic || !PropsValues.SCHEDULER_ENABLED) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,16 @@ renderResponse.setTitle(headerTitle);
</c:if>

<c:if test="<%= !RepositoryUtil.isExternalRepository(repositoryId) %>">
<aui:fieldset collapsed="<%= true %>" collapsible="<%= true %>" label='<%= FeatureFlagManagerUtil.isEnabled(themeDisplay.getCompanyId(), "LPD-10701") ? "schedule" : "expiration-date" %>'>
<aui:fieldset collapsed="<%= true %>" collapsible="<%= true %>" label='"schedule"'>
<liferay-ui:error exception="<%= FileEntryDisplayDateException.class %>" message="please-enter-a-valid-publish-date" />
<liferay-ui:error exception="<%= FileEntryExpirationDateException.class %>" message="please-enter-a-valid-expiration-date" />
<liferay-ui:error exception="<%= FileEntryReviewDateException.class %>" message="please-enter-a-valid-review-date" />

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(themeDisplay.getCompanyId(), "LPD-10701") %>'>
<p class="text-secondary">
<liferay-ui:message key="set-the-publication-date-and-time-for-your-document-to-be-published-automatically" />
</p>
<p class="text-secondary">
<liferay-ui:message key="set-the-publication-date-and-time-for-your-document-to-be-published-automatically" />
</p>

<aui:input label="publish-date" name="displayDate" wrapperCssClass="display-date" />
</c:if>
<aui:input label="publish-date" name="displayDate" wrapperCssClass="display-date" />

<p class="text-secondary">
<liferay-ui:message key="including-an-expiration-date-will-allow-your-documents-or-media-to-expire-automatically-and-become-unpublished" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ page import="com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItemLi
page import="com.liferay.item.selector.ItemSelector" %><%@
page import="com.liferay.portal.configuration.module.configuration.ConfigurationProviderUtil" %><%@
page import="com.liferay.portal.kernel.dao.search.RowChecker" %><%@
page import="com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil" %><%@
page import="com.liferay.portal.kernel.lock.Lock" %><%@
page import="com.liferay.portal.kernel.repository.model.RepositoryEntry" %><%@
page import="com.liferay.portal.kernel.servlet.SessionErrors" %><%@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ entriesChecker.setRememberCheckBoxStateURLRegex("^(?!.*" + liferayPortletRespons
</div>

<div class="card-detail">
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>'>
<c:if test="<%= !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>">
<liferay-portal-workflow:status
showStatusLabel="<%= false %>"
status="<%= WorkflowConstants.STATUS_APPROVED %>"
Expand All @@ -212,7 +212,7 @@ entriesChecker.setRememberCheckBoxStateURLRegex("^(?!.*" + liferayPortletRespons
status="<%= latestFileVersion.getStatus() %>"
/>

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test="<%= latestFileVersion.isScheduled() %>">

<%
String displayDateString = StringPool.BLANK;
Expand Down Expand Up @@ -370,7 +370,7 @@ entriesChecker.setRememberCheckBoxStateURLRegex("^(?!.*" + liferayPortletRespons
cssClass="table-cell-expand-smallest"
name="status"
>
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>'>
<c:if test="<%= !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>">
<liferay-portal-workflow:status
showStatusLabel="<%= false %>"
status="<%= WorkflowConstants.STATUS_APPROVED %>"
Expand All @@ -382,7 +382,7 @@ entriesChecker.setRememberCheckBoxStateURLRegex("^(?!.*" + liferayPortletRespons
status="<%= latestFileVersion.getStatus() %>"
/>

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test="<%= latestFileVersion.isScheduled() %>">

<%
String displayDateString = StringPool.BLANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,20 +375,18 @@ else {
id="dlFileEntryExpirationDatePanel"
markupView="lexicon"
persistState="<%= true %>"
title='<%= FeatureFlagManagerUtil.isEnabled(themeDisplay.getCompanyId(), "LPD-10701") ? "schedule" : "expiration-date" %>'
title="schedule"
>
<aui:fieldset>
<liferay-ui:error exception="<%= FileEntryDisplayDateException.class %>" message="please-enter-a-valid-publish-date" />
<liferay-ui:error exception="<%= FileEntryExpirationDateException.class %>" message="please-enter-a-valid-expiration-date" />
<liferay-ui:error exception="<%= FileEntryReviewDateException.class %>" message="please-enter-a-valid-review-date" />

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(themeDisplay.getCompanyId(), "LPD-10701") %>'>
<p class="text-secondary">
<liferay-ui:message key="set-the-publication-date-and-time-for-your-document-to-be-published-automatically" />
</p>
<p class="text-secondary">
<liferay-ui:message key="set-the-publication-date-and-time-for-your-document-to-be-published-automatically" />
</p>

<aui:input label="publish-date" name="displayDate" wrapperCssClass="display-date" />
</c:if>
<aui:input label="publish-date" name="displayDate" wrapperCssClass="display-date" />

<p class="text-secondary">
<liferay-ui:message key="including-an-expiration-date-will-allow-your-documents-or-media-to-expire-automatically-and-become-unpublished" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ DLViewEntriesDisplayContext dlViewEntriesDisplayContext = new DLViewEntriesDispl
</div>

<div class="card-detail">
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !latestFileVersion.isApproved() && dlViewEntriesDisplayContext.hasApprovedVersion(latestFileVersion.getFileEntryId()) %>'>
<c:if test="<%= !latestFileVersion.isApproved() && dlViewEntriesDisplayContext.hasApprovedVersion(latestFileVersion.getFileEntryId()) %>">
<liferay-portal-workflow:status
showStatusLabel="<%= false %>"
status="<%= WorkflowConstants.STATUS_APPROVED %>"
Expand All @@ -168,7 +168,7 @@ DLViewEntriesDisplayContext dlViewEntriesDisplayContext = new DLViewEntriesDispl
status="<%= latestFileVersion.getStatus() %>"
/>

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test="<%= latestFileVersion.isScheduled() %>">

<%
String displayDateString = StringPool.BLANK;
Expand Down Expand Up @@ -339,7 +339,7 @@ DLViewEntriesDisplayContext dlViewEntriesDisplayContext = new DLViewEntriesDispl
cssClass="table-cell-expand-smallest"
name="status"
>
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !latestFileVersion.isApproved() && dlViewEntriesDisplayContext.hasApprovedVersion(latestFileVersion.getFileEntryId()) %>'>
<c:if test="<%= !latestFileVersion.isApproved() && dlViewEntriesDisplayContext.hasApprovedVersion(latestFileVersion.getFileEntryId()) %>">
<liferay-portal-workflow:status
showStatusLabel="<%= false %>"
status="<%= WorkflowConstants.STATUS_APPROVED %>"
Expand All @@ -351,7 +351,7 @@ DLViewEntriesDisplayContext dlViewEntriesDisplayContext = new DLViewEntriesDispl
status="<%= latestFileVersion.getStatus() %>"
/>

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test="<%= latestFileVersion.isScheduled() %>">

<%
String displayDateString = StringPool.BLANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ else {
</c:if>

<span class="file-entry-status">
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>'>
<c:if test="<%= !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>">
<liferay-portal-workflow:status
showStatusLabel="<%= false %>"
status="<%= WorkflowConstants.STATUS_APPROVED %>"
Expand All @@ -131,7 +131,7 @@ else {
status="<%= latestFileVersion.getStatus() %>"
/>

<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test="<%= latestFileVersion.isScheduled() %>">

<%
String displayDateString = StringPool.BLANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import com.liferay.petra.function.transform.TransformUtil;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.comment.CommentManager;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.model.Group;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.FileVersion;
Expand Down Expand Up @@ -159,11 +158,7 @@ public Document toDTO(DTOConverterContext dtoConverterContext)
setDateExpired(fileEntry::getExpirationDate);
setDateModified(fileEntry::getModifiedDate);

if (FeatureFlagManagerUtil.isEnabled(
fileEntry.getCompanyId(), "LPD-10701")) {

setDatePublished(fileEntry::getDisplayDate);
}
setDatePublished(fileEntry::getDisplayDate);

setDescription(fileEntry::getDescription);
setDocumentFolderId(fileEntry::getFolderId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import com.liferay.petra.string.StringPool;
import com.liferay.portal.events.ServicePreAction;
import com.liferay.portal.events.ThemeServicePreAction;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
Expand Down Expand Up @@ -382,12 +381,7 @@ public Document patchDocument(Long documentId, MultipartBody multipartBody)
fileName = document.getFileName();
title = document.getTitle();
description = document.getDescription();

if (FeatureFlagManagerUtil.isEnabled(
contextCompany.getCompanyId(), "LPD-10701")) {

displayDate = document.getDatePublished();
}
displayDate = document.getDatePublished();

expirationDate = document.getDateExpired();
}
Expand Down Expand Up @@ -579,11 +573,7 @@ private Document _addDocument(
title = document.getTitle();
description = document.getDescription();

if (FeatureFlagManagerUtil.isEnabled(
contextCompany.getCompanyId(), "LPD-10701")) {

displayDate = document.getDatePublished();
}
displayDate = document.getDatePublished();

expirationDate = document.getDateExpired();
}
Expand Down Expand Up @@ -1018,13 +1008,7 @@ private Document _updateDocument(
fileName = document.getFileName();
title = document.getTitle();
description = document.getDescription();

if (FeatureFlagManagerUtil.isEnabled(
contextCompany.getCompanyId(), "LPD-10701")) {

displayDate = document.getDatePublished();
}

displayDate = document.getDatePublished();
expirationDate = document.getDateExpired();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7402,8 +7402,6 @@ feature.flag.LPD-7822.description=Dynamically apply updates to the settings and
feature.flag.LPD-7822.title=Dynamically Update Search Index Settings and Mappings
feature.flag.LPD-10588.description=Utility page for cookie policy lists and describes all cookies in use. Users can add and update cookies in the list with the cookie object. When the cookie manager is enabled, Analytics Cloud only tracks data from users who consent to statistics cookies.
feature.flag.LPD-10588.title=Analytics Cloud Cookie Control
feature.flag.LPD-10701.description=Users can configure a display date for documents to be scheduled.
feature.flag.LPD-10701.title=Display Date for Documents and Media
feature.flag.LPD-10703.description=Users can view actions and information related to workflow when reviewing a change in a publication.
feature.flag.LPD-10703.title=Enhance Publications Review Changes Screen With Workflow Information and Functionality
feature.flag.LPD-11147.description=Users can configure the URL path for different asset types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ export const testSearchInDlPortlet = mergeTests(
'LPS-178052': true,
})
);
export const testFeatureFlagsEnabled = mergeTests(
baseTest,
featureFlagsTest({
'LPD-10701': true,
})
);
export const testFeatureFlagsEnabled = mergeTests(baseTest);

export const testUploadMultipleFieldsWithCustomDocumentType =
mergeTests(baseTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.interval.IntervalActionProcessor;
import com.liferay.portal.kernel.io.ByteArrayFileInputStream;
import com.liferay.portal.kernel.language.LanguageUtil;
Expand Down Expand Up @@ -404,9 +403,7 @@ public void checkFileEntries(long companyId, long checkInterval)

long userId = _getActiveCompanyAdminUserId(companyId);

if (FeatureFlagManagerUtil.isEnabled(companyId, "LPD-10701")) {
_checkFileEntriesByDisplayDate(companyId, date, userId);
}
_checkFileEntriesByDisplayDate(companyId, date, userId);

_checkFileVersionsByExpirationDate(companyId, date, userId);

Expand Down Expand Up @@ -3057,12 +3054,6 @@ private String _getNextVersion(
}

private int _getStatus(Date date, DLFileVersion dlFileVersion, int status) {
if (!FeatureFlagManagerUtil.isEnabled(
dlFileVersion.getCompanyId(), "LPD-10701")) {

return status;
}

if ((status == WorkflowConstants.STATUS_APPROVED) &&
(dlFileVersion.getDisplayDate() != null) &&
date.before(dlFileVersion.getDisplayDate())) {
Expand Down
10 changes: 0 additions & 10 deletions portal-impl/src/portal.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6363,11 +6363,6 @@
#
feature.flag.LPD-10588=false

#
# Env: LIFERAY_FEATURE_PERIOD_FLAG_PERIOD__UPPERCASEL__UPPERCASEP__UPPERCASED__MINUS__NUMBER1__NUMBER0__NUMBER7__NUMBER0__NUMBER1_
#
feature.flag.LPD-10701=false

#
# Env: LIFERAY_FEATURE_PERIOD_FLAG_PERIOD__UPPERCASEL__UPPERCASEP__UPPERCASED__MINUS__NUMBER1__NUMBER0__NUMBER7__NUMBER0__NUMBER3_
#
Expand Down Expand Up @@ -6902,11 +6897,6 @@
#
feature.flag.LPD-10588.type=release

#
# Env: LIFERAY_FEATURE_PERIOD_FLAG_PERIOD__UPPERCASEL__UPPERCASEP__UPPERCASED__MINUS__NUMBER1__NUMBER0__NUMBER7__NUMBER0__NUMBER1__PERIOD_TYPE
#
feature.flag.LPD-10701.type=release

#
# Env: LIFERAY_FEATURE_PERIOD_FLAG_PERIOD__UPPERCASEL__UPPERCASEP__UPPERCASED__MINUS__NUMBER1__NUMBER0__NUMBER7__NUMBER0__NUMBER3__PERIOD_TYPE
#
Expand Down