From 979ecd2a218952a3816f08c21c47d0d0ea542b4c Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 26 May 2023 16:44:17 +0100 Subject: [PATCH] create tabs for different categories of messages from analysis. --- .../src/lib/remix-ui-static-analyser.tsx | 149 +++++++++--------- 1 file changed, 75 insertions(+), 74 deletions(-) diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index dd3079eefc..ce685bab4f 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -10,6 +10,9 @@ import { compilation } from './actions/staticAnalysisActions' import { initialState, analysisReducer } from './reducers/staticAnalysisReducer' import { CodeAnalysis } from '@remix-project/remix-analyzer' import { CustomTooltip } from '@remix-ui/helper' +import Tab from 'react-bootstrap/Tab' +import Tabs from 'react-bootstrap/Tabs' +import { Fade } from 'react-bootstrap' declare global { interface Window { @@ -208,6 +211,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { } const run = async (lastCompilationResult, lastCompilationSource, currentFile) => { + console.log({ state, lastCompilationResult, lastCompilationSource, currentFile }) if (!isSupportedVersion) return if (state.data !== null) { if (lastCompilationResult && (categoryIndex.length > 0 || slitherEnabled)) { @@ -474,15 +478,46 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { ) } + const handleShowLinterMessages = () => { + + } + + const tabKeys = [ + { + tabKey: 'linter', + child:
, + title: 'Linter' + }, + { + tabKey: 'basic', + child:
+ {Object.keys(groupedModules).map((categoryId, i) => { + const category = groupedModules[categoryId] + return ( + categorySection(category, categoryId, i) + ) + }) + } +
, + title: 'Basic' + }, + { + tabKey: 'slither', + child:
, + title: 'Slither' + } + ] + return (
-
+
+
{}} @@ -502,80 +537,46 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { onChange={() => {}} tooltipPlacement={'top-start'} /> - + {}} + />
-
- {/*
- {Object.keys(groupedModules).map((categoryId, i) => { - const category = groupedModules[categoryId] - return ( - categorySection(category, categoryId, i) - ) - }) - } -
*/} - checkbox seperator -
- Last results for: - - {state.file} - +
+ + {tabKeys.map(tabKey => ( + + {tabKey.child} + + ))} +
+ {Object.entries(warningState).length > 0 &&