use pre-released features
Этот коммит содержится в:
@@ -4,9 +4,13 @@
|
||||
import LoadingScreen from '../loading_screen.jsx';
|
||||
|
||||
import * as Client from 'utils/client.jsx';
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
import Constants from 'utils/constants.jsx';
|
||||
|
||||
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
||||
|
||||
const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES;
|
||||
|
||||
const holders = defineMessages({
|
||||
requestTypePost: {
|
||||
id: 'user.settings.cmds.request_type_post',
|
||||
@@ -277,11 +281,9 @@ export default class ManageCommandCmds extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
cmds.push(
|
||||
<div
|
||||
key={cmd.id}
|
||||
className='webhook__item webcmd__item'
|
||||
>
|
||||
let slashCommandAutocompleteDiv;
|
||||
if (Utils.isFeatureEnabled(PreReleaseFeatures.SLASHCMD_AUTOCMP)) {
|
||||
slashCommandAutocompleteDiv = (
|
||||
<div className='padding-top x2'>
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
@@ -290,6 +292,15 @@ export default class ManageCommandCmds extends React.Component {
|
||||
/>
|
||||
</strong><span className='word-break--all'>{cmd.external_management ? this.props.intl.formatMessage(holders.autocompleteYes) : this.props.intl.formatMessage(holders.autocompleteNo)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
cmds.push(
|
||||
<div
|
||||
key={cmd.id}
|
||||
className='webhook__item webcmd__item'
|
||||
>
|
||||
{slashCommandAutocompleteDiv}
|
||||
{triggerDiv}
|
||||
<div className='padding-top x2 webcmd__url'>
|
||||
<strong>
|
||||
@@ -433,6 +444,36 @@ export default class ManageCommandCmds extends React.Component {
|
||||
|
||||
const disableButton = this.state.cmd.url === '' || (this.state.cmd.trigger === '' && !this.state.external_management);
|
||||
|
||||
let slashCommandAutocompleteCheckbox;
|
||||
if (Utils.isFeatureEnabled(PreReleaseFeatures.SLASHCMD_AUTOCMP)) {
|
||||
slashCommandAutocompleteCheckbox = (
|
||||
<div className='padding-top x2'>
|
||||
<label className='control-label'>
|
||||
<FormattedMessage
|
||||
id='user.settings.cmds.external_management'
|
||||
defaultMessage='External management: '
|
||||
/>
|
||||
</label>
|
||||
<div className='padding-top'>
|
||||
<div className='checkbox'>
|
||||
<label>
|
||||
<input
|
||||
type='checkbox'
|
||||
checked={this.state.cmd.external_management}
|
||||
onChange={this.updateExternalManagement}
|
||||
/>
|
||||
<FormattedMessage
|
||||
id='user.settings.cmds.external_management_help'
|
||||
defaultMessage=' Let an external integration manage commands.'
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div key='addCommandCmd'>
|
||||
<FormattedHTMLMessage
|
||||
@@ -449,30 +490,7 @@ export default class ManageCommandCmds extends React.Component {
|
||||
<div className='padding-top'>
|
||||
|
||||
<div className='padding-top x2'>
|
||||
<label className='control-label'>
|
||||
<FormattedMessage
|
||||
id='user.settings.cmds.external_management'
|
||||
defaultMessage='External management: '
|
||||
/>
|
||||
</label>
|
||||
<div className='padding-top'>
|
||||
<div className='checkbox'>
|
||||
<label>
|
||||
<input
|
||||
type='checkbox'
|
||||
checked={this.state.cmd.external_management}
|
||||
onChange={this.updateExternalManagement}
|
||||
/>
|
||||
<FormattedMessage
|
||||
id='user.settings.cmds.external_management_help'
|
||||
defaultMessage=' Let an external integration manage commands.'
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='padding-top x2'>
|
||||
{slashCommandAutocompleteCheckbox}
|
||||
<label className='control-label'>
|
||||
<FormattedMessage
|
||||
id='user.settings.cmds.trigger'
|
||||
|
||||
@@ -51,6 +51,10 @@ const holders = defineMessages({
|
||||
EMBED_TOGGLE: {
|
||||
id: 'user.settings.advance.embed_toggle',
|
||||
defaultMessage: 'Show toggle for all embed previews'
|
||||
},
|
||||
SLASHCMD_AUTOCMP: {
|
||||
id: 'user.settings.advance.slashCmd_autocmp',
|
||||
defaultMessage: 'Enable external application to offer slash command autocomplete'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1091,6 +1091,7 @@
|
||||
"tutorial_tip.seen": "Seen this before? ",
|
||||
"upload_overlay.info": "Drop a file to upload it.",
|
||||
"user.settings.advance.embed_preview": "Show preview snippet of links below message",
|
||||
"user.settings.advance.slashCmd_autocmp": "Enable external application to offer slash command autocomplete",
|
||||
"user.settings.advance.embed_toggle": "Show toggle for all embed previews",
|
||||
"user.settings.advance.enabled": "enabled",
|
||||
"user.settings.advance.feature": " Feature ",
|
||||
|
||||
@@ -560,6 +560,10 @@ export default {
|
||||
EMBED_TOGGLE: {
|
||||
label: 'embed_toggle',
|
||||
description: 'Show toggle for all embed previews'
|
||||
},
|
||||
SLASHCMD_AUTOCMP: {
|
||||
label: 'slashCmd_autocmp',
|
||||
description: 'Enable external application to offer slash command autocomplete'
|
||||
}
|
||||
},
|
||||
OVERLAY_TIME_DELAY: 400,
|
||||
|
||||
Ссылка в новой задаче
Block a user