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
| /// <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
| 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
| <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
| // 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
| 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
| { | |
| "Headers": { | |
| "type": "sitecore.ordercloud.messages.product.updated", | |
| "marketplace": "yourMarketplaceId", | |
| "tenantid": "yourMarketplaceId" | |
| }, | |
| "Payload": { | |
| "UserContext": { | |
| "ID": null, | |
| "AnonymousID": null |
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
| { | |
| "Meta": { | |
| "Page": 1, | |
| "PageSize": 20, | |
| "TotalCount": 2, | |
| "TotalPages": 1, | |
| "ItemRange": [ | |
| 1, | |
| 2 | |
| ], |
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
| { | |
| "Meta": { | |
| "Page": 1, | |
| "PageSize": 20, | |
| "TotalCount": 3, | |
| "TotalPages": 1, | |
| "ItemRange": [ | |
| 1, | |
| 3 | |
| ], |
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
| { | |
| "Meta": { | |
| "Page": 1, | |
| "PageSize": 20, | |
| "TotalCount": 2, | |
| "TotalPages": 1, | |
| "ItemRange": [ | |
| 1, | |
| 2 | |
| ], |