finished fixes from liana and rob

pull/5370/head
Joseph Izang 1 year ago
parent 5747ae5945
commit 9b30843e68
  1. 4
      libs/remix-ui/static-analyser/src/lib/components/BasicTitle.tsx
  2. 18
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -32,8 +32,8 @@ export function calculateWarningStateEntries(entries: [string, any][]) {
export function BasicTitle(props: BasicTitleProps) { export function BasicTitle(props: BasicTitleProps) {
return ( return (
<span>Remix{props.warningStateEntries.length > 0 ? !props.hideWarnings ? <i data-id="StaticAnalysisErrorCount" className="badge badge-info rounded-circle ml-1">{calculateWarningStateEntries(props.warningStateEntries).length}</i>: ( <span>Remix{props.warningStateEntries.length > 0 ? !props.hideWarnings ? <i data-id="StaticAnalysisErrorCount" className={`badge ${calculateWarningStateEntries(props.warningStateEntries).length > 0 ? 'badge-warning' : 'badge-danger'} rounded-circle ml-1 text-center`}>{calculateWarningStateEntries(props.warningStateEntries).length}</i>: (
<i className="badge badge-info rounded-circle ml-1"> <i className="badge badge-warning rounded-circle ml-1 text-center">
{ {
calculateWarningStateEntries(props.warningStateEntries).errors.length calculateWarningStateEntries(props.warningStateEntries).errors.length
} }

@ -388,13 +388,11 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
: "alert alert-danger" : "alert alert-danger"
}`} }`}
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
>
<div
onClick={async () => { onClick={async () => {
await props.analysisModule.call( await props.analysisModule.call(
"editor", "editor",
"discardHighlight" "discardHighlight"
); )
await props.analysisModule.call( await props.analysisModule.call(
"editor", "editor",
"highlight", "highlight",
@ -414,6 +412,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
); );
}} }}
> >
<div>
<span className="text-wrap"> <span className="text-wrap">
{hint.formattedMessage} {hint.formattedMessage}
</span> </span>
@ -428,8 +427,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
key={index} key={index}
className="alert alert-danger" className="alert alert-danger"
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
>
<div
onClick={async () => { onClick={async () => {
await props.analysisModule.call( await props.analysisModule.call(
"editor", "editor",
@ -454,6 +451,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
); );
}} }}
> >
<div>
<span className="text-wrap"> <span className="text-wrap">
{hint.formattedMessage} {hint.formattedMessage}
</span> </span>
@ -474,11 +472,13 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
Linter Linter
{hints.length > 0 ? ( {hints.length > 0 ? (
hideWarnings ? ( hideWarnings ? (
<i className="badge badge-info rounded-circle ml-1"> <i className={`badge ${hints.filter(x => x.type === 'error').length > 0
? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}>
{hintErrors.length} {hintErrors.length}
</i> </i>
) : ( ) : (
<i className="badge badge-info rounded-circle ml-1"> <i className={`badge ${hints.filter(x => x.type === 'error').length > 0
? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}>
{hints.length} {hints.length}
</i> </i>
) )
@ -536,11 +536,11 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
Slither Slither
{slitherWarnings.length > 0 ? ( {slitherWarnings.length > 0 ? (
hideWarnings ? ( hideWarnings ? (
<i className="badge badge-info rounded-circle ml-1"> <i className="badge badge-warning rounded-circle ml-1">
{slitherErrors.length} {slitherErrors.length}
</i> </i>
) : ( ) : (
<i className="badge badge-info rounded-circle ml-1"> <i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}>
{slitherWarnings.length} {slitherWarnings.length}
</i> </i>
) )

Loading…
Cancel
Save