Add missing placement param to all antd notification() calls

This commit is contained in:
Kailash Nadh 2018-11-05 17:03:25 +05:30
parent f2c09e716c
commit 6761d1af23
7 changed files with 25 additions and 20 deletions

View file

@ -76,9 +76,9 @@ class App extends React.PureComponent {
// If it's a GET call, throw a global notification.
if (method === cs.MethodGet) {
notification["error"]({ placement: cs.MsgPosition,
message: "Error fetching data",
description: Utils.HttpError(e).message
})
message: "Error fetching data",
description: Utils.HttpError(e).message
})
}
// Set states and show the error on the layout.

View file

@ -223,7 +223,7 @@ class TheFormDef extends React.PureComponent {
this.props.setCurrentTab("content")
this.setState({ loading: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ loading: false })
})
} else {
@ -233,7 +233,7 @@ class TheFormDef extends React.PureComponent {
description: `"${values["name"]}" updated` })
this.setState({ loading: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ loading: false })
})
}
@ -264,7 +264,7 @@ class TheFormDef extends React.PureComponent {
description: `Test messages sent` })
}).catch(e => {
this.setState({ loading: false })
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
})
}
@ -435,7 +435,7 @@ class Campaign extends React.PureComponent {
this.setState({ formDisabled: true })
}
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
}

View file

@ -326,7 +326,7 @@ class Campaigns extends React.PureComponent {
// Reload the table.
this.fetchRecords()
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
}
@ -338,7 +338,7 @@ class Campaigns extends React.PureComponent {
// Reload the table.
this.fetchRecords()
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
}
@ -356,7 +356,7 @@ class Campaigns extends React.PureComponent {
this.setState({ record: null, modalWaiting: false })
this.props.route.history.push(cs.Routes.ViewCampaign.replace(":id", resp.data.data.id))
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ modalWaiting: false })
})
}

View file

@ -33,7 +33,9 @@ class TheFormDef extends React.PureComponent {
}
if(this.state.fileList.length < 1) {
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: "Select a valid file to upload" })
notification["error"]({ placement: cs.MsgPosition,
message: "Error",
description: "Select a valid file to upload" })
return
}
@ -42,8 +44,9 @@ class TheFormDef extends React.PureComponent {
params.append("file", this.state.fileList[0])
this.props.request(cs.Routes.UploadRouteImport, cs.MethodPost, params).then(() => {
notification["info"]({ placement: cs.MsgPosition, message: "File uploaded",
description: "Please wait while the import is running" })
notification["info"]({ placement: cs.MsgPosition,
message: "File uploaded",
description: "Please wait while the import is running" })
this.props.fetchimportState()
}).catch(e => {
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })

View file

@ -39,7 +39,7 @@ class CreateFormDef extends React.PureComponent {
this.props.onClose()
this.setState({ modalWaiting: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ modalWaiting: false })
})
}
@ -196,7 +196,7 @@ class Lists extends React.PureComponent {
// Reload the table.
this.fetchRecords()
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
}

View file

@ -24,7 +24,7 @@ class TheFormDef extends React.PureComponent {
// Reload the table.
this.fetchRecords()
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
}
@ -40,7 +40,9 @@ class TheFormDef extends React.PureComponent {
onFileChange = (f) => {
if(f.file.error && f.file.response && f.file.response.hasOwnProperty("message")) {
notification["error"]({ message: "Error uploading file", description: f.file.response.message })
notification["error"]({ placement: cs.MsgPosition,
message: "Error uploading file",
description: f.file.response.message })
} else if(f.file.status === "done") {
this.fetchRecords()
}

View file

@ -30,7 +30,7 @@ class CreateFormDef extends React.PureComponent {
this.props.onClose()
this.setState({ modalWaiting: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ modalWaiting: false })
})
} else {
@ -41,7 +41,7 @@ class CreateFormDef extends React.PureComponent {
this.props.onClose()
this.setState({ modalWaiting: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ modalWaiting: false })
})
}
@ -224,7 +224,7 @@ class Templates extends React.PureComponent {
// Reload the table.
this.fetchRecords()
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
})
}