Unverified Commit a35b307c authored by Jonathan's avatar Jonathan Committed by GitHub
Browse files

XYZ-35: Added Support for GlobalRelay Compliance Export Format

* Added System Console support for GlobalRelay
* make check-style
parent fe8925c2
......@@ -21,14 +21,18 @@ export default class MessageExportSettings extends AdminSettings {
getConfigFromState(config) {
config.MessageExportSettings.EnableExport = this.state.enableComplianceExport;
config.MessageExportSettings.ExportFormat = this.state.exportFormat;
config.MessageExportSettings.DailyRunTime = this.state.exportJobStartTime;
config.MessageExportSettings.GlobalRelayEmailAddress = this.state.globalRelayEmailAddress;
return config;
}
getStateFromConfig(config) {
return {
enableComplianceExport: config.MessageExportSettings.EnableExport,
exportJobStartTime: config.MessageExportSettings.DailyRunTime
exportFormat: config.MessageExportSettings.ExportFormat,
exportJobStartTime: config.MessageExportSettings.DailyRunTime,
globalRelayEmailAddress: config.MessageExportSettings.GlobalRelayEmailAddress
};
}
......@@ -43,16 +47,58 @@ export default class MessageExportSettings extends AdminSettings {
renderSettings() {
const exportFormatOptions = [
{value: 'actiance', text: Utils.localizeMessage('admin.complianceExport.exportFormat.actiance', 'Actiance XML')}
{value: 'actiance', text: Utils.localizeMessage('admin.complianceExport.exportFormat.actiance', 'Actiance XML')},
{value: 'globalrelay', text: Utils.localizeMessage('admin.complianceExport.exportFormat.globalrelay', 'GlobalRelay EML')}
];
// if export format is globalrelay, user must set email address
var dropdownHelpText;
var globalRelayEmail;
if (this.state.exportFormat === 'globalrelay') {
globalRelayEmail = (
<TextSetting
id='globalRelayEmailAddress'
label={
<FormattedMessage
id='admin.complianceExport.globalRelayEmailAddress.title'
defaultMessage='GlobalRelay Email Address:'
/>
}
placeholder={Utils.localizeMessage('admin.complianceExport.globalRelayEmailAddress.example', 'E.g.: "globalrelay@mattermost.com"')}
helpText={
<FormattedHTMLMessage
id='admin.complianceExport.globalRelayEmailAddress.description'
defaultMessage='The email address that your GlobalRelay instance monitors for incoming Compliance Exports'
/>
}
value={this.state.globalRelayEmailAddress === null ? '' : this.state.globalRelayEmailAddress}
disabled={!this.state.enableComplianceExport}
onChange={this.handleChange}
/>
);
dropdownHelpText = (
<FormattedMessage
id='admin.complianceExport.exportFormat.globalrelay.description'
defaultMessage='Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Exports will be emailed to the configured email address.'
/>
);
} else {
dropdownHelpText = (
<FormattedHTMLMessage
id='admin.complianceExport.exportFormat.actiance.description'
defaultMessage='Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Export files will be written to the "exports" subdirectory of the configured <a href="/admin_console/files/storage">Local Storage Directory</a>.'
/>
);
}
return (
<SettingsGroup>
<div className='banner'>
<div className='banner__content'>
<FormattedHTMLMessage
id='admin.complianceExport.description'
defaultMessage='This feature supports compliance exports to the Actiance XML format, and is currently in beta. Support for the GlobalRelay EML format and the Mattermost CSV format are scheduled for a future release, and will replace the existing <a href=\"/admin_console/general/compliance\">Compliance</a> feature. Compliance Export files will be written to the \"exports\" subdirectory of the configured <a href=\"/admin_console/files/storage\">Local Storage Directory</a>.'
defaultMessage='This feature supports compliance exports to the Actiance XML and GlobalRelay EML formats, and is currently in beta. Support for the Mattermost CSV format is scheduled for a future release, and will replace the existing <a href=\"/admin_console/general/compliance\">Compliance</a> feature.'
/>
</div>
</div>
......@@ -68,7 +114,7 @@ export default class MessageExportSettings extends AdminSettings {
helpText={
<FormattedHTMLMessage
id='admin.service.complianceExportDesc'
defaultMessage='When true, Mattermost will generate a compliance export file that contains all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\"https://about.mattermost.com/default-compliance-export-documentation\" target=\"_blank\">the documentation</a> to learn more.'
defaultMessage='When true, Mattermost will export all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\"https://about.mattermost.com/default-compliance-export-documentation\" target=\"_blank\">the documentation</a> to learn more.'
/>
}
value={this.state.enableComplianceExport}
......@@ -95,27 +141,23 @@ export default class MessageExportSettings extends AdminSettings {
onChange={this.handleChange}
/>
{/* dropdown value is hard-coded until we support more than one export format */}
<DropdownSetting
id='exportFormat'
values={exportFormatOptions}
label={
<FormattedMessage
id='admin.complianceExport.exportFormat.title'
defaultMessage='Export File Format:'
defaultMessage='Export Format:'
/>
}
helpText={
<FormattedMessage
id='admin.complianceExport.exportFormat.description'
defaultMessage='File format of the compliance export. Corresponds to the system that you want to import the data into.'
/>
}
value='actiance'
helpText={dropdownHelpText}
value={this.state.exportFormat}
disabled={!this.state.enableComplianceExport}
onChange={this.handleChange}
/>
{globalRelayEmail}
<JobsTable
jobType={JobTypes.MESSAGE_EXPORT}
disabled={!this.state.enableComplianceExport}
......
......@@ -201,13 +201,18 @@
"admin.compliance.true": "true",
"admin.complianceExport.createJob.help": "Initiates a Compliance Export job immediately.",
"admin.complianceExport.createJob.title": "Run Compliance Export Job Now",
"admin.complianceExport.description": "This feature supports compliance exports to the Actiance XML format, and is currently in beta. Support for the GlobalRelay EML format and the Mattermost CSV format are scheduled for a future release, and will replace the existing <a href=\"/admin_console/general/compliance\">Compliance</a> feature. Compliance Export files will be written to the \"exports\" subdirectory of the configured <a href=\"/admin_console/files/storage\">Local Storage Directory</a>.",
"admin.complianceExport.description": "This feature supports compliance exports to the Actiance XML and GlobalRelay EML formats, and is currently in beta. Support for the Mattermost CSV format is scheduled for a future release, and will replace the existing <a href=\"/admin_console/general/compliance\">Compliance</a> feature.",
"admin.complianceExport.exportFormat.actiance": "Actiance XML",
"admin.complianceExport.exportFormat.description": "File format of the compliance export. Corresponds to the system that you want to import the data into.",
"admin.complianceExport.exportFormat.title": "Export File Format:",
"admin.complianceExport.exportFormat.globalrelay": "GlobalRelay EML",
"admin.complianceExport.exportFormat.actiance.description": "Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Export files will be written to the \"exports\" subdirectory of the configured <a href=\"/admin_console/files/storage\">Local Storage Directory</a>.",
"admin.complianceExport.exportFormat.globalrelay.description": "Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Exports will be emailed to the configured email address.",
"admin.complianceExport.exportFormat.title": "Export Format:",
"admin.complianceExport.exportJobStartTime.description": "Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM.",
"admin.complianceExport.exportJobStartTime.example": "E.g.: \"02:00\"",
"admin.complianceExport.exportJobStartTime.title": "Compliance Export time:",
"admin.complianceExport.globalRelayEmailAddress.title": "GlobalRelay Email Address:",
"admin.complianceExport.globalRelayEmailAddress.description": "The email address that your GlobalRelay instance monitors for incoming Compliance Exports",
"admin.complianceExport.globalRelayEmailAddress.example": "E.g.: \"globalrelay@mattermost.com\"",
"admin.complianceExport.title": "Compliance Export (Beta)",
"admin.compliance_reports.desc": "Job Name:",
"admin.compliance_reports.desc_placeholder": "E.g. \"Audit 445 for HR\"",
......@@ -878,7 +883,7 @@
"admin.service.attemptTitle": "Maximum Login Attempts:",
"admin.service.cmdsDesc": "When true, custom slash commands will be allowed. See <a href='http://docs.mattermost.com/developer/slash-commands.html' target='_blank'>documentation</a> to learn more.",
"admin.service.cmdsTitle": "Enable Custom Slash Commands: ",
"admin.service.complianceExportDesc": "When true, Mattermost will generate a compliance export file that contains all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\"https://about.mattermost.com/default-compliance-export-documentation\" target=\"_blank\">the documentation</a> to learn more.",
"admin.service.complianceExportDesc": "When true, Mattermost will export all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\"https://about.mattermost.com/default-compliance-export-documentation\" target=\"_blank\">the documentation</a> to learn more.",
"admin.service.complianceExportTitle": "Enable Compliance Export:",
"admin.service.corsDescription": "Enable HTTP Cross origin request from a specific domain. Use \"*\" if you want to allow CORS from any domain or leave it blank to disable it.",
"admin.service.corsEx": "http://example.com",
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/MessageExportSettings should match snapshot, disabled 1`] = `
<div
className="wrapper--fixed"
>
<h3
className="admin-console-header"
>
<FormattedMessage
defaultMessage="Compliance Export (Beta)"
id="admin.complianceExport.title"
values={Object {}}
/>
</h3>
<form
className="form-horizontal"
onSubmit={[Function]}
role="form"
>
<SettingsGroup
show={true}
>
<div
className="banner"
>
<div
className="banner__content"
>
<FormattedHTMLMessage
defaultMessage="This feature supports compliance exports to the Actiance XML and GlobalRelay EML formats, and is currently in beta. Support for the Mattermost CSV format is scheduled for a future release, and will replace the existing <a href=\\\\\\"/admin_console/general/compliance\\\\\\">Compliance</a> feature."
id="admin.complianceExport.description"
values={Object {}}
/>
</div>
</div>
<BooleanSetting
disabled={false}
falseText={
<FormattedMessage
defaultMessage="false"
id="admin.false"
values={Object {}}
/>
}
helpText={
<FormattedHTMLMessage
defaultMessage="When true, Mattermost will export all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\\\\\\"https://about.mattermost.com/default-compliance-export-documentation\\\\\\" target=\\\\\\"_blank\\\\\\">the documentation</a> to learn more."
id="admin.service.complianceExportDesc"
values={Object {}}
/>
}
id="enableComplianceExport"
label={
<FormattedMessage
defaultMessage="Enable Compliance Export:"
id="admin.service.complianceExportTitle"
values={Object {}}
/>
}
onChange={[Function]}
trueText={
<FormattedMessage
defaultMessage="true"
id="admin.true"
values={Object {}}
/>
}
value={false}
/>
<TextSetting
disabled={true}
helpText={
<FormattedHTMLMessage
defaultMessage="Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM."
id="admin.complianceExport.exportJobStartTime.description"
values={Object {}}
/>
}
id="exportJobStartTime"
label={
<FormattedMessage
defaultMessage="Compliance Export Time:"
id="admin.complianceExport.exportJobStartTime.title"
values={Object {}}
/>
}
maxLength={null}
onChange={[Function]}
placeholder="E.g.: \\"02:00\\""
type="input"
value="01:00"
/>
<DropdownSetting
disabled={true}
helpText={
<FormattedHTMLMessage
defaultMessage="Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Export files will be written to the \\"exports\\" subdirectory of the configured <a href=\\"/admin_console/files/storage\\">Local Storage Directory</a>."
id="admin.complianceExport.exportFormat.actiance.description"
values={Object {}}
/>
}
id="exportFormat"
isDisabled={false}
label={
<FormattedMessage
defaultMessage="Export Format:"
id="admin.complianceExport.exportFormat.title"
values={Object {}}
/>
}
onChange={[Function]}
value="actiance"
values={
Array [
Object {
"text": "Actiance XML",
"value": "actiance",
},
Object {
"text": "GlobalRelay EML",
"value": "globalrelay",
},
]
}
/>
<Connect(InjectIntl(JobTable))
createJobButtonText={
<FormattedMessage
defaultMessage="Run Compliance Export Job Now"
id="admin.complianceExport.createJob.title"
values={Object {}}
/>
}
createJobHelpText={
<FormattedMessage
defaultMessage="Initiates a Compliance Export job immediately."
id="admin.complianceExport.createJob.help"
values={Object {}}
/>
}
disabled={true}
jobType="message_export"
/>
</SettingsGroup>
<div
className="form-group"
>
<FormError
error={null}
errors={Array []}
/>
</div>
<div
className="form-group"
>
<div
className="col-sm-12"
>
<SaveButton
btnClass="btn-primary"
defaultMessage="Save"
disabled={true}
extraClasses=""
onClick={[Function]}
saving={false}
savingMessage="Saving Config..."
/>
</div>
</div>
</form>
</div>
`;
exports[`components/MessageExportSettings should match snapshot, enabled, actiance 1`] = `
<div
className="wrapper--fixed"
>
<h3
className="admin-console-header"
>
<FormattedMessage
defaultMessage="Compliance Export (Beta)"
id="admin.complianceExport.title"
values={Object {}}
/>
</h3>
<form
className="form-horizontal"
onSubmit={[Function]}
role="form"
>
<SettingsGroup
show={true}
>
<div
className="banner"
>
<div
className="banner__content"
>
<FormattedHTMLMessage
defaultMessage="This feature supports compliance exports to the Actiance XML and GlobalRelay EML formats, and is currently in beta. Support for the Mattermost CSV format is scheduled for a future release, and will replace the existing <a href=\\\\\\"/admin_console/general/compliance\\\\\\">Compliance</a> feature."
id="admin.complianceExport.description"
values={Object {}}
/>
</div>
</div>
<BooleanSetting
disabled={false}
falseText={
<FormattedMessage
defaultMessage="false"
id="admin.false"
values={Object {}}
/>
}
helpText={
<FormattedHTMLMessage
defaultMessage="When true, Mattermost will export all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\\\\\\"https://about.mattermost.com/default-compliance-export-documentation\\\\\\" target=\\\\\\"_blank\\\\\\">the documentation</a> to learn more."
id="admin.service.complianceExportDesc"
values={Object {}}
/>
}
id="enableComplianceExport"
label={
<FormattedMessage
defaultMessage="Enable Compliance Export:"
id="admin.service.complianceExportTitle"
values={Object {}}
/>
}
onChange={[Function]}
trueText={
<FormattedMessage
defaultMessage="true"
id="admin.true"
values={Object {}}
/>
}
value={true}
/>
<TextSetting
disabled={false}
helpText={
<FormattedHTMLMessage
defaultMessage="Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM."
id="admin.complianceExport.exportJobStartTime.description"
values={Object {}}
/>
}
id="exportJobStartTime"
label={
<FormattedMessage
defaultMessage="Compliance Export Time:"
id="admin.complianceExport.exportJobStartTime.title"
values={Object {}}
/>
}
maxLength={null}
onChange={[Function]}
placeholder="E.g.: \\"02:00\\""
type="input"
value="01:00"
/>
<DropdownSetting
disabled={false}
helpText={
<FormattedHTMLMessage
defaultMessage="Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Export files will be written to the \\"exports\\" subdirectory of the configured <a href=\\"/admin_console/files/storage\\">Local Storage Directory</a>."
id="admin.complianceExport.exportFormat.actiance.description"
values={Object {}}
/>
}
id="exportFormat"
isDisabled={false}
label={
<FormattedMessage
defaultMessage="Export Format:"
id="admin.complianceExport.exportFormat.title"
values={Object {}}
/>
}
onChange={[Function]}
value="actiance"
values={
Array [
Object {
"text": "Actiance XML",
"value": "actiance",
},
Object {
"text": "GlobalRelay EML",
"value": "globalrelay",
},
]
}
/>
<Connect(InjectIntl(JobTable))
createJobButtonText={
<FormattedMessage
defaultMessage="Run Compliance Export Job Now"
id="admin.complianceExport.createJob.title"
values={Object {}}
/>
}
createJobHelpText={
<FormattedMessage
defaultMessage="Initiates a Compliance Export job immediately."
id="admin.complianceExport.createJob.help"
values={Object {}}
/>
}
disabled={false}
jobType="message_export"
/>
</SettingsGroup>
<div
className="form-group"
>
<FormError
error={null}
errors={Array []}
/>
</div>
<div
className="form-group"
>
<div
className="col-sm-12"
>
<SaveButton
btnClass="btn-primary"
defaultMessage="Save"
disabled={true}
extraClasses=""
onClick={[Function]}
saving={false}
savingMessage="Saving Config..."
/>
</div>
</div>
</form>
</div>
`;
exports[`components/MessageExportSettings should match snapshot, enabled, globalrelay 1`] = `
<div
className="wrapper--fixed"
>
<h3
className="admin-console-header"
>
<FormattedMessage
defaultMessage="Compliance Export (Beta)"
id="admin.complianceExport.title"
values={Object {}}
/>
</h3>
<form
className="form-horizontal"
onSubmit={[Function]}
role="form"
>
<SettingsGroup
show={true}
>
<div
className="banner"
>
<div
className="banner__content"
>
<FormattedHTMLMessage
defaultMessage="This feature supports compliance exports to the Actiance XML and GlobalRelay EML formats, and is currently in beta. Support for the Mattermost CSV format is scheduled for a future release, and will replace the existing <a href=\\\\\\"/admin_console/general/compliance\\\\\\">Compliance</a> feature."
id="admin.complianceExport.description"
values={Object {}}
/>
</div>
</div>
<BooleanSetting
disabled={false}
falseText={
<FormattedMessage
defaultMessage="false"
id="admin.false"
values={Object {}}
/>
}
helpText={
<FormattedHTMLMessage
defaultMessage="When true, Mattermost will export all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See <a href=\\\\\\"https://about.mattermost.com/default-compliance-export-documentation\\\\\\" target=\\\\\\"_blank\\\\\\">the documentation</a> to learn more."
id="admin.service.complianceExportDesc"
values={Object {}}
/>
}
id="enableComplianceExport"
label={
<FormattedMessage
defaultMessage="Enable Compliance Export:"
id="admin.service.complianceExportTitle"
values={Object {}}
/>
}
onChange={[Function]}
trueText={
<FormattedMessage
defaultMessage="true"
id="admin.true"
values={Object {}}
/>
}
value={true}
/>
<TextSetting
disabled={false}
helpText={
<FormattedHTMLMessage
defaultMessage="Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM."
id="admin.complianceExport.exportJobStartTime.description"
values={Object {}}
/>
}
id="exportJobStartTime"
label={
<FormattedMessage
defaultMessage="Compliance Export Time:"
id="admin.complianceExport.exportJobStartTime.title"
values={Object {}}
/>
}
maxLength={null}
onChange={[Function]}
placeholder="E.g.: \\"02:00\\""
type="input"
value="01:00"
/>
<DropdownSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="Format of the compliance export. Corresponds to the system that you want to import the data into. Compliance Exports will be emailed to the configured email address."