Commit d7ce6cca authored by Harrison Healey's avatar Harrison Healey Committed by Corey Hulen
Browse files

PLT-6924 Added config options to disable file uploads/downloads on mobile (#7049)

parent d0240ac5
......@@ -26,6 +26,8 @@ export default class StorageSettings extends AdminSettings {
getConfigFromState(config) {
config.FileSettings.EnableFileAttachments = this.state.enableFileAttachments;
config.FileSettings.EnableMobileUpload = this.state.enableMobileUpload;
config.FileSettings.EnableMobileDownload = this.state.enableMobileDownload;
config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize) * 1024 * 1024;
config.FileSettings.DriverName = this.state.driverName;
config.FileSettings.Directory = this.state.directory;
......@@ -41,6 +43,8 @@ export default class StorageSettings extends AdminSettings {
getStateFromConfig(config) {
return {
enableFileAttachments: config.FileSettings.EnableFileAttachments,
enableMobileUpload: config.FileSettings.EnableMobileUpload,
enableMobileDownload: config.FileSettings.EnableMobileDownload,
maxFileSize: config.FileSettings.MaxFileSize / 1024 / 1024,
driverName: config.FileSettings.DriverName,
directory: config.FileSettings.Directory,
......@@ -206,18 +210,54 @@ export default class StorageSettings extends AdminSettings {
label={
<FormattedMessage
id='admin.file.enableFileAttachments'
defaultMessage='Enable File Attachments:'
defaultMessage='Allow File Sharing:'
/>
}
helpText={
<FormattedMessage
id='admin.file.enableFileAttachmentsDesc'
defaultMessage='When false, disable file and image uploads on messages.'
defaultMessage='When false, disables file sharing on the server. All file and image uploads on messages are forbidden across clients and devices, including mobile.'
/>
}
value={this.state.enableFileAttachments}
onChange={this.handleChange}
/>
<BooleanSetting
id='enableMobileUpload'
label={
<FormattedMessage
id='admin.file.enableMobileUploadTitle'
defaultMessage='Allow File Uploads on Mobile:'
/>
}
helpText={
<FormattedMessage
id='admin.file.enableMobileUploadDesc'
defaultMessage='When false, disables file uploads on mobile apps. If Allow File Sharing is set to true, users can still upload files from a mobile web browser.'
/>
}
value={this.state.enableMobileUpload}
onChange={this.handleChange}
disabled={!this.state.enableFileAttachments}
/>
<BooleanSetting
id='enableMobileDownload'
label={
<FormattedMessage
id='admin.file.enableMobileDownloadTitle'
defaultMessage='Allow File Downloads on Mobile:'
/>
}
helpText={
<FormattedMessage
id='admin.file.enableMobileDownloadDesc'
defaultMessage='When false, disables file downloads on mobile apps. Users can still download files from a mobile web browser.'
/>
}
value={this.state.enableMobileDownload}
onChange={this.handleChange}
disabled={!this.state.enableFileAttachments}
/>
<TextSetting
id='maxFileSize'
label={
......
......@@ -323,8 +323,12 @@
"admin.email.smtpUsernameTitle": "SMTP Server Username:",
"admin.email.testing": "Testing...",
"admin.false": "false",
"admin.file.enableFileAttachments": "Enable File Attachments:",
"admin.file.enableFileAttachmentsDesc": "When false, disable file and image uploads on messages.",
"admin.file.enableFileAttachments": "Allow File Sharing:",
"admin.file.enableFileAttachmentsDesc": "When false, disables file sharing on the server. All file and image uploads on messages are forbidden across clients and devices, including mobile.",
"admin.file.enableMobileDownloadDesc": "When false, disables file downloads on mobile apps. Users can still download files from a mobile web browser.",
"admin.file.enableMobileDownloadTitle": "Allow File Downloads on Mobile:",
"admin.file.enableMobileUploadDesc": "When false, disables file uploads on mobile apps. If Allow File Sharing is set to true, users can still upload files from a mobile web browser.",
"admin.file.enableMobileUploadTitle": "Allow File Uploads on Mobile:",
"admin.file_upload.chooseFile": "Choose File",
"admin.file_upload.noFile": "No file uploaded",
"admin.file_upload.uploadFile": "Upload",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment