forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gfycat integration (mattermost#1367)
* Gfycat integration * Added headers to resolve make check-style. * Updated tests. * Removed gfycat analytics. * Added '(Beta)' to GIF system console. * Added gfycat API credentials to admin console. * Removed gfycatSdk. * Only enable gif picker if gfycat credentials are specified. * Updated gfycat credentials description on admin console. * Ran check-style. * Revert check for gfycat api credentials. * Updated package.json to latest redux commit. * Deleted unused stylesheets. * Changed Components to PureComponents. * Re-added emoji preview which might have been removed from merge conflict. * Fixed make check-style errors. * Minor updates to Gfycat System Console text * Add missing strings to en.json * Use image proxy.
- Loading branch information
1 parent
4d27296
commit 87839c9
Showing
68 changed files
with
2,379 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
import AdminSettings from './admin_settings.jsx'; | ||
import BooleanSetting from './boolean_setting.jsx'; | ||
import TextSetting from './text_setting.jsx'; | ||
import SettingsGroup from './settings_group.jsx'; | ||
|
||
export default class CustomGifSettings extends AdminSettings { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.getConfigFromState = this.getConfigFromState.bind(this); | ||
|
||
this.renderSettings = this.renderSettings.bind(this); | ||
} | ||
|
||
getConfigFromState(config) { | ||
config.ServiceSettings.EnableGifPicker = this.state.enableGifPicker; | ||
config.ServiceSettings.GfycatApiKey = this.state.gfycatApiKey; | ||
config.ServiceSettings.GfycatApiSecret = this.state.gfycatApiSecret; | ||
return config; | ||
} | ||
|
||
getStateFromConfig(config) { | ||
return { | ||
enableGifPicker: config.ServiceSettings.EnableGifPicker, | ||
gfycatApiKey: config.ServiceSettings.GfycatApiKey, | ||
gfycatApiSecret: config.ServiceSettings.GfycatApiSecret, | ||
}; | ||
} | ||
|
||
renderTitle() { | ||
return ( | ||
<FormattedMessage | ||
id='admin.customization.gif' | ||
defaultMessage='GIF (Beta)' | ||
/> | ||
); | ||
} | ||
|
||
renderSettings() { | ||
return ( | ||
<SettingsGroup> | ||
<BooleanSetting | ||
id='enableGifPicker' | ||
label={ | ||
<FormattedMessage | ||
id='admin.customization.enableGifPickerTitle' | ||
defaultMessage='Enable GIF Picker:' | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
id='admin.customization.enableGifPickerDesc' | ||
defaultMessage='Allow users to select GIFs from the emoji picker via a Gfycat integration.' | ||
/> | ||
} | ||
value={this.state.enableGifPicker} | ||
onChange={this.handleChange} | ||
setByEnv={this.isSetByEnv('ServiceSettings.EnableGifPicker')} | ||
/> | ||
<TextSetting | ||
id='gfycatApiKey' | ||
label={ | ||
<FormattedMessage | ||
id='admin.customization.gfycatApiKey' | ||
defaultMessage='Gfycat API Key:' | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
id='admin.customization.gfycatApiKeyDescription' | ||
defaultMessage='Request an API key at https://developers.gfycat.com/signup/#/. Enter the client ID you receive via email to this field.' | ||
/> | ||
} | ||
value={this.state.gfycatApiKey} | ||
placeholder='' | ||
onChange={this.handleChange} | ||
setByEnv={this.isSetByEnv('ServiceSettings.GfycatAPIKey')} | ||
/> | ||
<TextSetting | ||
id='gfycatApiSecret' | ||
label={ | ||
<FormattedMessage | ||
id='admin.customization.gfycatApiSecret' | ||
defaultMessage='Gfycat API Secret:' | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
id='admin.customization.gfycatApiSecretDescription' | ||
defaultMessage='The API secret generated by Gfycat for your API key.' | ||
/> | ||
} | ||
value={this.state.gfycatApiSecret} | ||
placeholder='' | ||
onChange={this.handleChange} | ||
setByEnv={this.isSetByEnv('ServiceSettings.GfycatAPISecret')} | ||
/> | ||
</SettingsGroup> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.