1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-09 15:30:05 +00:00

feat(log): use improved log for SAS run time only

This commit is contained in:
Yury Shkoda
2023-04-11 14:18:42 +03:00
parent 3a887dec55
commit 7b12591595
5 changed files with 134 additions and 86 deletions

View File

@@ -23,6 +23,7 @@ import LogTabWithIcons from './internal/components/log/logTabWithIcons'
import { usePrompt } from '../../utils/hooks'
import { getLanguageFromExtension } from './internal/helper'
import useEditor from './internal/hooks/useEditor'
import { RunTimeType } from '../../context/appContext'
const StyledTabPanel = styled(TabPanel)(() => ({
padding: '10px'
@@ -110,7 +111,11 @@ const SASjsEditor = ({
/>
)
const logWithErrorsOrWarnings = log?.errors.length || log?.warnings.length
// INFO: variable indicating if selected run type is SAS if there are any errors or warnings in the log
const logWithErrorsOrWarnings =
selectedRunTime === RunTimeType.SAS &&
log &&
(log?.errors.length !== 0 || log?.warnings.length !== 0)
return (
<Box sx={{ width: '100%', typography: 'body1', marginTop: '50px' }}>
@@ -155,6 +160,11 @@ const SASjsEditor = ({
icon={
logWithErrorsOrWarnings ? <LogTabWithIcons log={log} /> : ''
}
onClick={() => {
const logWrapper = document.querySelector(`#logWrapper`)
if (logWrapper) logWrapper.scrollTop = 0
}}
/>
<StyledTab
label={
@@ -205,7 +215,9 @@ const SASjsEditor = ({
</Paper>
</StyledTabPanel>
<StyledTabPanel value="log">
{log && <LogComponent log={log} />}
{log && (
<LogComponent log={log} selectedRunTime={selectedRunTime} />
)}
</StyledTabPanel>
<StyledTabPanel value="webout">
<div>