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
e4b9c097
Commit
e4b9c097
authored
Oct 03, 2023
by
fahrur huzain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validasi default company
parent
558c3acf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
14 deletions
+94
-14
CreateParameter.js
src/container/MasterData/Parameter/CreateParameter.js
+94
-14
No files found.
src/container/MasterData/Parameter/CreateParameter.js
View file @
e4b9c097
...
...
@@ -690,7 +690,13 @@ export default class CreateParameter extends Component {
}
else
{
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"REPORT_SUBMIT_PERIOD"
)
{
if
(
R
.
isEmpty
(
data
.
value
))
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
)){
}
else
{
if
(
this
.
state
.
getPerusahaan
.
company_name
==
"Default"
){
}
else
{
this
.
setState
({
errorValue
:
true
,
msgErrorValue
:
'Value Cannot be Empty'
})
}
}
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getParameter
))
{
}
else
{
...
...
@@ -735,8 +741,16 @@ export default class CreateParameter extends Component {
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
}
else
{
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"CURRENCY_MONEY_FORMAT"
)
{
if
(
R
.
isNil
(
this
.
state
.
getParameter
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getFormatData
)){
this
.
updateParameterCurrebcyMoneyFormat
()
}
else
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"CURRENCY"
)
{
}
}
}
}
else
if
(
this
.
state
.
getTypes
.
setticonng_group_name
==
"CURRENCY"
)
{
if
(
R
.
isNil
(
this
.
state
.
getReportName
))
{
}
else
{
if
(
R
.
isEmpty
(
data
.
value
))
{
...
...
@@ -756,8 +770,33 @@ export default class CreateParameter extends Component {
}
}
}
}
else
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"THRESHOLD_VARIANCE"
||
this
.
state
.
getTypes
.
setting_group_name
==
"THRESHOLD_CONTROL"
)
{
if
(
R
.
isEmpty
(
data
.
minValue
))
{
}
else
{
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
)
{
if
(
R
.
isEmpty
(
data
.
maxValue
))
{
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
this
.
updateParameter
()
}
}
}
}
}
else
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"REPORT_SUBMIT_PERIOD"
)
{
if
(
R
.
isEmpty
(
data
.
value
))
{
if
(
this
.
state
.
getPerusahaan
.
company_name
==
"Default"
){
if
(
R
.
isEmpty
(
data
.
minValue
))
{
}
else
{
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
){
if
(
R
.
isEmpty
(
data
.
maxValue
))
{
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
this
.
updateParameter
()
}
}
}
}
}
}
else
{
if
(
data
.
value
.
match
(
response
.
regexValue
)
&&
data
.
value
.
length
<=
response
.
valueLength
)
{
if
(
R
.
isEmpty
(
data
.
minValue
))
{
...
...
@@ -774,14 +813,30 @@ export default class CreateParameter extends Component {
}
}
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getParameter
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getFormatData
)){
this
.
updateParameter
()
}
}
}
}
}
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
}
else
{
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"CURRENCY_MONEY_FORMAT"
)
{
if
(
R
.
isNil
(
this
.
state
.
getParameter
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getFormatData
)){
this
.
createParameterCurrebcyMoneyFormat
()
}
}
}
}
else
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"CURRENCY"
)
{
if
(
R
.
isNil
(
this
.
state
.
getReportName
))
{
}
else
{
...
...
@@ -802,8 +857,33 @@ export default class CreateParameter extends Component {
}
}
}
}
else
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"THRESHOLD_VARIANCE"
||
this
.
state
.
getTypes
.
setting_group_name
==
"THRESHOLD_CONTROL"
)
{
if
(
R
.
isEmpty
(
data
.
minValue
))
{
}
else
{
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
)
{
if
(
R
.
isEmpty
(
data
.
maxValue
))
{
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
this
.
createParameter
()
}
}
}
}
}
else
if
(
this
.
state
.
getTypes
.
setting_group_name
==
"REPORT_SUBMIT_PERIOD"
)
{
if
(
R
.
isEmpty
(
data
.
value
))
{
if
(
this
.
state
.
getPerusahaan
.
company_name
==
"Default"
){
if
(
R
.
isEmpty
(
data
.
minValue
))
{
}
else
{
if
(
data
.
minValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
minValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
minValue
.
length
<=
minMaxValidasi
.
minLength
)
{
if
(
R
.
isEmpty
(
data
.
maxValue
))
{
}
else
{
if
(
data
.
maxValue
.
match
(
minMaxValidasi
.
minMaxRegex
)
&&
data
.
maxValue
.
substring
(
0
,
1
)
!=
"0"
&&
data
.
maxValue
.
length
<=
minMaxValidasi
.
maxLength
)
{
this
.
createParameter
()
}
}
}
}
}
}
else
{
if
(
data
.
value
.
match
(
response
.
regexValue
)
&&
data
.
value
.
length
<=
response
.
valueLength
)
{
if
(
R
.
isEmpty
(
data
.
minValue
))
{
...
...
@@ -820,11 +900,19 @@ export default class CreateParameter extends Component {
}
}
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getParameter
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getFormatData
)){
this
.
createParameter
()
}
}
}
}
}
}
}
validasiFormatResponse
(){
if
(
R
.
isNil
(
this
.
state
.
getTypes
)){
...
...
@@ -848,34 +936,27 @@ export default class CreateParameter extends Component {
if
(
R
.
isNil
(
this
.
state
.
getParameter
))
{
obj
=
{
regexValue
:
(
/
\b\d{4}\b
/
),
valueLength
:
4
}
}
else
{
console
.
log
(
this
.
state
.
getParameter
.
setting_type_name
);
switch
(
this
.
state
.
getParameter
.
setting_type_name
)
{
case
"MASTER_BUDGET"
:
obj
=
{
regexValue
:
(
/
\b\d{4}\b
/
),
valueLength
:
4
}
console
.
log
(
"masuk MB"
+
this
.
state
.
regexValue
+
" panjang"
+
this
.
state
.
valueLength
);
break
case
"MONTHLY_REPORT"
:
obj
=
{
regexValue
:
(
/^
(
Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
)\s\d{4}
$/
),
valueLength
:
8
}
console
.
log
(
"masuk MR"
+
this
.
state
.
regexValue
+
" panjang"
+
this
.
state
.
valueLength
);
break
case
"OUTLOOK_Q1"
:
obj
=
{
regexValue
:
(
/Q1
\s\d{4}
/
),
valueLength
:
7
}
console
.
log
(
"masuk Q1"
+
this
.
state
.
regexValue
+
" panjang"
+
this
.
state
.
valueLength
);
break
case
"OUTLOOK_Q2"
:
obj
=
{
regexValue
:
(
/Q2
\s\d{4}
/
),
valueLength
:
7
}
console
.
log
(
"masuk Q2"
+
this
.
state
.
regexValue
+
" panjang"
+
this
.
state
.
valueLength
);
break
case
"OUTLOOK_Q3"
:
obj
=
{
regexValue
:
(
/Q3
\s\d{4}
/
),
valueLength
:
7
}
console
.
log
(
"masuk Q3"
+
this
.
state
.
regexValue
+
" panjang"
+
this
.
state
.
valueLength
);
break
case
"OUTLOOK_PA"
:
obj
=
{
regexValue
:
(
/Q1
\s\d{4}
/
),
valueLength
:
7
}
console
.
log
(
"masuk PA"
+
this
.
state
.
regexValue
+
" panjang"
+
this
.
state
.
valueLength
);
break
default
:
obj
=
{
regexValue
:
(
/Q1
\s\d{4}
/
),
valueLength
:
7
}
...
...
@@ -947,7 +1028,6 @@ export default class CreateParameter extends Component {
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
obj
=
{
minMaxRegex
:
(
/^-
?\d
+
\.?\d
+$/
),
minLength
:
this
.
state
.
minValue
.
length
,
maxLength
:
this
.
state
.
maxValue
.
length
}
}
else
{
console
.
log
(
this
.
state
.
getTypes
.
setting_group_name
);
switch
(
this
.
state
.
getTypes
.
setting_group_name
)
{
case
"CURRENCY"
:
obj
=
{
minMaxRegex
:
(
/
\b\d{1,2}\s(
Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
)\s\d{4}\b
/
),
minLength
:
11
,
maxLength
:
11
,
regexValue
:
(
/^
\d
+$/
)}
...
...
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