summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/storage_settings.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-05-04 15:45:19 -0400
committerGitHub <noreply@github.com>2017-05-04 15:45:19 -0400
commit49481caf6db89b0853626ac52ab5f786a6887179 (patch)
tree128991892f16d7830097c217db689410a002eb73 /webapp/components/admin_console/storage_settings.jsx
parent44a8f76d993cdd97785cab7fd55ad9f07c3c757a (diff)
downloadchat-49481caf6db89b0853626ac52ab5f786a6887179.tar.gz
chat-49481caf6db89b0853626ac52ab5f786a6887179.tar.bz2
chat-49481caf6db89b0853626ac52ab5f786a6887179.zip
PLT-6262 Add config setting to disable file attachments (#6301)
* Add config setting to disable file attachments * Add unit tests * Updating UI for no attachments (#6312) * Update UI text on file upload System Console setting (#6313) * Update storage_settings.jsx * Update en.json
Diffstat (limited to 'webapp/components/admin_console/storage_settings.jsx')
-rw-r--r--webapp/components/admin_console/storage_settings.jsx20
1 files changed, 20 insertions, 0 deletions
diff --git a/webapp/components/admin_console/storage_settings.jsx b/webapp/components/admin_console/storage_settings.jsx
index 3b634dc53..1400b673c 100644
--- a/webapp/components/admin_console/storage_settings.jsx
+++ b/webapp/components/admin_console/storage_settings.jsx
@@ -25,6 +25,7 @@ export default class StorageSettings extends AdminSettings {
}
getConfigFromState(config) {
+ config.FileSettings.EnableFileAttachments = this.state.enableFileAttachments;
config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize) * 1024 * 1024;
config.FileSettings.DriverName = this.state.driverName;
config.FileSettings.Directory = this.state.directory;
@@ -39,6 +40,7 @@ export default class StorageSettings extends AdminSettings {
getStateFromConfig(config) {
return {
+ enableFileAttachments: config.FileSettings.EnableFileAttachments,
maxFileSize: config.FileSettings.MaxFileSize / 1024 / 1024,
driverName: config.FileSettings.DriverName,
directory: config.FileSettings.Directory,
@@ -199,6 +201,23 @@ export default class StorageSettings extends AdminSettings {
onChange={this.handleChange}
disabled={this.state.driverName !== DRIVER_S3}
/>
+ <BooleanSetting
+ id='enableFileAttachments'
+ label={
+ <FormattedMessage
+ id='admin.file.enableFileAttachments'
+ defaultMessage='Enable File Attachments:'
+ />
+ }
+ helpText={
+ <FormattedMessage
+ id='admin.file.enableFileAttachmentsDesc'
+ defaultMessage='When false, disable file and image uploads on messages.'
+ />
+ }
+ value={this.state.enableFileAttachments}
+ onChange={this.handleChange}
+ />
<TextSetting
id='maxFileSize'
label={
@@ -216,6 +235,7 @@ export default class StorageSettings extends AdminSettings {
}
value={this.state.maxFileSize}
onChange={this.handleChange}
+ disabled={!this.state.enableFileAttachments}
/>
</SettingsGroup>
);