[arvados-workbench2] created: 2.4.0-151-ge56cfbed

git repository hosting git at public.arvados.org
Thu Jul 7 20:18:59 UTC 2022


        at  e56cfbed7245813282b5a8d4066dc027d5eb2788 (commit)


commit e56cfbed7245813282b5a8d4066dc027d5eb2788
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Jul 7 17:16:47 2022 -0300

    18975: Adds 'Main logs' filter selection. Fixes filter dynamic population.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/cypress/integration/process.spec.js b/cypress/integration/process.spec.js
index faf70c49..e0281071 100644
--- a/cypress/integration/process.spec.js
+++ b/cypress/integration/process.spec.js
@@ -168,8 +168,8 @@ describe('Process tests', function() {
             cy.getAll('@stdoutLogs', '@nodeInfoLogs', '@crunchRunLogs').then(function() {
                 cy.loginAs(activeUser);
                 cy.goToPath(`/processes/${containerRequest.uuid}`);
-                // Should should all logs
-                cy.get('[data-cy=process-logs-filter]').should('contain', 'All logs');
+                // Should show main logs
+                cy.get('[data-cy=process-logs-filter]').should('contain', 'Main logs');
                 cy.get('[data-cy=process-logs]')
                     .should('contain', stdoutLogs[Math.floor(Math.random() * stdoutLogs.length)])
                     .and('contain', nodeInfoLogs[Math.floor(Math.random() * nodeInfoLogs.length)])
diff --git a/src/models/log.ts b/src/models/log.ts
index 20060f88..63e953bb 100644
--- a/src/models/log.ts
+++ b/src/models/log.ts
@@ -23,6 +23,6 @@ export interface LogResource extends Resource, ResourceWithProperties {
     kind: ResourceKind.LOG;
     objectUuid: string;
     eventAt: string;
-    eventType: string;
+    eventType: LogEventType;
     summary: string;
 }
diff --git a/src/store/process-logs-panel/process-logs-panel-actions.ts b/src/store/process-logs-panel/process-logs-panel-actions.ts
index b0ddd7ee..ca950ffe 100644
--- a/src/store/process-logs-panel/process-logs-panel-actions.ts
+++ b/src/store/process-logs-panel/process-logs-panel-actions.ts
@@ -45,21 +45,25 @@ export const addProcessLogsPanelItem = (message: ResourceEventMessage<{ text: st
     async (dispatch: Dispatch, getState: () => RootState, { logService }: ServiceRepository) => {
         if (PROCESS_PANEL_LOG_EVENT_TYPES.indexOf(message.eventType) > -1) {
             const uuid = getProcessLogsPanelCurrentUuid(getState().router);
-            if (uuid) {
-                const process = getProcess(uuid)(getState().resources);
-                if (process) {
-                    const { containerRequest, container } = process;
-                    if (message.objectUuid === containerRequest.uuid
-                        || (container && message.objectUuid === container.uuid)) {
-                        dispatch(processLogsPanelActions.ADD_PROCESS_LOGS_PANEL_ITEM({
-                            logType: COMBINED_FILTER_TYPE,
-                            log: message.properties.text
-                        }));
-                        dispatch(processLogsPanelActions.ADD_PROCESS_LOGS_PANEL_ITEM({
-                            logType: message.eventType,
-                            log: message.properties.text
-                        }));
-                    }
+            if (!uuid) { return }
+            const process = getProcess(uuid)(getState().resources);
+            if (!process) { return }
+            const { containerRequest, container } = process;
+            if (message.objectUuid === containerRequest.uuid
+                || (container && message.objectUuid === container.uuid)) {
+                dispatch(processLogsPanelActions.ADD_PROCESS_LOGS_PANEL_ITEM({
+                    logType: ALL_FILTER_TYPE,
+                    log: message.properties.text
+                }));
+                dispatch(processLogsPanelActions.ADD_PROCESS_LOGS_PANEL_ITEM({
+                    logType: message.eventType,
+                    log: message.properties.text
+                }));
+                if (MAIN_EVENT_TYPES.indexOf(message.eventType) > -1) {
+                    dispatch(processLogsPanelActions.ADD_PROCESS_LOGS_PANEL_ITEM({
+                        logType: MAIN_FILTER_TYPE,
+                        log: message.properties.text
+                    }));
                 }
             }
         }
@@ -84,6 +88,9 @@ const loadContainerLogs = async (containerUuid: string, logService: LogService)
 
 const createInitialLogPanelState = (logResources: LogResource[]) => {
     const allLogs = logsToLines(logResources);
+    const mainLogs = logsToLines(logResources.filter(
+        e => MAIN_EVENT_TYPES.indexOf(e.eventType) > -1
+    ));
     const groupedLogResources = groupBy(logResources, log => log.eventType);
     const groupedLogs = Object
         .keys(groupedLogResources)
@@ -91,8 +98,12 @@ const createInitialLogPanelState = (logResources: LogResource[]) => {
             ...grouped,
             [key]: logsToLines(groupedLogResources[key])
         }), {});
-    const filters = [COMBINED_FILTER_TYPE, ...Object.keys(groupedLogs)];
-    const logs = { [COMBINED_FILTER_TYPE]: allLogs, ...groupedLogs };
+    const filters = [MAIN_FILTER_TYPE, ALL_FILTER_TYPE, ...Object.keys(groupedLogs)];
+    const logs = {
+        [MAIN_FILTER_TYPE]: mainLogs,
+        [ALL_FILTER_TYPE]: allLogs,
+        ...groupedLogs
+    };
     return { filters, logs };
 };
 
@@ -111,7 +122,14 @@ export const navigateToLogCollection = (uuid: string) =>
 
 const MAX_AMOUNT_OF_LOGS = 10000;
 
-const COMBINED_FILTER_TYPE = 'All logs';
+const ALL_FILTER_TYPE = 'All logs';
+
+const MAIN_FILTER_TYPE = 'Main logs';
+const MAIN_EVENT_TYPES = [
+    LogEventType.CRUNCH_RUN,
+    LogEventType.STDERR,
+    LogEventType.STDOUT,
+];
 
 const PROCESS_PANEL_LOG_EVENT_TYPES = [
     LogEventType.ARV_MOUNT,
diff --git a/src/store/process-logs-panel/process-logs-panel-reducer.ts b/src/store/process-logs-panel/process-logs-panel-reducer.ts
index c7d694c0..c502f1b1 100644
--- a/src/store/process-logs-panel/process-logs-panel-reducer.ts
+++ b/src/store/process-logs-panel/process-logs-panel-reducer.ts
@@ -24,10 +24,13 @@ export const processLogsPanelReducer = (state = initialState, action: ProcessLog
             selectedFilter
         }),
         ADD_PROCESS_LOGS_PANEL_ITEM: ({ logType, log }) => {
+            const filters = state.filters.indexOf(logType) > -1
+                ? state.filters
+                : [...state.filters, logType];
             const currentLogs = state.logs[logType] || [];
             const logsOfType = [...currentLogs, log];
             const logs = { ...state.logs, [logType]: logsOfType };
-            return { ...state, logs };
+            return { ...state, logs, filters };
         },
         default: () => state,
     });

commit 22c5c7be1500c7fa0b9d23fd5004aa0839671dcf
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Tue Jul 5 11:12:14 2022 -0300

    18975: Improves word wrapping status indication on log viewer.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx
index 19b4beea..db603597 100644
--- a/src/components/icon/icon.tsx
+++ b/src/components/icon/icon.tsx
@@ -77,6 +77,7 @@ import NotInterested from '@material-ui/icons/NotInterested';
 // Import FontAwesome icons
 import { library } from '@fortawesome/fontawesome-svg-core';
 import { faPencilAlt, faSlash, faUsers, faEllipsisH } from '@fortawesome/free-solid-svg-icons';
+import { FormatAlignLeft } from '@material-ui/icons';
 library.add(
     faPencilAlt,
     faSlash,
@@ -180,7 +181,8 @@ export const CanReadIcon: IconType = (props) => <RemoveRedEye {...props} />;
 export const CanWriteIcon: IconType = (props) => <Edit {...props} />;
 export const CanManageIcon: IconType = (props) => <Computer {...props} />;
 export const AddUserIcon: IconType = (props) => <PersonAdd {...props} />;
-export const WordWrapIcon: IconType = (props) => <WrapText {...props} />;
+export const WordWrapOnIcon: IconType = (props) => <WrapText {...props} />;
+export const WordWrapOffIcon: IconType = (props) => <FormatAlignLeft {...props} />;
 export const TextIncreaseIcon: IconType = (props) => <TextIncrease {...props} />;
 export const TextDecreaseIcon: IconType = (props) => <TextDecrease {...props} />;
 export const DeactivateUserIcon: IconType = (props) => <NotInterested {...props} />;
diff --git a/src/views/process-panel/process-log-card.tsx b/src/views/process-panel/process-log-card.tsx
index ac409ec1..936b31a5 100644
--- a/src/views/process-panel/process-log-card.tsx
+++ b/src/views/process-panel/process-log-card.tsx
@@ -24,7 +24,8 @@ import {
     MaximizeIcon,
     TextDecreaseIcon,
     TextIncreaseIcon,
-    WordWrapIcon
+    WordWrapOffIcon,
+    WordWrapOnIcon,
 } from 'components/icon/icon';
 import { Process } from 'store/processes/process';
 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
@@ -92,7 +93,7 @@ export const ProcessLogsCard = withStyles(styles)(
     ({ classes, process, filters, selectedFilter, lines,
         onLogFilterChange, navigateToLog, onCopy,
         doHidePanel, doMaximizePanel, panelMaximized, panelName }: ProcessLogsCardProps) => {
-        const [wordWrapToggle, setWordWrapToggle] = useState<boolean>(true);
+        const [wordWrap, setWordWrap] = useState<boolean>(true);
         const [fontSize, setFontSize] = useState<number>(3);
         const fontBaseSize = 10;
         const fontStepSize = 1;
@@ -130,9 +131,9 @@ export const ProcessLogsCard = withStyles(styles)(
                             </Tooltip>
                         </Grid>
                         <Grid item>
-                            <Tooltip title="Toggle word wrapping" disableFocusListener>
-                                <IconButton onClick={() => setWordWrapToggle(!wordWrapToggle)}>
-                                    <WordWrapIcon />
+                            <Tooltip title={`${wordWrap ? 'Disable' : 'Enable'} word wrapping`} disableFocusListener>
+                                <IconButton onClick={() => setWordWrap(!wordWrap)}>
+                                    {wordWrap ? <WordWrapOffIcon /> : <WordWrapOnIcon />}
                                 </IconButton>
                             </Tooltip>
                         </Grid>
@@ -166,7 +167,7 @@ export const ProcessLogsCard = withStyles(styles)(
                             spacing={24}
                             direction='column'>
                             <Grid className={classes.logViewer} item xs>
-                                <ProcessLogCodeSnippet fontSize={fontBaseSize+(fontStepSize*fontSize)} wordWrap={wordWrapToggle} lines={lines} />
+                                <ProcessLogCodeSnippet fontSize={fontBaseSize+(fontStepSize*fontSize)} wordWrap={wordWrap} lines={lines} />
                             </Grid>
                         </Grid>
                         : <DefaultView

commit ad83bd90361b2b99fa37b3d052714d7918e64529
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Tue Jul 5 10:58:27 2022 -0300

    18975: Changes links' color to improve contrast and readability.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/views/process-panel/process-log-code-snippet.tsx b/src/views/process-panel/process-log-code-snippet.tsx
index 1ab25ea1..261075c0 100644
--- a/src/views/process-panel/process-log-code-snippet.tsx
+++ b/src/views/process-panel/process-log-code-snippet.tsx
@@ -26,6 +26,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         overflow: 'auto',
         backgroundColor: '#000',
         height: `calc(100% - ${theme.spacing.unit * 4}px)`, // so that horizontal scollbar is visible
+        "& a": {
+            color: theme.palette.primary.main,
+        },
     },
     logText: {
         padding: theme.spacing.unit * 0.5,

commit 92e2168c33e2ae98e03fae72520dd8ec3e4a1150
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Mon Jul 4 17:34:51 2022 -0300

    18975: Sets log viewer's "follow mode" mode ON by default.
    
    This also makes the log viewer to scroll down to the bottom.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/views/process-panel/process-log-code-snippet.tsx b/src/views/process-panel/process-log-code-snippet.tsx
index 6ea628e6..1ab25ea1 100644
--- a/src/views/process-panel/process-log-code-snippet.tsx
+++ b/src/views/process-panel/process-log-code-snippet.tsx
@@ -78,7 +78,7 @@ const renderLinks = (fontSize: number, dispatch: Dispatch) => (text: string) =>
 
 export const ProcessLogCodeSnippet = withStyles(styles)(connect()(
     ({classes, lines, fontSize, dispatch, wordWrap}: ProcessLogCodeSnippetProps & WithStyles<CssRules> & DispatchProp) => {
-        const [followMode, setFollowMode] = useState<boolean>(false);
+        const [followMode, setFollowMode] = useState<boolean>(true);
         const scrollRef = useRef<HTMLDivElement>(null);
 
         useEffect(() => {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list