Commit 0c74610c authored by EKSAD's avatar EKSAD

ilangin titik

parent 5db044ca
...@@ -43,9 +43,9 @@ class ForgotPassword extends Component { ...@@ -43,9 +43,9 @@ class ForgotPassword extends Component {
var isEmail = this.isEmail(this.state.email) var isEmail = this.isEmail(this.state.email)
if (this.state.email.trim() == "") { if (this.state.email.trim() == "") {
this.setState({ errorEmail: true, msgEmail: 'Email Cannot be Empty.' }) this.setState({ errorEmail: true, msgEmail: 'Email Cannot be Empty' })
} else if (!isEmail) { } else if (!isEmail) {
this.setState({ errorEmail: true, msgEmail: 'Please enter a valid email address.' }) this.setState({ errorEmail: true, msgEmail: 'Please enter a valid email address' })
} else { } else {
this.verification() this.verification()
} }
......
...@@ -75,11 +75,11 @@ class Login extends Component { ...@@ -75,11 +75,11 @@ class Login extends Component {
validateLogin() { validateLogin() {
var isEmail = this.isEmail(this.state.email) var isEmail = this.isEmail(this.state.email)
if (this.state.email.trim() == "") { if (this.state.email.trim() == "") {
this.setState({ errorEmail: true, msgEmail: 'Email Cannot be Empty.' }) this.setState({ errorEmail: true, msgEmail: 'Email Cannot be Empty' })
} else if (!isEmail) { } else if (!isEmail) {
this.setState({ errorEmail: true, msgEmail: 'Please enter a valid email address.' }) this.setState({ errorEmail: true, msgEmail: 'Please enter a valid email address' })
} else if (this.state.password.trim() == "") { } else if (this.state.password.trim() == "") {
this.setState({ errorPassword: true, msgPassword: 'Password Cannot be Empty.' }) this.setState({ errorPassword: true, msgPassword: 'Password Cannot be Empty' })
} else { } else {
this.login() this.login()
} }
......
...@@ -153,32 +153,32 @@ export default class CreateReportItems extends Component { ...@@ -153,32 +153,32 @@ export default class CreateReportItems extends Component {
validasi() { validasi() {
// alert('coba ya') // alert('coba ya')
if (R.isNil(this.state.reportType)) { if (R.isNil(this.state.reportType)) {
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report Type Cannot be Empty.'}) this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report Type Cannot be Empty'})
} else if (R.isNil(this.state.company)){ } else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Name Cannot be Empty.'}) this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Name Cannot be Empty'})
} else if (R.isEmpty(this.state.order)) { } else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order Cannot be Empty.' }) this.setState({ errorOrder: true, msgErrorOrder: 'Order Cannot be Empty' })
} }
else if (R.isEmpty(this.state.description)) { else if (R.isEmpty(this.state.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Description Cannot be Empty.' }) this.setState({ errorDesc: true, msgErrorDesc: 'Description Cannot be Empty' })
} }
else if (R.isNil(this.state.InputType)) { else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data Type Cannot be Empty.' }) this.setState({ errorTipeData: true, msgErrorTipeData: 'Data Type Cannot be Empty' })
} }
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) { else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula Cannot be Empty.' }) this.setState({ errorFormula: true, msgErrorFormula: 'Formula Cannot be Empty' })
} }
else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) { else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) {
this.setState({ errorRV: true, msgErrorRV: 'True Value Cannot be Empty.' }) this.setState({ errorRV: true, msgErrorRV: 'True Value Cannot be Empty' })
} }
else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) { else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False Condition Cannot be Empty.' }) this.setState({ errorCondition: true, msgErrorCondition: 'False Condition Cannot be Empty' })
} }
else if (R.isNil(this.state.startDate)) { else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty.' }) this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty' })
} }
else if (R.isNil(this.state.endDate)) { else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty.' }) this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} }
else { else {
this.addReportItems() this.addReportItems()
......
...@@ -135,25 +135,25 @@ export default class EditReportItems extends Component { ...@@ -135,25 +135,25 @@ export default class EditReportItems extends Component {
validasi() { validasi() {
// alert('coba ya') // alert('coba ya')
if (R.isNil(this.state.reportType)){ if (R.isNil(this.state.reportType)){
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report Type Cannot be Empty.'}) this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report Type Cannot be Empty'})
} else if (R.isNil(this.state.company)){ } else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Name Cannot be Empty.'}) this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Name Cannot be Empty'})
} else if (R.isEmpty(this.state.tempData.order)) { } else if (R.isEmpty(this.state.tempData.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order Cannot be Empty.' }) this.setState({ errorOrder: true, msgErrorOrder: 'Order Cannot be Empty' })
} else if (R.isEmpty(this.state.tempData.description)) { } else if (R.isEmpty(this.state.tempData.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Description Cannot be Empty.' }) this.setState({ errorDesc: true, msgErrorDesc: 'Description Cannot be Empty' })
} else if (R.isNil(this.state.InputType)) { } else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data Type Cannot be Empty.' }) this.setState({ errorTipeData: true, msgErrorTipeData: 'Data Type Cannot be Empty' })
} else if ((this.state.InputType.type_item_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) { } else if ((this.state.InputType.type_item_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula Cannot be Empty.' }) this.setState({ errorFormula: true, msgErrorFormula: 'Formula Cannot be Empty' })
} else if (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) { } else if (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) {
this.setState({ errorRV: true, msgErrorRV: 'True Value Cannot be Empty.' }) this.setState({ errorRV: true, msgErrorRV: 'True Value Cannot be Empty' })
} else if (this.state.InputType.type_item_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) { } else if (this.state.InputType.type_item_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False Condition Cannot be Empty.' }) this.setState({ errorCondition: true, msgErrorCondition: 'False Condition Cannot be Empty' })
} else if (R.isNil(this.state.tempData.start_date)) { } else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty.' }) this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty' })
} else if (R.isNil(this.state.tempData.end_date)) { } else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty.' }) this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} else { } else {
this.updateReportItems() this.updateReportItems()
} }
......
...@@ -20,8 +20,8 @@ class ResetPassword extends Component { ...@@ -20,8 +20,8 @@ class ResetPassword extends Component {
showPass2: false, showPass2: false,
errorPassword: false, errorPassword: false,
errorConfirmPassword: false, errorConfirmPassword: false,
msgPassword: 'Consists of 8 Characters with a Combination of Numbers.', msgPassword: 'Consists of 8 Characters with a Combination of Numbers',
msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers.', msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers',
userId: 0, userId: 0,
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
...@@ -68,17 +68,17 @@ class ResetPassword extends Component { ...@@ -68,17 +68,17 @@ class ResetPassword extends Component {
validateReset() { validateReset() {
if (this.state.password.trim() == "") { if (this.state.password.trim() == "") {
this.setState({ errorPassword: true, msgPassword: 'New Password Cannot be Empty.' }) this.setState({ errorPassword: true, msgPassword: 'New Password Cannot be Empty' })
} else if (this.state.password.length < 8) { } else if (this.state.password.length < 8) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Minimum length : 8.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Minimum length : 8' })
} else if (this.isEmail(this.state.password)) { } else if (this.isEmail(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Should not be same as Email Address.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Should not be same as Email Address' })
} else if (!this.isRegex(this.state.password)) { } else if (!this.isRegex(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Must using combination of characters, letters and numbers.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Must using combination of characters, letters and numbers' })
} else if (this.state.confirmPassword.trim() == "") { } else if (this.state.confirmPassword.trim() == "") {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Repeat Password Cannot be Empty.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Repeat Password Cannot be Empty' })
} else if (this.state.password !== this.state.confirmPassword) { } else if (this.state.password !== this.state.confirmPassword) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'The password and password confirmation do not match.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'The password and password confirmation do not match' })
} else { } else {
this.confirmPassword() this.confirmPassword()
} }
...@@ -119,9 +119,9 @@ class ResetPassword extends Component { ...@@ -119,9 +119,9 @@ class ResetPassword extends Component {
let data = this.state let data = this.state
this.setState({ ...data, [e.target.name]: e.target.value }) this.setState({ ...data, [e.target.name]: e.target.value })
if (e.target.name == "password") { if (e.target.name == "password") {
this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers.' }) this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers' })
} else if (e.target.name == "confirmPassword") { } else if (e.target.name == "confirmPassword") {
this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers.' }) this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers' })
} }
} }
......
...@@ -20,8 +20,8 @@ class SetPassword extends Component { ...@@ -20,8 +20,8 @@ class SetPassword extends Component {
showPass2: false, showPass2: false,
errorPassword: false, errorPassword: false,
errorConfirmPassword: false, errorConfirmPassword: false,
msgPassword: 'Consists of 8 Characters with a Combination of Numbers.', msgPassword: 'Consists of 8 Characters with a Combination of Numbers',
msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers.', msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers',
userId: 0, userId: 0,
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
...@@ -68,17 +68,17 @@ class SetPassword extends Component { ...@@ -68,17 +68,17 @@ class SetPassword extends Component {
validateReset() { validateReset() {
if (this.state.password.trim() == "") { if (this.state.password.trim() == "") {
this.setState({ errorPassword: true, msgPassword: 'New Password Cannot be Empty.' }) this.setState({ errorPassword: true, msgPassword: 'New Password Cannot be Empty' })
} else if (this.state.password.length < 8) { } else if (this.state.password.length < 8) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Minimum length : 8.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Minimum length : 8' })
} else if (this.isEmail(this.state.password)) { } else if (this.isEmail(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Should not be same as Email Address.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Should not be same as Email Address' })
} else if (!this.isRegex(this.state.password)) { } else if (!this.isRegex(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Must using combination of characters, letters and numbers.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Must using combination of characters, letters and numbers' })
} else if (this.state.confirmPassword.trim() == "") { } else if (this.state.confirmPassword.trim() == "") {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Repeat Password Cannot be Empty.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Repeat Password Cannot be Empty' })
} else if (this.state.password !== this.state.confirmPassword) { } else if (this.state.password !== this.state.confirmPassword) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'The password and password confirmation do not match.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'The password and password confirmation do not match' })
} else { } else {
this.confirmPassword() this.confirmPassword()
} }
...@@ -119,9 +119,9 @@ class SetPassword extends Component { ...@@ -119,9 +119,9 @@ class SetPassword extends Component {
let data = this.state let data = this.state
this.setState({ ...data, [e.target.name]: e.target.value }) this.setState({ ...data, [e.target.name]: e.target.value })
if (e.target.name == "password") { if (e.target.name == "password") {
this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers.' }) this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers' })
} else if (e.target.name == "confirmPassword") { } else if (e.target.name == "confirmPassword") {
this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers.' }) this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Consists of 8 Characters with a Combination of Numbers' })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment