mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 19:44:35 +00:00
fix(log): fixed single chunk scrolling
This commit is contained in:
@@ -145,7 +145,6 @@ const LogChunk = (props: LogChunkProps) => {
|
|||||||
</button>
|
</button>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
padding: '0 18px',
|
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
display: expanded ? 'block' : 'none',
|
display: expanded ? 'block' : 'none',
|
||||||
overflow: 'hidden'
|
overflow: 'hidden'
|
||||||
|
|||||||
@@ -134,6 +134,9 @@ const LogComponent = (props: LogComponentProps) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasErrorsOrWarnings =
|
||||||
|
logObject.errors?.length !== 0 || logObject.warnings?.length !== 0
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{selectedRunTime === RunTimeType.SAS && logObject.body ? (
|
{selectedRunTime === RunTimeType.SAS && logObject.body ? (
|
||||||
@@ -151,10 +154,12 @@ const LogComponent = (props: LogComponentProps) => {
|
|||||||
gap: 10
|
gap: 10
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
<div style={{ paddingBottom: 10 }}>
|
{hasErrorsOrWarnings && (
|
||||||
|
<div>
|
||||||
<TreeView
|
<TreeView
|
||||||
defaultCollapseIcon={<ExpandMore />}
|
defaultCollapseIcon={<ExpandMore />}
|
||||||
defaultExpandIcon={<ChevronRight />}
|
defaultExpandIcon={<ChevronRight />}
|
||||||
|
style={{ paddingBottom: 10 }}
|
||||||
>
|
>
|
||||||
{logObject.errors && logObject.errors.length !== 0 && (
|
{logObject.errors && logObject.errors.length !== 0 && (
|
||||||
<TreeItem
|
<TreeItem
|
||||||
@@ -171,17 +176,7 @@ const LogComponent = (props: LogComponentProps) => {
|
|||||||
nodeId={`error_${ind}`}
|
nodeId={`error_${ind}`}
|
||||||
label={<ListItemText primary={error.body} />}
|
label={<ListItemText primary={error.body} />}
|
||||||
key={`error_${ind}`}
|
key={`error_${ind}`}
|
||||||
onClick={() => {
|
onClick={() => goToLogLine(error, ind)}
|
||||||
setLogChunksState((prevState) => {
|
|
||||||
const newState = [...prevState]
|
|
||||||
|
|
||||||
newState[ind] = true
|
|
||||||
|
|
||||||
return newState
|
|
||||||
})
|
|
||||||
|
|
||||||
goToLogLine(error, ind)
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</TreeItem>
|
</TreeItem>
|
||||||
@@ -199,23 +194,14 @@ const LogComponent = (props: LogComponentProps) => {
|
|||||||
nodeId={`warning_${ind}`}
|
nodeId={`warning_${ind}`}
|
||||||
label={<ListItemText primary={warning.body} />}
|
label={<ListItemText primary={warning.body} />}
|
||||||
key={`warning_${ind}`}
|
key={`warning_${ind}`}
|
||||||
onClick={() => {
|
onClick={() => goToLogLine(warning, ind)}
|
||||||
setLogChunksState((prevState) => {
|
|
||||||
const newState = [...prevState]
|
|
||||||
|
|
||||||
newState[ind] = true
|
|
||||||
|
|
||||||
return newState
|
|
||||||
})
|
|
||||||
|
|
||||||
goToLogLine(warning, ind)
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</TreeItem>
|
</TreeItem>
|
||||||
)}
|
)}
|
||||||
</TreeView>
|
</TreeView>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{Array.isArray(logChunks) ? (
|
{Array.isArray(logChunks) ? (
|
||||||
@@ -227,7 +213,7 @@ const LogComponent = (props: LogComponentProps) => {
|
|||||||
key={`log-chunk-${id}`}
|
key={`log-chunk-${id}`}
|
||||||
logLineCount={logObject.linesCount}
|
logLineCount={logObject.linesCount}
|
||||||
scrollToLogInstance={scrollToLogInstance}
|
scrollToLogInstance={scrollToLogInstance}
|
||||||
onClick={(evt, chunkNumber) => {
|
onClick={(_, chunkNumber) => {
|
||||||
setLogChunksState((prevState) => {
|
setLogChunksState((prevState) => {
|
||||||
const newState = [...prevState]
|
const newState = [...prevState]
|
||||||
const expand = !newState[chunkNumber]
|
const expand = !newState[chunkNumber]
|
||||||
|
|||||||
Reference in New Issue
Block a user