Rename link to pathname
parent
a4b1522c38
commit
61e4e08991
|
@ -25,7 +25,7 @@ class KapacitorRule extends Component {
|
||||||
this.setState({timeRange})
|
this.setState({timeRange})
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCreate = link => {
|
handleCreate = pathname => {
|
||||||
const {
|
const {
|
||||||
addFlashMessage,
|
addFlashMessage,
|
||||||
queryConfigs,
|
queryConfigs,
|
||||||
|
@ -42,7 +42,7 @@ class KapacitorRule extends Component {
|
||||||
|
|
||||||
createRule(kapacitor, newRule)
|
createRule(kapacitor, newRule)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
router.push(link || `/sources/${source.id}/alert-rules`)
|
router.push(pathname || `/sources/${source.id}/alert-rules`)
|
||||||
addFlashMessage({type: 'success', text: 'Rule successfully created'})
|
addFlashMessage({type: 'success', text: 'Rule successfully created'})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
@ -53,7 +53,7 @@ class KapacitorRule extends Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
handleEdit = link => {
|
handleEdit = pathname => {
|
||||||
const {addFlashMessage, queryConfigs, rule, router, source} = this.props
|
const {addFlashMessage, queryConfigs, rule, router, source} = this.props
|
||||||
const updatedRule = Object.assign({}, rule, {
|
const updatedRule = Object.assign({}, rule, {
|
||||||
query: queryConfigs[rule.queryID],
|
query: queryConfigs[rule.queryID],
|
||||||
|
@ -61,7 +61,7 @@ class KapacitorRule extends Component {
|
||||||
|
|
||||||
editRule(updatedRule)
|
editRule(updatedRule)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
router.push(link || `/sources/${source.id}/alert-rules`)
|
router.push(pathname || `/sources/${source.id}/alert-rules`)
|
||||||
addFlashMessage({
|
addFlashMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: `${rule.name} successfully saved!`,
|
text: `${rule.name} successfully saved!`,
|
||||||
|
|
Loading…
Reference in New Issue