From 441156b91e9f9bac6b5592616551e2920c4cb33b Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 30 Mar 2016 10:56:20 -0400 Subject: Added DisplayName and Description fields to both types of webhooks and slash commands --- .../components/backstage/add_incoming_webhook.jsx | 24 ++++++++++++---------- .../components/backstage/add_outgoing_webhook.jsx | 24 ++++++++++++---------- .../backstage/installed_incoming_webhook.jsx | 5 ++--- .../backstage/installed_outgoing_webhook.jsx | 5 ++--- 4 files changed, 30 insertions(+), 28 deletions(-) (limited to 'webapp/components/backstage') diff --git a/webapp/components/backstage/add_incoming_webhook.jsx b/webapp/components/backstage/add_incoming_webhook.jsx index 83027c6b3..afeb9d569 100644 --- a/webapp/components/backstage/add_incoming_webhook.jsx +++ b/webapp/components/backstage/add_incoming_webhook.jsx @@ -18,12 +18,12 @@ export default class AddIncomingWebhook extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); - this.updateName = this.updateName.bind(this); + this.updateDisplayName = this.updateDisplayName.bind(this); this.updateDescription = this.updateDescription.bind(this); this.updateChannelId = this.updateChannelId.bind(this); this.state = { - name: '', + displayName: '', description: '', channelId: '', saving: false, @@ -60,7 +60,9 @@ export default class AddIncomingWebhook extends React.Component { } const hook = { - channel_id: this.state.channelId + channel_id: this.state.channelId, + display_name: this.state.displayName, + description: this.state.description }; AsyncClient.addIncomingHook( @@ -76,9 +78,9 @@ export default class AddIncomingWebhook extends React.Component { ); } - updateName(e) { + updateDisplayName(e) { this.setState({ - name: e.target.value + displayName: e.target.value }); } @@ -112,20 +114,20 @@ export default class AddIncomingWebhook extends React.Component {
diff --git a/webapp/components/backstage/add_outgoing_webhook.jsx b/webapp/components/backstage/add_outgoing_webhook.jsx index 5d98138df..c2b5e0414 100644 --- a/webapp/components/backstage/add_outgoing_webhook.jsx +++ b/webapp/components/backstage/add_outgoing_webhook.jsx @@ -18,14 +18,14 @@ export default class AddOutgoingWebhook extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); - this.updateName = this.updateName.bind(this); + this.updateDisplayName = this.updateDisplayName.bind(this); this.updateDescription = this.updateDescription.bind(this); this.updateChannelId = this.updateChannelId.bind(this); this.updateTriggerWords = this.updateTriggerWords.bind(this); this.updateCallbackUrls = this.updateCallbackUrls.bind(this); this.state = { - name: '', + displayName: '', description: '', channelId: '', triggerWords: '', @@ -80,7 +80,9 @@ export default class AddOutgoingWebhook extends React.Component { const hook = { channel_id: this.state.channelId, trigger_words: this.state.triggerWords.split('\n').map((word) => word.trim()), - callback_urls: this.state.callbackUrls.split('\n').map((url) => url.trim()) + callback_urls: this.state.callbackUrls.split('\n').map((url) => url.trim()), + display_name: this.state.displayName, + description: this.state.description }; AsyncClient.addOutgoingHook( @@ -96,9 +98,9 @@ export default class AddOutgoingWebhook extends React.Component { ); } - updateName(e) { + updateDisplayName(e) { this.setState({ - name: e.target.value + displayName: e.target.value }); } @@ -144,20 +146,20 @@ export default class AddOutgoingWebhook extends React.Component {
diff --git a/webapp/components/backstage/installed_incoming_webhook.jsx b/webapp/components/backstage/installed_incoming_webhook.jsx index f65cf6327..262bfe21d 100644 --- a/webapp/components/backstage/installed_incoming_webhook.jsx +++ b/webapp/components/backstage/installed_incoming_webhook.jsx @@ -4,7 +4,6 @@ import React from 'react'; import ChannelStore from 'stores/channel_store.jsx'; -import * as Utils from 'utils/utils.jsx'; import {FormattedMessage} from 'react-intl'; @@ -39,7 +38,7 @@ export default class InstalledIncomingWebhook extends React.Component {
- {channelName} + {incomingWebhook.display_name || channelName}
- {Utils.getWindowLocationOrigin() + '/hooks/' + incomingWebhook.id} + {incomingWebhook.description}
diff --git a/webapp/components/backstage/installed_outgoing_webhook.jsx b/webapp/components/backstage/installed_outgoing_webhook.jsx index fee427260..4482029bf 100644 --- a/webapp/components/backstage/installed_outgoing_webhook.jsx +++ b/webapp/components/backstage/installed_outgoing_webhook.jsx @@ -4,7 +4,6 @@ import React from 'react'; import ChannelStore from 'stores/channel_store.jsx'; -import * as Utils from 'utils/utils.jsx'; import {FormattedMessage} from 'react-intl'; @@ -47,7 +46,7 @@ export default class InstalledOutgoingWebhook extends React.Component {
- {channelName} + {outgoingWebhook.display_name || channelName}
- {Utils.getWindowLocationOrigin() + '/hooks/' + outgoingWebhook.id} + {outgoingWebhook.description} {' - '} {outgoingWebhook.token} -- cgit v1.2.3-1-g7c22 From 9fd7802af1a0f73039a66feaed30d8d230b065b6 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 30 Mar 2016 15:06:47 -0400 Subject: Added 'Created by...' line in integration list --- .../components/backstage/installed_incoming_webhook.jsx | 13 +++++++++++++ .../components/backstage/installed_outgoing_webhook.jsx | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'webapp/components/backstage') diff --git a/webapp/components/backstage/installed_incoming_webhook.jsx b/webapp/components/backstage/installed_incoming_webhook.jsx index 262bfe21d..95a303edc 100644 --- a/webapp/components/backstage/installed_incoming_webhook.jsx +++ b/webapp/components/backstage/installed_incoming_webhook.jsx @@ -4,6 +4,7 @@ import React from 'react'; import ChannelStore from 'stores/channel_store.jsx'; +import * as Utils from 'utils/utils.jsx'; import {FormattedMessage} from 'react-intl'; @@ -52,6 +53,18 @@ export default class InstalledIncomingWebhook extends React.Component { {incomingWebhook.description}
+
+ + + +
{outgoingWebhook.description} - {' - '} - {outgoingWebhook.token} + +
+
+ +
-- cgit v1.2.3-1-g7c22 From cac5c0f0dd055a28a3549f98d6ec9db3bc398eda Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 31 Mar 2016 15:55:32 -0400 Subject: Improved handling of invalid incoming and outgoing webhooks --- webapp/components/backstage/add_incoming_webhook.jsx | 3 +++ webapp/components/backstage/add_outgoing_webhook.jsx | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'webapp/components/backstage') diff --git a/webapp/components/backstage/add_incoming_webhook.jsx b/webapp/components/backstage/add_incoming_webhook.jsx index afeb9d569..f3601cb07 100644 --- a/webapp/components/backstage/add_incoming_webhook.jsx +++ b/webapp/components/backstage/add_incoming_webhook.jsx @@ -72,6 +72,7 @@ export default class AddIncomingWebhook extends React.Component { }, (err) => { this.setState({ + saving: false, serverError: err.message }); } @@ -125,6 +126,7 @@ export default class AddIncomingWebhook extends React.Component { { this.setState({ + saving: false, serverError: err.message }); } @@ -157,6 +158,7 @@ export default class AddOutgoingWebhook extends React.Component {