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') 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 +++++++++++++-- webapp/i18n/en.json | 1 + webapp/sass/routes/_backstage.scss | 5 +++++ 4 files changed, 32 insertions(+), 2 deletions(-) (limited to 'webapp') 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} + +
+
+ +
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 7dc6486ab..8fdb42b4c 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -814,6 +814,7 @@ "get_team_invite_link_modal.title": "Team Invite Link", "installed_integrations.add": "Add Integration", "installed_integrations.allFilter": "All ({count})", + "installed_integrations.creation": "Created by {creator} on {createAt, date, full}", "installed_integrations.delete": "Delete", "installed_integrations.header": "Installed Integrations", "installed_integrations.incomingWebhookType": "(Incoming Webhook)", diff --git a/webapp/sass/routes/_backstage.scss b/webapp/sass/routes/_backstage.scss index 729c8c912..e7e8c1e01 100644 --- a/webapp/sass/routes/_backstage.scss +++ b/webapp/sass/routes/_backstage.scss @@ -196,6 +196,11 @@ margin-bottom: 1em; } + .item-details__creation { + color: $dark-gray; + margin-bottom: 1em; + } + .list-item__actions { flex-grow: 0; flex-shrink: 0; -- 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 +++++ webapp/utils/async_client.jsx | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'webapp') 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 { { - dispatchError(err, 'addIncomingHook'); - if (error) { error(err); + } else { + dispatchError(err, 'addIncomingHook'); } } ); @@ -1205,10 +1205,10 @@ export function addOutgoingHook(hook, success, error) { } }, (err) => { - dispatchError(err, 'addOutgoingHook'); - if (error) { error(err); + } else { + dispatchError(err, 'addOutgoingHook'); } } ); -- cgit v1.2.3-1-g7c22 From 74daec08ce7f1b6a09e4b364f45b0f05f3c28a9e Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 4 Apr 2016 10:06:39 -0400 Subject: Fixed integration list actions getting squished by webhooks with long names --- webapp/sass/routes/_backstage.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webapp') diff --git a/webapp/sass/routes/_backstage.scss b/webapp/sass/routes/_backstage.scss index e7e8c1e01..13c51c8b4 100644 --- a/webapp/sass/routes/_backstage.scss +++ b/webapp/sass/routes/_backstage.scss @@ -201,7 +201,7 @@ margin-bottom: 1em; } - .list-item__actions { + .item-actions { flex-grow: 0; flex-shrink: 0; padding-left: 20px; -- cgit v1.2.3-1-g7c22