Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
ca85da35
Commit
ca85da35
authored
Apr 23, 2021
by
tizah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat_fix_n_refactor: exptracted checkbox as a reusable component and fix selec all and auto run,
rebasing extracted checkbox as reusable component
parent
420eb68b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
50 deletions
+21
-50
StaticAnalyserCheckedBox.tsx
...ic-analyser/src/lib/Checkbox/StaticAnalyserCheckedBox.tsx
+4
-4
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+17
-46
No files found.
libs/remix-ui/static-analyser/src/lib/Checkbox/StaticAnalyserCheckedBox.tsx
View file @
ca85da35
...
...
@@ -24,7 +24,7 @@ const StaticAnalyserCheckedBox = ({
categoryId
}:
StaticAnalyserCheckBoxProps
)
=>
{
return
(
<
div
className=
"
pt-1 h-80 mx-3 align-items-center listenOnNetwork_2A0YE0 custom-control custom-checkbox "
onClick=
{
onClick
}
>
<
div
className=
"
listenOnNetwork_2A0YE0 custom-control custom-checkbox"
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
onClick=
{
onClick
}
>
<
input
id=
{
id
}
type=
{
inputType
}
...
...
@@ -34,9 +34,9 @@ const StaticAnalyserCheckedBox = ({
className=
"custom-control-input"
checked=
{
checked
}
/>
<
label
className=
"
pt-1 form-check-label custom-control-label"
id=
{
`heading${categoryId}`
}
>
{
name
?
<
h6
>
{
itemName
}
</
h6
>
:
''
}
<
p
>
{
label
}
</
p
>
<
label
className=
"
form-check-label custom-control-label"
id=
{
`heading${categoryId}`
}
style=
{
{
paddingTop
:
'0.15rem'
}
}
>
{
name
?
<
div
className=
"font-weight-bold"
>
{
itemName
}
</
div
>
:
''
}
{
label
}
</
label
>
</
div
>
)
...
...
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
ca85da35
...
...
@@ -58,50 +58,50 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
[
categoryIndex
,
setCategoryIndex
]
=
useState
(
groupedModuleIndex
(
groupedModules
))
const
warningContainer
=
React
.
useRef
(
null
)
const
[
runButtonState
,
setRunButtonState
]
=
useState
(
true
)
const
[
result
,
setResult
]
=
useState
({
lastCompilationResult
:
null
,
lastCompilationSource
:
null
,
currentFile
:
'No file compiled'
})
const
[,
setModuleNameResult
]
=
useState
(
null
)
const
[,
setWarning
]
=
useState
({
msg
:
''
,
options
:
{},
hasWarning
:
false
,
warningErrors
:
[]
})
const
[
warningState
,
setWarningState
]
=
useState
([])
const
[
state
,
dispatch
]
=
useReducer
(
analysisReducer
,
initialState
)
useEffect
(()
=>
{
<<
<
<<<<
HEAD
compilation
(
props
.
analysisModule
,
dispatch
)
},
[])
<<<<<<<
HEAD
useEffect
(()
=>
{
if
(
autoRun
)
{
if
(
state
.
data
!==
null
)
{
run
(
state
.
data
,
state
.
source
,
state
.
file
)
=======
=======
if
(
autoRun
)
{
const
setCompilationResult
=
async
(
data
,
source
,
file
)
=>
{
await
setResult
({
lastCompilationResult
:
data
,
lastCompilationSource
:
source
,
currentFile
:
file
})
}
>>>>>>>
8
a85ae84e
(
fix
failing
test
)
if
(
props
.
analysisModule
)
{
props
.
analysisModule
.
on
(
'solidity'
,
'compilationFinished'
,
(
file
,
source
,
languageVersion
,
data
)
=>
{
if
(
languageVersion
.
indexOf
(
'soljson'
)
!==
0
)
return
setCompilationResult
(
data
,
source
,
file
)
if
(
categoryIndex
.
length
>
0
)
{
if
(
categoryIndex
.
length
>
0
)
{
run
(
data
,
source
,
file
)
}
}
)
>>>>>>>
19
de4ba6b
(
commiting
code
to
detect
failing
test
)
}
}
else
{
setAutoRun
(
true
)
}
return
()
=>
{
}
<
<<<<<<
HEAD
},
[
autoRun
,
categoryIndex
,
state
])
const
message
=
(
name
,
warning
,
more
,
fileName
,
locationString
)
:
string
=>
{
...
...
@@ -117,27 +117,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
</span>`
)
}
=======
}, [autoRun, categoryIndex])
>>>>>>>
8a85ae84e (fix failing test)
const
run
=
(
lastCompilationResult
,
lastCompilationSource
,
currentFile
)
=>
{
<
<<<<<<
HEAD
if
(
autoRun
)
{
if
(
lastCompilationResult
&&
categoryIndex
.
length
>
0
)
{
let
warningCount
=
0
const
warningMessage
=
[]
=======
// const highlightLocation = async (location, fileName) =>
{
// await props.analysisModule.call('editor', 'discardHighlight')
// await props.analysisModule.call('editor', 'highlight', location, fileName)
//
}
setResult
({
lastCompilationResult
,
lastCompilationSource
,
currentFile
})
if
(
lastCompilationResult
&&
categoryIndex
.
length
)
{
setRunButtonState
(
false
)
let
warningCount
=
0
const
warningMessage
=
[]
>>>>>>>
19
de4ba6b
(
commiting
code
to
detect
failing
test
)
runner
.
run
(
lastCompilationResult
,
categoryIndex
,
results
=>
{
results
.
map
((
result
)
=>
{
...
...
@@ -215,25 +200,11 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
if
(
categoryIndex
.
length
>
0
)
{
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
<
<<<<<<
HEAD
}
else
{
if
(
categoryIndex
.
length
)
{
warningContainer
.
current
.
innerText
=
'No compiled AST available'
}
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
-
1
])
=======
const
groupedCategory
=
groupBy
(
resultArray
,
'
warningModuleName
')
setWarningState
(
groupedCategory
)
})
if
(
categoryIndex
.
length
>
0)
{
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
}
else
{
setRunButtonState
(
true
)
if
(
categoryIndex
.
length
)
{
warningContainer
.
current
.
innerText
=
'No compiled AST available'
>>>>>>>
8
a85ae84e
(
fix
failing
test
)
}
}
}
...
...
@@ -247,9 +218,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
})
)
}
else
{
setCategoryIndex
(
_
.
uniq
([...
categoryIndex
]))
setCategoryIndex
(
_
.
uniq
([...
categoryIndex
,
...
index
]))
}
}
const
handleCheckOrUncheckCategory
=
(
category
)
=>
{
...
...
@@ -342,6 +312,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
<
div
className=
"analysis_3ECCBV px-3 pb-1"
>
<
div
className=
"my-2 d-flex flex-column align-items-left"
>
<
div
className=
"d-flex justify-content-between"
id=
"staticanalysisButton"
>
<
div
className=
"d-flex justify-content-between"
>
<
RemixUiCheckbox
id=
"checkAllEntries"
inputType=
"checkbox"
...
...
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