Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
id: 'key',
title: 'Key',
type: CustomCollectionFieldType.string,
required: true
},
{
id: 'text',
title: 'Text',
type: CustomCollectionFieldType.string,
required: true
},
{
id: 'filterValue',
title: 'Filterable Value',
type: CustomCollectionFieldType.string,
}
]
})
);
filterPaneFields.push(...this.buildFilterPaneFields([
{key:'key', text:'Key'},
{key:'text', text:'Text'},
{key:'filterValue', text:'Filterable Value'},
], 'filterValue'));
}
if(this.properties.choiceType === 'list') {
choicesPaneFields.push(
PropertyFieldListPicker('listId', {
label: 'List/Library',
text: strings.ResultTypes.GreaterThanOperator
},
{
key: ResultTypeOperator.LessOrEqual,
text: strings.ResultTypes.LessOrEqualOperator
},
{
key: ResultTypeOperator.LessThan,
text: strings.ResultTypes.LessThanOperator
}
]
},
{
id: 'value',
title: strings.ResultTypes.ConditionValueLabel,
type: CustomCollectionFieldType.string,
required: false,
},
{
id: "inlineTemplateContent",
title: "Inline template",
type: CustomCollectionFieldType.custom,
onCustomRender: (field, value, onUpdate) => {
return (
React.createElement("div", null,
React.createElement(this._textDialogComponent.TextDialog, {
language: this._propertyFieldCodeEditorLanguages.Handlebars,
dialogTextFieldValue: value ? value : dialogTextFieldValue,
onChanged: (fieldValue) => onUpdate(field.id, fieldValue),
strings: {
cancelButtonText: strings.CancelButtonText,
dialogButtonText: strings.DialogButtonText,
})
];
if(this.properties.choiceType === 'custom') {
choicesPaneFields.push(
PropertyFieldCollectionData('customChoices', {
key: 'customChoices',
label: 'Custom Choices',
panelHeader: 'Custom Choices',
manageBtnLabel: 'Manage Choices',
value: this.properties.customChoices,
fields: [
{
id: 'key',
title: 'Key',
type: CustomCollectionFieldType.string,
required: true
},
{
id: 'text',
title: 'Text',
type: CustomCollectionFieldType.string,
required: true
},
{
id: 'filterValue',
title: 'Filterable Value',
type: CustomCollectionFieldType.string,
}
]
})
);
return ({
key: prop,
text: prop
});
});
stylingFields.push(PropertyFieldCollectionData('customTemplateFieldValues', {
key: 'customTemplateFieldValues',
label: strings.customTemplateFieldsLabel,
panelHeader: strings.customTemplateFieldsPanelHeader,
manageBtnLabel: strings.customTemplateFieldsConfigureButtonLabel,
value: this.properties.customTemplateFieldValues,
fields: [
{
id: 'fieldName',
title: strings.customTemplateFieldTitleLabel,
type: CustomCollectionFieldType.string,
},
{
id: 'searchProperty',
title: strings.customTemplateFieldPropertyLabel,
type: CustomCollectionFieldType.dropdown,
options: searchPropertyOptions
}
]
}));
}
}
return stylingFields;
}