Skip to content

Commit

Permalink
DEVPROD-8220: Render Command Sections (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaJoon authored Jul 8, 2024
1 parent 5442567 commit 00b5690
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 81 deletions.
14 changes: 12 additions & 2 deletions apps/parsley/src/components/LogRow/RowRenderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import AnsiRow from "../AnsiRow";
import ResmokeRow from "../ResmokeRow";
import SectionHeader from "../SectionHeader";
import SkippedLinesRow from "../SkippedLinesRow";
import SubsectionHeader from "../SubsectionHeader";

type RowRendererFunction = (props: {
processedLogLines: ProcessedLogLines;
Expand All @@ -31,7 +32,7 @@ const ParsleyRow: RowRendererFunction = ({ processedLogLines }) => {
searchState,
sectioning,
} = useLogContext();
const { toggleFunctionSection } = sectioning;
const { toggleCommandSection, toggleFunctionSection } = sectioning;
const { prettyPrint, wordWrapFormat, wrap } = preferences;

const { searchTerm } = searchState;
Expand Down Expand Up @@ -87,7 +88,16 @@ const ParsleyRow: RowRendererFunction = ({ processedLogLines }) => {
}

if (isSubsectionHeaderRow(processedLogLine)) {
return <div>subsection start</div>;
return (
<SubsectionHeader
commandID={processedLogLine.commandID}
commandName={processedLogLine.commandName}
functionID={processedLogLine.functionID}
lineIndex={index}
onToggle={toggleCommandSection}
open={processedLogLine.isOpen}
/>
);
}

return (
Expand Down
Loading

0 comments on commit 00b5690

Please sign in to comment.