Skip to content

Commit

Permalink
Merge branch 'main' into 30820-custom-hook-content-analytics-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
oidacra authored Dec 17, 2024
2 parents 5cf2435 + 65ad5d1 commit d49793f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
13 changes: 13 additions & 0 deletions core-web/libs/portlets/edit-ema/portlet/src/lib/shared/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export const MOCK_RESPONSE_HEADLESS: DotPageApiResponse = {
inode: '123-i',
canEdit: true,
canRead: true,
canSeeRules: true,
contentType: 'htmlpageasset',
canLock: true,
locked: false,
Expand Down Expand Up @@ -212,6 +213,7 @@ export const MOCK_RESPONSE_VTL: DotPageApiResponse = {
inode: '123-i',
canEdit: true,
canRead: true,
canSeeRules: true,
rendered: '<html><body><h1>Hello, World!</h1></body></html>',
contentType: 'htmlpageasset',
canLock: true,
Expand Down Expand Up @@ -427,6 +429,7 @@ export const PAGE_RESPONSE_BY_LANGUAGE_ID = {
inode: '123',
canEdit: true,
canRead: true,
canSeeRules: true,
pageURI: 'index',
liveInode: '1234',
stInode: '12345',
Expand Down Expand Up @@ -455,6 +458,7 @@ export const PAGE_RESPONSE_BY_LANGUAGE_ID = {
inode: '123',
canEdit: true,
canRead: true,
canSeeRules: true,
pageURI: 'index',
liveInode: '1234',
stInode: '12345',
Expand Down Expand Up @@ -483,6 +487,7 @@ export const PAGE_RESPONSE_BY_LANGUAGE_ID = {
inode: '123',
canEdit: true,
canRead: true,
canSeeRules: true,
pageURI: 'index',
liveInode: '1234',
stInode: '12345',
Expand Down Expand Up @@ -757,6 +762,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
identifier: '123',
canEdit: true,
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
canLock: false,
isLocked: true,
Expand Down Expand Up @@ -785,6 +791,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
identifier: '123',
canEdit: true,
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
canLock: true,
locked: true,
Expand All @@ -811,6 +818,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
inode: PAGE_INODE_MOCK,
identifier: '123',
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
canEdit: false
},
Expand All @@ -836,6 +844,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
inode: PAGE_INODE_MOCK,
identifier: 'i-have-a-running-experiment',
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
rendered: '<div>New Content - Hello World</div>',
canEdit: true
Expand All @@ -862,6 +871,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
inode: PAGE_INODE_MOCK,
identifier: '123',
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
rendered: '<div>New Content - Hello World</div>',
canEdit: true
Expand All @@ -888,6 +898,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
inode: PAGE_INODE_MOCK,
identifier: '123',
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
rendered: '<div>hello world</div>',
canEdit: true
Expand All @@ -914,6 +925,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
inode: PAGE_INODE_MOCK,
identifier: '123',
canRead: true,
canSeeRules: true,
pageURI: 'page-one',
canEdit: true
},
Expand All @@ -939,6 +951,7 @@ export const UVE_PAGE_RESPONSE_MAP = {
identifier: '123',
canEdit: true,
canRead: true,
canSeeRules: true,
pageURI: 'page-one'
},
site: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export interface DotPage {
inode: string;
canEdit: boolean;
canRead: boolean;
canSeeRules: boolean;
canLock?: boolean;
locked?: boolean;
lockedBy?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export const UVEStore = signalStore(
label: 'editema.editor.navbar.rules',
id: 'rules',
href: `rules/${page?.identifier}`,
isDisabled: !page?.canEdit || !isEnterpriseLicense
isDisabled:
!page?.canSeeRules || !page?.canEdit || !isEnterpriseLicense
},
{
iconURL: 'experiments',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ protected Map<String, Object> transform(final HTMLPageAsset page, final Map<Stri
map.put("canEdit", toolBox.permissionAPI.doesUserHavePermission(page, PermissionLevel.EDIT.getType(), user, false));
map.put("canRead", toolBox.permissionAPI.doesUserHavePermission(page, PermissionLevel.READ.getType(), user, false));
map.put("canLock", canLock(page, user));
map.put("canSeeRules", toolBox.permissionAPI.doesUserHavePermissions(page, "RULES: " + PermissionLevel.READ.getType(), user, false));


if(info.isPresent() && info.get().getLockedBy()!=null) {
map.put("lockedOn", info.get().getLockedOn());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<%@ page import="com.liferay.portal.language.LanguageUtil"%>
<%@ page import="java.util.stream.Collectors" %>
<%@ page import="com.dotcms.publisher.business.PublishQueueElementTransformer" %>
<%@ page import="com.dotcms.publisher.bundle.bean.Bundle" %>
<%@ page import="com.dotmarketing.exception.DotDataException" %>
<%@ page import="com.dotmarketing.util.Logger" %>
<%@ page import="com.liferay.util.StringPool" %>
<%@ page import="com.dotcms.publishing.FilterDescriptor" %>
<%@ include file="/html/portlet/ext/contentlet/publishing/init.jsp" %>
<%
final int MAX_ASSETS_TO_SHOW = 3;
Expand Down Expand Up @@ -288,6 +293,7 @@


<th nowrap="nowrap" ><strong><%= LanguageUtil.get(pageContext, "publisher_Identifier") %></strong></th>
<th nowrap="nowrap" ><strong><%= LanguageUtil.get(pageContext, "Filter") %></strong></th>
<th style="width:100%" nowrap="nowrap" ><strong><%= LanguageUtil.get(pageContext, "publisher_Contents") %></strong></th>
<th style="width:100px" nowrap="nowrap" ><strong><%= LanguageUtil.get(pageContext, "publisher_Status") %></strong></th>
<th style="width:40px" nowrap="nowrap" ><strong><%= LanguageUtil.get(pageContext, "publisher_Date_Entered") %></strong></th>
Expand Down Expand Up @@ -322,6 +328,18 @@
}
shortBundleId.append("-").append(bundleIdParts[i]);
}
String filterName = "";
try {
final Bundle bundle = APILocator.getBundleAPI().getBundleById(c.getBundleId());
if ( UtilMethods.isSet(bundle) && UtilMethods.isSet(bundle.getFilterKey()) ) {
final FilterDescriptor filterDescriptor =
APILocator.getPublisherAPI().getFilterDescriptorByKey(bundle.getFilterKey());
filterName = filterDescriptor != null ? filterDescriptor.getTitle() : "";
}
} catch (DotDataException e) {
Logger.error(this, "Error getting bundle id: " + c.getBundleId(), e);
}
%>
<tr <%=errorclass%>>
<td style="width:30px;text-align:center;" valign="top">
Expand All @@ -336,7 +354,11 @@
<td valign="top" nowrap="nowrap" style="cursor: pointer" onclick="javascript: showDetail('<%=c.getBundleId()%>')">
<%=shortBundleId.toString()%>
</td>
<%--BundleTitle--%>
<%--BundleFilter--%>
<td valign="top" nowrap="nowrap" style="cursor: pointer" onclick="javascript: showDetail('<%=c.getBundleId()%>')">
<%= filterName %>
</td>
<%--BundleContents--%>
<%try{ %>
<% if(bundleAssets.keySet().size()>0){ %>
<td valign="top" style="cursor: pointer" onclick="showDetail('<%=c.getBundleId()%>', event)">
Expand Down

0 comments on commit d49793f

Please sign in to comment.