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
6dfe730e
Commit
6dfe730e
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,
parent
493511fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
146 additions
and
32 deletions
+146
-32
.babelrc
libs/remix-ui/checkbox/.babelrc
+4
-0
.eslintrc
libs/remix-ui/checkbox/.eslintrc
+19
-0
README.md
libs/remix-ui/checkbox/README.md
+7
-0
index.ts
libs/remix-ui/checkbox/src/index.ts
+1
-0
remix-ui-checkbox.css
libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.css
+0
-0
remix-ui-checkbox.tsx
libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx
+47
-0
tsconfig.json
libs/remix-ui/checkbox/tsconfig.json
+16
-0
tsconfig.lib.json
libs/remix-ui/checkbox/tsconfig.lib.json
+13
-0
StaticAnalyserButton.tsx
...i/static-analyser/src/lib/Button/StaticAnalyserButton.tsx
+3
-5
StaticAnalyserCheckedBox.tsx
...ic-analyser/src/lib/Checkbox/StaticAnalyserCheckedBox.tsx
+4
-4
ErrorRenderer.tsx
libs/remix-ui/static-analyser/src/lib/ErrorRenderer.tsx
+10
-21
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+0
-0
nx.json
nx.json
+3
-0
package.json
package.json
+1
-1
tsconfig.json
tsconfig.json
+2
-1
workspace.json
workspace.json
+16
-0
No files found.
libs/remix-ui/checkbox/.babelrc
0 → 100644
View file @
6dfe730e
{
"presets": ["@nrwl/react/babel"],
"plugins": []
}
libs/remix-ui/checkbox/.eslintrc
0 → 100644
View file @
6dfe730e
{
"env": {
"browser": true,
"es6": true
},
"extends": "../../../.eslintrc",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
}
libs/remix-ui/checkbox/README.md
0 → 100644
View file @
6dfe730e
# remix-ui-checkbox
This library was generated with
[
Nx
](
https://nx.dev
)
.
## Running unit tests
Run
`nx test remix-ui-checkbox`
to execute the unit tests via
[
Jest
](
https://jestjs.io
)
.
libs/remix-ui/checkbox/src/index.ts
0 → 100644
View file @
6dfe730e
export
*
from
'./lib/remix-ui-checkbox'
libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.css
0 → 100644
View file @
6dfe730e
libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx
0 → 100644
View file @
6dfe730e
import
React
from
'react'
//eslint-disable-line
import
'./remix-ui-checkbox.css'
/* eslint-disable-next-line */
export
interface
RemixUiCheckboxProps
{
onClick
?:
(
event
)
=>
void
onChange
?:
(
event
)
=>
void
label
?:
string
inputType
?:
string
name
?:
string
checked
?:
boolean
id
?:
string
itemName
?:
string
categoryId
?:
string
}
export
const
RemixUiCheckbox
=
({
id
,
label
,
onClick
,
inputType
,
name
,
checked
,
onChange
,
itemName
,
categoryId
}:
RemixUiCheckboxProps
)
=>
{
return
(
<
div
className=
"listenOnNetwork_2A0YE0 custom-control custom-checkbox"
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
onClick=
{
onClick
}
>
<
input
id=
{
id
}
type=
{
inputType
}
onChange=
{
onChange
}
style=
{
{
verticalAlign
:
'bottom'
}
}
name=
{
name
}
className=
"custom-control-input"
checked=
{
checked
}
/>
<
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
>
)
}
export
default
RemixUiCheckbox
libs/remix-ui/checkbox/tsconfig.json
0 → 100644
View file @
6dfe730e
{
"extends"
:
"../../../tsconfig.json"
,
"compilerOptions"
:
{
"jsx"
:
"react"
,
"allowJs"
:
true
,
"esModuleInterop"
:
true
,
"allowSyntheticDefaultImports"
:
true
},
"files"
:
[],
"include"
:
[],
"references"
:
[
{
"path"
:
"./tsconfig.lib.json"
}
]
}
libs/remix-ui/checkbox/tsconfig.lib.json
0 → 100644
View file @
6dfe730e
{
"extends"
:
"./tsconfig.json"
,
"compilerOptions"
:
{
"outDir"
:
"../../../dist/out-tsc"
,
"types"
:
[
"node"
]
},
"files"
:
[
"../../../node_modules/@nrwl/react/typings/cssmodule.d.ts"
,
"../../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude"
:
[
"**/*.spec.ts"
,
"**/*.spec.tsx"
],
"include"
:
[
"**/*.js"
,
"**/*.jsx"
,
"**/*.ts"
,
"**/*.tsx"
]
}
libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx
View file @
6dfe730e
...
@@ -12,11 +12,9 @@ const StaticAnalyserButton = ({
...
@@ -12,11 +12,9 @@ const StaticAnalyserButton = ({
disabled
disabled
}:
StaticAnalyserButtonProps
)
=>
{
}:
StaticAnalyserButtonProps
)
=>
{
return
(
return
(
<
div
className=
"remixui-button-container"
id=
'staticanalysisButton'
>
<
button
className=
"btn btn-sm w-25 btn-primary"
onClick=
{
onClick
}
disabled=
{
disabled
}
>
<
button
className=
"btn btn-sm w-31 btn-primary"
onClick=
{
onClick
}
disabled=
{
disabled
}
>
{
buttonText
}
{
buttonText
}
</
button
>
</
button
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/static-analyser/src/lib/Checkbox/StaticAnalyserCheckedBox.tsx
View file @
6dfe730e
...
@@ -24,7 +24,7 @@ const StaticAnalyserCheckedBox = ({
...
@@ -24,7 +24,7 @@ const StaticAnalyserCheckedBox = ({
categoryId
categoryId
}:
StaticAnalyserCheckBoxProps
)
=>
{
}:
StaticAnalyserCheckBoxProps
)
=>
{
return
(
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
<
input
id=
{
id
}
id=
{
id
}
type=
{
inputType
}
type=
{
inputType
}
...
@@ -34,9 +34,9 @@ const StaticAnalyserCheckedBox = ({
...
@@ -34,9 +34,9 @@ const StaticAnalyserCheckedBox = ({
className=
"custom-control-input"
className=
"custom-control-input"
checked=
{
checked
}
checked=
{
checked
}
/>
/>
<
label
className=
"
pt-1 form-check-label custom-control-label"
id=
{
`heading${categoryId}`
}
>
<
label
className=
"
form-check-label custom-control-label"
id=
{
`heading${categoryId}`
}
style=
{
{
paddingTop
:
'0.15rem'
}
}
>
{
name
?
<
h6
>
{
itemName
}
</
h6
>
:
''
}
{
name
?
<
div
className=
"font-weight-bold"
>
{
itemName
}
</
div
>
:
''
}
<
p
>
{
label
}
</
p
>
{
label
}
</
label
>
</
label
>
</
div
>
</
div
>
)
)
...
...
libs/remix-ui/static-analyser/src/lib/ErrorRenderer.tsx
View file @
6dfe730e
...
@@ -4,20 +4,12 @@ interface ErrorRendererProps {
...
@@ -4,20 +4,12 @@ interface ErrorRendererProps {
message
:
any
;
message
:
any
;
opt
:
any
,
opt
:
any
,
warningErrors
:
any
warningErrors
:
any
editor
:
any
}
}
const
ErrorRenderer
=
({
message
,
opt
}:
ErrorRendererProps
)
=>
{
const
ErrorRenderer
=
({
message
,
opt
,
editor
}:
ErrorRendererProps
)
=>
{
const
[,
setError
]
=
useState
(
{
row
:
null
,
column
:
null
,
text
:
null
,
type
:
null
,
errFile
:
null
}
)
const
getPositionDetails
=
(
msg
:
any
)
=>
{
const
getPositionDetails
=
(
msg
:
any
)
=>
{
const
result
=
{
}
as
any
const
result
=
{
}
as
Record
<
string
,
number
|
string
>
// To handle some compiler warning without location like SPDX license warning etc
// To handle some compiler warning without location like SPDX license warning etc
if
(
!
msg
.
includes
(
':'
))
return
{
errLine
:
-
1
,
errCol
:
-
1
,
errFile
:
msg
}
if
(
!
msg
.
includes
(
':'
))
return
{
errLine
:
-
1
,
errCol
:
-
1
,
errFile
:
msg
}
...
@@ -32,6 +24,12 @@ const ErrorRenderer = ({ message, opt }: ErrorRendererProps) => {
...
@@ -32,6 +24,12 @@ const ErrorRenderer = ({ message, opt }: ErrorRendererProps) => {
result
.
errFile
=
position
?
position
[
1
]
:
''
result
.
errFile
=
position
?
position
[
1
]
:
''
return
result
return
result
}
}
const
handlePointToErrorOnClick
=
()
=>
{
const
result
=
opt
.
locationString
.
split
(
':'
)
editor
.
_components
.
registry
.
get
(
'editor'
).
api
.
gotoLine
(
parseInt
(
result
[
0
])
-
1
,
parseInt
(
result
[
1
]))
}
if
(
!
message
)
return
if
(
!
message
)
return
let
position
=
getPositionDetails
(
message
)
let
position
=
getPositionDetails
(
message
)
if
(
!
position
.
errFile
||
(
opt
.
errorType
&&
opt
.
errorType
===
position
.
errFile
))
{
if
(
!
position
.
errFile
||
(
opt
.
errorType
&&
opt
.
errorType
===
position
.
errFile
))
{
...
@@ -43,15 +41,6 @@ const ErrorRenderer = ({ message, opt }: ErrorRendererProps) => {
...
@@ -43,15 +41,6 @@ const ErrorRenderer = ({ message, opt }: ErrorRendererProps) => {
opt
.
errLine
=
position
.
errLine
opt
.
errLine
=
position
.
errLine
opt
.
errCol
=
position
.
errCol
opt
.
errCol
=
position
.
errCol
opt
.
errFile
=
position
.
errFile
.
trim
()
opt
.
errFile
=
position
.
errFile
.
trim
()
if
(
!
opt
.
noAnnotations
&&
opt
.
errFile
)
{
setError
({
errFile
:
opt
.
errFile
,
row
:
opt
.
errLine
,
column
:
opt
.
errCol
,
text
:
message
,
type
:
opt
.
type
})
}
const
classList
=
opt
.
type
===
'error'
?
'alert alert-danger'
:
'alert alert-warning'
const
classList
=
opt
.
type
===
'error'
?
'alert alert-danger'
:
'alert alert-warning'
return
(
return
(
<
div
>
<
div
>
...
@@ -59,7 +48,7 @@ const ErrorRenderer = ({ message, opt }: ErrorRendererProps) => {
...
@@ -59,7 +48,7 @@ const ErrorRenderer = ({ message, opt }: ErrorRendererProps) => {
<
div
className=
"close"
data
-
id=
"renderer"
>
<
div
className=
"close"
data
-
id=
"renderer"
>
<
i
className=
"fas fa-times"
></
i
>
<
i
className=
"fas fa-times"
></
i
>
</
div
>
</
div
>
<
span
className=
'd-flex flex-column'
>
<
span
className=
'd-flex flex-column'
onClick=
{
handlePointToErrorOnClick
}
>
<
span
className=
'h6 font-weight-bold'
>
{
opt
.
name
}
</
span
>
<
span
className=
'h6 font-weight-bold'
>
{
opt
.
name
}
</
span
>
{
opt
.
item
.
warning
}
{
opt
.
item
.
warning
}
{
opt
.
item
.
more
{
opt
.
item
.
more
...
...
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
6dfe730e
This diff is collapsed.
Click to expand it.
nx.json
View file @
6dfe730e
...
@@ -98,6 +98,9 @@
...
@@ -98,6 +98,9 @@
},
},
"remix-ui-static-analyser"
:
{
"remix-ui-static-analyser"
:
{
"tags"
:
[]
"tags"
:
[]
},
"remix-ui-checkbox"
:
{
"tags"
:
[]
}
}
}
}
}
}
package.json
View file @
6dfe730e
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
"workspace-schematic"
:
"nx workspace-schematic"
,
"workspace-schematic"
:
"nx workspace-schematic"
,
"dep-graph"
:
"nx dep-graph"
,
"dep-graph"
:
"nx dep-graph"
,
"help"
:
"nx help"
,
"help"
:
"nx help"
,
"lint:libs"
:
"nx run-many --target=lint --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd,remix-ui-tree-view,remix-ui-modal-dialog,remix-ui-toaster,remix-ui-file-explorer,remix-ui-debugger-ui,remix-ui-workspace"
,
"lint:libs"
:
"nx run-many --target=lint --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd,remix-ui-tree-view,remix-ui-modal-dialog,remix-ui-toaster,remix-ui-file-explorer,remix-ui-debugger-ui,remix-ui-workspace
,remix-ui-static-analyser,remix-ui-checkbox
"
,
"build:libs"
:
"nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd"
,
"build:libs"
:
"nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd"
,
"test:libs"
:
"nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd"
,
"test:libs"
:
"nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd"
,
"publish:libs"
:
"npm run build:libs & lerna publish --skip-git & npm run bumpVersion:libs"
,
"publish:libs"
:
"npm run build:libs & lerna publish --skip-git & npm run bumpVersion:libs"
,
...
...
tsconfig.json
View file @
6dfe730e
...
@@ -39,7 +39,8 @@
...
@@ -39,7 +39,8 @@
"@remix-ui/toaster"
:
[
"libs/remix-ui/toaster/src/index.ts"
],
"@remix-ui/toaster"
:
[
"libs/remix-ui/toaster/src/index.ts"
],
"@remix-ui/file-explorer"
:
[
"libs/remix-ui/file-explorer/src/index.ts"
],
"@remix-ui/file-explorer"
:
[
"libs/remix-ui/file-explorer/src/index.ts"
],
"@remix-ui/workspace"
:
[
"libs/remix-ui/workspace/src/index.ts"
],
"@remix-ui/workspace"
:
[
"libs/remix-ui/workspace/src/index.ts"
],
"@remix-ui/static-analyser"
:
[
"libs/remix-ui/static-analyser/src/index.ts"
]
"@remix-ui/static-analyser"
:
[
"libs/remix-ui/static-analyser/src/index.ts"
],
"@remix-ui/checkbox"
:
[
"libs/remix-ui/checkbox/src/index.ts"
]
}
}
},
},
"exclude"
:
[
"node_modules"
,
"tmp"
]
"exclude"
:
[
"node_modules"
,
"tmp"
]
...
...
workspace.json
View file @
6dfe730e
...
@@ -744,6 +744,22 @@
...
@@ -744,6 +744,22 @@
}
}
}
}
}
}
},
"remix-ui-checkbox"
:
{
"root"
:
"libs/remix-ui/checkbox"
,
"sourceRoot"
:
"libs/remix-ui/checkbox/src"
,
"projectType"
:
"library"
,
"schematics"
:
{},
"architect"
:
{
"lint"
:
{
"builder"
:
"@nrwl/linter:lint"
,
"options"
:
{
"linter"
:
"eslint"
,
"tsConfig"
:
[
"libs/remix-ui/checkbox/tsconfig.lib.json"
],
"exclude"
:
[
"**/node_modules/**"
,
"!libs/remix-ui/checkbox/**/*"
]
}
}
}
}
}
},
},
"cli"
:
{
"cli"
:
{
...
...
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