From eb3b863069f903dcb847d71291d90f4b8fd13be8 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Tue, 17 Oct 2017 15:13:04 -0700 Subject: [PATCH] Better banner copy --- ui/src/sources/containers/SourcePage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/sources/containers/SourcePage.js b/ui/src/sources/containers/SourcePage.js index 3ea8b1e1c..a30d4b829 100644 --- a/ui/src/sources/containers/SourcePage.js +++ b/ui/src/sources/containers/SourcePage.js @@ -44,7 +44,7 @@ class SourcePage extends Component { }) }) .catch(error => { - this.handleError(error) + this.handleError('Could not connect to source', error) this.setState({isLoading: false}) }) } @@ -109,7 +109,7 @@ class SourcePage extends Component { this._redirect(sourceFromServer) }) .catch(error => { - this.handleError(error) + this.handleError('Unable to create source', error) }) } @@ -117,18 +117,18 @@ class SourcePage extends Component { .then(({data: sourceFromServer}) => { this.props.updateSourceAction(sourceFromServer) this._redirect(sourceFromServer) - notify('success', 'The source info saved') + notify('success', `New source ${source.name} added`) }) .catch(error => { - this.handleError(error) + this.handleError('Unable to update source', error) }) } - handleError = err => { + handleError = (bannerText, err) => { const {notify} = this.props const error = this.parseError(err) console.error('Error: ', error) - notify('error', `There was a problem: ${error}`) + notify('error', `${bannerText}: ${error}`) } _redirect = source => {