Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
f5577c2b
Commit
f5577c2b
authored
6 years ago
by
Roshan Patil
Browse files
Options
Downloads
Patches
Plain Diff
Dynamic from changes
parent
cf4c6f51
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!68
Core dev bto c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
routebuildermdl/dynamicFormResponseEval.go
+21
-17
routebuildermdl/dynamicFormResponseEval.go
routebuildermdl/routebuildermdl.go
+2
-2
routebuildermdl/routebuildermdl.go
routebuildermdl/serviceCachemdl.go
+1
-1
routebuildermdl/serviceCachemdl.go
with
24 additions
and
20 deletions
routebuildermdl/dynamicFormResponseEval.go
+
21
−
17
View file @
f5577c2b
...
...
@@ -27,6 +27,7 @@ func dynamicFormEvalution(ab *servicebuildermdl.AbstractBusinessLogicHolder, rs
if
eval
==
nil
{
return
nil
,
nil
}
configs
:=
rs
.
Get
(
"conditions"
)
.
Array
()
if
rs
.
String
()
==
""
||
len
(
configs
)
==
0
{
return
nil
,
nil
...
...
@@ -36,27 +37,24 @@ func dynamicFormEvalution(ab *servicebuildermdl.AbstractBusinessLogicHolder, rs
loggermdl
.
LogError
(
"No current page found"
)
return
nil
,
errormdl
.
Wrap
(
"No current page found"
)
}
nextNoConditionPage
:=
gjson
.
Result
{}
currentPageIsNoCondition
:=
false
currentPageIndex
:=
-
1
isCurrentPageIsNC
:=
false
isEndPage
:=
false
endPageObj
:=
gjson
.
Result
{}
for
_
,
obj
:=
range
configs
{
for
i
,
obj
:=
range
configs
{
condition
:=
obj
.
Get
(
"condition"
)
.
String
()
pageID
:=
obj
.
Get
(
"pageID"
)
.
String
()
noCondition
:=
obj
.
Get
(
"noCondition"
)
.
Bool
()
if
noCondition
{
if
currentPageIsNoCondition
{
nextNoConditionPage
=
obj
currentPageIsNoCondition
=
false
if
pageID
==
currentPage
{
isEndPage
=
obj
.
Get
(
"isEndPage"
)
.
Bool
()
if
isEndPage
{
endPageObj
=
obj
}
if
pageID
==
currentPage
{
currentPageIsNoCondition
=
true
isEndPage
=
obj
.
Get
(
"isEndPage"
)
.
Bool
()
if
isEndPage
{
endPageObj
=
obj
}
if
noCondition
{
isCurrentPageIsNC
=
true
}
currentPageIndex
=
i
continue
}
var
expr
conditions
.
Expr
...
...
@@ -95,10 +93,16 @@ func dynamicFormEvalution(ab *servicebuildermdl.AbstractBusinessLogicHolder, rs
if
isEndPage
{
return
endPageObj
.
Value
(),
nil
}
if
nextNoConditionPage
.
String
()
!=
""
{
return
nextNoConditionPage
.
Value
(),
nil
}
for
i
,
obj
:=
range
configs
{
if
isCurrentPageIsNC
&&
i
<=
currentPageIndex
{
continue
}
noCondition
:=
obj
.
Get
(
"noCondition"
)
.
Bool
()
if
noCondition
{
return
obj
.
Value
(),
nil
}
}
ab
.
SetErrorCode
(
errormdl
.
NEXTFORMEVALERROR
)
return
nil
,
errormdl
.
Wrap
(
"NO CONDITION MATCHED"
)
}
This diff is collapsed.
Click to expand it.
routebuildermdl/routebuildermdl.go
+
2
−
2
View file @
f5577c2b
...
...
@@ -68,7 +68,6 @@ func executeService(name string, data []byte, isForm bool, formData *multipart.F
service
,
found
=
openServices
.
Get
(
name
)
}
if
!
found
{
// ab.SetErrorCode(errormdl.SERVICENOTFOUND)
loggermdl
.
LogError
(
"Service Not Found: "
+
name
)
return
nil
,
nextDynamicPage
,
ab
,
isCompressed
,
errormdl
.
SERVICENOTFOUND
,
errormdl
.
Wrap
(
"Service Not Found: "
+
name
)
}
...
...
@@ -138,10 +137,11 @@ func commonHandler(c *gin.Context, isRestricted, isRoleBased bool, principalObj
if
errormdl
.
CheckErr1
(
err
)
!=
nil
{
if
ab
==
nil
{
responseDataObj
.
ErrorCode
=
errorCode
responseDataObj
.
Error
=
err
.
Error
()
}
else
{
responseDataObj
.
Error
=
ab
.
GetErrorData
()
if
responseDataObj
.
Error
==
nil
{
responseDataObj
.
Error
=
err
ormdl
.
CheckErr3
(
err
)
.
Error
()
responseDataObj
.
Error
=
err
.
Error
()
}
errorCode
:=
ab
.
GetErrorCode
()
if
errorCode
==
0
{
...
...
This diff is collapsed.
Click to expand it.
routebuildermdl/serviceCachemdl.go
+
1
−
1
View file @
f5577c2b
...
...
@@ -53,7 +53,7 @@ func GetRestrictedServicePtr(serviceName string) (ServiceType, error) {
}
serviceCache
,
ok
:=
intService
.
(
ServiceCache
)
if
!
ok
{
return
nil
,
errormdl
.
Wrap
(
"Service Not Ca"
)
return
nil
,
errormdl
.
Wrap
(
"Service Not Ca
sted
"
)
}
return
serviceCache
.
Service
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets