This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Inheritance = '!*'; | |
export const securityFieldName = '__Security'; | |
const permissionCanRead = '+read'; | |
const permissionCannotRead = '-read'; | |
enum ParseState { au, ar, pe, pd }; | |
export type Permissions = { | |
[username: string]: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Removes components from placeholders (in the page layout) if given role is not authorized to view them | |
function removeComponents(placeholders: PlaceholdersData, role: string) { | |
for (let placeholder in placeholders) { | |
for (let i = 0; i < placeholders[placeholder].length; i++) { | |
if ('fields' in placeholders[placeholder][i] || 'placeholders' in placeholders[placeholder][i]) { | |
const componentRendering = placeholders[placeholder][i] as ComponentRendering; | |
if (componentRendering?.fields) { | |
// @ts-expect-error | |
if('data' in componentRendering.fields && componentRendering.fields.data.datasource?.security) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<sitecore xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"> | |
<api> | |
<GraphQL> | |
<defaults> | |
<content> | |
<schemaProviders> | |
<edgeContent type="Sitecore.Services.GraphQL.EdgeSchema.EdgeSchemaProvider, Sitecore.Services.GraphQL.EdgeSchema"> | |
<templates type="Sitecore.Services.GraphQL.Content.TemplateGeneration.Filters.StandardTemplatePredicate, Sitecore.Services.GraphQL.Content"> | |
<paths> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRouter } from 'next/router'; | |
import { | |
FieldViewModel, | |
InputViewModel | |
} from '@sitecore-jss/sitecore-jss-forms'; | |
import { | |
createDefaultFieldFactory, | |
ValueFieldProps | |
} from '@sitecore-jss/sitecore-jss-react-forms'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Overriding this class to fix issue where labels (eg. on checkbox list) are truncated | |
/// </summary> | |
public class DataSourceSettingsManager : Sitecore.ExperienceForms.Mvc.DataSource.DataSourceSettingsManager | |
{ | |
protected override void UpdateSettings(ListFieldItemCollection settings, Item fieldSettingsItem, FieldSettingsContext settingsContext) | |
{ | |
//base.UpdateSettings(settings, fieldSettingsItem, settingsContext); | |
Assert.ArgumentNotNull(settings, "settings"); | |
Assert.ArgumentNotNull(fieldSettingsItem, "fieldSettingsItem"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomFieldFactory.setComponent(AllFieldTypes.TextField, (props : FieldWithValueProps<FormField<TextViewModel>>) => { | |
// Replace markdown style links in text, eg. this is a sentence with [a link](https://google.com) in it | |
const markdownRegex = /\[([^\]]+)\]\(([^\)]+)\)/; | |
props.field.model.text = props.field.model.text?.replaceAll('\n','<br/>'); | |
props.field.model.text = props.field.model.text?.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"); | |
if(props.field.model.text && props.field.model.text.match(markdownRegex)){ | |
props.field.model.text = props.field.model.text.replace(markdownRegex, '<a href="$2">$1</a>'); | |
const Tag = (props.field.model.htmlTag || 'p'); | |
return React.createElement(Tag, { className: props.field.model.cssClass, dangerouslySetInnerHTML: {__html: props.field.model.text} }); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { InputViewModel } from "@sitecore-jss/sitecore-jss-forms"; | |
import { | |
createDefaultFieldFactory, | |
FieldTypes, | |
ValueFieldProps | |
} from '@sitecore-jss/sitecore-jss-react-forms'; | |
export const AllFieldTypes = { | |
...FieldTypes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<sitecore xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<settings> | |
<setting name="Xdb.Enabled" value="false" /> | |
<setting name="Xdb.Tracking.Enabled" value="false" /> | |
</settings> | |
<services> | |
<configurator patch:delete="*[@type='Sitecore.XConnect.Client.Configuration.HealthCheckServicesConfigurators.XConnectCollectionHealthCheckServicesConfigurator, Sitecore.XConnect.Client.Configuration'" /> | |
<configurator patch:delete="*[@type='Sitecore.XConnect.Client.Configuration.HealthCheckServicesConfigurators.XConnectConfigurationHealthCheckServicesConfigurator, Sitecore.XConnect.Client.Configuration'" /> | |
<configurator patch:delete="*[@type='Sitecore.XConnect.Client.Configuration.HealthCheckServicesConfigurators.XConnectSearchealthCheckServicesConfigurator, Sitecore.XConnect.Client.Configuration'" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Abstractions; | |
using Sitecore.Owin.Authentication.IdentityServer.Extensions; | |
using Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignedIn; | |
using Sitecore.Pipelines.GetStartUrl; | |
using Sitecore.Sites; | |
using System; | |
namespace Identity.Pipelines.CookieAuthentication.SignedIn | |
{ | |
public class CustomGetStartUrl : Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignedIn.GetStartUrl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Abstractions; | |
using Sitecore.Diagnostics; | |
using Sitecore.Owin.Authentication.IdentityServer.Extensions; | |
using Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.ApplyRedirect; | |
using System; | |
using System.Collections.Specialized; | |
using System.Web; | |
namespace Identity.Pipelines.CookieAuthentication.ApplyRedirect | |
{ |