Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
9fbd6063
Commit
9fbd6063
authored
Oct 12, 2023
by
fahrur huzain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validasi parameter currencyTC
parent
06d229aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
21 deletions
+59
-21
CreateParameter.js
src/container/MasterData/Parameter/CreateParameter.js
+59
-21
No files found.
src/container/MasterData/Parameter/CreateParameter.js
View file @
9fbd6063
...
@@ -615,6 +615,8 @@ export default class CreateParameter extends Component {
...
@@ -615,6 +615,8 @@ export default class CreateParameter extends Component {
errorEndDate
:
false
,
errorEndDate
:
false
,
errorGroup
:
false
,
errorGroup
:
false
,
errorPerusahaan
:
false
,
errorPerusahaan
:
false
,
errorThresholdCurrency
:
false
,
msgErrorThresholdCurrency
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorGroup
:
''
,
msgErrorGroup
:
''
,
msgErrorParameter
:
''
,
msgErrorParameter
:
''
,
...
@@ -643,6 +645,8 @@ export default class CreateParameter extends Component {
...
@@ -643,6 +645,8 @@ export default class CreateParameter extends Component {
errorEndDate
:
false
,
errorEndDate
:
false
,
errorGroup
:
false
,
errorGroup
:
false
,
errorPerusahaan
:
false
,
errorPerusahaan
:
false
,
errorThresholdCurrency
:
false
,
msgErrorThresholdCurrency
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorGroup
:
''
,
msgErrorGroup
:
''
,
msgErrorParameter
:
''
,
msgErrorParameter
:
''
,
...
@@ -672,6 +676,8 @@ export default class CreateParameter extends Component {
...
@@ -672,6 +676,8 @@ export default class CreateParameter extends Component {
errorEndDate
:
false
,
errorEndDate
:
false
,
errorGroup
:
false
,
errorGroup
:
false
,
errorPerusahaan
:
false
,
errorPerusahaan
:
false
,
errorThresholdCurrency
:
false
,
msgErrorThresholdCurrency
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorGroup
:
''
,
msgErrorGroup
:
''
,
msgErrorParameter
:
''
,
msgErrorParameter
:
''
,
...
@@ -702,6 +708,8 @@ export default class CreateParameter extends Component {
...
@@ -702,6 +708,8 @@ export default class CreateParameter extends Component {
errorEndDate
:
false
,
errorEndDate
:
false
,
errorGroup
:
false
,
errorGroup
:
false
,
errorPerusahaan
:
false
,
errorPerusahaan
:
false
,
errorThresholdCurrency
:
false
,
msgErrorThresholdCurrency
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorPerusahaan
:
''
,
msgErrorGroup
:
''
,
msgErrorGroup
:
''
,
msgErrorParameter
:
''
,
msgErrorParameter
:
''
,
...
@@ -1202,15 +1210,36 @@ export default class CreateParameter extends Component {
...
@@ -1202,15 +1210,36 @@ export default class CreateParameter extends Component {
return
obj
;
return
obj
;
}
}
validasiCurrencyTC
(){
console
.
log
(
this
.
state
.
getThresholdCurrency
)
console
.
log
(
this
.
state
.
errorThresholdCurrency
)
console
.
log
(
this
.
state
.
msgErrorThresholdCurrency
)
if
(
R
.
isNil
(
this
.
state
.
getThresholdCurrency
)){
this
.
setState
({
errorThresholdCurrency
:
true
,
msgErrorThresholdCurrency
:
'Currency Cannot be Empty'
})
}
}
async
validasiMaxValue
()
{
async
validasiMaxValue
()
{
let
data
=
await
this
.
validasiValueData
()
let
data
=
await
this
.
validasiValueData
()
let
minMaxValidasi
=
await
this
.
validasiMinMaxValue
()
let
minMaxValidasi
=
await
this
.
validasiMinMaxValue
()
if
(
R
.
isEmpty
(
data
.
maxValue
))
{
if
(
R
.
isEmpty
(
data
.
maxValue
))
{
this
.
validasiMaxResponse
()
this
.
validasiMaxResponse
()
this
.
validasiCurrencyTC
()
}
else
{
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
)){
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
this
.
validasiMaxResponse
()
this
.
validasiCurrencyTC
()
}
else
{
this
.
validasiMaxResponse
()
this
.
validasiCurrencyTC
()
}
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
(
this
.
state
.
getTypes
.
setting_group_name
!=
"THRESHOLD_CONTROL"
?
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
:
true
)
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
this
.
validasiCurrencyTC
()
}
else
{
this
.
validasiMaxResponse
()
this
.
validasiCurrencyTC
()
}
}
}
}
}
}
}
...
@@ -1231,11 +1260,20 @@ export default class CreateParameter extends Component {
...
@@ -1231,11 +1260,20 @@ export default class CreateParameter extends Component {
this
.
validasiMinResponse
()
this
.
validasiMinResponse
()
this
.
validasiFormatData
()
this
.
validasiFormatData
()
}
else
{
}
else
{
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
)
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
)){
this
.
validasiFormatData
()
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
){
}
else
{
this
.
validasiFormatData
()
this
.
validasiMinResponse
()
}
else
{
this
.
validasiFormatData
()
this
.
validasiMinResponse
()
this
.
validasiFormatData
()
}
}
else
{
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
(
this
.
state
.
getTypes
.
setting_group_name
!=
"THRESHOLD_CONTROL"
?
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
:
true
)
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
){
this
.
validasiFormatData
()
}
else
{
this
.
validasiMinResponse
()
this
.
validasiFormatData
()
}
}
}
}
}
}
}
...
@@ -1503,11 +1541,11 @@ export default class CreateParameter extends Component {
...
@@ -1503,11 +1541,11 @@ export default class CreateParameter extends Component {
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getPerusahaan
:
newInputValue
},
()
=>
this
.
clearMessage
())}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getPerusahaan
:
newInputValue
},
()
=>
this
.
clearMessage
())}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
error
=
{
this
.
state
.
errorPerusahaan
}
error
=
{
this
.
state
.
errorPerusahaan
}
helperText
=
{
this
.
state
.
msgErrorPerusahaan
}
helperText
=
{
this
.
state
.
msgErrorPerusahaan
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
label
=
"Company Name"
/>
}
label
=
"Company Name"
/>
}
value
=
{
this
.
state
.
getPerusahaan
}
value
=
{
this
.
state
.
getPerusahaan
}
/
>
/
>
<
/div
>
<
/div
>
...
@@ -1534,8 +1572,8 @@ export default class CreateParameter extends Component {
...
@@ -1534,8 +1572,8 @@ export default class CreateParameter extends Component {
}}
}}
name
=
"description"
name
=
"description"
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
// error={this.state.errorDeskripsi}
// error={this.state.errorDeskripsi}
// helperText={this.state.msgErrorDeskripsi}
// helperText={this.state.msgErrorDeskripsi}
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
...
@@ -1572,8 +1610,8 @@ export default class CreateParameter extends Component {
...
@@ -1572,8 +1610,8 @@ export default class CreateParameter extends Component {
}
}
// this.handleChange(coba, 'value')}
// this.handleChange(coba, 'value')}
}
}
// error={this.state.errorOrder}
// error={this.state.errorOrder}
// helperText={this.state.msgErrorOrder}
// helperText={this.state.msgErrorOrder}
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
...
@@ -1635,8 +1673,8 @@ export default class CreateParameter extends Component {
...
@@ -1635,8 +1673,8 @@ export default class CreateParameter extends Component {
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
label
=
"Type Report"
label
=
"Type Report"
// error={this.state.errorPerusahaan}
// error={this.state.errorPerusahaan}
// helperText={this.state.msgErrorPerusahaan}
// helperText={this.state.msgErrorPerusahaan}
/>
}
/>
}
value
=
{
this
.
state
.
getReportName
}
value
=
{
this
.
state
.
getReportName
}
/
>
/
>
...
@@ -2081,8 +2119,8 @@ export default class CreateParameter extends Component {
...
@@ -2081,8 +2119,8 @@ export default class CreateParameter extends Component {
}
}
// this.handleChange(coba, 'value')}
// this.handleChange(coba, 'value')}
}
}
// error={this.state.errorOrder}
// error={this.state.errorOrder}
// helperText={this.state.msgErrorOrder}
// helperText={this.state.msgErrorOrder}
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment