-
Publish your bot to a remote
-
- {publishTypes && publishTypes.length &&
publish to types: {publishTypes.join(',')}
}
-
- {publishTargets.map((target, i) => {
- return (
-
-
-
- {target.name}
-
-
-
- );
- })}
-
- {!publishVersions &&
{formatMessage('Loading')}
}
-
-
-
- );
-};
-
-const CreatePublishTarget = props => {
- let targetType = '';
- let config = '';
- let name = '';
- const updateType = (e, type) => {
- // console.log('UPDATE TYPE', type);
- targetType = type.key;
- };
- const updateConfig = (e, newConfig) => {
- // console.log('UPDATE CONFIG', config);
- // todo: attempt json parse and only allow submit if json is valid
- config = newConfig;
- };
- const updateName = (e, newName) => {
- name = newName;
- };
-
- const submit = () => {
- try {
- JSON.parse(config);
- return props.onSave(name, targetType, config);
- } catch (err) {
- alert('Error parsing configuration');
- }
- };
-
- return (
-