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

@ -223,7 +223,7 @@ class TheFormDef extends React.PureComponent {
this.props.setCurrentTab("content") this.props.setCurrentTab("content")
this.setState({ loading: false }) this.setState({ loading: false })
}).catch(e => { }).catch(e => {
notification["error"]({ message: "Error", description: e.message }) notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ loading: false }) this.setState({ loading: false })
}) })
} else { } else {
@ -233,7 +233,7 @@ class TheFormDef extends React.PureComponent {
description: `"${values["name"]}" updated` }) description: `"${values["name"]}" updated` })
this.setState({ loading: false }) this.setState({ loading: false })
}).catch(e => { }).catch(e => {
notification["error"]({ message: "Error", description: e.message }) notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ loading: false }) this.setState({ loading: false })
}) })
} }
@ -264,7 +264,7 @@ class TheFormDef extends React.PureComponent {
description: `Test messages sent` }) description: `Test messages sent` })
}).catch(e => { }).catch(e => {
this.setState({ loading: false }) 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 }) this.setState({ formDisabled: true })
} }
}).catch(e => { }).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. // Reload the table.
this.fetchRecords() this.fetchRecords()
}).catch(e => { }).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. // Reload the table.
this.fetchRecords() this.fetchRecords()
}).catch(e => { }).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.setState({ record: null, modalWaiting: false })
this.props.route.history.push(cs.Routes.ViewCampaign.replace(":id", resp.data.data.id)) this.props.route.history.push(cs.Routes.ViewCampaign.replace(":id", resp.data.data.id))
}).catch(e => { }).catch(e => {
notification["error"]({ message: "Error", description: e.message }) notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ modalWaiting: false }) this.setState({ modalWaiting: false })
}) })
} }

View File

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

View File

@ -39,7 +39,7 @@ class CreateFormDef extends React.PureComponent {
this.props.onClose() this.props.onClose()
this.setState({ modalWaiting: false }) this.setState({ modalWaiting: false })
}).catch(e => { }).catch(e => {
notification["error"]({ message: "Error", description: e.message }) notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message })
this.setState({ modalWaiting: false }) this.setState({ modalWaiting: false })
}) })
} }
@ -196,7 +196,7 @@ class Lists extends React.PureComponent {
// Reload the table. // Reload the table.
this.fetchRecords() this.fetchRecords()
}).catch(e => { }).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. // Reload the table.
this.fetchRecords() this.fetchRecords()
}).catch(e => { }).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) => { onFileChange = (f) => {
if(f.file.error && f.file.response && f.file.response.hasOwnProperty("message")) { 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") { } else if(f.file.status === "done") {
this.fetchRecords() this.fetchRecords()
} }

View File

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