Improve copy on Tickscript editing notifications

pull/10616/head
deniz kusefoglu 2018-02-01 13:09:09 -08:00
parent 11bfcba5d2
commit 30fa3b730e
3 changed files with 6 additions and 10 deletions

View File

@ -198,7 +198,7 @@ export const updateRuleStatus = (rule, status) => dispatch => {
export const createTask = (kapacitor, task) => async dispatch => {
try {
const {data} = await createTaskAJAX(kapacitor, task)
dispatch(publishNotification('success', 'You made a TICKscript!'))
dispatch(publishNotification('success', 'TICKscript successfully created'))
return data
} catch (error) {
if (!error) {
@ -218,14 +218,13 @@ export const updateTask = (
) => async dispatch => {
try {
const {data} = await updateTaskAJAX(kapacitor, task, ruleID, sourceID)
dispatch(publishNotification('success', 'TICKscript updated successully'))
dispatch(publishNotification('success', 'TICKscript saved'))
return data
} catch (error) {
if (!error) {
dispatch(errorThrown('Could not communicate with server'))
return
}
return error.data
}
}

View File

@ -30,7 +30,7 @@ const TickscriptHeader = ({
{isNewTickscript
? <button
className="btn btn-success btn-sm"
title="ID your TICKscript to save"
title="Name your TICKscript to save"
onClick={onSave}
disabled={!id}
>
@ -52,7 +52,7 @@ const TickscriptHeader = ({
/>
: <button
className="btn btn-default btn-sm"
title="Return to Alert Rules Page"
title="Return to Alert Rules"
onClick={onExit}
>
Exit

View File

@ -173,11 +173,9 @@ class TickscriptPage extends Component {
} else {
response = await createTask(kapacitor, task, router, sourceID)
}
if (response && response.code === 500) {
// check responses on failing??!
return this.setState({validation: response.message})
if (response) {
this.setState({unsavedChanges: false})
}
this.setState({unsavedChanges: false})
} catch (error) {
console.error(error)
throw error
@ -226,7 +224,6 @@ class TickscriptPage extends Component {
areLogsEnabled,
unsavedChanges,
} = this.state
return (
<Tickscript
task={task}