Skip to content
Merged
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 @@ -34,8 +34,9 @@
import org.jobrunr.storage.StorageProvider;
import org.jobrunr.storage.StorageProviderUtils;
import org.jobrunr.storage.sql.common.SqlStorageProviderFactory;
import org.jobrunr.utils.mapper.jackson.JacksonJsonMapper;
import org.jobrunr.utils.mapper.jackson3.Jackson3JsonMapper;

import com.simisinc.platform.domain.events.Event;
import com.simisinc.platform.infrastructure.database.ConnectionPool;
import com.simisinc.platform.infrastructure.instance.InstanceManager;
import com.simisinc.platform.infrastructure.scheduler.admin.DatasetsDownloadAndSyncJob;
Expand All @@ -53,6 +54,8 @@
import com.zeroio.platform.infrastructure.scheduler.cms.RefreshAllDocumentTextIndexesJob;
import com.zeroio.platform.infrastructure.scheduler.cms.RefreshAllWebPageTextIndexesJob;

import tools.jackson.databind.jsontype.BasicPolymorphicTypeValidator;

/**
* Initializes background jobs to be run on a schedule
*
Expand Down Expand Up @@ -126,7 +129,7 @@ public static void startup(ServletContext servletContext1) {

// Initialize the scheduler
JobRunr.configure()
.useJsonMapper(new JacksonJsonMapper())
.useJsonMapper(new Jackson3JsonMapper(BasicPolymorphicTypeValidator.builder().allowIfSubType(Event.class)))
.useStorageProvider(jobStorageProvider)
// .useJobActivator(new JobActivator() {
// public <T> T activateJob(Class<T> aClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public WidgetContext execute(WidgetContext context) {
}
// Make sure the blog exists
if (blog == null) {
// Auto-create it if an admin
if (context.getUserSession().hasRole("admin")) {
// Auto-create the blog and layout of the page
if (context.getUserSession().hasRole("admin") || context.getUserSession().hasRole("content-manager")) {
// The Blog needs an administrative record
Blog blogBean = new Blog();
blogBean.setName(blogUniqueId);
Expand All @@ -115,7 +115,7 @@ public WidgetContext execute(WidgetContext context) {
try {
SaveWebPageCommand.saveWebPage(webPage);
} catch (DataException e) {
// No concern yet
LOG.error("Unable to create the blog page for " + blogBean.getUniqueId(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public JsonServiceContext get(JsonServiceContext context) {
.append("\",");
sb.append("\"fileLength\":").append(file.getFileLength()).append(",");
sb.append("\"url\":\"").append(JsonCommand.toJson(StringUtils.defaultString(file.getUrl()))).append("\",");
sb.append("\"downloadUrl\":\"").append("/assets/file/").append(JsonCommand.toJson(StringUtils.defaultString(file.getUrl()))).append("\",");
sb.append("\"downloadCount\":").append(file.getDownloadCount()).append(",");
sb.append("\"error\":")
.append(isMissingOnServer(file.getFileType(), file.getMimeType(), file.getFileServerPath())).append(",");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ CREATE TABLE IF NOT EXISTS regions (
name VARCHAR(100),
values JSONB
);

-- Example
-- INSERT INTO regions (level, code, name, values) VALUES (10, 'apac', 'Asia Pacific', '["apac"]');
-- INSERT INTO regions (level, code, name, values) VALUES (20, 'emea', 'Europe, Middle East, and Africa', '["emea"]');
-- INSERT INTO regions (level, code, name, values) VALUES (30, 'latam', 'Latin America', '["latam"]');
-- INSERT INTO regions (level, code, name, values) VALUES (40, 'na', 'North America', '["na", "na-ca", "na-us"]');
-- INSERT INTO regions (level, code, name, values) VALUES (60, 'global', 'Global', '["na", "na-us", "na-ca", "apac", "emea", "latam"]');
-- UPDATE site_properties SET property_value = 'true' WHERE property_name = 'site.regions.enabled';
8 changes: 0 additions & 8 deletions src/main/webapp/WEB-INF/jsp/cms/page-children-widget.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@
.children-pages h4 {
margin: 0;
color: var(--text);
font-size: 1rem;
font-weight: 700;
letter-spacing: 0.01em;
}

.page-tree {
list-style: none;
padding: 0.45rem 0 0;
margin: 0;
font-size: 0.92rem;
}

.tree-item {
Expand All @@ -56,24 +52,20 @@

.tree-item.level-1 .tree-link {
color: var(--accent-1);
font-weight: 700;
}

.tree-item.level-2 .tree-link {
color: var(--accent-2);
font-weight: 600;
}

.tree-item.level-3 .tree-link {
color: var(--accent-3);
font-weight: 600;
}

.tree-item.level-4 .tree-link,
.tree-item.level-5 .tree-link,
.tree-item.level-6 .tree-link {
color: var(--text);
font-weight: 500;
}

.tree-indicator {
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/WEB-INF/jsp/cms/search-form.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<c:if test="${!empty param.label}">
<input type="hidden" name="label" value="<c:out value='${param.label}'/>">
</c:if>
<c:if test="${!empty param.excludeLabel}">
<input type="hidden" name="excludeLabel" value="<c:out value='${param.excludeLabel}'/>">
</c:if>
<c:if test="${!empty param.contributorFilter}">
<input type="hidden" name="contributorFilter" value="<c:out value='${param.contributorFilter}'/>">
</c:if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class ContentEditorBridge {
}

this.lastPreviewLink = pageLink;
iframe.src = pageLink;
iframe.src = encodeURI(pageLink);

// Load content blocks for this page
if (this.pageContentBlocksManager) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2590,7 +2590,8 @@ class PropertiesPanel {
if (preview) {
const iconClass = input.value.trim();
if (iconClass) {
preview.innerHTML = `<i class="fa ${iconClass}"></i>`;
const escapedIconClass = iconClass.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
preview.innerHTML = `<i class="fa ${escapedIconClass}"></i>`;
preview.style.color = '#333';
} else {
preview.innerHTML = '';
Expand Down
Loading