16672: Removes the old process logs panel & related code.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 17 Mar 2022 16:54:33 +0000 (13:54 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 25 Mar 2022 20:59:23 +0000 (17:59 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

13 files changed:
src/routes/route-change-handlers.ts
src/routes/routes.ts
src/store/navigation/navigation-action.ts
src/store/process-logs-panel/process-logs-panel.ts
src/views-components/context-menu/action-sets/process-resource-action-set.ts
src/views/process-log-panel/process-log-main-card.tsx [deleted file]
src/views/process-log-panel/process-log-panel-root.tsx [deleted file]
src/views/process-log-panel/process-log-panel.tsx [deleted file]
src/views/process-panel/process-log-card.tsx
src/views/process-panel/process-log-code-snippet.tsx [moved from src/views/process-log-panel/process-log-code-snippet.tsx with 100% similarity]
src/views/process-panel/process-log-form.tsx [moved from src/views/process-log-panel/process-log-form.tsx with 95% similarity]
src/views/process-panel/process-panel-root.tsx
src/views/workbench/workbench.tsx

index 044a38bf20df04d3822a5325990256a89b9295ec..5e07e6e8209e716e249a27eea3ee67456ddb1857 100644 (file)
@@ -27,7 +27,6 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
     const publicFavoritesMatch = Routes.matchPublicFavoritesRoute(pathname);
     const trashMatch = Routes.matchTrashRoute(pathname);
     const processMatch = Routes.matchProcessRoute(pathname);
-    const processLogMatch = Routes.matchProcessLogRoute(pathname);
     const repositoryMatch = Routes.matchRepositoriesRoute(pathname);
     const searchResultsMatch = Routes.matchSearchResultsRoute(pathname);
     const sharedWithMeMatch = Routes.matchSharedWithMeRoute(pathname);
@@ -71,8 +70,6 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
         store.dispatch(WorkbenchActions.loadTrash());
     } else if (processMatch) {
         store.dispatch(WorkbenchActions.loadProcess(processMatch.params.id));
-    } else if (processLogMatch) {
-        store.dispatch(WorkbenchActions.loadProcessLog(processLogMatch.params.id));
     } else if (rootMatch) {
         store.dispatch(navigateToRootProject);
     } else if (sharedWithMeMatch) {
index 41c71f7ca87994a32938d9c0138d1ba204a1ce6d..d7257b5124b38fc0f71ef392d52102ec7b52825e 100644 (file)
@@ -25,7 +25,6 @@ export const Routes = {
     PROCESSES: `/processes/:id(${RESOURCE_UUID_PATTERN})`,
     FAVORITES: '/favorites',
     TRASH: '/trash',
-    PROCESS_LOGS: `/process-logs/:id(${RESOURCE_UUID_PATTERN})`,
     REPOSITORIES: '/repositories',
     SHARED_WITH_ME: '/shared-with-me',
     RUN_PROCESS: '/run-process',
@@ -95,8 +94,6 @@ export const getNavUrl = (uuid: string, config: FederationConfig) => {
 
 export const getProcessUrl = (uuid: string) => `/processes/${uuid}`;
 
-export const getProcessLogUrl = (uuid: string) => `/process-logs/${uuid}`;
-
 export const getGroupUrl = (uuid: string) => `/group/${uuid}`;
 
 export interface ResourceRouteParams {
@@ -124,9 +121,6 @@ export const matchCollectionRoute = (route: string) =>
 export const matchProcessRoute = (route: string) =>
     matchPath<ResourceRouteParams>(route, { path: Routes.PROCESSES });
 
-export const matchProcessLogRoute = (route: string) =>
-    matchPath<ResourceRouteParams>(route, { path: Routes.PROCESS_LOGS });
-
 export const matchSharedWithMeRoute = (route: string) =>
     matchPath(route, { path: Routes.SHARED_WITH_ME });
 
index 19cc36ae6d51752fb92150495a22115648ac2f72..49f565911e0b04230502be62c7032b2918a16d11 100644 (file)
@@ -6,7 +6,7 @@ import { Dispatch, compose, AnyAction } from 'redux';
 import { push } from "react-router-redux";
 import { ResourceKind, extractUuidKind } from 'models/resource';
 import { SidePanelTreeCategory } from '../side-panel-tree/side-panel-tree-actions';
-import { Routes, getProcessLogUrl, getGroupUrl, getNavUrl } from 'routes/routes';
+import { Routes, getGroupUrl, getNavUrl } from 'routes/routes';
 import { RootState } from 'store/store';
 import { ServiceRepository } from 'services/services';
 import { pluginConfig } from 'plugins';
@@ -99,8 +99,6 @@ export const pushOrGoto = (url: string): AnyAction => {
 };
 
 
-export const navigateToProcessLogs = compose(push, getProcessLogUrl);
-
 export const navigateToRootProject = (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
     navigateTo(SidePanelTreeCategory.PROJECTS)(dispatch, getState);
 };
index 74a18041bcc9e07f9f28000c8ab10588f6be0e50..0ca5d679c9caa14b0e2c2fe8847d56d57f61de29 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { matchProcessLogRoute, matchProcessRoute } from 'routes/routes';
+import { matchProcessRoute } from 'routes/routes';
 import { RouterState } from 'react-router-redux';
 
 export interface ProcessLogsPanel {
@@ -21,6 +21,6 @@ export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel)
 
 export const getProcessLogsPanelCurrentUuid = (router: RouterState) => {
     const pathname = router.location ? router.location.pathname : '';
-    const match = matchProcessLogRoute(pathname) || matchProcessRoute(pathname);
+    const match = matchProcessRoute(pathname);
     return match ? match.params.id : undefined;
 };
index be2f82fd9629b7daa961bd56190c384e1a235fbe..55b2d31fab2202ded4367af0dd61bc80182cc351 100644 (file)
@@ -8,7 +8,7 @@ import { toggleFavorite } from "store/favorites/favorites-actions";
 import {
     RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon,
     RemoveIcon, ReRunProcessIcon, InputIcon, OutputIcon, CommandIcon,
-    LogIcon, AdvancedIcon
+    AdvancedIcon
 } from "components/icon/icon";
 import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
 import { openMoveProcessDialog } from 'store/processes/process-move-actions';
@@ -21,7 +21,6 @@ import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
 import { openProcessInputDialog } from "store/processes/process-input-actions";
 import { navigateToOutput } from "store/process-panel/process-panel-actions";
 import { openProcessCommandDialog } from "store/processes/process-command-actions";
-import { navigateToProcessLogs } from "store/navigation/navigation-action";
 import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab";
 import { TogglePublicFavoriteAction } from "../actions/public-favorite-action";
 import { togglePublicFavorite } from "store/public-favorites/public-favorites-actions";
@@ -77,13 +76,6 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [[
             dispatch<any>(openProcessCommandDialog(resource.uuid));
         }
     },
-    {
-        icon: LogIcon,
-        name: "Log",
-        execute: (dispatch, resource) => {
-            dispatch<any>(navigateToProcessLogs(resource.uuid));
-        }
-    },
     {
         icon: DetailsIcon,
         name: "View details",
diff --git a/src/views/process-log-panel/process-log-main-card.tsx b/src/views/process-log-panel/process-log-main-card.tsx
deleted file mode 100644 (file)
index aab44da..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import React from 'react';
-import {
-    StyleRulesCallback,
-    WithStyles,
-    withStyles,
-    Card,
-    CardHeader,
-    IconButton,
-    CardContent,
-    Grid,
-    Typography,
-    Tooltip
-} from '@material-ui/core';
-import { Process } from 'store/processes/process';
-import { ProcessLogCodeSnippet } from 'views/process-log-panel/process-log-code-snippet';
-import {
-    ProcessLogForm,
-    ProcessLogFormDataProps,
-    ProcessLogFormActionProps
-} from 'views/process-log-panel/process-log-form';
-import { MoreOptionsIcon, LogIcon } from 'components/icon/icon';
-import { ArvadosTheme } from 'common/custom-theme';
-import { CodeSnippetDataProps } from 'components/code-snippet/code-snippet';
-import { DefaultView } from 'components/default-view/default-view';
-
-type CssRules = 'backLink' | 'backIcon' | 'card' | 'title' | 'iconHeader' | 'link';
-
-const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
-    backLink: {
-        fontSize: '14px',
-        fontWeight: 600,
-        display: 'flex',
-        alignItems: 'center',
-        textDecoration: 'none',
-        padding: theme.spacing.unit,
-        color: theme.palette.grey["700"],
-    },
-    backIcon: {
-        marginRight: theme.spacing.unit
-    },
-    card: {
-        width: '100%'
-    },
-    title: {
-        color: theme.palette.grey["700"]
-    },
-    iconHeader: {
-        fontSize: '1.875rem',
-        color: theme.customs.colors.green700
-    },
-    link: {
-        fontSize: '0.875rem',
-        color: theme.palette.primary.main,
-        textAlign: 'right',
-        '&:hover': {
-            cursor: 'pointer'
-        }
-    }
-});
-
-interface ProcessLogMainCardDataProps {
-    process: Process;
-}
-
-export interface ProcessLogMainCardActionProps {
-    onContextMenu: (event: React.MouseEvent<any>, process: Process) => void;
-    navigateToLogCollection: (uuid: string) => void;
-}
-
-export type ProcessLogMainCardProps = ProcessLogMainCardDataProps
-    & ProcessLogMainCardActionProps
-    & CodeSnippetDataProps
-    & ProcessLogFormDataProps
-    & ProcessLogFormActionProps;
-
-export const ProcessLogMainCard = withStyles(styles)(
-    ({ classes, process, selectedFilter, filters, onChange, lines, onContextMenu, navigateToLogCollection }: ProcessLogMainCardProps & WithStyles<CssRules>) =>
-        <Grid item xs={12}>
-            <Card className={classes.card}>
-                <CardHeader
-                    avatar={<LogIcon className={classes.iconHeader} />}
-                    action={
-                        <Tooltip title="More options" disableFocusListener>
-                            <IconButton onClick={event => onContextMenu(event, process)} aria-label="More options">
-                                <MoreOptionsIcon />
-                            </IconButton>
-                        </Tooltip>}
-                    title={
-                        <Typography noWrap variant='h6' className={classes.title}>
-                            Logs for {process.containerRequest.name}
-                        </Typography>}
-                />
-                <CardContent>
-                    {lines.length > 0
-                        ? < Grid
-                            container
-                            spacing={24}
-                            direction='column'>
-                            <Grid container item>
-                                <Grid item xs={6}>
-                                    <ProcessLogForm selectedFilter={selectedFilter} filters={filters} onChange={onChange} />
-                                </Grid>
-                                <Grid item xs={6} className={classes.link}>
-                                    <span onClick={() => navigateToLogCollection(process.containerRequest.logUuid!)}>
-                                        Go to Log collection
-                                    </span>
-                                </Grid>
-                            </Grid>
-                            <Grid item xs>
-                                <ProcessLogCodeSnippet lines={lines} />
-                            </Grid>
-                        </Grid>
-                        : <DefaultView
-                            icon={LogIcon}
-                            messages={['No logs yet']} />
-                    }
-                </CardContent>
-            </Card>
-        </Grid >
-);
\ No newline at end of file
diff --git a/src/views/process-log-panel/process-log-panel-root.tsx b/src/views/process-log-panel/process-log-panel-root.tsx
deleted file mode 100644 (file)
index be04372..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import React from 'react';
-import { Grid } from '@material-ui/core';
-import { Process } from 'store/processes/process';
-import { ProcessLogMainCard } from 'views/process-log-panel/process-log-main-card';
-import { ProcessLogFormDataProps, ProcessLogFormActionProps } from 'views/process-log-panel/process-log-form';
-import { DefaultView } from 'components/default-view/default-view';
-import { ProcessIcon } from 'components/icon/icon';
-import { CodeSnippetDataProps } from 'components/code-snippet/code-snippet';
-import { ProcessLogMainCardActionProps } from './process-log-main-card';
-
-export type ProcessLogPanelRootDataProps = {
-    process?: Process;
-} & ProcessLogFormDataProps & CodeSnippetDataProps;
-
-export type ProcessLogPanelRootActionProps = ProcessLogMainCardActionProps & ProcessLogFormActionProps;
-
-export type ProcessLogPanelRootProps = ProcessLogPanelRootDataProps & ProcessLogPanelRootActionProps;
-
-export const ProcessLogPanelRoot = (props: ProcessLogPanelRootProps) =>
-    props.process
-        ? <Grid container spacing={16}>
-            <ProcessLogMainCard 
-                process={props.process} 
-                {...props} />
-        </Grid> 
-        : <Grid container
-            alignItems='center'
-            justify='center'>
-            <DefaultView
-                icon={ProcessIcon}
-                messages={['Process Log not found']} />
-        </Grid>;
diff --git a/src/views/process-log-panel/process-log-panel.tsx b/src/views/process-log-panel/process-log-panel.tsx
deleted file mode 100644 (file)
index b11d143..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { RootState } from 'store/store';
-import { connect } from 'react-redux';
-import { getProcess } from 'store/processes/process';
-import { Dispatch } from 'redux';
-import { openProcessContextMenu } from 'store/context-menu/context-menu-actions';
-import { ProcessLogPanelRootDataProps, ProcessLogPanelRootActionProps, ProcessLogPanelRoot } from './process-log-panel-root';
-import { getProcessPanelLogs } from 'store/process-logs-panel/process-logs-panel';
-import { setProcessLogsPanelFilter, navigateToLogCollection } from 'store/process-logs-panel/process-logs-panel-actions';
-import { getProcessLogsPanelCurrentUuid } from 'store/process-logs-panel/process-logs-panel';
-
-export interface Log {
-    object_uuid: string;
-    event_at: string;
-    event_type: string;
-    summary: string;
-    properties: any;
-}
-
-export interface FilterOption {
-    label: string;
-    value: string;
-}
-
-const mapStateToProps = ({resources, processLogsPanel, router}: RootState): ProcessLogPanelRootDataProps => {
-    const uuid = getProcessLogsPanelCurrentUuid(router) || '';
-    return {
-        process: getProcess(uuid)(resources),
-        selectedFilter: { label: processLogsPanel.selectedFilter, value: processLogsPanel.selectedFilter },
-        filters: processLogsPanel.filters.map(filter => ({ label: filter, value: filter })),
-        lines: getProcessPanelLogs(processLogsPanel)
-    };
-};
-
-const mapDispatchToProps = (dispatch: Dispatch): ProcessLogPanelRootActionProps => ({
-    onContextMenu: (event, process) => {
-        dispatch<any>(openProcessContextMenu(event, process));
-    },
-    onChange: filter => {
-        dispatch(setProcessLogsPanelFilter(filter.value));
-    },
-    navigateToLogCollection: (uuid: string) => {
-        dispatch<any>(navigateToLogCollection(uuid));
-    }
-});
-
-export const ProcessLogPanel = connect(mapStateToProps, mapDispatchToProps)(ProcessLogPanelRoot);
index 85195d4060a8909d49e68628c5bfee0536237173..b87bb6e475f4b06bf5de799c11dabef9daf98ff8 100644 (file)
@@ -24,9 +24,11 @@ import {
 } from 'components/icon/icon';
 import { Process } from 'store/processes/process';
 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
-import { FilterOption } from 'views/process-log-panel/process-log-panel';
-import { ProcessLogForm } from 'views/process-log-panel/process-log-form';
-import { ProcessLogCodeSnippet } from 'views/process-log-panel/process-log-code-snippet';
+import {
+    FilterOption,
+    ProcessLogForm
+} from 'views/process-panel/process-log-form';
+import { ProcessLogCodeSnippet } from 'views/process-panel/process-log-code-snippet';
 import { DefaultView } from 'components/default-view/default-view';
 import { CodeSnippetDataProps } from 'components/code-snippet/code-snippet';
 
similarity index 95%
rename from src/views/process-log-panel/process-log-form.tsx
rename to src/views/process-panel/process-log-form.tsx
index 7f98c978ef530ec3417098a37dd51b9f05298356..6a8e522144d750df223bcec77a42b90f21cd61fa 100644 (file)
@@ -13,7 +13,6 @@ import {
     Input
 } from '@material-ui/core';
 import { ArvadosTheme } from 'common/custom-theme';
-import { FilterOption } from './process-log-panel';
 
 type CssRules = 'formControl';
 
@@ -23,6 +22,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     }
 });
 
+export interface FilterOption {
+    label: string;
+    value: string;
+}
+
 export interface ProcessLogFormDataProps {
     selectedFilter: FilterOption;
     filters: FilterOption[];
index 2bd115f138088095816756039a5176ed79dff4a4..c39806489995b345f814bb06c04c199636e025e1 100644 (file)
@@ -13,9 +13,9 @@ import { SubprocessFilterDataProps } from 'components/subprocess-filter/subproce
 import { MPVContainer, MPVPanelContent, MPVPanelState } from 'components/multi-panel-view/multi-panel-view';
 import { ArvadosTheme } from 'common/custom-theme';
 import { ProcessDetailsCard } from './process-details-card';
-import { FilterOption } from 'views/process-log-panel/process-log-panel';
 import { getProcessPanelLogs, ProcessLogsPanel } from 'store/process-logs-panel/process-logs-panel';
 import { ProcessLogsCard } from './process-log-card';
+import { FilterOption } from 'views/process-panel/process-log-form';
 
 type CssRules = 'root';
 
index 49922202517c27f5dadb9a01364b6bb66377d441..fe97bd3b449ad4be36f5f099dc6a8f18fd333407 100644 (file)
@@ -20,7 +20,6 @@ import { MultipleFilesRemoveDialog } from 'views-components/file-remove-dialog/m
 import { Routes } from 'routes/routes';
 import { SidePanel } from 'views-components/side-panel/side-panel';
 import { ProcessPanel } from 'views/process-panel/process-panel';
-import { ProcessLogPanel } from 'views/process-log-panel/process-log-panel';
 import { ChangeWorkflowDialog } from 'views-components/run-process-dialog/change-workflow-dialog';
 import { CreateProjectDialog } from 'views-components/dialog-forms/create-project-dialog';
 import { CreateCollectionDialog } from 'views-components/dialog-forms/create-collection-dialog';
@@ -158,7 +157,6 @@ let routes = <>
     <Route path={Routes.ALL_PROCESSES} component={AllProcessesPanel} />
     <Route path={Routes.PROCESSES} component={ProcessPanel} />
     <Route path={Routes.TRASH} component={TrashPanel} />
-    <Route path={Routes.PROCESS_LOGS} component={ProcessLogPanel} />
     <Route path={Routes.SHARED_WITH_ME} component={SharedWithMePanel} />
     <Route path={Routes.RUN_PROCESS} component={RunProcessPanel} />
     <Route path={Routes.WORKFLOWS} component={WorkflowPanel} />