Island: Allow HTML in config_schema descriptions to be renedered

This commit is contained in:
Mike Salvatore 2021-06-30 14:09:26 -04:00
parent f698c889e3
commit 938022fc52
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import React from 'react';
function HtmlFieldDescription(props) {
var content_obj = {__html: props.description};
return <p id={props.id} className='field-description' dangerouslySetInnerHTML={content_obj} />;
}
export default HtmlFieldDescription;

View File

@ -17,6 +17,7 @@ import isUnsafeOptionSelected from '../utils/SafeOptionValidator.js';
import ConfigExportModal from '../configuration-components/ExportConfigModal';
import ConfigImportModal from '../configuration-components/ImportConfigModal';
import applyUiSchemaManipulators from '../configuration-components/UISchemaManipulators.tsx';
import HtmlFieldDescription from '../configuration-components/HtmlFieldDescription.js';
const ATTACK_URL = '/api/attack';
const CONFIG_URL = '/api/configuration/island';
@ -411,6 +412,7 @@ class ConfigurePageComponent extends AuthComponent {
setPbaFilenameLinux: this.setPbaFilenameLinux,
selectedSection: this.state.selectedSection
})
formProperties['fields'] = {DescriptionField: HtmlFieldDescription};
formProperties['formData'] = this.state.currentFormData;
formProperties['onChange'] = this.onChange;
formProperties['customFormats'] = formValidationFormats;