Skip to content

Commit

Permalink
LPD-20520 call the FF method with the companyId
Browse files Browse the repository at this point in the history
  • Loading branch information
AliciaGarciaGarcia authored and brianchandotcom committed Mar 18, 2024
1 parent 9dce1f0 commit d8735da
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ public String getViewFileEntryURL(FileEntry fileEntry) {
}

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

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ public UUID getUuid() {

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

return false;
}

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

<c:if test="<%= !RepositoryUtil.isExternalRepository(repositoryId) %>">
<aui:fieldset collapsed="<%= true %>" collapsible="<%= true %>" label='<%= FeatureFlagManagerUtil.isEnabled("LPD-10701") ? "schedule" : "expiration-date" %>'>
<aui:fieldset collapsed="<%= true %>" collapsible="<%= true %>" label='<%= FeatureFlagManagerUtil.isEnabled(themeDisplay.getCompanyId(), "LPD-10701") ? "schedule" : "expiration-date" %>'>
<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("LPD-10701") %>'>
<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>
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("LPD-10701") && !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>'>
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !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("LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && 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("LPD-10701") && !latestFileVersion.isApproved() && dlViewFileVersionDisplayContext.hasApprovedVersion() %>'>
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && !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("LPD-10701") && latestFileVersion.isScheduled() %>'>
<c:if test='<%= FeatureFlagManagerUtil.isEnabled(latestFileVersion.getCompanyId(), "LPD-10701") && latestFileVersion.isScheduled() %>'>

<%
String displayDateString = StringPool.BLANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ else {
<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("LPD-10701") %>'>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ DLViewEntriesDisplayContext dlViewEntriesDisplayContext = new DLViewEntriesDispl
</div>

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

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

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

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

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

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

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

<%
String displayDateString = StringPool.BLANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public void checkFileEntries(long companyId, long checkInterval)

long userId = _getActiveCompanyAdminUserId(companyId);

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

Expand Down Expand Up @@ -1992,7 +1992,9 @@ public DLFileEntry updateStatus(

int oldStatus = dlFileVersion.getStatus();

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

Date date = new Date();

if ((status == WorkflowConstants.STATUS_APPROVED) &&
Expand Down

0 comments on commit d8735da

Please sign in to comment.