X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/4076b2736c50e6122d3d840f9c1f6f7d2cf81c28..b546e1dc213e7336e2d48f0e73962179b57145ae:/src/store/process-logs-panel/process-logs-panel-actions.ts 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 62c9a25d..bf0dc935 100644 --- a/src/store/process-logs-panel/process-logs-panel-actions.ts +++ b/src/store/process-logs-panel/process-logs-panel-actions.ts @@ -8,14 +8,16 @@ import { LogEventType } from '~/models/log'; import { RootState } from '~/store/store'; import { ServiceRepository } from '~/services/services'; import { Dispatch } from 'redux'; -import { FilterBuilder } from '~/common/api/filter-builder'; import { groupBy } from 'lodash'; import { loadProcess } from '~/store/processes/processes-actions'; -import { OrderBuilder } from '~/common/api/order-builder'; import { LogResource } from '~/models/log'; import { LogService } from '~/services/log-service/log-service'; -import { ResourceEventMessage } from '../../websocket/resource-event-message'; +import { ResourceEventMessage } from '~/websocket/resource-event-message'; import { getProcess } from '~/store/processes/process'; +import { FilterBuilder } from "~/services/api/filter-builder"; +import { OrderBuilder } from "~/services/api/order-builder"; +import { navigateToCollection } from '~/store/navigation/navigation-action'; +import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions'; export const processLogsPanelActions = unionize({ RESET_PROCESS_LOGS_PANEL: ofType<{}>(), @@ -98,6 +100,16 @@ const createInitialLogPanelState = (logResources: LogResource[]) => { const logsToLines = (logs: LogResource[]) => logs.map(({ properties }) => properties.text); +export const navigateToLogCollection = (uuid: string) => + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + try { + await services.collectionService.get(uuid); + dispatch(navigateToCollection(uuid)); + } catch { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'This collection does not exists!', hideDuration: 2000, kind: SnackbarKind.ERROR })); + } + }; + const MAX_AMOUNT_OF_LOGS = 10000; const SUMMARIZED_FILTER_TYPE = 'Summarized';