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
4c031214
Commit
4c031214
authored
Apr 12, 2021
by
tizah
Committed by
tizah
May 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added warning sign when analysis has runned
parent
15a549f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
analysis-tab.js
apps/remix-ide/src/app/tabs/analysis-tab.js
+13
-2
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+9
-10
No files found.
apps/remix-ide/src/app/tabs/analysis-tab.js
View file @
4c031214
...
...
@@ -56,10 +56,21 @@ class AnalysisTab extends ViewPlugin {
analysisModule
=
{
this
}
event
=
{
this
.
event
}
/>
,
this
.
element
this
.
element
,
()
=>
{
this
.
event
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
if
(
count
>
0
)
{
this
.
emit
(
'statusChanged'
,
{
key
:
count
,
title
:
`
${
count
}
warning
${
count
===
1
?
''
:
's'
}
`
,
type
:
'warning'
})
}
else
if
(
count
===
0
)
{
this
.
emit
(
'statusChanged'
,
{
key
:
'succeed'
,
title
:
'no warning'
,
type
:
'success'
})
}
else
{
// count ==-1 no compilation result
this
.
emit
(
'statusChanged'
,
{
key
:
'none'
})
}
})
}
)
}
}
module
.
exports
=
AnalysisTab
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
4c031214
import
React
,
{
useEffect
,
useState
}
from
'react'
import
ReactDOM
from
'react-dom'
//eslint-disable-line
import
CheckBox
from
'./Checkbox/StaticAnalyserCheckedBox'
// eslint-disable-line
import
Button
from
'./Button/StaticAnalyserButton'
// eslint-disable-line
import
remixLib
from
'@remix-project/remix-lib'
...
...
@@ -18,7 +19,8 @@ export interface RemixUiStaticAnalyserProps {
registry
:
any
,
event
:
any
,
analysisModule
:
any
_deps
:
any
_deps
:
any
,
emit
:
any
}
export
const
RemixUiStaticAnalyser
=
(
props
:
RemixUiStaticAnalyserProps
)
=>
{
...
...
@@ -63,7 +65,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
warningContainer
=
React
.
useRef
(
null
)
const
[
runButtonState
,
setRunButtonState
]
=
useState
(
true
)
const
[
autoRun
,
setAutoRun
]
=
useState
(
tru
e
)
const
[
autoRun
,
setAutoRun
]
=
useState
(
fals
e
)
const
[
result
,
setResult
]
=
useState
({
lastCompilationResult
:
null
,
lastCompilationSource
:
null
,
...
...
@@ -96,7 +98,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
)
}
}
else
{
setAutoRun
(
true
)
}
return
()
=>
{
}
},
[
autoRun
])
...
...
@@ -105,6 +110,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
// await props.analysisModule.call('editor', 'discardHighlight')
// await props.analysisModule.call('editor', 'highlight', location, fileName)
// }
console
.
log
({
autoRun
},
' auto run in run function'
)
setResult
({
lastCompilationResult
,
lastCompilationSource
,
currentFile
})
if
(
lastCompilationResult
&&
categoryIndex
.
length
)
{
setRunButtonState
(
false
)
...
...
@@ -193,6 +199,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
groupedCategory
=
groupBy
(
resultArray
,
'warningModuleName'
)
setWarningState
(
groupedCategory
)
})
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
else
{
setRunButtonState
(
true
)
...
...
@@ -203,14 +210,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
// const correctRunBtnDisabled = () => {
// if (props.lastCompilationResult && selectedCategoryIndex.length !== 0) {
// setRunButtonState(false)
// } else {
// setRunButtonState(true)
// }
// }
const
handleCheckAllModules
=
(
groupedModules
)
=>
{
const
index
=
groupedModuleIndex
(
groupedModules
)
if
(
index
.
every
(
el
=>
categoryIndex
.
includes
(
el
)))
{
...
...
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